Compare commits
37 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ead0178665 | ||
![]() |
242fcf9699 | ||
![]() |
3c641c4bd8 | ||
![]() |
3c2b697b80 | ||
![]() |
9c0372fb22 | ||
![]() |
ffafc0e088 | ||
![]() |
b8959d0f5d | ||
![]() |
7560cc853a | ||
![]() |
a920aedc10 | ||
![]() |
21d7d604c1 | ||
![]() |
9bfeccf087 | ||
![]() |
e90eb8de8f | ||
![]() |
4a1a13aa0a | ||
![]() |
6e989a2bd2 | ||
![]() |
25b8b670a1 | ||
![]() |
5909119713 | ||
![]() |
b86a6abf46 | ||
![]() |
30b43757dc | ||
![]() |
1901a14f5a | ||
![]() |
b86f3c751f | ||
![]() |
d7fe3d9703 | ||
![]() |
5738954d3e | ||
![]() |
cfc4487bec | ||
![]() |
f1968fd59f | ||
![]() |
121da6f408 | ||
![]() |
a83f33c4b6 | ||
![]() |
e9da04da70 | ||
![]() |
1edb7a0155 | ||
![]() |
148eb1bdc1 | ||
![]() |
654613c90d | ||
![]() |
2e0332b7c8 | ||
![]() |
6d94d1f829 | ||
![]() |
955f675241 | ||
![]() |
943c197612 | ||
![]() |
b4e6aa187d | ||
![]() |
84d09c4861 | ||
![]() |
f7449a50e1 |
93
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
93
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
name: Bug report
|
||||
description: Create a bug report to help us improve
|
||||
labels:
|
||||
- bug
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Describe the bug
|
||||
description: A clear and concise description of the bug.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: ImmortalWrt version
|
||||
description: |
|
||||
The ImmortalWrt release or commit hash where this bug occurs (use command below).
|
||||
```. /etc/openwrt_release && echo $DISTRIB_REVISION```
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: release
|
||||
attributes:
|
||||
label: ImmortalWrt release
|
||||
description: |
|
||||
The ImmortalWrt release or commit hash where this bug occurs (use command below).
|
||||
```. /etc/openwrt_release && echo $DISTRIB_RELEASE```
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: target
|
||||
attributes:
|
||||
label: ImmortalWrt target/subtarget
|
||||
description: |
|
||||
The ImmortalWrt target and subtarget where this bug is observed (use command below).
|
||||
```. /etc/openwrt_release && echo $DISTRIB_TARGET```
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: device
|
||||
attributes:
|
||||
label: Device
|
||||
description: |
|
||||
The device exhibiting this bug (if unsure, use command below).
|
||||
```cat /tmp/sysinfo/model```
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: image_kind
|
||||
attributes:
|
||||
label: Image kind
|
||||
options:
|
||||
- Official downloaded image
|
||||
- Self-built image
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: reproduce
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Steps to reproduce the reported behaviour.
|
||||
- type: textarea
|
||||
id: behaviour
|
||||
attributes:
|
||||
label: Actual behaviour
|
||||
description: A clear and concise description of what actually happens.
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: Expected behaviour
|
||||
description: A clear and concise description of what you expected to happen.
|
||||
- type: textarea
|
||||
id: additional
|
||||
attributes:
|
||||
label: Additional info
|
||||
description: Add any additional info you think might be helfpul.
|
||||
- type: textarea
|
||||
id: diffconfig
|
||||
attributes:
|
||||
label: Diffconfig
|
||||
description: |
|
||||
In case of a self-built image, please attach diffconfig.
|
||||
```./scripts/diffconfig.sh```
|
||||
render: text
|
||||
- type: checkboxes
|
||||
id: terms
|
||||
attributes:
|
||||
label: Terms
|
||||
description: By submitting this issue, you agree to the terms below.
|
||||
options:
|
||||
- label: I am reporting an issue for ImmortalWrt, not an unsupported fork.
|
||||
required: true
|
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: ImmortalWrt community
|
||||
url: https://t.me/ctcgfw_openwrt_discuss
|
||||
about: Consider reaching out to our community to get help. ImmortalWrt is a complex software project with many pitfalls; there is a good chance someone can help you solve your issue in no time.
|
||||
- name: OpenWrt documentation
|
||||
url: https://openwrt.org/docs/start
|
||||
about: The OpenWrt documentation contains a lot of valuable information.
|
64
.github/workflows/Update-Athena-LED.yml
vendored
64
.github/workflows/Update-Athena-LED.yml
vendored
@ -1,64 +0,0 @@
|
||||
name: Update-Athena-LED
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: 0 0 * * 0
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
permissions: write-all
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Delete old Releases and Workflows
|
||||
uses: ophub/delete-releases-workflows@main
|
||||
with:
|
||||
gh_token: ${{secrets.GITHUB_TOKEN}}
|
||||
delete_workflows: true
|
||||
workflows_keep_day: 0
|
||||
|
||||
update:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: cleanup
|
||||
steps:
|
||||
- name: Checkout Projects
|
||||
uses: actions/checkout@main
|
||||
|
||||
- name: Update Athena LED
|
||||
run: |
|
||||
cd ./package/emortal/
|
||||
PKG_NAME=luci-app-athena-led
|
||||
|
||||
LOCAL_HASH=$(cat "./$PKG_NAME/.latest_commit" 2>/dev/null || echo "none")
|
||||
REMOTE_HASH=$(curl -sL https://api.github.com/repos/NONGFAH/luci-app-athena-led/commits/main | jq -r '.sha' | cut -c1-8)
|
||||
|
||||
if [[ "$LOCAL_HASH" != "$REMOTE_HASH" ]]; then
|
||||
rm -rf ./$PKG_NAME
|
||||
curl -sL -o ./athena-led.zip https://github.com/NONGFAH/luci-app-athena-led/archive/refs/heads/main.zip
|
||||
unzip ./athena-led.zip -d ./
|
||||
mv ./luci-app-athena-led-main ./$PKG_NAME && rm -rf ./athena-led.zip
|
||||
chmod +x -R ./$PKG_NAME/root/usr/sbin/* && chmod +x -R ./$PKG_NAME/root/etc/init.d/*
|
||||
|
||||
echo "$PKG_NAME has been updated to $REMOTE_HASH!"
|
||||
|
||||
echo "$REMOTE_HASH" > "./$PKG_NAME/.latest_commit"
|
||||
echo "PKG_NAME=$PKG_NAME" >> "$GITHUB_ENV"
|
||||
echo "REMOTE_HASH=$REMOTE_HASH" >> "$GITHUB_ENV"
|
||||
else
|
||||
echo "$PKG_NAME is already the latest!"
|
||||
fi
|
||||
|
||||
[ -z "$(git status -s)" ] || echo -e "CHANGE_STAT=1" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Commit Changes
|
||||
if: ${{ env.CHANGE_STAT }}
|
||||
run: |
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git config --local user.email "<github-actions[bot]@users.noreply.github.com>"
|
||||
git add .
|
||||
git commit -m "${{env.PKG_NAME}}: update version to ${{env.REMOTE_HASH}}"
|
||||
git push -f origin HEAD:main
|
@ -313,8 +313,8 @@ menu "Target Images"
|
||||
config TARGET_ROOTFS_PARTSIZE
|
||||
int "Root filesystem partition size (in MiB)"
|
||||
depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS
|
||||
default 300 if BUILDBOT
|
||||
default 160
|
||||
default 512 if BUILDBOT
|
||||
default 1024
|
||||
help
|
||||
Select the root filesystem partition size.
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
src-git nss_packages https://github.com/qosmio/nss-packages.git
|
||||
src-git sqm_scripts_nss https://github.com/qosmio/sqm-scripts-nss.git
|
||||
src-git packages https://github.com/immortalwrt/packages.git
|
||||
src-git luci https://github.com/immortalwrt/luci.git
|
||||
src-git routing https://github.com/openwrt/routing.git
|
||||
|
@ -1,40 +1,30 @@
|
||||
BPF_DEPENDS := @HAS_BPF_TOOLCHAIN +@NEED_BPF_TOOLCHAIN
|
||||
LLVM_VER:=
|
||||
|
||||
CLANG_MIN_VER:=12
|
||||
|
||||
ifneq ($(CONFIG_USE_LLVM_HOST),)
|
||||
find-llvm-tool=$(firstword $(shell PATH='$(BPF_PATH)' command -v $(1) || echo '$(firstword $(1))-not-found'))
|
||||
|
||||
BPF_TOOLCHAIN_HOST_PATH:=$(call qstrip,$(CONFIG_BPF_TOOLCHAIN_HOST_PATH))
|
||||
ifneq ($(BPF_TOOLCHAIN_HOST_PATH),)
|
||||
BPF_PATH:=$(BPF_TOOLCHAIN_HOST_PATH)/bin:$(PATH)
|
||||
else
|
||||
BPF_PATH:=$(PATH)
|
||||
endif
|
||||
CLANG:=$(call find-llvm-tool,clang clang-13 clang-12)
|
||||
CLANG:=$(firstword $(shell PATH='$(BPF_PATH)' command -v clang clang-13 clang-12 clang-11))
|
||||
LLVM_VER:=$(subst clang,,$(notdir $(CLANG)))
|
||||
|
||||
BPF_PATH:=$(dir $(CLANG)):$(BPF_PATH)
|
||||
LLVM_LLC:=$(call find-llvm-tool,llc$(LLVM_VER))
|
||||
LLVM_DIS:=$(call find-llvm-tool,llvm-dis$(LLVM_VER))
|
||||
LLVM_OPT:=$(call find-llvm-tool,opt$(LLVM_VER))
|
||||
LLVM_STRIP:=$(call find-llvm-tool,llvm-strip$(LLVM_VER))
|
||||
else
|
||||
LLVM_PATH:=/invalid
|
||||
|
||||
ifneq ($(CONFIG_USE_LLVM_PREBUILT),)
|
||||
LLVM_PATH:=$(TOPDIR)/llvm-bpf/bin
|
||||
endif
|
||||
ifneq ($(CONFIG_USE_LLVM_BUILD),)
|
||||
LLVM_PATH:=$(STAGING_DIR_HOST)/llvm-bpf/bin
|
||||
endif
|
||||
|
||||
CLANG:=$(LLVM_PATH)/clang
|
||||
LLVM_LLC:=$(LLVM_PATH)/llc
|
||||
LLVM_DIS:=$(LLVM_PATH)/llvm-dis
|
||||
LLVM_OPT:=$(LLVM_PATH)/opt
|
||||
LLVM_STRIP:=$(LLVM_PATH)/llvm-strip
|
||||
endif
|
||||
ifneq ($(CONFIG_USE_LLVM_PREBUILT),)
|
||||
CLANG:=$(TOPDIR)/llvm-bpf/bin/clang
|
||||
endif
|
||||
ifneq ($(CONFIG_USE_LLVM_BUILD),)
|
||||
CLANG:=$(STAGING_DIR_HOST)/llvm-bpf/bin/clang
|
||||
endif
|
||||
|
||||
LLVM_PATH:=$(dir $(CLANG))
|
||||
LLVM_LLC:=$(LLVM_PATH)/llc$(LLVM_VER)
|
||||
LLVM_DIS:=$(LLVM_PATH)/llvm-dis$(LLVM_VER)
|
||||
LLVM_OPT:=$(LLVM_PATH)/opt$(LLVM_VER)
|
||||
LLVM_STRIP:=$(LLVM_PATH)/llvm-strip$(LLVM_VER)
|
||||
|
||||
BPF_KARCH:=mips
|
||||
BPF_ARCH:=mips$(if $(CONFIG_ARCH_64BIT),64)$(if $(CONFIG_BIG_ENDIAN),,el)
|
||||
|
@ -1,2 +1,2 @@
|
||||
LINUX_VERSION-6.6 = .87
|
||||
LINUX_KERNEL_HASH-6.6.87 = 8957e5c2dacdbc47a16dbf1f6303ca7088409be6197a3881f752313275357ac6
|
||||
LINUX_VERSION-6.6 = .85
|
||||
LINUX_KERNEL_HASH-6.6.85 = 5ebaccf4ca3428cd26817bae62171f4efd270eed866a3e3d0a1d9e970b7b7529
|
||||
|
@ -290,8 +290,8 @@ ifeq ($(DUMP),1)
|
||||
CPU_CFLAGS_archs = -mcpu=archs
|
||||
endif
|
||||
ifeq ($(ARCH),riscv64)
|
||||
CPU_TYPE ?= generic
|
||||
CPU_CFLAGS_generic:=-mabi=lp64d -march=rv64gc
|
||||
CPU_TYPE ?= riscv64
|
||||
CPU_CFLAGS_riscv64:=-mabi=lp64d -march=rv64imafdc
|
||||
endif
|
||||
ifeq ($(ARCH),loongarch64)
|
||||
CPU_TYPE ?= generic
|
||||
|
@ -1,21 +1,13 @@
|
||||
PKG_NAME ?= trusted-firmware-a
|
||||
PKG_CPE_ID ?= cpe:/a:arm:trusted_firmware-a
|
||||
|
||||
PKG_LTS ?=
|
||||
|
||||
ifneq ($(PKG_LTS),)
|
||||
PKG_VERSION_PREFIX:=lts-v
|
||||
PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION_PREFIX)$(PKG_VERSION)
|
||||
else
|
||||
PKG_VERSION_PREFIX:=v
|
||||
PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
endif
|
||||
|
||||
ifndef PKG_SOURCE_PROTO
|
||||
PKG_SOURCE = trusted-firmware-a-$(PKG_VERSION_PREFIX)$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/TrustedFirmware-A/trusted-firmware-a/tar.gz/$(PKG_VERSION_PREFIX)$(PKG_VERSION)?
|
||||
PKG_SOURCE = trusted-firmware-a-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/TrustedFirmware-A/trusted-firmware-a/tar.gz/v$(PKG_VERSION)?
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_TARGETS := bin
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
@ -91,7 +83,7 @@ define Build/Compile/Trusted-Firmware-A
|
||||
OPENSSL_DIR=$(STAGING_DIR_HOST) \
|
||||
$(if $(DTC),DTC="$(DTC)") \
|
||||
PLAT=$(PLAT) \
|
||||
BUILD_STRING="ImmortalWrt $(PKG_VERSION_PREFIX)$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
|
||||
BUILD_STRING="ImmortalWrt v$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
|
||||
$(TFA_MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
|
@ -43,7 +43,6 @@ endef
|
||||
define Trusted-Firmware-A/Default
|
||||
BUILD_TARGET:=layerscape
|
||||
BUILD_SUBTARGET:=armv8_64b
|
||||
BUILD_DEVICES:=fsl_$(1)
|
||||
DEPENDS:=+layerscape-rcw +u-boot-fsl_$(1)
|
||||
endef
|
||||
|
||||
|
@ -28,7 +28,7 @@ endef
|
||||
define U-Boot/qca9558_nec_aterm
|
||||
NAME:=NEC Aterm series (QCA9558)
|
||||
BUILD_SUBTARGET:= generic
|
||||
BUILD_DEVICES:=nec_wg1400hp nec_wg1800hp nec_wg1800hp2 nec_wg2200hp
|
||||
BUILD_DEVICES:=nec_wg1400hp nec_wg1800hp nec_wg1800hp2
|
||||
UBOOT_CONFIG:=nec_qca9558_aterm
|
||||
endef
|
||||
|
||||
|
@ -435,18 +435,6 @@ define U-Boot/mt7981_livinet_zr-3020
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_netis_nx31
|
||||
NAME:=netis NX31
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=netis_nx31
|
||||
UBOOT_CONFIG:=mt7981_netis_nx31
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_nokia_ea0326gmp
|
||||
NAME:=Nokia EA0326GMP
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@ -822,6 +810,18 @@ define U-Boot/mt7986_zyxel_ex5601-t0
|
||||
DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-4k-ddr4
|
||||
endef
|
||||
|
||||
define U-Boot/mt7986_superbox_s20-plus
|
||||
NAME:=Superbox S20-Plus
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=superbox_s20-plus
|
||||
UBOOT_CONFIG:=mt7986a_superbox_s20-plus
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=emmc
|
||||
BL2_SOC:=mt7986
|
||||
BL2_DDRTYPE:=ddr4
|
||||
DEPENDS:=+trusted-firmware-a-mt7986-emmc-ddr4
|
||||
endef
|
||||
|
||||
define U-Boot/mt7988_arcadyan_mozart
|
||||
NAME:=Arcadyan Mozart
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@ -1018,7 +1018,6 @@ UBOOT_TARGETS := \
|
||||
mt7981_konka_komi-a31-emmc \
|
||||
mt7981_konka_komi-a31-nor \
|
||||
mt7981_livinet_zr-3020 \
|
||||
mt7981_netis_nx31 \
|
||||
mt7981_nokia_ea0326gmp \
|
||||
mt7981_openwrt_one-snand \
|
||||
mt7981_openwrt_one-nor \
|
||||
@ -1048,6 +1047,7 @@ UBOOT_TARGETS := \
|
||||
mt7986_tplink_tl-xtr8488 \
|
||||
mt7986_xiaomi_redmi-router-ax6000 \
|
||||
mt7986_zyxel_ex5601-t0 \
|
||||
mt7986_superbox_s20-plus \
|
||||
mt7986_rfb \
|
||||
mt7988_arcadyan_mozart \
|
||||
mt7988_asus_zenwifi-bt8 \
|
||||
|
@ -1,334 +0,0 @@
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7981_netis_nx31_defconfig
|
||||
@@ -0,0 +1,106 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7981-netis_nx31"
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_TARGET_MT7981=y
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007ef00
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-netis_nx31.dtb"
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_PROMPT="MT7981> "
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_PART=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="defenvs/netis_nx31_env"
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+# CONFIG_MMC is not set
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_MTD_SPI_NAND=y
|
||||
+CONFIG_MTD_UBI_FASTMAP=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_MTK_TPHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7981=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_SERIAL_RX_BUFFER=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPIM=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7981-netis_nx31.dts
|
||||
@@ -0,0 +1,162 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+/*
|
||||
+ * Copyright (c) 2025
|
||||
+ * Author: Mikhail Zhilkin <csharper2005@gmail.com>
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7981.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ model = "netis NX31";
|
||||
+ compatible = "netis,nx31", "mediatek,mt7981";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x10000000>;
|
||||
+ };
|
||||
+
|
||||
+ keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ button-0 {
|
||||
+ label = "mesh";
|
||||
+ linux,code = <BTN_0>;
|
||||
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ button-1 {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led-0 {
|
||||
+ label = "blue:wlan2g";
|
||||
+ gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-1 {
|
||||
+ label = "blue:status";
|
||||
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-2 {
|
||||
+ label = "blue:wan";
|
||||
+ gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ led-3 {
|
||||
+ label = "blue:wlan5g";
|
||||
+ gpios = <&gpio 34 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ mediatek,force-highspeed;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "2500base-x";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ spi_flash_pins: spi0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "spi0", "spi0_wp_hold";
|
||||
+ };
|
||||
+
|
||||
+ conf-pu {
|
||||
+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
+ };
|
||||
+
|
||||
+ conf-pd {
|
||||
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&spi_flash_pins>;
|
||||
+ status = "okay";
|
||||
+ must_tx;
|
||||
+ enhance_timing;
|
||||
+ dma_ext;
|
||||
+ ipm_design;
|
||||
+ support_quad;
|
||||
+ tick_dly = <2>;
|
||||
+ sample_sel = <0>;
|
||||
+
|
||||
+ spi_nand@0 {
|
||||
+ compatible = "spi-nand";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <52000000>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "BL2";
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "u-boot-env (unused)";
|
||||
+ reg = <0x100000 0x80000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@160000 {
|
||||
+ label = "Factory";
|
||||
+ reg = <0x180000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@380000 {
|
||||
+ label = "FIP";
|
||||
+ reg = <0x380000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@580000 {
|
||||
+ label = "ubi";
|
||||
+ reg = <0x580000 0x7a80000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/defenvs/netis_nx31_env
|
||||
@@ -0,0 +1,57 @@
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x46000000
|
||||
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
||||
+bootcmd=run check_buttons ; if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
|
||||
+bootconf=config-1
|
||||
+bootdelay=0
|
||||
+bootfile=immortalwrt-mediatek-filogic-netis_nx31-initramfs-recovery.itb
|
||||
+bootfile_bl2=immortalwrt-mediatek-filogic-netis_nx31-preloader.bin
|
||||
+bootfile_fip=immortalwrt-mediatek-filogic-netis_nx31-bl31-uboot.fip
|
||||
+bootfile_upg=immortalwrt-mediatek-filogic-netis_nx31-squashfs-sysupgrade.itb
|
||||
+bootled_status=blue:status
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to NAND.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then led $bootled_status on ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=led $bootled_status on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led bootled_status off
|
||||
+boot_recovery=led $bootled_status on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led bootled_status off
|
||||
+boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
|
||||
+boot_tftp_forever=led $bootled_status on ; while true ; do run boot_tftp ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
|
||||
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
|
||||
+check_buttons=if button reset ; then run boot_tftp ; fi
|
||||
+ethaddr_factory=mtd read Factory 0x40080000 0x1e0000 0x20000 && env readmem -b ethaddr 0x4009ef20 0x6 ; setenv ethaddr_factory
|
||||
+part_default=production
|
||||
+part_recovery=recovery
|
||||
+reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
|
||||
+mtd_write_fip=mtd erase FIP && mtd write FIP $loadaddr
|
||||
+mtd_write_bl2=mtd erase BL2 && mtd write BL2 $loadaddr
|
||||
+ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic || run ubi_format
|
||||
+ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
|
||||
+ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
|
||||
+ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
|
||||
+ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
|
||||
+ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
|
||||
+ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
|
||||
+ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
|
||||
+_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
@ -0,0 +1,318 @@
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7986a_superbox_s20-plus_defconfig
|
||||
@@ -0,0 +1,124 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
|
||||
+CONFIG_POSITION_INDEPENDENT=y
|
||||
+CONFIG_ARCH_MEDIATEK=y
|
||||
+CONFIG_TEXT_BASE=0x41e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_ENV_SIZE=0x40000
|
||||
+CONFIG_ENV_OFFSET=0x400000
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="mt7986a-superbox_s20-plus"
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_TARGET_MT7986=y
|
||||
+CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_ENV_OFFSET_REDUND=0x440000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_PCI=y
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_AHCI=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_BOOTDELAY=30
|
||||
+CONFIG_AUTOBOOT_KEYED=y
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986a-superbox_s20-plus.dtb"
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_PRE_CONSOLE_BUFFER=y
|
||||
+CONFIG_LOG=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_PROMPT="MT7986> "
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_PWM=y
|
||||
+CONFIG_CMD_GPT=y
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_PART=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_USB=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
+CONFIG_OF_EMBED=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_MMC=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="superbox_s20-plus_env"
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_VERSION_VARIABLE=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_NETCONSOLE=y
|
||||
+CONFIG_USE_IPADDR=y
|
||||
+CONFIG_IPADDR="192.168.1.1"
|
||||
+CONFIG_USE_SERVERIP=y
|
||||
+CONFIG_SERVERIP="192.168.1.254"
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_SCSI_AHCI=y
|
||||
+CONFIG_AHCI_PCI=y
|
||||
+CONFIG_MTK_AHCI=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_SUPPORT_EMMC_BOOT=y
|
||||
+CONFIG_MMC_HS200_SUPPORT=y
|
||||
+CONFIG_MMC_MTK=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_DM_MDIO=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PCIE_MEDIATEK=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PHY_MTK_TPHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7622=y
|
||||
+CONFIG_PINCTRL_MT7986=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_DM_REGULATOR_GPIO=y
|
||||
+CONFIG_DM_PWM=y
|
||||
+CONFIG_PWM_MTK=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_SCSI=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_USB=y
|
||||
+CONFIG_USB_XHCI_HCD=y
|
||||
+CONFIG_USB_XHCI_MTK=y
|
||||
+CONFIG_USB_STORAGE=y
|
||||
+CONFIG_ZSTD=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7986a-superbox_s20-plus.dts
|
||||
@@ -0,0 +1,130 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7986.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/linux-event-codes.h>
|
||||
+
|
||||
+/ {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ model = "CLX S20P";
|
||||
+ compatible = "mediatek,mt7986", "mediatek,mt7986-rfb";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x80000000>;
|
||||
+ };
|
||||
+
|
||||
+ gpio-keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ button-reset {
|
||||
+ label = "reset";
|
||||
+ gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio-leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ led_sys {
|
||||
+ label = "sys";
|
||||
+ gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
|
||||
+ default-state = "on";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ reg_1p8v: regulator-1p8v {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "fixed-1.8V";
|
||||
+ regulator-min-microvolt = <1800000>;
|
||||
+ regulator-max-microvolt = <1800000>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+
|
||||
+ reg_3p3v: regulator-3p3v {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "fixed-3.3V";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "2500base-x";
|
||||
+ mediatek,switch = "mt7531";
|
||||
+ reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc0 {
|
||||
+ bus-width = <8>;
|
||||
+ cap-mmc-highspeed;
|
||||
+ cap-mmc-hw-reset;
|
||||
+ max-frequency = <200000000>;
|
||||
+ non-removable;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc0_pins_default>;
|
||||
+ vmmc-supply = <®_3p3v>;
|
||||
+ vqmmc-supply = <®_1p8v>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ mmc0_pins_default: mmc0default {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "emmc_51";
|
||||
+ };
|
||||
+
|
||||
+ conf-cmd-dat {
|
||||
+ pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
|
||||
+ "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
|
||||
+ "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
|
||||
+ input-enable;
|
||||
+ drive-strength = <MTK_DRIVE_4mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
|
||||
+ };
|
||||
+
|
||||
+ conf-clk {
|
||||
+ pins = "EMMC_CK";
|
||||
+ drive-strength = <MTK_DRIVE_6mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
|
||||
+ };
|
||||
+
|
||||
+ conf-dsl {
|
||||
+ pins = "EMMC_DSL";
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
|
||||
+ };
|
||||
+
|
||||
+ conf-rst {
|
||||
+ pins = "EMMC_RSTB";
|
||||
+ drive-strength = <MTK_DRIVE_4mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/superbox_s20-plus_env
|
||||
@@ -0,0 +1,55 @@
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.254
|
||||
+loadaddr=0x46000000
|
||||
+console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
|
||||
+bootargs=root=/dev/fit0 rootwait
|
||||
+bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
|
||||
+bootconf=config-1
|
||||
+bootdelay=0
|
||||
+bootfile=immortalwrt-mediatek-filogic-superbox_s20-plus-initramfs-recovery.itb
|
||||
+bootfile_bl2=immortalwrt-mediatek-filogic-superbox_s20-plus-preloader.bin
|
||||
+bootfile_fip=immortalwrt-mediatek-filogic-superbox_s20-plus-bl31-uboot.fip
|
||||
+bootfile_upg=immortalwrt-mediatek-filogic-superbox_s20-plus-squashfs-sysupgrade.itb
|
||||
+bootled_pwr=red:status
|
||||
+bootled_rec=blue:status
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) )
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
|
||||
+bootmenu_2=Boot production system from eMMC.=run boot_production ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Boot recovery system from eMMC.=run boot_recovery ; run bootmenu_confirm_return
|
||||
+bootmenu_4=Load production system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_5=Load recovery system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
|
||||
+bootmenu_6=[31mLoad BL31+U-Boot FIP via TFTP then write to eMMC.[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_7=[31mLoad BL2 preloader via TFTP then write to eMMC.[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_8=Reboot.=reset
|
||||
+bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
|
||||
+boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
|
||||
+boot_production=led $bootled_pwr on ; run emmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
|
||||
+boot_recovery=led $bootled_rec on ; run emmc_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
|
||||
+boot_emmc=run boot_production ; run boot_recovery
|
||||
+boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
|
||||
+boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run emmc_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run emmc_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
|
||||
+boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip
|
||||
+boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2
|
||||
+boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
|
||||
+mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size
|
||||
+mmc_read_vol=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
|
||||
+part_default=production
|
||||
+part_recovery=recovery
|
||||
+reset_factory=eraseenv && reset
|
||||
+emmc_read_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol
|
||||
+emmc_read_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol
|
||||
+emmc_write_bl2=mmc partconf 0 1 1 1 && mmc erase 0x0 0x400 && mmc write $fileaddr 0x0 0x400 ; mmc partconf 0 1 1 0
|
||||
+emmc_write_fip=mmc erase 0x3400 0x2000 && mmc write $fileaddr 0x3400 0x2000 && mmc erase 0x2000 0x800
|
||||
+emmc_write_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol
|
||||
+emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
|
||||
+_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
@ -117,6 +117,13 @@ define U-Boot/rk3399/Default
|
||||
ATF:=$(RK3399_ATF)
|
||||
endef
|
||||
|
||||
define U-Boot/fine3399-rk3399
|
||||
$(U-Boot/rk3399/Default)
|
||||
NAME:=Fine 3399
|
||||
BUILD_DEVICES:= \
|
||||
rumu3f_fine-3399
|
||||
endef
|
||||
|
||||
define U-Boot/guangmiao-g4c-rk3399
|
||||
$(U-Boot/rk3399/Default)
|
||||
NAME:=GuangMiao G4C
|
||||
@ -146,20 +153,6 @@ define U-Boot/nanopi-r4se-rk3399
|
||||
friendlyarm_nanopi-r4se
|
||||
endef
|
||||
|
||||
define U-Boot/rock-4c-plus-rk3399
|
||||
$(U-Boot/rk3399/Default)
|
||||
NAME:=ROCK 4C+
|
||||
BUILD_DEVICES:= \
|
||||
radxa_rock-4c-plus
|
||||
endef
|
||||
|
||||
define U-Boot/rock-4se-rk3399
|
||||
$(U-Boot/rk3399/Default)
|
||||
NAME:=ROCK 4SE
|
||||
BUILD_DEVICES:= \
|
||||
radxa_rock-4se
|
||||
endef
|
||||
|
||||
define U-Boot/rock-pi-4-rk3399
|
||||
$(U-Boot/rk3399/Default)
|
||||
NAME:=ROCK Pi 4
|
||||
@ -399,12 +392,11 @@ define U-Boot/rock5a-rk3588s
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
fine3399-rk3399 \
|
||||
guangmiao-g4c-rk3399 \
|
||||
nanopc-t4-rk3399 \
|
||||
nanopi-r4s-rk3399 \
|
||||
nanopi-r4se-rk3399 \
|
||||
rock-4c-plus-rk3399 \
|
||||
rock-4se-rk3399 \
|
||||
rock-pi-4-rk3399 \
|
||||
rockpro64-rk3399 \
|
||||
rock-pi-s-rk3308 \
|
||||
|
@ -1,10 +1,11 @@
|
||||
--- a/arch/arm/dts/Makefile
|
||||
+++ b/arch/arm/dts/Makefile
|
||||
@@ -87,6 +87,23 @@ dtb-$(CONFIG_ROCKCHIP_RK3368) += \
|
||||
@@ -87,6 +87,24 @@ dtb-$(CONFIG_ROCKCHIP_RK3368) += \
|
||||
rk3368-geekbox.dtb \
|
||||
rk3368-px5-evb.dtb \
|
||||
|
||||
+dtb-$(CONFIG_ROCKCHIP_RK3399) += \
|
||||
+ rk3399-fine-3399.dtb \
|
||||
+ rk3399-guangmiao-g4c.dtb \
|
||||
+ rk3399-nanopi-r4se.dtb
|
||||
+
|
||||
|
@ -0,0 +1,14 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
#include "rk3399-u-boot.dtsi"
|
||||
#include "rk3399-sdram-lpddr4-100.dtsi"
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
|
||||
};
|
||||
};
|
||||
|
||||
&vdd_log {
|
||||
regulator-init-microvolt = <950000>;
|
||||
};
|
@ -0,0 +1,789 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/pwm/pwm.h>
|
||||
#include "rk3399.dtsi"
|
||||
#include "rk3399-op1-opp.dtsi"
|
||||
|
||||
/ {
|
||||
model = "RUMU3F Fine3399";
|
||||
compatible = "rockchip,rk3399";
|
||||
|
||||
aliases {
|
||||
ethernet0 = &gmac;
|
||||
mmc0 = &sdio0;
|
||||
mmc1 = &sdmmc;
|
||||
mmc2 = &sdhci;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial2:1500000n8";
|
||||
};
|
||||
|
||||
clkin_gmac: external-gmac-clock {
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <125000000>;
|
||||
clock-output-names = "clkin_gmac";
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
|
||||
dc_12v: dc-12v {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "dc_12v";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <12000000>;
|
||||
regulator-max-microvolt = <12000000>;
|
||||
};
|
||||
|
||||
sdio_pwrseq: sdio-pwrseq {
|
||||
compatible = "mmc-pwrseq-simple";
|
||||
clocks = <&rk808 1>;
|
||||
clock-names = "ext_clock";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&wifi_reg_on_h>;
|
||||
reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
/* switched by pmic_sleep */
|
||||
vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc1v8_s3";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
vin-supply = <&vcc_1v8>;
|
||||
};
|
||||
|
||||
vcc3v3_sys: vcc3v3-sys {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc3v3_sys";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
vin-supply = <&dc_12v>;
|
||||
};
|
||||
|
||||
vcc_sys: vcc-sys {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "vcc_sys";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
vin-supply = <&dc_12v>;
|
||||
};
|
||||
|
||||
vcc_phy: vcc-phy-regulator {
|
||||
compatible = "regulator-fixed";
|
||||
enable-active-high;
|
||||
gpio = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&vcc_phy_h>;
|
||||
regulator-name = "vcc_phy";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
vdd_log: vdd-log {
|
||||
compatible = "pwm-regulator";
|
||||
pwms = <&pwm2 0 25000 1>;
|
||||
regulator-name = "vdd_log";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <800000>;
|
||||
regulator-max-microvolt = <1400000>;
|
||||
vin-supply = <&vcc_sys>;
|
||||
};
|
||||
|
||||
leds: gpio-leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&user_led2>;
|
||||
|
||||
user_led2 {
|
||||
label = "blue:work_led";
|
||||
gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
};
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
autorepeat;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&power_key>;
|
||||
|
||||
key-power {
|
||||
debounce-interval = <100>;
|
||||
gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
|
||||
label = "GPIO Key Power";
|
||||
linux,code = <KEY_POWER>;
|
||||
wakeup-source;
|
||||
};
|
||||
};
|
||||
|
||||
fan0: pwm-fan {
|
||||
compatible = "pwm-fan";
|
||||
cooling-levels = <0 25 50 75 100 150>;
|
||||
#cooling-cells = <2>;
|
||||
fan-supply = <&vcc_sys>;
|
||||
pwms = <&pwm1 0 40000 0>;
|
||||
};
|
||||
|
||||
backlight: backlight {
|
||||
compatible = "pwm-backlight";
|
||||
brightness-levels = <0 36 72 108 144 180 216 255>;
|
||||
default-brightness-level = <5>;
|
||||
pwms = <&pwm0 0 1000000 0>;
|
||||
};
|
||||
|
||||
ir-receiver {
|
||||
compatible = "gpio-ir-receiver";
|
||||
gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&ir_int>;
|
||||
};
|
||||
|
||||
adc-keys {
|
||||
compatible = "adc-keys";
|
||||
io-channels = <&saradc 1>;
|
||||
io-channel-names = "buttons";
|
||||
keyup-threshold-microvolt = <1750000>;
|
||||
poll-interval = <100>;
|
||||
|
||||
recovery {
|
||||
label = "Recovery";
|
||||
linux,code = <KEY_VENDOR>;
|
||||
press-threshold-microvolt = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&cpu_l0 {
|
||||
cpu-supply = <&vdd_cpu_l>;
|
||||
};
|
||||
|
||||
&cpu_l1 {
|
||||
cpu-supply = <&vdd_cpu_l>;
|
||||
};
|
||||
|
||||
&cpu_l2 {
|
||||
cpu-supply = <&vdd_cpu_l>;
|
||||
};
|
||||
|
||||
&cpu_l3 {
|
||||
cpu-supply = <&vdd_cpu_l>;
|
||||
};
|
||||
|
||||
&cpu_b0 {
|
||||
cpu-supply = <&vdd_cpu_b>;
|
||||
};
|
||||
|
||||
&cpu_b1 {
|
||||
cpu-supply = <&vdd_cpu_b>;
|
||||
};
|
||||
|
||||
&gpu {
|
||||
mali-supply = <&vdd_gpu>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&cpu_thermal {
|
||||
trips {
|
||||
cpu_hot: cpu_hot {
|
||||
hysteresis = <10000>;
|
||||
temperature = <55000>;
|
||||
type = "active";
|
||||
};
|
||||
};
|
||||
|
||||
cooling-maps {
|
||||
map2 {
|
||||
cooling-device =
|
||||
<&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
||||
trip = <&cpu_hot>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&emmc_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&gmac {
|
||||
assigned-clocks = <&cru SCLK_RMII_SRC>;
|
||||
assigned-clock-parents = <&clkin_gmac>;
|
||||
clock_in_out = "input";
|
||||
phy-supply = <&vcc_phy>;
|
||||
phy-mode = "rgmii";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&rgmii_pins>;
|
||||
snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
|
||||
snps,reset-active-low;
|
||||
snps,reset-delays-us = <0 10000 50000>;
|
||||
tx_delay = <0x28>;
|
||||
rx_delay = <0x11>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hdmi {
|
||||
ddc-i2c-bus = <&i2c3>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&hdmi_cec>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&hdmi_sound {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c0 {
|
||||
clock-frequency = <400000>;
|
||||
i2c-scl-rising-time-ns = <168>;
|
||||
i2c-scl-falling-time-ns = <4>;
|
||||
status = "okay";
|
||||
|
||||
rk808: pmic@1b {
|
||||
compatible = "rockchip,rk808";
|
||||
reg = <0x1b>;
|
||||
interrupt-parent = <&gpio1>;
|
||||
interrupts = <RK_PC5 IRQ_TYPE_LEVEL_LOW>;
|
||||
#clock-cells = <1>;
|
||||
clock-output-names = "xin32k", "rk808-clkout2";
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pmic_int_l &pmic_dvs2>;
|
||||
rockchip,system-power-controller;
|
||||
wakeup-source;
|
||||
|
||||
vcc1-supply = <&vcc3v3_sys>;
|
||||
vcc2-supply = <&vcc3v3_sys>;
|
||||
vcc3-supply = <&vcc3v3_sys>;
|
||||
vcc4-supply = <&vcc3v3_sys>;
|
||||
vcc6-supply = <&vcc3v3_sys>;
|
||||
vcc7-supply = <&vcc3v3_sys>;
|
||||
vcc8-supply = <&vcc3v3_sys>;
|
||||
vcc9-supply = <&vcc3v3_sys>;
|
||||
vcc10-supply = <&vcc3v3_sys>;
|
||||
vcc11-supply = <&vcc3v3_sys>;
|
||||
vcc12-supply = <&vcc3v3_sys>;
|
||||
vddio-supply = <&vcc1v8_pmu>;
|
||||
|
||||
regulators {
|
||||
vdd_center: DCDC_REG1 {
|
||||
regulator-name = "vdd_center";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
regulator-ramp-delay = <6001>;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vdd_cpu_l: DCDC_REG2 {
|
||||
regulator-name = "vdd_cpu_l";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
regulator-ramp-delay = <6001>;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vcc_ddr: DCDC_REG3 {
|
||||
regulator-name = "vcc_ddr";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-state-mem {
|
||||
regulator-on-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vcc_1v8: DCDC_REG4 {
|
||||
regulator-name = "vcc_1v8";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-state-mem {
|
||||
regulator-on-in-suspend;
|
||||
regulator-suspend-microvolt = <1800000>;
|
||||
};
|
||||
};
|
||||
|
||||
vcc1v8_dvp: LDO_REG1 {
|
||||
regulator-name = "vcc1v8_dvp";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vcc3v0_tp: LDO_REG2 {
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <3000000>;
|
||||
regulator-max-microvolt = <3000000>;
|
||||
regulator-name = "vcc3v0_tp";
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vcc1v8_pmu: LDO_REG3 {
|
||||
regulator-name = "vcc1v8_pmu";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-state-mem {
|
||||
regulator-on-in-suspend;
|
||||
regulator-suspend-microvolt = <1800000>;
|
||||
};
|
||||
};
|
||||
|
||||
vcc_sd: LDO_REG4 {
|
||||
regulator-name = "vcc_sd";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-state-mem {
|
||||
regulator-on-in-suspend;
|
||||
regulator-suspend-microvolt = <3300000>;
|
||||
};
|
||||
};
|
||||
|
||||
vcca3v0_codec: LDO_REG5 {
|
||||
regulator-name = "vcca3v0_codec";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <3000000>;
|
||||
regulator-max-microvolt = <3000000>;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vcc_1v5: LDO_REG6 {
|
||||
regulator-name = "vcc_1v5";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <1500000>;
|
||||
regulator-max-microvolt = <1500000>;
|
||||
regulator-state-mem {
|
||||
regulator-on-in-suspend;
|
||||
regulator-suspend-microvolt = <1500000>;
|
||||
};
|
||||
};
|
||||
|
||||
vcca1v8_codec: LDO_REG7 {
|
||||
regulator-name = "vcca1v8_codec";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <1800000>;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vcc_3v0: LDO_REG8 {
|
||||
regulator-name = "vcc_3v0";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-min-microvolt = <3000000>;
|
||||
regulator-max-microvolt = <3000000>;
|
||||
regulator-state-mem {
|
||||
regulator-on-in-suspend;
|
||||
regulator-suspend-microvolt = <3000000>;
|
||||
};
|
||||
};
|
||||
|
||||
vcc3v3_s3: SWITCH_REG1 {
|
||||
regulator-name = "vcc3v3_s3";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vcc3v3_s0: SWITCH_REG2 {
|
||||
regulator-name = "vcc3v3_s0";
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vdd_cpu_b: regulator@40 {
|
||||
compatible = "silergy,syr827";
|
||||
reg = <0x40>;
|
||||
fcs,suspend-voltage-selector = <1>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&cpu_b_sleep>;
|
||||
regulator-name = "vdd_cpu_b";
|
||||
regulator-min-microvolt = <712500>;
|
||||
regulator-max-microvolt = <1500000>;
|
||||
regulator-ramp-delay = <1000>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
vin-supply = <&vcc_sys>;
|
||||
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
|
||||
vdd_gpu: regulator@41 {
|
||||
compatible = "silergy,syr828";
|
||||
reg = <0x41>;
|
||||
fcs,suspend-voltage-selector = <1>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&gpu_sleep>;
|
||||
regulator-name = "vdd_gpu";
|
||||
regulator-min-microvolt = <712500>;
|
||||
regulator-max-microvolt = <1500000>;
|
||||
regulator-ramp-delay = <1000>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
vin-supply = <&vcc_sys>;
|
||||
|
||||
regulator-state-mem {
|
||||
regulator-off-in-suspend;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&i2c3 {
|
||||
i2c-scl-rising-time-ns = <450>;
|
||||
i2c-scl-falling-time-ns = <15>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2s2 {
|
||||
#sound-dai-cells = <0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&iep_mmu {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&io_domains {
|
||||
status = "okay";
|
||||
|
||||
bt656-supply = <&vcc_3v0>;
|
||||
audio-supply = <&vcca1v8_codec>;
|
||||
sdmmc-supply = <&vcc_sd>;
|
||||
gpio1830-supply = <&vcc_3v0>;
|
||||
};
|
||||
|
||||
&pmu_io_domains {
|
||||
status = "okay";
|
||||
pmu1830-supply = <&vcc_1v8>;
|
||||
};
|
||||
|
||||
&pcie_phy {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pcie0 {
|
||||
ep-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>;
|
||||
max-link-speed = <2>;
|
||||
num-lanes = <2>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pcie_clkreqn_cpm>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pinctrl {
|
||||
pmic {
|
||||
cpu_b_sleep: cpu-b-sleep {
|
||||
rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
};
|
||||
|
||||
gpu_sleep: gpu-sleep {
|
||||
rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
};
|
||||
|
||||
pmic_int_l: pmic-int-l {
|
||||
rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
|
||||
pmic_dvs2: pmic-dvs2 {
|
||||
rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
};
|
||||
};
|
||||
|
||||
sdio-pwrseq {
|
||||
wifi_reg_on_h: wifi-reg-on-h {
|
||||
rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
wifi {
|
||||
wifi_host_wake_l: wifi-host-wake-l {
|
||||
rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
bt {
|
||||
bt_enable_h: bt-enable-h {
|
||||
rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
|
||||
bt_host_wake_l: bt-host-wake-l {
|
||||
rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
|
||||
};
|
||||
|
||||
bt_wake_l: bt-wake-l {
|
||||
rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
gmac {
|
||||
vcc_phy_h: vcc-phy-h {
|
||||
rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
user_led2: user_led2 {
|
||||
rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
ir {
|
||||
ir_int: ir-int {
|
||||
rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
|
||||
};
|
||||
};
|
||||
|
||||
buttons {
|
||||
power_key: power_key {
|
||||
rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pwm0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwm1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwm2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&saradc {
|
||||
vref-supply = <&vcca1v8_s3>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdio0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
bus-width = <4>;
|
||||
cap-sd-highspeed;
|
||||
cap-sdio-irq;
|
||||
clock-frequency = <50000000>;
|
||||
disable-wp;
|
||||
keep-power-in-suspend;
|
||||
max-frequency = <50000000>;
|
||||
mmc-pwrseq = <&sdio_pwrseq>;
|
||||
non-removable;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
|
||||
sd-uhs-sdr104;
|
||||
status = "okay";
|
||||
|
||||
brcmf: wifi@1 {
|
||||
reg = <1>;
|
||||
compatible = "brcm,bcm4329-fmac";
|
||||
interrupt-parent = <&gpio0>;
|
||||
interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
|
||||
interrupt-names = "host-wake";
|
||||
brcm,drive-strength = <5>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&wifi_host_wake_l>;
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc {
|
||||
bus-width = <4>;
|
||||
cap-sd-highspeed;
|
||||
cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
|
||||
clock-frequency = <150000000>;
|
||||
disable-wp;
|
||||
sd-uhs-sdr104;
|
||||
max-frequency = <150000000>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
|
||||
vqmmc-supply = <&vcc_sd>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&sdhci {
|
||||
bus-width = <8>;
|
||||
mmc-hs400-1_8v;
|
||||
mmc-hs400-enhanced-strobe;
|
||||
keep-power-in-suspend;
|
||||
non-removable;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
status = "okay";
|
||||
|
||||
panel@0 {
|
||||
compatible = "sitronix,st7735s", "sitronix,st7735r", "sitronix,st7789v", "jianda,jd-t18003-t01";
|
||||
reg = <0>;
|
||||
rgb;
|
||||
width = <80>;
|
||||
height = <160>;
|
||||
fps = <30>;
|
||||
buswidth = <8>;
|
||||
rotate = <270>;
|
||||
backlight = <&backlight>;
|
||||
dc-gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
|
||||
reset-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_LOW>;
|
||||
led-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;
|
||||
spi-max-frequency = <32000000>;
|
||||
debug = <0>;
|
||||
spi-cpol;
|
||||
spi-cpha;
|
||||
};
|
||||
};
|
||||
|
||||
&tcphy0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&tcphy1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&tsadc {
|
||||
/* tshut mode 0:CRU 1:GPIO */
|
||||
rockchip,hw-tshut-mode = <1>;
|
||||
/* tshut polarity 0:LOW 1:HIGH */
|
||||
rockchip,hw-tshut-polarity = <1>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&u2phy0 {
|
||||
status = "okay";
|
||||
|
||||
u2phy0_otg: otg-port {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
u2phy0_host: host-port {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&u2phy1 {
|
||||
status = "okay";
|
||||
|
||||
u2phy1_otg: otg-port {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
u2phy1_host: host-port {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
|
||||
status = "okay";
|
||||
|
||||
bluetooth {
|
||||
compatible = "brcm,bcm43438-bt";
|
||||
clocks = <&rk808 1>;
|
||||
clock-names = "lpo";
|
||||
device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;
|
||||
host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
|
||||
shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
|
||||
max-speed = <4000000>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
|
||||
vbat-supply = <&vcc3v3_sys>;
|
||||
vddio-supply = <&vcc_1v8>;
|
||||
};
|
||||
};
|
||||
|
||||
&uart2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_host0_ehci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_host0_ohci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_host1_ehci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_host1_ohci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbdrd3_0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbdrd_dwc3_0 {
|
||||
status = "okay";
|
||||
dr_mode = "host";
|
||||
};
|
||||
|
||||
&usbdrd3_1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usbdrd_dwc3_1 {
|
||||
status = "okay";
|
||||
dr_mode = "host";
|
||||
};
|
||||
|
||||
&vopb {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&vopb_mmu {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&vopl {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&vopl_mmu {
|
||||
status = "okay";
|
||||
};
|
@ -0,0 +1,84 @@
|
||||
CONFIG_ARM=y
|
||||
CONFIG_SKIP_LOWLEVEL_INIT=y
|
||||
CONFIG_COUNTER_FREQUENCY=24000000
|
||||
CONFIG_ARCH_ROCKCHIP=y
|
||||
CONFIG_SPL_GPIO=y
|
||||
CONFIG_NR_DRAM_BANKS=1
|
||||
CONFIG_ENV_OFFSET=0x3F8000
|
||||
CONFIG_DEFAULT_DEVICE_TREE="rk3399-fine-3399"
|
||||
CONFIG_DM_RESET=y
|
||||
CONFIG_ROCKCHIP_RK3399=y
|
||||
CONFIG_TARGET_EVB_RK3399=y
|
||||
CONFIG_DEBUG_UART_BASE=0xFF1A0000
|
||||
CONFIG_DEBUG_UART_CLOCK=24000000
|
||||
CONFIG_SYS_LOAD_ADDR=0x800800
|
||||
CONFIG_DEBUG_UART=y
|
||||
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-fine-3399.dtb"
|
||||
CONFIG_DISPLAY_BOARDINFO_LATE=y
|
||||
CONFIG_SPL_MAX_SIZE=0x40000
|
||||
CONFIG_SPL_PAD_TO=0x7f8000
|
||||
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
|
||||
CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
|
||||
CONFIG_TPL=y
|
||||
CONFIG_CMD_BOOTZ=y
|
||||
CONFIG_CMD_GPT=y
|
||||
CONFIG_CMD_I2C=y
|
||||
CONFIG_CMD_MMC=y
|
||||
CONFIG_CMD_PCI=y
|
||||
CONFIG_CMD_USB=y
|
||||
CONFIG_CMD_ROCKUSB=y
|
||||
CONFIG_CMD_USB_MASS_STORAGE=y
|
||||
# CONFIG_CMD_SETEXPR is not set
|
||||
CONFIG_CMD_TIME=y
|
||||
CONFIG_CMD_PMIC=y
|
||||
CONFIG_CMD_REGULATOR=y
|
||||
CONFIG_SPL_OF_CONTROL=y
|
||||
# CONFIG_OF_UPSTREAM is not set
|
||||
CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
|
||||
CONFIG_ENV_IS_IN_MMC=y
|
||||
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
CONFIG_ROCKCHIP_GPIO=y
|
||||
CONFIG_SYS_I2C_ROCKCHIP=y
|
||||
CONFIG_ROCKCHIP_IODOMAIN=y
|
||||
CONFIG_MMC_DW=y
|
||||
CONFIG_MMC_DW_ROCKCHIP=y
|
||||
CONFIG_MMC_SDHCI=y
|
||||
CONFIG_MMC_SDHCI_SDMA=y
|
||||
CONFIG_MMC_SDHCI_ROCKCHIP=y
|
||||
CONFIG_ETH_DESIGNWARE=y
|
||||
CONFIG_GMAC_ROCKCHIP=y
|
||||
CONFIG_NVME_PCI=y
|
||||
CONFIG_PHY_ROCKCHIP_INNO_USB2=y
|
||||
CONFIG_PHY_ROCKCHIP_TYPEC=y
|
||||
CONFIG_PMIC_RK8XX=y
|
||||
CONFIG_SPL_DM_REGULATOR_FIXED=y
|
||||
CONFIG_REGULATOR_PWM=y
|
||||
CONFIG_REGULATOR_RK8XX=y
|
||||
CONFIG_PWM_ROCKCHIP=y
|
||||
CONFIG_RAM_ROCKCHIP_LPDDR4=y
|
||||
CONFIG_BAUDRATE=1500000
|
||||
CONFIG_DEBUG_UART_SHIFT=2
|
||||
CONFIG_SYS_NS16550_MEM32=y
|
||||
CONFIG_SYSINFO=y
|
||||
CONFIG_SYSINFO_SMBIOS=y
|
||||
CONFIG_SYSRESET=y
|
||||
CONFIG_USB=y
|
||||
CONFIG_USB_XHCI_HCD=y
|
||||
CONFIG_USB_EHCI_HCD=y
|
||||
CONFIG_USB_EHCI_GENERIC=y
|
||||
CONFIG_USB_KEYBOARD=y
|
||||
CONFIG_USB_DWC3=y
|
||||
CONFIG_USB_DWC3_GENERIC=y
|
||||
CONFIG_USB_HOST_ETHER=y
|
||||
CONFIG_USB_ETHER_ASIX=y
|
||||
CONFIG_USB_ETHER_ASIX88179=y
|
||||
CONFIG_USB_ETHER_MCS7830=y
|
||||
CONFIG_USB_ETHER_RTL8152=y
|
||||
CONFIG_USB_ETHER_SMSC95XX=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_FUNCTION_ROCKUSB=y
|
||||
CONFIG_VIDEO=y
|
||||
CONFIG_DISPLAY=y
|
||||
CONFIG_VIDEO_ROCKCHIP=y
|
||||
CONFIG_DISPLAY_ROCKCHIP_HDMI=y
|
||||
CONFIG_ERRNO_STR=y
|
@ -45,7 +45,6 @@ livinet,zr-3020-ubootmod|\
|
||||
mercusys,mr90x-v1-ubi|\
|
||||
netcore,n60|\
|
||||
netcore,n60-pro|\
|
||||
netis,nx31|\
|
||||
nokia,ea0326gmp|\
|
||||
qihoo,360t7|\
|
||||
routerich,ax3000-ubootmod|\
|
||||
@ -81,7 +80,8 @@ bananapi,bpi-r4-poe|\
|
||||
cmcc,rax3000m|\
|
||||
cmcc,rax3000me|\
|
||||
jdcloud,re-cp-03|\
|
||||
konka,komi-a31)
|
||||
konka,komi-a31|\
|
||||
superbox,s20-plus)
|
||||
. /lib/upgrade/fit.sh
|
||||
export_fitblk_bootdev
|
||||
case "$CI_METHOD" in
|
||||
@ -119,7 +119,6 @@ gatonetworks,gdsp)
|
||||
glinet,gl-mt3000)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
|
||||
;;
|
||||
mercusys,mr80x-v3|\
|
||||
mercusys,mr90x-v1|\
|
||||
routerich,ax3000|\
|
||||
tenbay,wr3000k|\
|
||||
|
@ -38,8 +38,7 @@ glinet,gl-axt1800|\
|
||||
netgear,wax214|\
|
||||
netgear,wax610|\
|
||||
netgear,wax610y|\
|
||||
tplink,eap610od|\
|
||||
tplink,eap623od-hd-v1)
|
||||
tplink,eap610-outdoor)
|
||||
ubootenv_add_mtd "0:appsblenv" "0x0" "0x40000" "0x20000"
|
||||
;;
|
||||
linksys,mr7350|\
|
||||
|
@ -141,3 +141,30 @@ define Package/brcmfmac-nvram-43752-sdio/install
|
||||
$(1)/lib/firmware/brcm/brcmfmac43752-sdio.firefly,rk3568-roc-pc.txt
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-nvram-43752-sdio))
|
||||
|
||||
Package/brcmfmac-firmware-43430b0-sdio = $(call Package/armbian-firmware-default,Broadcom BCM43430B0 FullMac SDIO firmware)
|
||||
define Package/brcmfmac-firmware-43430b0-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/BCM43430B0.hcd \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43430b0-sdio.bin \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.clm_blob \
|
||||
$(1)/lib/firmware/brcm/
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-firmware-43430b0-sdio))
|
||||
|
||||
Package/brcmfmac-nvram-43430b0-sdio = $(call Package/armbian-firmware-default,Broadcom BCM43430B0 SDIO NVRAM firmware)
|
||||
define Package/brcmfmac-nvram-43430b0-sdio/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/brcm/brcmfmac43430b0-sdio.txt \
|
||||
$(1)/lib/firmware/brcm/
|
||||
$(LN) \
|
||||
brcmfmac43430b0-sdio.txt \
|
||||
$(1)/lib/firmware/brcm/brcmfmac43430b0-sdio.rumu3f,fine-3399.txt
|
||||
endef
|
||||
$(eval $(call BuildPackage,brcmfmac-nvram-43430b0-sdio))
|
||||
|
@ -8,9 +8,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ath11k-firmware
|
||||
PKG_SOURCE_DATE:=2025-04-13
|
||||
PKG_SOURCE_VERSION:=0353334f1ed0afdede3a3425350f90594b1ce323
|
||||
PKG_MIRROR_HASH:=80cd9d1c8a96951d4e3a76802fdd711fa07d37d7c69459146be6c3b4ad5f97d9
|
||||
PKG_SOURCE_DATE:=2025-03-24
|
||||
PKG_SOURCE_VERSION:=f4564f5a0ceffc84322722bda7763aaf69d690f3
|
||||
PKG_MIRROR_HASH:=99a9406f312d0ed7cfd45de85ebf297470143d765dcaa02a87a42975bc865a04
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
@ -6,9 +6,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git
|
||||
PKG_SOURCE_DATE:=2025-04-15
|
||||
PKG_SOURCE_VERSION:=38a18dc26c9b150f06f56b9c5972d789eb5bc0c4
|
||||
PKG_MIRROR_HASH:=a10a9b524ecd91854265b04819303410ae77e1f5a093f9cc8eb43e25e99c1bae
|
||||
PKG_SOURCE_DATE:=2025-04-01
|
||||
PKG_SOURCE_VERSION:=c220fac7fdb35628ba53ff53ed36cf883a401161
|
||||
PKG_MIRROR_HASH:=26338b4f165eb2e90273cd61ed26715b99e496ccf738167e22ff9213ca42c973
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -66,9 +66,8 @@ ALLWIFIBOARDS:= \
|
||||
redmi_ax6 \
|
||||
skspruce_wia3300-20 \
|
||||
spectrum_sax1v1k \
|
||||
tplink_eap610od \
|
||||
tplink_eap610-outdoor \
|
||||
tplink_eap620hd-v1 \
|
||||
tplink_eap623od-hd-v1 \
|
||||
tplink_eap660hd-v1 \
|
||||
wallys_dr40x9 \
|
||||
xiaomi_ax3600 \
|
||||
@ -225,9 +224,8 @@ $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze))
|
||||
$(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
|
||||
$(eval $(call generate-ipq-wifi-package,skspruce_wia3300-20,SKSpruce WIA3300-20))
|
||||
$(eval $(call generate-ipq-wifi-package,spectrum_sax1v1k,Spectrum SAX1V1K))
|
||||
$(eval $(call generate-ipq-wifi-package,tplink_eap610od,TPLink EAP610-Outdoor))
|
||||
$(eval $(call generate-ipq-wifi-package,tplink_eap610-outdoor,TPLink EAP610-Outdoor))
|
||||
$(eval $(call generate-ipq-wifi-package,tplink_eap620hd-v1,TP-Link EAP620 HD v1))
|
||||
$(eval $(call generate-ipq-wifi-package,tplink_eap623od-hd-v1,TP-Link EAP623-Outdoor HD v1))
|
||||
$(eval $(call generate-ipq-wifi-package,tplink_eap660hd-v1,TP-Link EAP660 HD v1))
|
||||
$(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
|
||||
$(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
|
||||
|
@ -25,8 +25,6 @@ define Package/layerscape-fman
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP FMan ucode
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
@ -27,8 +27,6 @@ define Package/layerscape-ddr-phy
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP Layerscape DDR PHY firmware
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
@ -26,8 +26,6 @@ define Package/layerscape-dpl
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP DPL firmware
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
MAKE_PATH:=config
|
||||
|
@ -25,8 +25,6 @@ define Package/layerscape-mc
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP MC firmware
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv8_64b
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
@ -25,8 +25,6 @@ define Package/layerscape-rcw
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=NXP Layerscape RCW binaries
|
||||
DEPENDS:=@TARGET_layerscape
|
||||
DEFAULT:=y if TARGET_layerscape_armv7
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
BOARDS := \
|
||||
|
@ -5,11 +5,3 @@ define Package/ath12k-firmware-wcn7850/install
|
||||
$(PKG_BUILD_DIR)/ath12k/WCN7850/hw2.0/* $(1)/lib/firmware/ath12k/WCN7850/hw2.0/
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath12k-firmware-wcn7850))
|
||||
|
||||
Package/ath12k-firmware-qcn9274 = $(call Package/firmware-default,QCN9274 ath12k firmware)
|
||||
define Package/ath12k-firmware-qcn9274/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN9274/hw2.0
|
||||
$(INSTALL_DATA) \
|
||||
$(PKG_BUILD_DIR)/ath12k/QCN9274/hw2.0/* $(1)/lib/firmware/ath12k/QCN9274/hw2.0/
|
||||
endef
|
||||
$(eval $(call BuildPackage,ath12k-firmware-qcn9274))
|
||||
|
@ -7,7 +7,8 @@ Rollback some APIs to fix compilation errors.
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
---
|
||||
ath10k-6.14/ahb.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
ath10k-6.14/mac.c | 5 ++---
|
||||
2 files changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/ath10k-6.14/ahb.c
|
||||
+++ b/ath10k-6.14/ahb.c
|
||||
@ -20,3 +21,26 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
};
|
||||
|
||||
int ath10k_ahb_init(void)
|
||||
--- a/ath10k-6.14/mac.c
|
||||
+++ b/ath10k-6.14/mac.c
|
||||
@@ -9607,10 +9607,9 @@ exit:
|
||||
|
||||
static void ath10k_sta_rc_update(struct ieee80211_hw *hw,
|
||||
struct ieee80211_vif *vif,
|
||||
- struct ieee80211_link_sta *link_sta,
|
||||
+ struct ieee80211_sta *sta,
|
||||
u32 changed)
|
||||
{
|
||||
- struct ieee80211_sta *sta = link_sta->sta;
|
||||
struct ath10k *ar = hw->priv;
|
||||
struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
|
||||
struct ath10k_vif *arvif = (void *)vif->drv_priv;
|
||||
@@ -10603,7 +10602,7 @@ static const struct ieee80211_ops ath10k
|
||||
.reconfig_complete = ath10k_reconfig_complete,
|
||||
.get_survey = ath10k_get_survey,
|
||||
.set_bitrate_mask = ath10k_mac_op_set_bitrate_mask,
|
||||
- .link_sta_rc_update = ath10k_sta_rc_update,
|
||||
+ .sta_rc_update = ath10k_sta_rc_update,
|
||||
.offset_tsf = ath10k_offset_tsf,
|
||||
.get_tsf = ath10k_get_tsf,
|
||||
.ampdu_action = ath10k_ampdu_action,
|
||||
|
@ -35,9 +35,9 @@ define Package/bcm63xx-cfe/install
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
rm -rf $(STAGING_DIR_IMAGE)/$(PKG_NAME)
|
||||
mkdir -p $(STAGING_DIR_IMAGE)/$(PKG_NAME)
|
||||
$(CP) -r $(PKG_BUILD_DIR)/* $(STAGING_DIR_IMAGE)/$(PKG_NAME)
|
||||
rm -rf $(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||
mkdir -p $(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||
$(CP) -r $(PKG_BUILD_DIR)/* $(KERNEL_BUILD_DIR)/$(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bcm63xx-cfe))
|
||||
|
@ -1,99 +0,0 @@
|
||||
--- a/ioctl.c
|
||||
+++ b/ioctl.c
|
||||
@@ -829,29 +829,37 @@ static inline void tfm_info_to_alg_info(
|
||||
"%s", crypto_tfm_alg_driver_name(tfm));
|
||||
}
|
||||
|
||||
-#ifndef CRYPTO_ALG_KERN_DRIVER_ONLY
|
||||
+#if defined(QCANSS) || defined(QCA) || defined(MT7621) || defined(MT7622) || defined(LANTIQ) || defined(BCM675X) || defined(BCM49XX) || defined(MT798X)
|
||||
static unsigned int is_known_accelerated(struct crypto_tfm *tfm)
|
||||
{
|
||||
const char *name = crypto_tfm_alg_driver_name(tfm);
|
||||
|
||||
if (name == NULL)
|
||||
- return 1; /* assume accelerated */
|
||||
+ return 0;
|
||||
|
||||
/* look for known crypto engine names */
|
||||
- if (strstr(name, "-talitos") ||
|
||||
- !strncmp(name, "mv-", 3) ||
|
||||
- !strncmp(name, "atmel-", 6) ||
|
||||
- strstr(name, "geode") ||
|
||||
- strstr(name, "hifn") ||
|
||||
- strstr(name, "-ixp4xx") ||
|
||||
- strstr(name, "-omap") ||
|
||||
- strstr(name, "-picoxcell") ||
|
||||
- strstr(name, "-s5p") ||
|
||||
- strstr(name, "-ppc4xx") ||
|
||||
- strstr(name, "-caam") ||
|
||||
- strstr(name, "-n2"))
|
||||
+#if defined(QCANSS)
|
||||
+ if (!strncmp(name, "nss-", 4))
|
||||
return 1;
|
||||
-
|
||||
+#elif defined(QCA)
|
||||
+ if (!strncmp(name, "qcrypto", 7))
|
||||
+ return 1;
|
||||
+#elif defined(MT7621)
|
||||
+ if (strstr(name, "eip93"))
|
||||
+ return 1;
|
||||
+#elif defined(MT7622)
|
||||
+ if (strstr(name, "mtk"))
|
||||
+ return 1;
|
||||
+#elif defined(MT798X)
|
||||
+ if (strstr(name, "safexcel-"))
|
||||
+ return 1;
|
||||
+#elif defined(LANTIQ)
|
||||
+ if (strstr(name, "ltq-crypto"))
|
||||
+ return 1;
|
||||
+#elif defined(BCM675X) || defined(BCM49XX)
|
||||
+ if (strstr(name, "-iproc"))
|
||||
+ return 1;
|
||||
+#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -876,22 +884,22 @@ static int get_session_info(struct fcryp
|
||||
else
|
||||
tfm = crypto_aead_tfm(ses_ptr->cdata.async.as);
|
||||
tfm_info_to_alg_info(&siop->cipher_info, tfm);
|
||||
-#ifdef CRYPTO_ALG_KERN_DRIVER_ONLY
|
||||
- if (tfm->__crt_alg->cra_flags & CRYPTO_ALG_KERN_DRIVER_ONLY)
|
||||
+#if defined(QCANSS) || defined(QCA) || defined(MT7621) || defined(MT7622) || defined(LANTIQ) || defined(BCM675X) || defined(BCM49XX) || defined(MT798X)
|
||||
+ if (is_known_accelerated(tfm))
|
||||
siop->flags |= SIOP_FLAG_KERNEL_DRIVER_ONLY;
|
||||
#else
|
||||
- if (is_known_accelerated(tfm))
|
||||
+ if (tfm->__crt_alg->cra_flags & CRYPTO_ALG_KERN_DRIVER_ONLY)
|
||||
siop->flags |= SIOP_FLAG_KERNEL_DRIVER_ONLY;
|
||||
#endif
|
||||
}
|
||||
if (ses_ptr->hdata.init) {
|
||||
tfm = crypto_ahash_tfm(ses_ptr->hdata.async.s);
|
||||
tfm_info_to_alg_info(&siop->hash_info, tfm);
|
||||
-#ifdef CRYPTO_ALG_KERN_DRIVER_ONLY
|
||||
- if (tfm->__crt_alg->cra_flags & CRYPTO_ALG_KERN_DRIVER_ONLY)
|
||||
+#if defined(QCANSS) || defined(QCA) || defined(MT7621) || defined(MT7622) || defined(LANTIQ) || defined(BCM675X) || defined(BCM49XX) || defined(MT798X)
|
||||
+ if (is_known_accelerated(tfm))
|
||||
siop->flags |= SIOP_FLAG_KERNEL_DRIVER_ONLY;
|
||||
#else
|
||||
- if (is_known_accelerated(tfm))
|
||||
+ if (tfm->__crt_alg->cra_flags & CRYPTO_ALG_KERN_DRIVER_ONLY)
|
||||
siop->flags |= SIOP_FLAG_KERNEL_DRIVER_ONLY;
|
||||
#endif
|
||||
}
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -168,6 +168,12 @@ __crypto_run_zc(struct csession *ses_ptr
|
||||
struct crypt_op *cop = &kcop->cop;
|
||||
int ret = 0;
|
||||
|
||||
+#if defined(QCANSS)
|
||||
+//openssl bug!!!
|
||||
+ if (unlikely(cop->src != cop->dst)) {
|
||||
+ return __crypto_run_std(ses_ptr, cop);
|
||||
+ }
|
||||
+#endif
|
||||
ret = get_userbuf(ses_ptr, cop->src, cop->len, cop->dst, cop->len,
|
||||
kcop->task, kcop->mm, &src_sg, &dst_sg);
|
||||
if (unlikely(ret)) {
|
@ -674,7 +674,7 @@ static void gpio_keys_irq_close(struct gpio_keys_button_dev *bdev)
|
||||
}
|
||||
}
|
||||
|
||||
static void gpio_keys_remove(struct platform_device *pdev)
|
||||
static int gpio_keys_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct gpio_keys_button_dev *bdev = platform_get_drvdata(pdev);
|
||||
|
||||
@ -684,11 +684,13 @@ static void gpio_keys_remove(struct platform_device *pdev)
|
||||
gpio_keys_polled_close(bdev);
|
||||
else
|
||||
gpio_keys_irq_close(bdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver gpio_keys_driver = {
|
||||
.probe = gpio_keys_probe,
|
||||
.remove_new = gpio_keys_remove,
|
||||
.remove = gpio_keys_remove,
|
||||
.driver = {
|
||||
.name = "gpio-keys",
|
||||
.of_match_table = of_match_ptr(gpio_keys_of_match),
|
||||
@ -697,7 +699,7 @@ static struct platform_driver gpio_keys_driver = {
|
||||
|
||||
static struct platform_driver gpio_keys_polled_driver = {
|
||||
.probe = gpio_keys_polled_probe,
|
||||
.remove_new = gpio_keys_remove,
|
||||
.remove = gpio_keys_remove,
|
||||
.driver = {
|
||||
.name = "gpio-keys-polled",
|
||||
.of_match_table = of_match_ptr(gpio_keys_polled_of_match),
|
||||
|
@ -2780,7 +2780,7 @@ static int ltq_mei_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ltq_mei_remove(struct platform_device *pdev)
|
||||
static int ltq_mei_remove(struct platform_device *pdev)
|
||||
{
|
||||
int i = 0;
|
||||
int num;
|
||||
@ -2794,6 +2794,7 @@ static void ltq_mei_remove(struct platform_device *pdev)
|
||||
IFX_MEI_ExitDevice (i);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id ltq_mei_match[] = {
|
||||
@ -2803,7 +2804,7 @@ static const struct of_device_id ltq_mei_match[] = {
|
||||
|
||||
static struct platform_driver ltq_mei_driver = {
|
||||
.probe = ltq_mei_probe,
|
||||
.remove_new = ltq_mei_remove,
|
||||
.remove = ltq_mei_remove,
|
||||
.driver = {
|
||||
.name = "lantiq,mei-xway",
|
||||
.of_match_table = ltq_mei_match,
|
||||
|
@ -1865,7 +1865,7 @@ INIT_PRIV_DATA_FAIL:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ltq_atm_remove(struct platform_device *pdev)
|
||||
static int ltq_atm_remove(struct platform_device *pdev)
|
||||
{
|
||||
int port_num;
|
||||
struct ltq_atm_ops *ops = platform_get_drvdata(pdev);
|
||||
@ -1885,11 +1885,13 @@ static void ltq_atm_remove(struct platform_device *pdev)
|
||||
ops->shutdown();
|
||||
|
||||
clear_priv_data();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver ltq_atm_driver = {
|
||||
.probe = ltq_atm_probe,
|
||||
.remove_new = ltq_atm_remove,
|
||||
.remove = ltq_atm_remove,
|
||||
.driver = {
|
||||
.name = "atm",
|
||||
.of_match_table = ltq_atm_match,
|
||||
|
@ -143,7 +143,7 @@ static int ltq_deu_probe(struct platform_device *pdev)
|
||||
* \ingroup IFX_DEU_FUNCTIONS
|
||||
* \brief remove the loaded crypto algorithms
|
||||
*/
|
||||
static void ltq_deu_remove(struct platform_device *pdev)
|
||||
static int ltq_deu_remove(struct platform_device *pdev)
|
||||
{
|
||||
//#ifdef CONFIG_CRYPTO_DEV_PWR_SAVE_MODE
|
||||
#if defined(CONFIG_CRYPTO_DEV_DES)
|
||||
@ -168,6 +168,8 @@ static void ltq_deu_remove(struct platform_device *pdev)
|
||||
ifxdeu_fini_md5_hmac ();
|
||||
#endif
|
||||
printk("DEU has exited successfully\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -191,7 +193,7 @@ MODULE_DEVICE_TABLE(of, ltq_deu_match);
|
||||
|
||||
static struct platform_driver ltq_deu_driver = {
|
||||
.probe = ltq_deu_probe,
|
||||
.remove_new = ltq_deu_remove,
|
||||
.remove = ltq_deu_remove,
|
||||
.driver = {
|
||||
.name = "deu",
|
||||
.of_match_table = ltq_deu_match,
|
||||
|
@ -1566,7 +1566,7 @@ INIT_PRIV_DATA_FAIL:
|
||||
* Output:
|
||||
* none
|
||||
*/
|
||||
static void ltq_ptm_remove(struct platform_device *pdev)
|
||||
static int ltq_ptm_remove(struct platform_device *pdev)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1591,11 +1591,13 @@ static void ltq_ptm_remove(struct platform_device *pdev)
|
||||
ifx_ptm_uninit_chip();
|
||||
|
||||
clear_priv_data();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver ltq_ptm_driver = {
|
||||
.probe = ltq_ptm_probe,
|
||||
.remove_new = ltq_ptm_remove,
|
||||
.remove = ltq_ptm_remove,
|
||||
.driver = {
|
||||
.name = "ptm",
|
||||
.of_match_table = ltq_ptm_match,
|
||||
|
@ -1079,7 +1079,7 @@ INIT_PRIV_DATA_FAIL:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ltq_ptm_remove(struct platform_device *pdev)
|
||||
static int ltq_ptm_remove(struct platform_device *pdev)
|
||||
{
|
||||
int i;
|
||||
ifx_mei_atm_showtime_enter = NULL;
|
||||
@ -1103,6 +1103,8 @@ static void ltq_ptm_remove(struct platform_device *pdev)
|
||||
ifx_ptm_uninit_chip();
|
||||
|
||||
clear_priv_data();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef MODULE
|
||||
@ -1133,7 +1135,7 @@ static int __init queue_gamma_map_setup(char *line)
|
||||
#endif
|
||||
static struct platform_driver ltq_ptm_driver = {
|
||||
.probe = ltq_ptm_probe,
|
||||
.remove_new = ltq_ptm_remove,
|
||||
.remove = ltq_ptm_remove,
|
||||
.driver = {
|
||||
.name = "ptm",
|
||||
.of_match_table = ltq_ptm_match,
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
net.netfilter.nf_conntrack_acct=1
|
||||
net.netfilter.nf_conntrack_checksum=0
|
||||
net.netfilter.nf_conntrack_max=65535
|
||||
net.netfilter.nf_conntrack_tcp_timeout_established=7440
|
||||
net.netfilter.nf_conntrack_udp_timeout=60
|
||||
net.netfilter.nf_conntrack_udp_timeout_stream=180
|
||||
|
@ -658,7 +658,7 @@ $(eval $(call KernelPackage,dsa-realtek))
|
||||
|
||||
define KernelPackage/dsa-rtl8366rb
|
||||
SUBMENU:=$(NETWORK_DEVICES_MENU)
|
||||
TITLE:=Realtek RTL8366RB switch DSA support
|
||||
TITLE:=Realtek RTL8365MB switch DSA support
|
||||
DEPENDS:=+kmod-dsa-realtek @!TARGET_x86 @!TARGET_bcm47xx @!TARGET_uml
|
||||
KCONFIG:= \
|
||||
CONFIG_NET_DSA_REALTEK_RTL8366RB \
|
||||
|
@ -1651,7 +1651,6 @@ endef
|
||||
$(eval $(call KernelPackage,qrtr-mhi))
|
||||
|
||||
define KernelPackage/unix-diag
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=UNIX socket monitoring interface
|
||||
KCONFIG:=CONFIG_UNIX_DIAG
|
||||
FILES:= $(LINUX_DIR)/net/unix/unix_diag.ko
|
||||
@ -1661,7 +1660,6 @@ endef
|
||||
$(eval $(call KernelPackage,unix-diag))
|
||||
|
||||
define KernelPackage/packet-diag
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=Packet sockets monitoring interface
|
||||
KCONFIG:=CONFIG_PACKET_DIAG
|
||||
FILES:= $(LINUX_DIR)/net/packet/af_packet_diag.ko
|
||||
|
@ -538,7 +538,7 @@ $(eval $(call KernelPackage,usb-dwc3-octeon))
|
||||
|
||||
define KernelPackage/usb-dwc3-qcom
|
||||
TITLE:=DWC3 Qualcomm USB driver
|
||||
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_qualcommax||TARGET_qualcommbe) +kmod-usb-dwc3
|
||||
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x||TARGET_qualcommax) +kmod-usb-dwc3
|
||||
KCONFIG:= CONFIG_USB_DWC3_QCOM
|
||||
FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3-qcom.ko
|
||||
AUTOLOAD:=$(call AutoLoad,53,dwc3-qcom,1)
|
||||
|
@ -36,21 +36,14 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_MAC80211_DEBUGFS \
|
||||
CONFIG_PACKAGE_MAC80211_MESH \
|
||||
CONFIG_PACKAGE_MAC80211_TRACING \
|
||||
CONFIG_PACKAGE_MAC80211_NSS_SUPPORT \
|
||||
CONFIG_PACKAGE_MAC80211_NSS_REDIRECT \
|
||||
CONFIG_PACKAGE_IWLWIFI_DEBUG \
|
||||
CONFIG_PACKAGE_IWLWIFI_DEBUGFS \
|
||||
CONFIG_PACKAGE_RTLWIFI_DEBUG
|
||||
CONFIG_PACKAGE_RTLWIFI_DEBUG \
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
WMENU:=Wireless Drivers
|
||||
|
||||
NSS_PATCH:= subsys ath10k ath11k
|
||||
IPQ_BRANCH:=$(shell git -C $(TOPDIR) rev-parse --abbrev-ref HEAD)
|
||||
IPQ_DATE:=$(shell git -C $(TOPDIR) log -1 --format=%cd --date=format:%Y-%m-%d)
|
||||
IPQ_COMMIT:=$(shell git -C $(TOPDIR) log -1 --format=%h)
|
||||
|
||||
define KernelPackage/mac80211/Default
|
||||
SUBMENU:=$(WMENU)
|
||||
URL:=https://wireless.wiki.kernel.org/
|
||||
@ -136,15 +129,10 @@ 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 +kmod-crypto-cmac +kmod-crypto-ccm +kmod-crypto-gcm +hostapd-common \
|
||||
+ATH11K_NSS_SUPPORT:kmod-qca-nss-drv
|
||||
DEPENDS+= +kmod-cfg80211 +kmod-crypto-cmac +kmod-crypto-ccm +kmod-crypto-gcm +hostapd-common
|
||||
KCONFIG:=\
|
||||
CONFIG_AVERAGE=y
|
||||
FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
|
||||
ifdef CONFIG_PACKAGE_MAC80211_NSS_REDIRECT
|
||||
AUTOLOAD:=$(call AutoProbe, mac80211)
|
||||
MODPARAMS.mac80211:=nss_redirect=1
|
||||
endif
|
||||
ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||
MENU:=1
|
||||
endef
|
||||
@ -152,21 +140,6 @@ endef
|
||||
define KernelPackage/mac80211/config
|
||||
if PACKAGE_kmod-mac80211
|
||||
|
||||
if PACKAGE_kmod-qca-nss-drv
|
||||
config PACKAGE_MAC80211_NSS_SUPPORT
|
||||
bool "Enable NSS support"
|
||||
default y
|
||||
help
|
||||
This option enables support for NSS in QCA boards.
|
||||
config PACKAGE_MAC80211_NSS_REDIRECT
|
||||
bool "Enable autoloading with 'nss_redirect=1' (not needed on ath11k)"
|
||||
depends on PACKAGE_MAC80211_NSS_SUPPORT
|
||||
default n
|
||||
help
|
||||
This option enables autoloading mac80211 with 'nss_redirect=1'.
|
||||
However, it is not required for wifi offloading.
|
||||
endif
|
||||
|
||||
config PACKAGE_MAC80211_DEBUGFS
|
||||
bool "Export mac80211 internals in DebugFS"
|
||||
select KERNEL_DEBUG_FS
|
||||
@ -308,16 +281,6 @@ ifeq ($(BUILD_VARIANT),smallbuffers)
|
||||
C_DEFINES+= -DCONFIG_ATH10K_SMALLBUFFERS
|
||||
endif
|
||||
|
||||
ifdef CONFIG_ATH11K_NSS_SUPPORT
|
||||
IREMAP_CFLAGS+=-I$(STAGING_DIR)/usr/include/qca-nss-drv -I$(STAGING_DIR)/usr/include/qca-nss-clients
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NSS_FIRMWARE_VERSION_11_4),y)
|
||||
C_DEFINES+=-DCONFIG_NSS_FIRMWARE_VERSION_11_4
|
||||
endif
|
||||
|
||||
config-$(CONFIG_PACKAGE_MAC80211_NSS_SUPPORT) += MAC80211_NSS_SUPPORT
|
||||
|
||||
MAKE_OPTS:= \
|
||||
$(subst -C $(LINUX_DIR),-C "$(PKG_BUILD_DIR)",$(KERNEL_MAKEOPTS)) \
|
||||
EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS) $(C_DEFINES)" \
|
||||
@ -391,11 +354,6 @@ define Build/Patch
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rtl,rtl/)
|
||||
ifdef CONFIG_ATH11K_NSS_SUPPORT
|
||||
$(foreach driver,$(NSS_PATCH),
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/nss/$(driver),nss/$(driver)/)
|
||||
)
|
||||
endif
|
||||
$(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
|
||||
endef
|
||||
|
||||
@ -413,11 +371,6 @@ define Quilt/Refresh/Package
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rtl,rtl/)
|
||||
ifdef CONFIG_ATH11K_NSS_SUPPORT
|
||||
$(foreach driver,$(NSS_PATCH),
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/nss/$(driver),nss/$(driver)/)
|
||||
)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@ -439,18 +392,6 @@ define Build/InstallDev
|
||||
rm -f $(1)/usr/include/mac80211-backport/linux/module.h
|
||||
endef
|
||||
|
||||
ifdef CONFIG_ATH11K_NSS_SUPPORT
|
||||
define KernelPackage/ath11k/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/config $(1)/usr/bin $(1)/etc/hotplug.d/net
|
||||
$(INSTALL_BIN) ./files/qca-nss-pbuf.init $(1)/etc/init.d/qca-nss-pbuf
|
||||
$(INSTALL_DATA) ./files/pbuf.uci $(1)/etc/config/pbuf
|
||||
$(INSTALL_BIN) ./files/nss_diag.sh $(1)/usr/bin/nss_diag
|
||||
$(INSTALL_DATA) ./files/disable_mesh_chksum_ath11k.hotplug $(1)/etc/hotplug.d/net/99-disable_mesh_chksum_ath11k
|
||||
echo "IPQ_BRANCH=$(IPQ_BRANCH)" > $(1)/etc/ipq_release
|
||||
echo "IPQ_DATE=$(IPQ_DATE)" >> $(1)/etc/ipq_release
|
||||
echo "IPQ_COMMIT=$(IPQ_COMMIT)" >> $(1)/etc/ipq_release
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(foreach drv,$(PKG_DRIVERS),$(call KernelPackage,$(drv))))
|
||||
$(eval $(call KernelPackage,cfg80211))
|
||||
|
@ -13,14 +13,7 @@ PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_ATH10K_LEDS \
|
||||
CONFIG_ATH10K_THERMAL \
|
||||
CONFIG_ATH11K_THERMAL \
|
||||
CONFIG_ATH11K_DEBUGFS_STA \
|
||||
CONFIG_ATH11K_DEBUGFS_HTT_STATS \
|
||||
CONFIG_ATH_USER_REGD \
|
||||
CONFIG_ATH11K_MEM_PROFILE_1G \
|
||||
CONFIG_ATH11K_MEM_PROFILE_512M \
|
||||
CONFIG_ATH11K_MEM_PROFILE_256M \
|
||||
CONFIG_ATH11K_NSS_SUPPORT \
|
||||
CONFIG_ATH11K_NSS_MESH_SUPPORT
|
||||
CONFIG_ATH_USER_REGD
|
||||
|
||||
ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
|
||||
config-y += \
|
||||
@ -66,13 +59,6 @@ config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR
|
||||
config-$(CONFIG_ATH10K_LEDS) += ATH10K_LEDS
|
||||
config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL
|
||||
config-$(CONFIG_ATH11K_THERMAL) += ATH11K_THERMAL
|
||||
config-$(CONFIG_ATH11K_MEM_PROFILE_1G) += ATH11K_MEM_PROFILE_1G
|
||||
config-$(CONFIG_ATH11K_MEM_PROFILE_512M) += ATH11K_MEM_PROFILE_512M
|
||||
config-$(CONFIG_ATH11K_MEM_PROFILE_256M) += ATH11K_MEM_PROFILE_256M
|
||||
config-$(CONFIG_ATH11K_NSS_SUPPORT) += ATH11K_NSS_SUPPORT
|
||||
config-$(CONFIG_ATH11K_NSS_MESH_SUPPORT) += ATH11K_NSS_MESH_SUPPORT
|
||||
config-$(CONFIG_ATH11K_DEBUGFS_STA) += ATH11K_DEBUGFS_STA
|
||||
config-$(CONFIG_ATH11K_DEBUGFS_HTT_STATS) += ATH11K_DEBUGFS_HTT_STATS
|
||||
|
||||
config-$(call config_package,ath9k-htc) += ATH9K_HTC
|
||||
config-$(call config_package,ath10k,regular) += ATH10K ATH10K_PCI
|
||||
@ -345,16 +331,8 @@ define KernelPackage/ath11k
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath11k
|
||||
DEPENDS+= +kmod-ath +@DRIVER_11AC_SUPPORT +@DRIVER_11AX_SUPPORT \
|
||||
+kmod-crypto-michael-mic +ATH11K_THERMAL:kmod-hwmon-core \
|
||||
+ATH11K_THERMAL:kmod-thermal +kmod-qcom-qmi-helpers \
|
||||
+ATH11K_NSS_SUPPORT:kmod-qca-nss-drv \
|
||||
+ATH11K_NSS_MESH_SUPPORT:kmod-qca-nss-drv-wifi-meshmgr \
|
||||
+@(ATH11K_NSS_SUPPORT):NSS_DRV_WIFIOFFLOAD_ENABLE \
|
||||
+@(ATH11K_NSS_SUPPORT):NSS_DRV_WIFI_EXT_VDEV_ENABLE
|
||||
+ATH11K_THERMAL:kmod-thermal +kmod-qcom-qmi-helpers
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath11k/ath11k.ko
|
||||
ifdef CONFIG_ATH11K_NSS_SUPPORT
|
||||
AUTOLOAD:=$(call AutoProbe,ath11k)
|
||||
MODPARAMS.ath11k:=nss_offload=1 frame_mode=2
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/ath11k/description
|
||||
@ -362,10 +340,6 @@ This module adds support for Qualcomm Technologies 802.11ax family of
|
||||
chipsets.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath11k/conffiles
|
||||
/etc/config/pbuf
|
||||
endef
|
||||
|
||||
define KernelPackage/ath11k/config
|
||||
|
||||
config ATH11K_THERMAL
|
||||
@ -373,63 +347,6 @@ define KernelPackage/ath11k/config
|
||||
depends on PACKAGE_kmod-ath11k
|
||||
default y if TARGET_qualcommax
|
||||
|
||||
config ATH11K_DEBUGFS_STA
|
||||
bool "Enable ath11k station statistics"
|
||||
depends on PACKAGE_kmod-ath11k
|
||||
depends on PACKAGE_MAC80211_DEBUGFS
|
||||
default y
|
||||
help
|
||||
Say Y to enable access to the station statistics via debugfs.
|
||||
|
||||
config ATH11K_DEBUGFS_HTT_STATS
|
||||
bool "Enable ath11k HTT statistics"
|
||||
depends on PACKAGE_kmod-ath11k
|
||||
depends on PACKAGE_MAC80211_DEBUGFS
|
||||
default y
|
||||
help
|
||||
Say Y to enable access to the HTT statistics via debugfs.
|
||||
|
||||
config ATH11K_NSS_SUPPORT
|
||||
bool "Enable NSS WiFi offload"
|
||||
select ATH11K_MEM_PROFILE_512M
|
||||
select PACKAGE_kmod-qca-nss-ecm
|
||||
default y
|
||||
help
|
||||
Say Y to enable NSS WiFi offload support. Ensure you enable feeds for NSS drivers.
|
||||
https://github.com/qosmio/nss-packages
|
||||
|
||||
config ATH11K_NSS_MESH_SUPPORT
|
||||
bool "Enable NSS WiFi Mesh offload"
|
||||
depends on ATH11K_NSS_SUPPORT
|
||||
select PACKAGE_MAC80211_MESH
|
||||
select NSS_FIRMWARE_VERSION_11_4
|
||||
default n
|
||||
|
||||
choice
|
||||
prompt "Memory Profile"
|
||||
depends on PACKAGE_kmod-ath11k
|
||||
default ATH11K_MEM_PROFILE_512M
|
||||
help
|
||||
This option allows you to select the memory profile.
|
||||
It should correspond to the total RAM of your board.
|
||||
|
||||
config ATH11K_MEM_PROFILE_1G
|
||||
bool "Use 1G memory profile"
|
||||
help
|
||||
This allows configuring ath11k for boards with 1GB+ memory.
|
||||
|
||||
config ATH11K_MEM_PROFILE_512M
|
||||
bool "Use 512MB memory profile"
|
||||
help
|
||||
This allows configuring ath11k for boards with 512M memory.
|
||||
The default is 1GB if not selected
|
||||
|
||||
config ATH11K_MEM_PROFILE_256M
|
||||
bool "Use 256MB memory profile"
|
||||
help
|
||||
This allows configuring ath11k for boards with 256M memory.
|
||||
The default is 1GB if not selected
|
||||
endchoice
|
||||
endef
|
||||
|
||||
define KernelPackage/ath11k-ahb
|
||||
|
@ -1,24 +0,0 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=1090
|
||||
PROG=${0##*/}
|
||||
[ "$ACTION" = "add" ] && [ "$DEVTYPE" = "wlan" ] || exit 0
|
||||
|
||||
UEVENT="/sys/class/net/$INTERFACE/device/uevent"
|
||||
[ -r "$UEVENT" ] || exit 0
|
||||
|
||||
DRIVER=$(awk -F= '/^DRIVER/{print $2}' "$UEVENT")
|
||||
case "$DRIVER" in
|
||||
*ath11k*)
|
||||
mode=$(ubus call network.wireless status \
|
||||
| jsonfilter -e "@[*].interfaces[@.ifname='$INTERFACE'].config.mode" 2> /dev/null)
|
||||
[ "$mode" = "mesh" ] || exit 0
|
||||
|
||||
INC="/lib/netifd/offload/disable_offloads.sh"
|
||||
. "$INC" 2> /dev/null || {
|
||||
logger -t "$PROG" -p user.error "missing include script $INC. exiting..."
|
||||
exit 1
|
||||
}
|
||||
|
||||
disable_feature tx-checksumming "$INTERFACE"
|
||||
;;
|
||||
esac
|
@ -1,94 +0,0 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=3037,3060,2034,1091,2166
|
||||
|
||||
# check if stdout is a terminal, then set colors.
|
||||
if [ -t 1 ]; then
|
||||
red="\033[31m"
|
||||
green="\033[32m"
|
||||
yellow="\033[33m"
|
||||
blue="\033[34m"
|
||||
magenta="\033[35m"
|
||||
cyan="\033[36m"
|
||||
white="\033[37m"
|
||||
reset="\033[m"
|
||||
bold="\033[1m"
|
||||
fi
|
||||
|
||||
# Retrieve Linux kernel
|
||||
kernel=$(uname -r)
|
||||
|
||||
# Retrieve CPU freq mode
|
||||
cpu_mode=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
|
||||
|
||||
# Retrieve OpenWRT version
|
||||
[ -r /etc/openwrt_version ] && openwrt_rev=$(cat /etc/openwrt_version)
|
||||
|
||||
# Retrieve device model
|
||||
model=$(jsonfilter -e ''@.model.name'' < /etc/board.json | sed -e "s/,/_/g")
|
||||
|
||||
# NSS firmware version
|
||||
nss_fw="/lib/firmware/qca*.bin"
|
||||
# shellcheck disable=2086
|
||||
[ "$(ls $nss_fw 2> /dev/null)" ] && nss_version=$(grep -h -m 1 -a -o 'Version:.[^[:cntrl:]]*' $nss_fw | head -1 | cut -d ' ' -f 2)
|
||||
|
||||
# ATH11K firmware version
|
||||
ath11k_fw=$(grep -hm1 -a -o 'WLAN.[^[:cntrl:]]*SILICONZ-1' /lib/firmware/*/q6* | head -1)
|
||||
|
||||
# MAC80211 (backports) version
|
||||
mac80211_version=$(awk '/version/{print $NF;exit}' /lib/modules/*/compat.ko)
|
||||
|
||||
# OpenWRT IPQ release details
|
||||
[ -r /etc/ipq_release ] && . /etc/ipq_release
|
||||
ipq_branch=${IPQ_BRANCH:-"N/A"}
|
||||
ipq_commit=${IPQ_COMMIT:-"N/A"}
|
||||
ipq_date=${IPQ_DATE:-"N/A"}
|
||||
|
||||
# Defaults for empty variables
|
||||
kernel=${kernel:-"N/A"}
|
||||
cpu_mode=${cpu_mode:-"N/A"}
|
||||
openwrt_rev=${openwrt_rev:-"N/A"}
|
||||
model=${model:-"N/A"}
|
||||
nss_version=${nss_version:-"N/A"}
|
||||
ath11k_fw=${ath11k_fw:-"N/A"}
|
||||
mac80211_version=${mac80211_version:-"N/A"}
|
||||
|
||||
# Display the information
|
||||
echo -e "${bold}${red} MODEL${reset}: ${cyan}${bold}${model}${reset}"
|
||||
echo -e "${bold}${red} KERNEL${reset}: ${cyan}${bold}${kernel}${reset}"
|
||||
echo -e "${bold}${red} CPU MODE${reset}: ${cyan}${bold}${cpu_mode}${reset}"
|
||||
echo -e "${bold}${red} OPENWRT${reset}: ${green}${openwrt_rev}${reset}"
|
||||
echo -e "${bold}${red}IPQ BRANCH${reset}: ${green}${ipq_branch}${reset}"
|
||||
echo -e "${bold}${red}IPQ COMMIT${reset}: ${green}${ipq_commit}${reset}"
|
||||
echo -e "${bold}${red} IPQ DATE${reset}: ${green}${ipq_date}${reset}"
|
||||
echo -e "${bold}${red} NSS FW${reset}: ${yellow}${nss_version}${reset}"
|
||||
echo -e "${bold}${red} MAC80211${reset}: ${yellow}${mac80211_version}${reset}"
|
||||
echo -e "${bold}${red} ATH11K FW${reset}: ${yellow}${ath11k_fw}${reset}"
|
||||
|
||||
# Display GRO Fragmentation status using BusyBox
|
||||
echo -ne "${bold}${red} INTERFACE${reset}: ${white}"
|
||||
n=0
|
||||
for iface in /sys/class/net/br-lan/device /sys/class/net/*/device; do
|
||||
iface=${iface%/*}
|
||||
iface=${iface##*/}
|
||||
ethtool -k "$iface" | awk -v n=$n -v i="$iface" -v rst="${reset}" -v red="${red}" -v green="${green}" '
|
||||
BEGIN { settings=""; if(n>0) spacing=" " }
|
||||
/tx-checksumming|rx-gro-list/ {
|
||||
color=green
|
||||
if($2=="off") color=red
|
||||
settings = settings $1 " " sprintf("%s%-3s%s", color,$2,rst) " ";
|
||||
}
|
||||
END { printf "%s%-11s%s\n", spacing, i, settings; }'
|
||||
n=$((n + 1))
|
||||
done
|
||||
|
||||
echo -e "${reset}"
|
||||
echo -ne "${bold}${red} NSS PKGS${reset}: ${white}"
|
||||
|
||||
apk list -I | awk -v count=0 '
|
||||
/kmod-qca|^nss/ {
|
||||
if(count>0) tab=" "
|
||||
print tab $1
|
||||
count++
|
||||
}'
|
||||
|
||||
echo -ne "${reset}"
|
@ -1,8 +0,0 @@
|
||||
config general opt
|
||||
option auto_scale 'off'
|
||||
# option memory_profile 'off'
|
||||
option memory_profile 'auto'
|
||||
# option memory_profile '1gb'
|
||||
# option memory_profile '512mb'
|
||||
# option memory_profile '256mb'
|
||||
option scaling_governor 'schedutil'
|
@ -1,182 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# shellcheck disable=3043,3010
|
||||
# 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.
|
||||
#
|
||||
|
||||
START=95
|
||||
NAME=qca-nss-pbuf
|
||||
|
||||
reload_wifi() {
|
||||
if [ -r /sys/module/ath11k/parameters/nss_offload ]; then
|
||||
nss_offload=$(cat /sys/module/ath11k/parameters/nss_offload 2> /dev/null)
|
||||
[ "$nss_offload" -eq 1 ] && wifi up
|
||||
fi
|
||||
}
|
||||
|
||||
get_num_cpus() {
|
||||
local num_cpus
|
||||
num_cpus=$(awk -F': ' '/^processor/ {count++} END {print count}' /proc/cpuinfo)
|
||||
echo "${num_cpus:-1}"
|
||||
}
|
||||
|
||||
apply_sysctl() {
|
||||
[ "$(sysctl -n -e dev.nss.general.redirect)" -eq 0 ] && /etc/init.d/qca-nss-ecm start
|
||||
|
||||
# Running this script multiple times is useless, as extra_pbuf_core0
|
||||
# can't be changed if it is allocated, assume it's already been run.
|
||||
if [ "$(sysctl -n -e dev.nss.n2hcfg.extra_pbuf_core0)" -eq 0 ]; then
|
||||
logger -t $NAME "$board - setting dev.nss.n2hcfg.extra_pbuf_core0=$extra_pbuf_core0"
|
||||
sysctl -w dev.nss.n2hcfg.extra_pbuf_core0="$extra_pbuf_core0" > /dev/null 2>&1
|
||||
else
|
||||
logger -t $NAME "Sysctl key 'extra_pbuf_core0' already set to '""$extra_pbuf_core0""'. Skipping applying wifi nss configs"
|
||||
fi
|
||||
|
||||
sysctl -w dev.nss.n2hcfg.n2h_high_water_core0="$n2h_high_water_core0" > /dev/null 2>&1
|
||||
|
||||
logger -t $NAME "$board - setting dev.nss.n2hcfg.n2h_wifi_pool_buf=$n2h_wifi_pool_buf"
|
||||
sysctl -w dev.nss.n2hcfg.n2h_wifi_pool_buf="$n2h_wifi_pool_buf" > /dev/null 2>&1
|
||||
|
||||
logger -t $NAME "$board - setting dev.nss.n2hcfg.n2h_high_water_core0=$n2h_high_water_core0"
|
||||
sysctl -w dev.nss.n2hcfg.n2h_high_water_core0="$n2h_high_water_core0" > /dev/null 2>&1
|
||||
|
||||
}
|
||||
|
||||
apply_nss_config() {
|
||||
local auto_scale n2h_queue_limit_core0 n2h_queue_limit_core1 num_cpus
|
||||
local hash_bitmap
|
||||
|
||||
if [ ! -r /sys/module/ath11k/parameters/nss_offload ]; then
|
||||
logger -t $NAME "Module parameter '/sys/module/ath11k/parameters/nss_offload' does NOT exist. Skipping applying wifi nss configs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
enable_nss_offload=$(cat /sys/module/ath11k/parameters/nss_offload)
|
||||
|
||||
if [ "$enable_nss_offload" -ne "1" ]; then
|
||||
logger -t $NAME -s user.warn "Module parameter 'nss_offload=0'. Skipping applying wifi nss configs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ ! -d "/proc/sys/dev/nss/rps" ] && {
|
||||
logger -s -t $NAME -p user.error "NSS driver not loaded or disabled! Exiting... "
|
||||
exit 1
|
||||
}
|
||||
|
||||
config_load pbuf
|
||||
config_get_bool auto_scale opt auto_scale 0
|
||||
config_get n2h_queue_limit_core0 opt n2h_queue_limit_core0 256
|
||||
config_get n2h_queue_limit_core1 opt n2h_queue_limit_core1 256
|
||||
|
||||
sysctl -w dev.nss.clock.auto_scale="$auto_scale" > /dev/null 2>&1
|
||||
|
||||
sysctl -w dev.nss.n2hcfg.n2h_queue_limit_core0="$n2h_queue_limit_core0" > /dev/null 2>&1
|
||||
sysctl -w dev.nss.n2hcfg.n2h_queue_limit_core1="$n2h_queue_limit_core1" > /dev/null 2>&1
|
||||
|
||||
local memory_profile memtotal board
|
||||
board=$(board_name)
|
||||
|
||||
if memory_profile=$(uci_get pbuf.opt.memory_profile); then
|
||||
case "$memory_profile" in
|
||||
1024 | 1g* | 512 | 512m* | 256 | 256m*)
|
||||
logger -t $NAME "Using custom memory profile - $board"
|
||||
;;
|
||||
off* | false* | disable* | 0)
|
||||
logger -s -t $NAME -p user.warn "NSS pbuf option 'memory_profile=off'. Not running. Enable if you have issues connecting more than 65 clients"
|
||||
exit 0
|
||||
;;
|
||||
auto)
|
||||
memtotal=$(awk '/MemTotal/{print $2}' /proc/meminfo)
|
||||
[ "$memtotal" -gt 512000 ] && memory_profile=1024
|
||||
[ "$memtotal" -le 512000 ] && memory_profile=512
|
||||
[ "$memtotal" -le 256000 ] && memory_profile=256
|
||||
logger -t $NAME "Setting n2hcfg values for board: $board"
|
||||
;;
|
||||
*)
|
||||
logger -s -t $NAME -p user.error "Unknown profile $memory_profile. Choose auto, 1gb, 512mb, or 256mb"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$memory_profile" in
|
||||
# 1GB+ profile
|
||||
1024 | 1g*)
|
||||
extra_pbuf_core0=10000000 n2h_high_water_core0=72512 n2h_wifi_pool_buf=36864 apply_sysctl
|
||||
;;
|
||||
# 512MB profile
|
||||
512 | 512m*)
|
||||
extra_pbuf_core0=3100000 n2h_high_water_core0=30624 n2h_wifi_pool_buf=8192 apply_sysctl
|
||||
;;
|
||||
# 256MB profile
|
||||
256 | 256m*)
|
||||
extra_pbuf_core0=3100000 n2h_high_water_core0=30258 n2h_wifi_pool_buf=4096 apply_sysctl
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
set_stats_disable() {
|
||||
|
||||
local stats_disable
|
||||
config_load pbuf
|
||||
config_get stats_disable opt stats_disable 1
|
||||
|
||||
find /sys/kernel/debug/ath11k -name stats_disable | while read -r stats_file; do
|
||||
stats_msg_prefix="Disabling"
|
||||
[ "$stats_disable" -eq 0 ] && stats_msg_prefix="Enabling"
|
||||
logger -t $NAME -p user.notice "$stats_msg_prefix ath11k stats"
|
||||
echo "$stats_disable" > "$stats_file"
|
||||
done
|
||||
}
|
||||
|
||||
set_scaling_governor() {
|
||||
|
||||
local scaling_governor num_cpus
|
||||
config_load pbuf
|
||||
config_get scaling_governor opt scaling_governor
|
||||
|
||||
scaling_available_governors=/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
|
||||
|
||||
if [ -r "$scaling_available_governors" ]; then
|
||||
scaling_available_governors=$(cat $scaling_available_governors)
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -n "$scaling_available_governors" ] && [ -n "$scaling_governor" ]; then
|
||||
if [[ "$scaling_available_governors" =~ $scaling_governor ]]; then
|
||||
logger -t $NAME -p user.notice "Setting CPU scaling governor to '$scaling_governor'"
|
||||
num_cpus=$(get_num_cpus)
|
||||
for num in $(seq 0 $((num_cpus - 1))); do
|
||||
echo "$scaling_governor" > "/sys/devices/system/cpu/cpu${num}/cpufreq/scaling_governor"
|
||||
done
|
||||
else
|
||||
logger -t $NAME -p user.error "'$scaling_governor' not available in CPU governors [ $scaling_available_governors ]"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
|
||||
set_scaling_governor
|
||||
set_stats_disable
|
||||
apply_nss_config
|
||||
|
||||
num_cpus=$(get_num_cpus)
|
||||
hash_bitmap="$(((1 << num_cpus) - 1))"
|
||||
sysctl -w dev.nss.rps.hash_bitmap=$hash_bitmap > /dev/null 2>&1
|
||||
reload_wifi
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -9920,6 +9920,21 @@ static int ath10k_mac_init_rd(struct ath
|
||||
@@ -9919,6 +9919,21 @@ static int ath10k_mac_init_rd(struct ath
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
int ath10k_mac_register(struct ath10k *ar)
|
||||
{
|
||||
static const u32 cipher_suites[] = {
|
||||
@@ -10282,6 +10297,12 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10281,6 +10296,12 @@ int ath10k_mac_register(struct ath10k *a
|
||||
|
||||
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
|
||||
|
||||
|
@ -40,7 +40,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
|
||||
if (ret)
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -10298,7 +10298,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10297,7 +10297,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
|
||||
|
||||
#ifdef CPTCFG_MAC80211_LEDS
|
||||
|
@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -10091,7 +10091,6 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10090,7 +10090,6 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
|
||||
ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
|
||||
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
|
||||
|
@ -0,0 +1,231 @@
|
||||
From: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
|
||||
To: <ath11k@lists.infradead.org>
|
||||
Cc: <linux-wireless@vger.kernel.org>,
|
||||
Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
|
||||
Subject: [PATCH] ath11k: Add support for dynamic vlan
|
||||
Date: Mon, 10 Jan 2022 09:11:30 +0530 [thread overview]
|
||||
Message-ID: <1641786090-10232-1-git-send-email-quic_seevalam@quicinc.com> (raw)
|
||||
|
||||
Advertise AP-VLAN interface type for vlan support in driver.
|
||||
Metadata information in dp_tx is added to notify firmware
|
||||
that multicast/broadcast packets are encrypted in software.
|
||||
|
||||
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01073-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/core.c | 6 +++
|
||||
drivers/net/wireless/ath/ath11k/dp_tx.c | 74 ++++++++++++++++++++++++++++++++-
|
||||
drivers/net/wireless/ath/ath11k/dp_tx.h | 14 +++++++
|
||||
drivers/net/wireless/ath/ath11k/hw.h | 1 +
|
||||
drivers/net/wireless/ath/ath11k/mac.c | 5 +++
|
||||
5 files changed, 98 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -94,6 +94,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.num_vdevs = 16 + 1,
|
||||
.num_peers = 512,
|
||||
.supports_suspend = false,
|
||||
+ .supports_ap_vlan = true,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
|
||||
.supports_regdb = false,
|
||||
.fix_l1ss = true,
|
||||
@@ -177,6 +178,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.num_vdevs = 16 + 1,
|
||||
.num_peers = 512,
|
||||
.supports_suspend = false,
|
||||
+ .supports_ap_vlan = true,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
|
||||
.supports_regdb = false,
|
||||
.fix_l1ss = true,
|
||||
@@ -263,6 +265,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.num_vdevs = 2 + 1,
|
||||
.num_peers = 512,
|
||||
.supports_suspend = true,
|
||||
+ .supports_ap_vlan = false,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
|
||||
.supports_regdb = false,
|
||||
.fix_l1ss = true,
|
||||
@@ -349,6 +352,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.num_vdevs = 8,
|
||||
.num_peers = 128,
|
||||
.supports_suspend = false,
|
||||
+ .supports_ap_vlan = true,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
|
||||
.supports_regdb = false,
|
||||
.fix_l1ss = true,
|
||||
@@ -435,6 +439,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.num_vdevs = 2 + 1,
|
||||
.num_peers = 512,
|
||||
.supports_suspend = true,
|
||||
+ .supports_ap_vlan = false,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855),
|
||||
.supports_regdb = true,
|
||||
.fix_l1ss = false,
|
||||
@@ -522,6 +527,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.num_vdevs = 2 + 1,
|
||||
.num_peers = 512,
|
||||
.supports_suspend = true,
|
||||
+ .supports_ap_vlan = false,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855),
|
||||
.supports_regdb = true,
|
||||
.fix_l1ss = false,
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
@@ -79,6 +79,44 @@ enum hal_encrypt_type ath11k_dp_tx_get_e
|
||||
}
|
||||
}
|
||||
|
||||
+#define HTT_META_DATA_ALIGNMENT 0x8
|
||||
+
|
||||
+static int ath11k_dp_metadata_align_skb(struct sk_buff *skb, u8 align_len)
|
||||
+{
|
||||
+ if (unlikely(skb_cow_head(skb, align_len)))
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ skb_push(skb, align_len);
|
||||
+ memset(skb->data, 0, align_len);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int ath11k_dp_prepare_htt_metadata(struct sk_buff *skb,
|
||||
+ u8 *htt_metadata_size)
|
||||
+{
|
||||
+ u8 htt_desc_size;
|
||||
+ /* Size rounded of multiple of 8 bytes */
|
||||
+ u8 htt_desc_size_aligned;
|
||||
+ struct htt_tx_msdu_desc_ext *desc_ext;
|
||||
+ int ret;
|
||||
+
|
||||
+ htt_desc_size = sizeof(*desc_ext);
|
||||
+ htt_desc_size_aligned = ALIGN(htt_desc_size, HTT_META_DATA_ALIGNMENT);
|
||||
+
|
||||
+ ret = ath11k_dp_metadata_align_skb(skb, htt_desc_size_aligned);
|
||||
+ if (unlikely(ret))
|
||||
+ return ret;
|
||||
+
|
||||
+ desc_ext = (struct htt_tx_msdu_desc_ext *)skb->data;
|
||||
+ desc_ext->info0 =
|
||||
+ __cpu_to_le32(FIELD_PREP(HTT_TX_MSDU_DESC_INFO0_VALID_ENCRYPT_TYPE, 1) |
|
||||
+ FIELD_PREP(HTT_TX_MSDU_DESC_INFO0_ENCRYPT_TYPE, 0) |
|
||||
+ FIELD_PREP(HTT_TX_MSDU_DESC_INFO0_HOST_TX_DESC_POOL, 1));
|
||||
+ *htt_metadata_size = htt_desc_size_aligned;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
|
||||
struct ath11k_sta *arsta, struct sk_buff *skb)
|
||||
{
|
||||
@@ -97,6 +135,7 @@ int ath11k_dp_tx(struct ath11k *ar, stru
|
||||
u32 ring_selector = 0;
|
||||
u8 ring_map = 0;
|
||||
bool tcl_ring_retry;
|
||||
+ u8 align_pad, htt_meta_size = 0;
|
||||
|
||||
if (unlikely(test_bit(ATH11K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags)))
|
||||
return -ESHUTDOWN;
|
||||
@@ -208,15 +247,42 @@ tcl_ring_sel:
|
||||
goto fail_remove_idr;
|
||||
}
|
||||
|
||||
+ /* Add metadata for sw encrypted vlan group traffic */
|
||||
+ if (!test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags) &&
|
||||
+ !(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
|
||||
+ * 8-byte aligned address. So we add alignment pad to start of
|
||||
+ * buffer. HTT Metadata should be ensured to be multiple of 8-bytes
|
||||
+ * to get 8-byte aligned start address along with align_pad added
|
||||
+ */
|
||||
+ align_pad = ((unsigned long)skb->data) & (HTT_META_DATA_ALIGNMENT - 1);
|
||||
+ ret = ath11k_dp_metadata_align_skb(skb, align_pad);
|
||||
+ if (unlikely(ret))
|
||||
+ goto fail_remove_idr;
|
||||
+
|
||||
+ ti.pkt_offset += align_pad;
|
||||
+ ret = ath11k_dp_prepare_htt_metadata(skb, &htt_meta_size);
|
||||
+ if (unlikely(ret))
|
||||
+ goto fail_pull_skb;
|
||||
+
|
||||
+ ti.pkt_offset += htt_meta_size;
|
||||
+ ti.meta_data_flags |= HTT_TCL_META_DATA_VALID_HTT;
|
||||
+ ti.flags0 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_TO_FW, 1);
|
||||
+ ti.encap_type = HAL_TCL_ENCAP_TYPE_RAW;
|
||||
+ ti.encrypt_type = HAL_ENCRYPT_TYPE_OPEN;
|
||||
+ }
|
||||
+
|
||||
ti.paddr = dma_map_single(ab->dev, skb->data, skb->len, DMA_TO_DEVICE);
|
||||
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;
|
||||
+ goto fail_pull_skb;
|
||||
}
|
||||
|
||||
- ti.data_len = skb->len;
|
||||
+ ti.data_len = skb->len - ti.pkt_offset;
|
||||
skb_cb->paddr = ti.paddr;
|
||||
skb_cb->vif = arvif->vif;
|
||||
skb_cb->ar = ar;
|
||||
@@ -271,6 +337,10 @@ tcl_ring_sel:
|
||||
fail_unmap_dma:
|
||||
dma_unmap_single(ab->dev, ti.paddr, ti.data_len, DMA_TO_DEVICE);
|
||||
|
||||
+fail_pull_skb:
|
||||
+ if (ti.pkt_offset)
|
||||
+ skb_pull(skb, ti.pkt_offset);
|
||||
+
|
||||
fail_remove_idr:
|
||||
spin_lock_bh(&tx_ring->tx_idr_lock);
|
||||
idr_remove(&tx_ring->txbuf_idr,
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_tx.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.h
|
||||
@@ -17,6 +17,20 @@ struct ath11k_dp_htt_wbm_tx_status {
|
||||
u16 peer_id;
|
||||
};
|
||||
|
||||
+#define HTT_TX_MSDU_DESC_INFO0_VALID_ENCRYPT_TYPE BIT(8)
|
||||
+#define HTT_TX_MSDU_DESC_INFO0_ENCRYPT_TYPE GENMASK(16, 15)
|
||||
+#define HTT_TX_MSDU_DESC_INFO0_HOST_TX_DESC_POOL BIT(31)
|
||||
+
|
||||
+struct htt_tx_msdu_desc_ext {
|
||||
+ __le32 info0;
|
||||
+ __le32 info1;
|
||||
+ __le32 info2;
|
||||
+ __le32 info3;
|
||||
+ __le32 info4;
|
||||
+ __le32 info5;
|
||||
+ __le32 info6;
|
||||
+} __packed;
|
||||
+
|
||||
void ath11k_dp_tx_update_txcompl(struct ath11k *ar, struct hal_tx_status *ts);
|
||||
int ath11k_dp_tx_htt_h2t_ver_req_msg(struct ath11k_base *ab);
|
||||
int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
||||
@@ -194,6 +194,7 @@ struct ath11k_hw_params {
|
||||
u32 num_vdevs;
|
||||
u32 num_peers;
|
||||
bool supports_suspend;
|
||||
+ bool supports_ap_vlan;
|
||||
u32 hal_desc_sz;
|
||||
bool supports_regdb;
|
||||
bool fix_l1ss;
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -10265,6 +10265,11 @@ static int __ath11k_mac_register(struct
|
||||
*/
|
||||
ar->hw->wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MONITOR);
|
||||
|
||||
+ if (ab->hw_params.supports_ap_vlan) {
|
||||
+ ar->hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP_VLAN);
|
||||
+ ar->hw->wiphy->software_iftypes |= BIT(NL80211_IFTYPE_AP_VLAN);
|
||||
+ }
|
||||
+
|
||||
/* Apply the regd received during initialization */
|
||||
ret = ath11k_regd_update(ar);
|
||||
if (ret) {
|
@ -25,7 +25,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -809,6 +809,67 @@ static struct ath11k_hw_params ath11k_hw
|
||||
@@ -815,6 +815,67 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.support_fw_mac_sequence = true,
|
||||
.support_dual_stations = true,
|
||||
},
|
||||
|
@ -10,7 +10,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
---
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -822,6 +822,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
@@ -828,6 +828,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.bdf_addr = 0x4D200000,
|
||||
.hw_ops = &ipq5018_ops,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
|
||||
@ -104,7 +104,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
.tcl2wbm_rbm_map = ath11k_hw_tcl2wbm_rbm_map_ipq8074,
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
||||
@@ -425,6 +425,7 @@ extern const struct ath11k_hw_regs qcn90
|
||||
@@ -426,6 +426,7 @@ extern const struct ath11k_hw_regs qcn90
|
||||
extern const struct ath11k_hw_regs wcn6855_regs;
|
||||
extern const struct ath11k_hw_regs wcn6750_regs;
|
||||
extern const struct ath11k_hw_regs ipq5018_regs;
|
||||
|
@ -8,7 +8,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
---
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -821,6 +821,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
@@ -827,6 +827,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.max_radios = MAX_RADIOS_5018,
|
||||
.bdf_addr = 0x4D200000,
|
||||
.hw_ops = &ipq5018_ops,
|
||||
@ -64,7 +64,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
/* CE0: host->target HTC control and raw streams */
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
||||
@@ -289,6 +289,7 @@ extern const struct ath11k_hw_ring_mask
|
||||
@@ -290,6 +290,7 @@ extern const struct ath11k_hw_ring_mask
|
||||
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_wcn6750;
|
||||
|
@ -24,7 +24,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
|
||||
---
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -719,6 +719,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
@@ -725,6 +725,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.smp2p_wow_exit = false,
|
||||
.support_fw_mac_sequence = false,
|
||||
.support_dual_stations = false,
|
||||
@ -34,7 +34,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
|
||||
.name = "qca2066 hw2.1",
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp.c
|
||||
@@ -348,12 +348,66 @@ void ath11k_dp_stop_shadow_timers(struct
|
||||
@@ -361,12 +361,66 @@ void ath11k_dp_stop_shadow_timers(struct
|
||||
ath11k_dp_shadow_stop_timer(ab, &ab->dp.reo_cmd_timer);
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
|
||||
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);
|
||||
@@ -375,6 +429,8 @@ static int ath11k_dp_srng_common_setup(s
|
||||
@@ -388,6 +442,8 @@ static int ath11k_dp_srng_common_setup(s
|
||||
int i, ret;
|
||||
u8 tcl_num, wbm_num;
|
||||
|
||||
@ -112,7 +112,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
|
||||
DP_WBM_RELEASE_RING_SIZE);
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp.h
|
||||
@@ -46,6 +46,8 @@ struct dp_rx_tid {
|
||||
@@ -44,6 +44,8 @@ struct dp_rx_tid {
|
||||
#define DP_MON_PURGE_TIMEOUT_MS 100
|
||||
#define DP_MON_SERVICE_BUDGET 128
|
||||
|
||||
@ -121,7 +121,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
|
||||
struct dp_reo_cache_flush_elem {
|
||||
struct list_head list;
|
||||
struct dp_rx_tid data;
|
||||
@@ -288,6 +290,10 @@ struct ath11k_dp {
|
||||
@@ -286,6 +288,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];
|
||||
@ -132,7 +132,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
|
||||
};
|
||||
|
||||
/* HTT definitions */
|
||||
@@ -1691,5 +1697,6 @@ void ath11k_dp_shadow_init_timer(struct
|
||||
@@ -1689,5 +1695,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);
|
||||
@ -141,7 +141,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
|
||||
#endif
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
|
||||
@@ -787,6 +787,10 @@ int ath11k_dp_tx_send_reo_cmd(struct ath
|
||||
@@ -857,6 +857,10 @@ int ath11k_dp_tx_send_reo_cmd(struct ath
|
||||
if (cmd_num == 0)
|
||||
return -EINVAL;
|
||||
|
||||
@ -154,7 +154,7 @@ Signed-off-by: Sriram R <srirrama@codeaurora.org>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
||||
@@ -232,6 +232,7 @@ struct ath11k_hw_params {
|
||||
@@ -233,6 +233,7 @@ struct ath11k_hw_params {
|
||||
bool smp2p_wow_exit;
|
||||
bool support_fw_mac_sequence;
|
||||
bool support_dual_stations;
|
||||
|
@ -12,7 +12,7 @@
|
||||
} else if (sta->deflink.ht_cap.ht_supported &&
|
||||
!ath11k_peer_assoc_h_ht_masked(ht_mcs_mask)) {
|
||||
if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_40)
|
||||
@@ -5491,6 +5491,9 @@ static void ath11k_mac_setup_ht_vht_cap(
|
||||
@@ -5490,6 +5490,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);
|
||||
|
@ -532,7 +532,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5995,7 +6010,7 @@ static int ath12k_mac_start(struct ath12
|
||||
@@ -5994,7 +6009,7 @@ static int ath12k_mac_start(struct ath12
|
||||
|
||||
/* TODO: Do we need to enable ANI? */
|
||||
|
||||
@ -541,7 +541,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
|
||||
ar->num_started_vdevs = 0;
|
||||
ar->num_created_vdevs = 0;
|
||||
@@ -6175,6 +6190,9 @@ static void ath12k_mac_stop(struct ath12
|
||||
@@ -6174,6 +6189,9 @@ static void ath12k_mac_stop(struct ath12
|
||||
cancel_delayed_work_sync(&ar->scan.timeout);
|
||||
cancel_work_sync(&ar->regd_update_work);
|
||||
cancel_work_sync(&ar->ab->rfkill_work);
|
||||
@ -551,7 +551,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
|
||||
@@ -6421,6 +6439,117 @@ static void ath12k_mac_op_update_vif_off
|
||||
@@ -6420,6 +6438,117 @@ static void ath12k_mac_op_update_vif_off
|
||||
ath12k_mac_update_vif_offload(arvif);
|
||||
}
|
||||
|
||||
@ -669,7 +669,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ath12k_hw *ah = ar->ah;
|
||||
@@ -6535,6 +6664,7 @@ static int ath12k_mac_vdev_create(struct
|
||||
@@ -6534,6 +6663,7 @@ static int ath12k_mac_vdev_create(struct
|
||||
arvif->vdev_id, ret);
|
||||
goto err_peer_del;
|
||||
}
|
||||
@ -677,7 +677,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
break;
|
||||
case WMI_VDEV_TYPE_STA:
|
||||
param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
|
||||
@@ -6573,6 +6703,13 @@ static int ath12k_mac_vdev_create(struct
|
||||
@@ -6572,6 +6702,13 @@ static int ath12k_mac_vdev_create(struct
|
||||
arvif->vdev_id, ret);
|
||||
goto err_peer_del;
|
||||
}
|
||||
@ -691,7 +691,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -6913,6 +7050,11 @@ static void ath12k_mac_op_remove_interfa
|
||||
@@ -6912,6 +7049,11 @@ static void ath12k_mac_op_remove_interfa
|
||||
ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
|
||||
arvif->vdev_id);
|
||||
|
||||
@ -703,7 +703,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
|
||||
ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
|
||||
if (ret)
|
||||
@@ -7753,6 +7895,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
|
||||
@@ -7752,6 +7894,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
|
||||
ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
|
||||
ath12k_mac_monitor_stop(ar);
|
||||
|
||||
@ -718,7 +718,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
mutex_unlock(&ar->conf_mutex);
|
||||
}
|
||||
|
||||
@@ -8291,6 +8441,14 @@ ath12k_mac_op_reconfig_complete(struct i
|
||||
@@ -8290,6 +8440,14 @@ ath12k_mac_op_reconfig_complete(struct i
|
||||
ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
|
||||
ar->pdev->pdev_id);
|
||||
|
||||
@ -733,7 +733,7 @@ Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
if (ab->is_reset) {
|
||||
recovery_count = atomic_inc_return(&ab->recovery_count);
|
||||
|
||||
@@ -9340,6 +9498,9 @@ static void ath12k_mac_setup(struct ath1
|
||||
@@ -9339,6 +9497,9 @@ static void ath12k_mac_setup(struct ath1
|
||||
|
||||
INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work);
|
||||
skb_queue_head_init(&ar->wmi_mgmt_tx_queue);
|
||||
|
@ -1,67 +0,0 @@
|
||||
From 24f587572acf7509127dbdfcbf1b681ef84eeba0 Mon Sep 17 00:00:00 2001
|
||||
From: Aaradhana Sahu <quic_aarasahu@quicinc.com>
|
||||
Date: Thu, 16 Jan 2025 08:58:35 +0530
|
||||
Subject: [PATCH] wifi: ath12k: Fetch regdb.bin file from board-2.bin
|
||||
|
||||
Currently, ath12k_core_fetch_regdb() finds regdb.bin file through
|
||||
board id's but in board-2.bin file regdb.bin file is present with
|
||||
default board id because of which regdb.bin is not fetched.
|
||||
|
||||
Add support to fetch regdb.bin file from board-2.bin through
|
||||
default board id.
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
|
||||
Reviewed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
Link: https://patch.msgid.link/20250116032835.118397-1-quic_aarasahu@quicinc.com
|
||||
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/core.c | 12 +++++++-----
|
||||
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/core.c
|
||||
@@ -161,7 +161,7 @@ EXPORT_SYMBOL(ath12k_core_resume);
|
||||
|
||||
static int __ath12k_core_create_board_name(struct ath12k_base *ab, char *name,
|
||||
size_t name_len, bool with_variant,
|
||||
- bool bus_type_mode)
|
||||
+ bool bus_type_mode, bool with_default)
|
||||
{
|
||||
/* strlen(',variant=') + strlen(ab->qmi.target.bdf_ext) */
|
||||
char variant[9 + ATH12K_QMI_BDF_EXT_STR_LENGTH] = { 0 };
|
||||
@@ -192,7 +192,9 @@ static int __ath12k_core_create_board_na
|
||||
"bus=%s,qmi-chip-id=%d,qmi-board-id=%d%s",
|
||||
ath12k_bus_str(ab->hif.bus),
|
||||
ab->qmi.target.chip_id,
|
||||
- ab->qmi.target.board_id, variant);
|
||||
+ with_default ?
|
||||
+ ATH12K_BOARD_ID_DEFAULT : ab->qmi.target.board_id,
|
||||
+ variant);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -204,19 +206,19 @@ static int __ath12k_core_create_board_na
|
||||
static int ath12k_core_create_board_name(struct ath12k_base *ab, char *name,
|
||||
size_t name_len)
|
||||
{
|
||||
- return __ath12k_core_create_board_name(ab, name, name_len, true, false);
|
||||
+ return __ath12k_core_create_board_name(ab, name, name_len, true, false, false);
|
||||
}
|
||||
|
||||
static int ath12k_core_create_fallback_board_name(struct ath12k_base *ab, char *name,
|
||||
size_t name_len)
|
||||
{
|
||||
- return __ath12k_core_create_board_name(ab, name, name_len, false, false);
|
||||
+ return __ath12k_core_create_board_name(ab, name, name_len, false, false, true);
|
||||
}
|
||||
|
||||
static int ath12k_core_create_bus_type_board_name(struct ath12k_base *ab, char *name,
|
||||
size_t name_len)
|
||||
{
|
||||
- return __ath12k_core_create_board_name(ab, name, name_len, false, true);
|
||||
+ return __ath12k_core_create_board_name(ab, name, name_len, false, true, true);
|
||||
}
|
||||
|
||||
const struct firmware *ath12k_core_firmware_request(struct ath12k_base *ab,
|
@ -1,153 +0,0 @@
|
||||
From patchwork Mon Mar 10 13:28:18 2025
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Mantas <mantas@8devices.com>
|
||||
X-Patchwork-Id: 14010032
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com
|
||||
[209.85.167.41])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ADD522A4DA
|
||||
for <linux-wireless@vger.kernel.org>; Mon, 10 Mar 2025 13:28:47 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=209.85.167.41
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1741613330; cv=none;
|
||||
b=Vx8zckt7S92zrauuzzoNjX/1eXhlbq+4R3uNXCWPCBFXXHBuAHrmXrDOQILh1g+IfyWOgpyXyibTTkLg6IWREXcA/OjV+V9ehNaQaHJAt4D14uxuNW6uIDA56myF+bhdmiZnfGZfK3puVBjeCAMbZwGhc81dTR3RaEhKYP93Wcg=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1741613330; c=relaxed/simple;
|
||||
bh=yRMCaDQnvsF6vQ/w9rLRB/etZre1sSzpWUDTNGX0zAk=;
|
||||
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;
|
||||
b=rFopB9f+nOXbmGbGXoo4SeBAV82xQ6nydiMDCiYAw7sELURejS0lK9xQZolnRGeyNtHnQgix39lrcilr6cdvGMhaziXzS6RYlY2WyoHTMxHwYGUIa9McnJ1AkCczdVv6SgeNUlVVEgAZBqH0Q2pmd5b91h/PMc/aPdQm9SQY8IU=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=quarantine dis=none) header.from=8devices.com;
|
||||
spf=pass smtp.mailfrom=8devices.com;
|
||||
dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com
|
||||
header.b=LitRbtOU; arc=none smtp.client-ip=209.85.167.41
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=quarantine dis=none) header.from=8devices.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=8devices.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com
|
||||
header.b="LitRbtOU"
|
||||
Received: by mail-lf1-f41.google.com with SMTP id
|
||||
2adb3069b0e04-5499c5d9691so1866539e87.2
|
||||
for <linux-wireless@vger.kernel.org>;
|
||||
Mon, 10 Mar 2025 06:28:47 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=8devices.com; s=8devices; t=1741613326; x=1742218126;
|
||||
darn=vger.kernel.org;
|
||||
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
|
||||
:date:from:from:to:cc:subject:date:message-id:reply-to;
|
||||
bh=6+w3029kfHch5SeD/z0zur2K64cd98za9hhmN/ji0MY=;
|
||||
b=LitRbtOUxDhUPycKFo/pzuJu9Y11QmpYSvOmkgM9TcNEOsBvLk8z0EJ7+xy24ijRGJ
|
||||
Xz16V9Z1kJGkXBK90klI6s3RjVBQf+dxf37t2kdQWdrgOE2VhXjnnV5zP7odCkMmOViw
|
||||
2UmKSvagsxc6KojE2OYyd+vR3hmL+4fCtegorXMaRrf0Brje8XJmViAUgbc+IAtfL0Ao
|
||||
pnig300fAb4WbnmIJIRiOUKoTESjbJRkUehGJkhe1ztiPE1F86AVMXw5IrDBR/WtMin1
|
||||
9nYYDqfSGvI7fOvfStfZ9hS0ShIhBNd5naccyQ7c0xSTvXJ51vUvNvdZuufm9OKsbQ99
|
||||
nh4g==
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20230601; t=1741613326; x=1742218126;
|
||||
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
|
||||
:date:from:x-gm-message-state:from:to:cc:subject:date:message-id
|
||||
:reply-to;
|
||||
bh=6+w3029kfHch5SeD/z0zur2K64cd98za9hhmN/ji0MY=;
|
||||
b=Gx+AX3aIV66kzjGLGOToc2CuQrnfaWn43yZW2rgRpKJv03162undTbo+SdaI8s+8mY
|
||||
aKrYsNOOqI4h6pHCZsVkBzqVh5ZOs+xJbJaHEETGzyBYA2sy0bdDwDUr0rIzJUD8ZYiw
|
||||
736zfMRE2rxfOLoVIcfBLXMUcR2d63n/4wxgr1s5HVV3o8uEZ5gxNDnz5p/QabiWbT3m
|
||||
AMSVVaOBUTRnd9GcZhzYfKboT7SNrTJz0emqSWPKCWfm8dYIzH3TuIGULfRu5UA1/Y2H
|
||||
Q6ZbLmcYu5+VDKCtQl4nSmun3WUNAyPoeg5PCB1YcuCpqKcjU8l5Kkn+JxNjYAG432us
|
||||
Z5xQ==
|
||||
X-Forwarded-Encrypted: i=1;
|
||||
AJvYcCVigvWgctGNxtYGpBtNhTPBpQPHa7l14ZVktj/Oe1W8p1xwSIjIViAk2X3sDC23bbrmI41TVZbgJZDGCMFJ6g==@vger.kernel.org
|
||||
X-Gm-Message-State: AOJu0YxJFjAixTwr8dSwTYmdvbVzm/jbyVk+gQV6pF/9Vep5xeVdJMWa
|
||||
TE+4MHJDPdO8dA16Yn/y5c8pLBEYKqRlo8uDHNKV6e5ldbv18Xv6bR163j+rVCQ=
|
||||
X-Gm-Gg: ASbGncsUwV1fquQPNOfmTge/yCSzRhyC7+A8STTBe3n+C2XDK1UV8IswQL5UEXlb268
|
||||
mumVPzu1Ex8+Nh+quKWT+CIR3WR0NRXm1oiG0N+Cu2Mm4cm4mipqrV9Yxd6x5OMsG32XKd6r0iQ
|
||||
gr7joJETyo6k1TGc6i0LyoIabLOCc7Nkeu7BD+URUnBvoeQyXBdJpX0bbdvANKW5DrUeX1GkUA7
|
||||
0o4dZYtRola31Z1W9xZMdSefhmI4zZE4uy/RyR/FkQq2Zqk9FGct8DOKoHpOPa0DHVMy0lQAiNI
|
||||
KNg6OYtuJY+/6TpDoZzNpooiLi29WL6hqlpkmlZeluuCBG6HlSbZTQ==
|
||||
X-Google-Smtp-Source:
|
||||
AGHT+IGIixTut4yqDWp69RPz6EjMMq4lD94Ez1yhsRnow6NgvTk6WmKPLFavYgOJC+xGczTQmaocLw==
|
||||
X-Received: by 2002:a05:6512:1112:b0:549:5850:f275 with SMTP id
|
||||
2adb3069b0e04-54990ec8e60mr4354451e87.50.1741613326121;
|
||||
Mon, 10 Mar 2025 06:28:46 -0700 (PDT)
|
||||
Received: from [127.0.1.1] ([78.62.132.154])
|
||||
by smtp.gmail.com with ESMTPSA id
|
||||
2adb3069b0e04-5498b1bcaecsm1460408e87.200.2025.03.10.06.28.45
|
||||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||
Mon, 10 Mar 2025 06:28:45 -0700 (PDT)
|
||||
From: Mantas Pucka <mantas@8devices.com>
|
||||
Date: Mon, 10 Mar 2025 15:28:18 +0200
|
||||
Subject: [PATCH ath-next] wifi: ath12k: limit WMI_SCAN_CHAN_LIST_CMDID
|
||||
argument size
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
Message-Id: <20250310-limit-wmi-chanlist-v1-1-8f0fb45459a7@8devices.com>
|
||||
X-B4-Tracking: v=1; b=H4sIAPHozmcC/x2MSwqEMBAFryK9tiGJ+MGriIuMtvpAM0MSHEG8u
|
||||
9FNQVG8d1IQDwnUZid52RHwdUl0ntGwWDcLY0xORplSFVrxig2R/xv46StCZF0Pn2Y0ibaiNPx
|
||||
5mXC8px3ZuLCTI1J/XTfUqQSebgAAAA==
|
||||
X-Change-ID: 20250310-limit-wmi-chanlist-17cb8d27cba6
|
||||
To: ath12k@lists.infradead.org
|
||||
Cc: Johannes Berg <johannes@sipsolutions.net>,
|
||||
Jeff Johnson <jjohnson@kernel.org>, linux-wireless@vger.kernel.org,
|
||||
linux-kernel@vger.kernel.org, Mantas Pucka <mantas@8devices.com>
|
||||
X-Mailer: b4 0.14.2
|
||||
|
||||
When using BDF with both 5GHz and 6GHz bands enabled on QCN9274, interface
|
||||
fails to start. It happens because FW fails to process
|
||||
WMI_SCAN_CHAN_LIST_CMDID with argument size >2048, resulting in a command
|
||||
timeout. The current code allows splitting channel list across multiple WMI
|
||||
commands but uses WMI max_msg_len (4096) as chunk size, which is still too
|
||||
large.
|
||||
|
||||
Fix this by limiting the number of channels sent at once, using the value
|
||||
specified in WMI interface description [1].
|
||||
|
||||
[1] https://git.codelinaro.org/clo/qsdk/platform/vendor/qcom-opensource/wlan/fw-api/-/blob/NHSS.QSDK.13.0.0.6/fw/wmi_unified.h#L6459
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Mantas Pucka <mantas@8devices.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/wmi.c | 3 +++
|
||||
drivers/net/wireless/ath/ath12k/wmi.h | 2 ++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
|
||||
---
|
||||
base-commit: 42aa76e608ca845c98e79f9e23af0bdb07b2eb1d
|
||||
change-id: 20250310-limit-wmi-chanlist-17cb8d27cba6
|
||||
|
||||
Best regards,
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
@@ -2558,6 +2558,9 @@ int ath12k_wmi_send_scan_chan_list_cmd(s
|
||||
max_chan_limit = (wmi->wmi_ab->max_msg_len[ar->pdev_idx] - len) /
|
||||
sizeof(*chan_info);
|
||||
|
||||
+ if (max_chan_limit > WMI_MAX_NUM_CHAN_PER_WMI_CMD)
|
||||
+ max_chan_limit = WMI_MAX_NUM_CHAN_PER_WMI_CMD;
|
||||
+
|
||||
num_send_chans = min(arg->nallchans, max_chan_limit);
|
||||
|
||||
arg->nallchans -= num_send_chans;
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
@@ -3743,6 +3743,8 @@ struct wmi_stop_scan_cmd {
|
||||
__le32 pdev_id;
|
||||
} __packed;
|
||||
|
||||
+#define WMI_MAX_NUM_CHAN_PER_WMI_CMD 58
|
||||
+
|
||||
struct ath12k_wmi_scan_chan_list_arg {
|
||||
u32 pdev_id;
|
||||
u16 nallchans;
|
@ -1,137 +0,0 @@
|
||||
From patchwork Thu Mar 13 09:00:56 2025
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Mantas <mantas@8devices.com>
|
||||
X-Patchwork-Id: 14014575
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com
|
||||
[209.85.167.49])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id F210C2641F0
|
||||
for <linux-wireless@vger.kernel.org>; Thu, 13 Mar 2025 09:01:28 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=209.85.167.49
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1741856491; cv=none;
|
||||
b=CeFjBZstZXxg4oQQPPON0u0Mw9kvUaCubWSfpcWvN2italvlwccDBr+izqIzCXwxYaoAedVR6iHEQv+LBtIHOsMWHOCI9E6jYAPqjbEUEU0RMdvujKLVFvFXYR4UaRDAMzDGMlFF1qc0pY0sYR4FYfFBBQOarHn2sjZ/csIyj4k=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1741856491; c=relaxed/simple;
|
||||
bh=oLhlWw1tOovRHEGC4gsbi6BHKYXLNDYOrtVP3tTS5nE=;
|
||||
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;
|
||||
b=baAfN8drFOEwQR9LVuWoVsd3jkMbQECK7Zuc68EzbbJwM4Zb0tbziTk1vvqED+f9JPOMbjRyjvV1hvy3svqZr7OuTZJdSM41D+DsbHvw0jEhaRlKwzpLWuOn9lu56ahcAsvx4A4JRawEK90smoYpejhxkdlSrxqRBh1ey3RwmQU=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=quarantine dis=none) header.from=8devices.com;
|
||||
spf=pass smtp.mailfrom=8devices.com;
|
||||
dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com
|
||||
header.b=FdBxu3P+; arc=none smtp.client-ip=209.85.167.49
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=quarantine dis=none) header.from=8devices.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=8devices.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=8devices.com header.i=@8devices.com
|
||||
header.b="FdBxu3P+"
|
||||
Received: by mail-lf1-f49.google.com with SMTP id
|
||||
2adb3069b0e04-54943bb8006so648002e87.0
|
||||
for <linux-wireless@vger.kernel.org>;
|
||||
Thu, 13 Mar 2025 02:01:28 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=8devices.com; s=8devices; t=1741856487; x=1742461287;
|
||||
darn=vger.kernel.org;
|
||||
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
|
||||
:date:from:from:to:cc:subject:date:message-id:reply-to;
|
||||
bh=uj7GGUjO2Cb2hoHrzMda/fIIQwFl12ddzGuw5jrHW8M=;
|
||||
b=FdBxu3P+gf3qNd4jxSOCYUJ1meLFYAm0ou6lnEyomeeXDBFwITM6FM0cgBdXgmkLWZ
|
||||
ZKowNImwE9FKqNGxpg2tZ4obR9aM7HzzkxV3TE+1aIiocbr/5xyXQU+/AUvaM3vui/8d
|
||||
SFiwhX9FwFKdrYi1Og4XFD2aBhA5Fzp0U27grJYGTLchEfkr9Om43y3vZ7w2ENEBU0SO
|
||||
7NFmSwx7BmflIybP2sGCUzjacGQzzec0zz256EY7GpZH9r19jgWiCe1YGWdlxDaRhWze
|
||||
xV4okbZKydpYlUU/qGsgn23cRQuFCvMobvfkmTwsGYwlN4bAzq/cHw83YEFrUzYOngZK
|
||||
z7bg==
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20230601; t=1741856487; x=1742461287;
|
||||
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
|
||||
:date:from:x-gm-message-state:from:to:cc:subject:date:message-id
|
||||
:reply-to;
|
||||
bh=uj7GGUjO2Cb2hoHrzMda/fIIQwFl12ddzGuw5jrHW8M=;
|
||||
b=PhLIANoGtdl34d9fFH7uxPyg1K5yPGRwimsWPVhHon98V9QP64+qUbifocbfojxz8u
|
||||
NEVzhOx0kfmsmkBxUzuRCu6xuTAF8LmjBpAJJxo3/4nqY67np8iZt/MITzx6egbMOUAs
|
||||
txqj0rzXwr55N/9yAD/QuD6bBcd8PcNMPp0CjFAt39AyK6De3BEIcA7b/eLoY3lifaxJ
|
||||
9U5ZZ/dHXwSIr9xuE1EB6pT5FbHcI8iWJTDJ8NdBcmWC8qtGAAMzlzWqHU0nOAJEjwEc
|
||||
T+oaJr8fTAgq4B5OvS1cNClscZHvoM3zlIoczwPPoBZCtUi2gThz9R4BrBxepdoZl1qq
|
||||
NZQA==
|
||||
X-Forwarded-Encrypted: i=1;
|
||||
AJvYcCUSbJyRkEPLa3fw7FZX3Ci6+/o8dqI0hd6pkVT20pi6Ufgze7nBQXa+qdK3OM5Ng2TFBrym8JoyBo//MwDHng==@vger.kernel.org
|
||||
X-Gm-Message-State: AOJu0Ywjzq2sFNyTMNPyxDt+721RyXdLbDPrF5PY3LnwpKaTfduyXkMF
|
||||
K/7N3Cpb/71aQsMXwmIbXAOGeLVWLBQHdYnQLZlsCTjVNArIjgiX7tNB0Mq56+qYtR9PdMrBAt8
|
||||
m
|
||||
X-Gm-Gg: ASbGncvDd0SdjhjPfzaKTXW4e0hclZuKu4pZ4d0XD5/Q6dnv09ZObgGjJbIRrAhYizp
|
||||
zWc8CwidDk8UYPX/OhiAyDhS4XRKRy2QG03sZh17aHDhishhmCE+mcqe+YUM+F4ns/05sAR2MeP
|
||||
wu/Rz6NS6UD4ihGNReTORGB3X4n9I5dgdNheFyqbrRX+Js4zXuvn1jgoEWawfovOu/4HAlnv+7p
|
||||
1ufgXBXJGVj6+OGzyNOyYloTB/Csok3zU9yBfrU+G19mpGaF86t/6yxmUIXCO+cWfbu2GIhVZp3
|
||||
RmSiDo/spnsvtYVGCPc6v9jALz83YcknTLkX8u+08AOkJKK7Mh8rKlCvbfZcB355
|
||||
X-Google-Smtp-Source:
|
||||
AGHT+IE2NulrNIo+M5vahinpDWyI9BdSgzdREdo+l0AN7HhcxOd01ZBOpT3HYFht1EVpKj5T7Edrrw==
|
||||
X-Received: by 2002:a05:6512:ba6:b0:549:8f21:bc0e with SMTP id
|
||||
2adb3069b0e04-54990eb1987mr9398593e87.32.1741856486697;
|
||||
Thu, 13 Mar 2025 02:01:26 -0700 (PDT)
|
||||
Received: from [127.0.1.1] ([78.62.132.154])
|
||||
by smtp.gmail.com with ESMTPSA id
|
||||
2adb3069b0e04-549ba88591csm142134e87.187.2025.03.13.02.01.25
|
||||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||
Thu, 13 Mar 2025 02:01:25 -0700 (PDT)
|
||||
From: Mantas Pucka <mantas@8devices.com>
|
||||
Date: Thu, 13 Mar 2025 11:00:56 +0200
|
||||
Subject: [PATCH] wifi: ath12k: fix 5GHz operation on wideband QCN9274
|
||||
radios
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
Message-Id: <20250313-ath12-wideband-caps-v1-1-23ac4247cd8a@8devices.com>
|
||||
X-B4-Tracking: v=1; b=H4sIAMee0mcC/x3MQQqAIBBA0avErBvIsUi6SrSwHGs2FhoVhHdPW
|
||||
r7F/y8kjsIJhuqFyJck2UOBqitYNhtWRnHFQA11jVYa7bkpwlsczzY4XOyRkNqZjOqNcZ6hlEd
|
||||
kL89/HaecP+zWjGtlAAAA
|
||||
X-Change-ID: 20250313-ath12-wideband-caps-24b281788dfe
|
||||
To: ath12k@lists.infradead.org
|
||||
Cc: Johannes Berg <johannes@sipsolutions.net>,
|
||||
Jeff Johnson <jjohnson@kernel.org>, linux-wireless@vger.kernel.org,
|
||||
linux-kernel@vger.kernel.org, Mantas Pucka <mantas@8devices.com>
|
||||
X-Mailer: b4 0.14.2
|
||||
|
||||
Currently ath12k_mac_setup_ht_vht_cap() incorrectly assumes that QCN9274
|
||||
radios with 6GHz band can't support 5GHz as well. This prevents the
|
||||
addition of HT and VHT capabilities for the 5GHz band. Since QCN9274 is
|
||||
capable of operating in multiple bands, remove the 6GHz support check and
|
||||
exception for single_pdev_only (i.e. WCN7850).
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Mantas Pucka <mantas@8devices.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/mac.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
|
||||
---
|
||||
base-commit: 42aa76e608ca845c98e79f9e23af0bdb07b2eb1d
|
||||
change-id: 20250313-ath12-wideband-caps-24b281788dfe
|
||||
|
||||
Best regards,
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -5186,9 +5186,7 @@ static void ath12k_mac_setup_ht_vht_cap(
|
||||
rate_cap_rx_chainmask);
|
||||
}
|
||||
|
||||
- if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP &&
|
||||
- (ar->ab->hw_params->single_pdev_only ||
|
||||
- !ar->supports_6ghz)) {
|
||||
+ if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP) {
|
||||
band = &ar->mac.sbands[NL80211_BAND_5GHZ];
|
||||
ht_cap = cap->band[NL80211_BAND_5GHZ].ht_cap_info;
|
||||
if (ht_cap_info)
|
@ -1,469 +0,0 @@
|
||||
From patchwork Wed Sep 18 21:20:48 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
X-Patchwork-Id: 13807212
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
|
||||
[205.220.168.131])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A06681CA6B9
|
||||
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:13 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=205.220.168.131
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1726694475; cv=none;
|
||||
b=HjUnHV2ZbMRZne/OD71kC1p0zBs+1+LVanM+3YbUfCnjvvtSry2r0Dj0HBjHnId1ltZw0ebTJaEZDcXBybkc2yiiGRlcH5s4feXisp9WApElGptz2Qn1SEtO3VDLKyE5m56eJftK/dpin6HPZGOk3hMBHkxoo966Jp4vlC9e2rY=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1726694475; c=relaxed/simple;
|
||||
bh=lJX5iM2Ahf/ROaeR2Kk4suhcbwA47aOSPqyQsesg4A0=;
|
||||
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
|
||||
MIME-Version:Content-Type;
|
||||
b=RYEWdi9+UZKYtzHKfAF5xdIOkpdgQjBK8hE1SX/f0rJDxozjZe1jDY28C+kzN4uhSwcBSwr7pZjMLL8LELNITE6fIk/zDY5UAO/jdeUPBnTrmrckzZOwaCFIQ1nt6ssDZDfpJADBjCIuMXB7HNChH3qSMlmYTV9QTDxpBK0fQxM=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com;
|
||||
spf=pass smtp.mailfrom=quicinc.com;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b=EtpV59A6; arc=none smtp.client-ip=205.220.168.131
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b="EtpV59A6"
|
||||
Received: from pps.filterd (m0279862.ppops.net [127.0.0.1])
|
||||
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
|
||||
48IL3WbX003099;
|
||||
Wed, 18 Sep 2024 21:21:07 GMT
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
|
||||
cc:content-transfer-encoding:content-type:date:from:in-reply-to
|
||||
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
|
||||
3ukRiLVgAcc9GoJxAaFrgsHYImZ/9ZPgSlMf75Ew/1Y=; b=EtpV59A6K8yD5o5B
|
||||
8JSYPL7TI2tnIQciUmyLNJig3DWGn3AZbFqPjgTYUgoQLHjsNWd+WRAKx13tQhSW
|
||||
peq0OW9986uI1TFVpaw0pwVXoBiStEI5MH/7ThiA5nIAI4hYBI6+iiwL7qWpboSL
|
||||
UrG9sWI35wsgcjedTtrzR2QfpeTAvlnReoac/49o5GAysu1oGDN79VAAP7tDZbO2
|
||||
trx/XdQmW/8iqtRR3Idhjcod6B6ovXKkmAZUHzhp4zRupTUsKOU84X3aTYZQLN/B
|
||||
46HuFZSlOJEB/63Co7I2K8YfQT3FikP2mkrIsDwH78Y2OekhXJWFe7dU4SsX6nh6
|
||||
sIXVxA==
|
||||
Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com
|
||||
[129.46.96.20])
|
||||
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4gd387e-1
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:07 +0000 (GMT)
|
||||
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
|
||||
[10.47.209.196])
|
||||
by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
|
||||
48ILL6rr020545
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:06 GMT
|
||||
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
|
||||
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
|
||||
15.2.1544.9; Wed, 18 Sep 2024 14:21:06 -0700
|
||||
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
To: <ath12k@lists.infradead.org>
|
||||
CC: <linux-wireless@vger.kernel.org>,
|
||||
Pradeep Kumar Chitrapu
|
||||
<quic_pradeepc@quicinc.com>,
|
||||
Muna Sinada <quic_msinada@quicinc.com>,
|
||||
"Jeff
|
||||
Johnson" <quic_jjohnson@quicinc.com>
|
||||
Subject: [PATCH V8 1/9] wifi: ath12k: push HE MU-MIMO params to hardware
|
||||
Date: Wed, 18 Sep 2024 14:20:48 -0700
|
||||
Message-ID: <20240918212056.4137076-2-quic_pradeepc@quicinc.com>
|
||||
X-Mailer: git-send-email 2.34.1
|
||||
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196)
|
||||
X-QCInternal: smtphost
|
||||
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
|
||||
signatures=585085
|
||||
X-Proofpoint-ORIG-GUID: QTgqLsl2p5OGLwWEQsGrsmA8q68U11H8
|
||||
X-Proofpoint-GUID: QTgqLsl2p5OGLwWEQsGrsmA8q68U11H8
|
||||
X-Proofpoint-Virus-Version: vendor=baseguard
|
||||
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
|
||||
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
|
||||
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
|
||||
malwarescore=0 suspectscore=0
|
||||
bulkscore=0 clxscore=1015 spamscore=0 adultscore=0 lowpriorityscore=0
|
||||
mlxlogscore=999 impostorscore=0 mlxscore=0 priorityscore=1501 phishscore=0
|
||||
classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000
|
||||
definitions=main-2409180140
|
||||
|
||||
Currently, only the HE IE in management frames is updated with
|
||||
respect to MU-MIMO configurations, but this change is not
|
||||
reflected in the hardware. Add support to propagate MU-MIMO
|
||||
configurations to the hardware as well.
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/mac.c | 215 +++++++++++++++++---------
|
||||
drivers/net/wireless/ath/ath12k/mac.h | 15 ++
|
||||
drivers/net/wireless/ath/ath12k/wmi.h | 28 +---
|
||||
3 files changed, 156 insertions(+), 102 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -2851,6 +2851,108 @@ static int ath12k_setup_peer_smps(struct
|
||||
ath12k_smps_map[smps]);
|
||||
}
|
||||
|
||||
+static int ath12k_mac_set_he_txbf_conf(struct ath12k_vif *arvif)
|
||||
+{
|
||||
+ struct ath12k *ar = arvif->ar;
|
||||
+ u32 param = WMI_VDEV_PARAM_SET_HEMU_MODE;
|
||||
+ u32 value = 0;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!arvif->vif->bss_conf.he_support)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.he_su_beamformer) {
|
||||
+ value |= u32_encode_bits(HE_SU_BFER_ENABLE, HE_MODE_SU_TX_BFER);
|
||||
+ if (arvif->vif->bss_conf.he_mu_beamformer &&
|
||||
+ arvif->vdev_type == WMI_VDEV_TYPE_AP)
|
||||
+ value |= u32_encode_bits(HE_MU_BFER_ENABLE, HE_MODE_MU_TX_BFER);
|
||||
+ }
|
||||
+
|
||||
+ if (arvif->vif->type != NL80211_IFTYPE_MESH_POINT) {
|
||||
+ value |= u32_encode_bits(HE_DL_MUOFDMA_ENABLE, HE_MODE_DL_OFDMA) |
|
||||
+ u32_encode_bits(HE_UL_MUOFDMA_ENABLE, HE_MODE_UL_OFDMA);
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.he_full_ul_mumimo)
|
||||
+ value |= u32_encode_bits(HE_UL_MUMIMO_ENABLE, HE_MODE_UL_MUMIMO);
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.he_su_beamformee)
|
||||
+ value |= u32_encode_bits(HE_SU_BFEE_ENABLE, HE_MODE_SU_TX_BFEE);
|
||||
+ }
|
||||
+
|
||||
+ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param, value);
|
||||
+ if (ret) {
|
||||
+ ath12k_warn(ar->ab, "failed to set vdev %d HE MU mode: %d\n",
|
||||
+ arvif->vdev_id, ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ param = WMI_VDEV_PARAM_SET_HE_SOUNDING_MODE;
|
||||
+ value = u32_encode_bits(HE_VHT_SOUNDING_MODE_ENABLE, HE_VHT_SOUNDING_MODE) |
|
||||
+ u32_encode_bits(HE_TRIG_NONTRIG_SOUNDING_MODE_ENABLE,
|
||||
+ HE_TRIG_NONTRIG_SOUNDING_MODE);
|
||||
+ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
|
||||
+ param, value);
|
||||
+ if (ret) {
|
||||
+ ath12k_warn(ar->ab, "failed to set vdev %d sounding mode: %d\n",
|
||||
+ arvif->vdev_id, ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int ath12k_mac_vif_recalc_sta_he_txbf(struct ath12k *ar,
|
||||
+ struct ieee80211_vif *vif,
|
||||
+ struct ieee80211_sta_he_cap *he_cap,
|
||||
+ int *hemode)
|
||||
+{
|
||||
+ struct ieee80211_he_cap_elem he_cap_elem = {};
|
||||
+ struct ieee80211_sta_he_cap *cap_band;
|
||||
+ struct cfg80211_chan_def def;
|
||||
+
|
||||
+ if (!vif->bss_conf.he_support)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (vif->type != NL80211_IFTYPE_STATION)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (WARN_ON(ath12k_mac_vif_chan(vif, &def)))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (def.chan->band == NL80211_BAND_2GHZ)
|
||||
+ cap_band = &ar->mac.iftype[NL80211_BAND_2GHZ][vif->type].he_cap;
|
||||
+ else
|
||||
+ cap_band = &ar->mac.iftype[NL80211_BAND_5GHZ][vif->type].he_cap;
|
||||
+
|
||||
+ memcpy(&he_cap_elem, &cap_band->he_cap_elem, sizeof(he_cap_elem));
|
||||
+
|
||||
+ *hemode = 0;
|
||||
+ if (HECAP_PHY_SUBFME_GET(he_cap_elem.phy_cap_info)) {
|
||||
+ if (HECAP_PHY_SUBFMR_GET(he_cap->he_cap_elem.phy_cap_info))
|
||||
+ *hemode |= u32_encode_bits(HE_SU_BFEE_ENABLE, HE_MODE_SU_TX_BFEE);
|
||||
+ if (HECAP_PHY_MUBFMR_GET(he_cap->he_cap_elem.phy_cap_info))
|
||||
+ *hemode |= u32_encode_bits(HE_MU_BFEE_ENABLE, HE_MODE_MU_TX_BFEE);
|
||||
+ }
|
||||
+
|
||||
+ if (vif->type != NL80211_IFTYPE_MESH_POINT) {
|
||||
+ *hemode |= u32_encode_bits(HE_DL_MUOFDMA_ENABLE, HE_MODE_DL_OFDMA) |
|
||||
+ u32_encode_bits(HE_UL_MUOFDMA_ENABLE, HE_MODE_UL_OFDMA);
|
||||
+
|
||||
+ if (HECAP_PHY_ULMUMIMO_GET(he_cap_elem.phy_cap_info))
|
||||
+ if (HECAP_PHY_ULMUMIMO_GET(he_cap->he_cap_elem.phy_cap_info))
|
||||
+ *hemode |= u32_encode_bits(HE_UL_MUMIMO_ENABLE,
|
||||
+ HE_MODE_UL_MUMIMO);
|
||||
+
|
||||
+ if (u32_get_bits(*hemode, HE_MODE_MU_TX_BFEE))
|
||||
+ *hemode |= u32_encode_bits(HE_SU_BFEE_ENABLE, HE_MODE_SU_TX_BFEE);
|
||||
+
|
||||
+ if (u32_get_bits(*hemode, HE_MODE_MU_TX_BFER))
|
||||
+ *hemode |= u32_encode_bits(HE_SU_BFER_ENABLE, HE_MODE_SU_TX_BFER);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void ath12k_bss_assoc(struct ath12k *ar,
|
||||
struct ath12k_vif *arvif,
|
||||
struct ieee80211_bss_conf *bss_conf)
|
||||
@@ -2858,9 +2960,11 @@ static void ath12k_bss_assoc(struct ath1
|
||||
struct ieee80211_vif *vif = arvif->vif;
|
||||
struct ath12k_wmi_vdev_up_params params = {};
|
||||
struct ath12k_wmi_peer_assoc_arg peer_arg;
|
||||
+ struct ieee80211_sta_he_cap he_cap;
|
||||
struct ieee80211_sta *ap_sta;
|
||||
struct ath12k_peer *peer;
|
||||
bool is_auth = false;
|
||||
+ u32 hemode = 0;
|
||||
int ret;
|
||||
|
||||
lockdep_assert_held(&ar->conf_mutex);
|
||||
@@ -2880,8 +2984,29 @@ static void ath12k_bss_assoc(struct ath1
|
||||
|
||||
ath12k_peer_assoc_prepare(ar, vif, ap_sta, &peer_arg, false);
|
||||
|
||||
+ /* he_cap here is updated at assoc success for sta mode only */
|
||||
+ he_cap = ap_sta->deflink.he_cap;
|
||||
+
|
||||
+ /* ap_sta->deflink.he_cap must be protected by rcu_read_lock */
|
||||
+ ret = ath12k_mac_vif_recalc_sta_he_txbf(ar, vif, &he_cap, &hemode);
|
||||
+ if (ret) {
|
||||
+ ath12k_warn(ar->ab, "failed to recalc he txbf for vdev %i on bss %pM: %d\n",
|
||||
+ arvif->vdev_id, bss_conf->bssid, ret);
|
||||
+ rcu_read_unlock();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
rcu_read_unlock();
|
||||
|
||||
+ /* keep this before ath12k_wmi_send_peer_assoc_cmd() */
|
||||
+ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
|
||||
+ WMI_VDEV_PARAM_SET_HEMU_MODE, hemode);
|
||||
+ if (ret) {
|
||||
+ ath12k_warn(ar->ab, "failed to submit vdev param txbf 0x%x: %d\n",
|
||||
+ hemode, ret);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
ret = ath12k_wmi_send_peer_assoc_cmd(ar, &peer_arg);
|
||||
if (ret) {
|
||||
ath12k_warn(ar->ab, "failed to run peer assoc for %pM vdev %i: %d\n",
|
||||
@@ -3220,6 +3345,13 @@ static void ath12k_mac_bss_info_changed(
|
||||
ether_addr_copy(arvif->bssid, info->bssid);
|
||||
|
||||
if (changed & BSS_CHANGED_BEACON_ENABLED) {
|
||||
+ if (info->enable_beacon) {
|
||||
+ ret = ath12k_mac_set_he_txbf_conf(arvif);
|
||||
+ if (ret)
|
||||
+ ath12k_warn(ar->ab,
|
||||
+ "failed to set HE TXBF config for vdev: %d\n",
|
||||
+ arvif->vdev_id);
|
||||
+ }
|
||||
ath12k_control_beaconing(arvif, info);
|
||||
|
||||
if (arvif->is_up && vif->bss_conf.he_support &&
|
||||
@@ -5352,11 +5484,14 @@ static void ath12k_mac_copy_he_cap(struc
|
||||
|
||||
he_cap_elem->mac_cap_info[1] &=
|
||||
IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK;
|
||||
-
|
||||
+ he_cap_elem->phy_cap_info[0] &=
|
||||
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G |
|
||||
+ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G |
|
||||
+ 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[5] &=
|
||||
~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK;
|
||||
- he_cap_elem->phy_cap_info[5] &=
|
||||
- ~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK;
|
||||
he_cap_elem->phy_cap_info[5] |= num_tx_chains - 1;
|
||||
|
||||
switch (iftype) {
|
||||
@@ -6318,71 +6453,6 @@ static int ath12k_mac_setup_vdev_create_
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static u32
|
||||
-ath12k_mac_prepare_he_mode(struct ath12k_pdev *pdev, u32 viftype)
|
||||
-{
|
||||
- struct ath12k_pdev_cap *pdev_cap = &pdev->cap;
|
||||
- struct ath12k_band_cap *cap_band = NULL;
|
||||
- u32 *hecap_phy_ptr = NULL;
|
||||
- u32 hemode;
|
||||
-
|
||||
- if (pdev->cap.supported_bands & WMI_HOST_WLAN_2G_CAP)
|
||||
- cap_band = &pdev_cap->band[NL80211_BAND_2GHZ];
|
||||
- else
|
||||
- cap_band = &pdev_cap->band[NL80211_BAND_5GHZ];
|
||||
-
|
||||
- hecap_phy_ptr = &cap_band->he_cap_phy_info[0];
|
||||
-
|
||||
- hemode = u32_encode_bits(HE_SU_BFEE_ENABLE, HE_MODE_SU_TX_BFEE) |
|
||||
- u32_encode_bits(HECAP_PHY_SUBFMR_GET(hecap_phy_ptr),
|
||||
- HE_MODE_SU_TX_BFER) |
|
||||
- u32_encode_bits(HECAP_PHY_ULMUMIMO_GET(hecap_phy_ptr),
|
||||
- HE_MODE_UL_MUMIMO);
|
||||
-
|
||||
- /* TODO: WDS and other modes */
|
||||
- if (viftype == NL80211_IFTYPE_AP) {
|
||||
- hemode |= u32_encode_bits(HECAP_PHY_MUBFMR_GET(hecap_phy_ptr),
|
||||
- HE_MODE_MU_TX_BFER) |
|
||||
- u32_encode_bits(HE_DL_MUOFDMA_ENABLE, HE_MODE_DL_OFDMA) |
|
||||
- u32_encode_bits(HE_UL_MUOFDMA_ENABLE, HE_MODE_UL_OFDMA);
|
||||
- } else {
|
||||
- hemode |= u32_encode_bits(HE_MU_BFEE_ENABLE, HE_MODE_MU_TX_BFEE);
|
||||
- }
|
||||
-
|
||||
- return hemode;
|
||||
-}
|
||||
-
|
||||
-static int ath12k_set_he_mu_sounding_mode(struct ath12k *ar,
|
||||
- struct ath12k_vif *arvif)
|
||||
-{
|
||||
- u32 param_id, param_value;
|
||||
- struct ath12k_base *ab = ar->ab;
|
||||
- int ret;
|
||||
-
|
||||
- param_id = WMI_VDEV_PARAM_SET_HEMU_MODE;
|
||||
- param_value = ath12k_mac_prepare_he_mode(ar->pdev, arvif->vif->type);
|
||||
- ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
|
||||
- param_id, param_value);
|
||||
- if (ret) {
|
||||
- ath12k_warn(ab, "failed to set vdev %d HE MU mode: %d param_value %x\n",
|
||||
- arvif->vdev_id, ret, param_value);
|
||||
- return ret;
|
||||
- }
|
||||
- param_id = WMI_VDEV_PARAM_SET_HE_SOUNDING_MODE;
|
||||
- param_value =
|
||||
- u32_encode_bits(HE_VHT_SOUNDING_MODE_ENABLE, HE_VHT_SOUNDING_MODE) |
|
||||
- u32_encode_bits(HE_TRIG_NONTRIG_SOUNDING_MODE_ENABLE,
|
||||
- HE_TRIG_NONTRIG_SOUNDING_MODE);
|
||||
- ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
|
||||
- param_id, param_value);
|
||||
- if (ret) {
|
||||
- ath12k_warn(ab, "failed to set vdev %d HE MU mode: %d\n",
|
||||
- arvif->vdev_id, ret);
|
||||
- return ret;
|
||||
- }
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
static void ath12k_mac_update_vif_offload(struct ath12k_vif *arvif)
|
||||
{
|
||||
struct ieee80211_vif *vif = arvif->vif;
|
||||
@@ -7340,7 +7410,6 @@ ath12k_mac_vdev_start_restart(struct ath
|
||||
struct ath12k_base *ab = ar->ab;
|
||||
struct wmi_vdev_start_req_arg arg = {};
|
||||
const struct cfg80211_chan_def *chandef = &ctx->def;
|
||||
- int he_support = arvif->vif->bss_conf.he_support;
|
||||
int ret;
|
||||
|
||||
lockdep_assert_held(&ar->conf_mutex);
|
||||
@@ -7396,14 +7465,6 @@ ath12k_mac_vdev_start_restart(struct ath
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
|
||||
/* TODO: Notify if secondary 80Mhz also needs radar detection */
|
||||
- if (he_support) {
|
||||
- ret = ath12k_set_he_mu_sounding_mode(ar, arvif);
|
||||
- if (ret) {
|
||||
- ath12k_warn(ar->ab, "failed to set he mode vdev %i\n",
|
||||
- arg.vdev_id);
|
||||
- return ret;
|
||||
- }
|
||||
- }
|
||||
}
|
||||
|
||||
arg.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR);
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.h
|
||||
@@ -41,6 +41,21 @@ struct ath12k_generic_iter {
|
||||
#define ATH12K_TX_POWER_MAX_VAL 70
|
||||
#define ATH12K_TX_POWER_MIN_VAL 0
|
||||
|
||||
+#define HECAP_PHY_SUBFMR_GET(hecap_phy) \
|
||||
+ u8_get_bits(hecap_phy[3], IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER)
|
||||
+
|
||||
+#define HECAP_PHY_SUBFME_GET(hecap_phy) \
|
||||
+ u8_get_bits(hecap_phy[4], IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE)
|
||||
+
|
||||
+#define HECAP_PHY_MUBFMR_GET(hecap_phy) \
|
||||
+ u8_get_bits(hecap_phy[4], IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER)
|
||||
+
|
||||
+#define HECAP_PHY_ULMUMIMO_GET(hecap_phy) \
|
||||
+ u8_get_bits(hecap_phy[2], IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO)
|
||||
+
|
||||
+#define HECAP_PHY_ULOFDMA_GET(hecap_phy) \
|
||||
+ u8_get_bits(hecap_phy[2], IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO)
|
||||
+
|
||||
enum ath12k_supported_bw {
|
||||
ATH12K_BW_20 = 0,
|
||||
ATH12K_BW_40 = 1,
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
@@ -2995,31 +2995,6 @@ struct ath12k_wmi_rx_reorder_queue_remov
|
||||
#define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2)
|
||||
#define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3)
|
||||
|
||||
-#define HECAP_PHYDWORD_0 0
|
||||
-#define HECAP_PHYDWORD_1 1
|
||||
-#define HECAP_PHYDWORD_2 2
|
||||
-
|
||||
-#define HECAP_PHY_SU_BFER BIT(31)
|
||||
-#define HECAP_PHY_SU_BFEE BIT(0)
|
||||
-#define HECAP_PHY_MU_BFER BIT(1)
|
||||
-#define HECAP_PHY_UL_MUMIMO BIT(22)
|
||||
-#define HECAP_PHY_UL_MUOFDMA BIT(23)
|
||||
-
|
||||
-#define HECAP_PHY_SUBFMR_GET(hecap_phy) \
|
||||
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_0], HECAP_PHY_SU_BFER)
|
||||
-
|
||||
-#define HECAP_PHY_SUBFME_GET(hecap_phy) \
|
||||
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_1], HECAP_PHY_SU_BFEE)
|
||||
-
|
||||
-#define HECAP_PHY_MUBFMR_GET(hecap_phy) \
|
||||
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_1], HECAP_PHY_MU_BFER)
|
||||
-
|
||||
-#define HECAP_PHY_ULMUMIMO_GET(hecap_phy) \
|
||||
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_0], HECAP_PHY_UL_MUMIMO)
|
||||
-
|
||||
-#define HECAP_PHY_ULOFDMA_GET(hecap_phy) \
|
||||
- u32_get_bits(hecap_phy[HECAP_PHYDWORD_0], HECAP_PHY_UL_MUOFDMA)
|
||||
-
|
||||
#define HE_MODE_SU_TX_BFEE BIT(0)
|
||||
#define HE_MODE_SU_TX_BFER BIT(1)
|
||||
#define HE_MODE_MU_TX_BFEE BIT(2)
|
||||
@@ -3031,8 +3006,11 @@ struct ath12k_wmi_rx_reorder_queue_remov
|
||||
#define HE_DL_MUOFDMA_ENABLE 1
|
||||
#define HE_UL_MUOFDMA_ENABLE 1
|
||||
#define HE_DL_MUMIMO_ENABLE 1
|
||||
+#define HE_UL_MUMIMO_ENABLE 1
|
||||
#define HE_MU_BFEE_ENABLE 1
|
||||
#define HE_SU_BFEE_ENABLE 1
|
||||
+#define HE_MU_BFER_ENABLE 1
|
||||
+#define HE_SU_BFER_ENABLE 1
|
||||
|
||||
#define HE_VHT_SOUNDING_MODE_ENABLE 1
|
||||
#define HE_SU_MU_SOUNDING_MODE_ENABLE 1
|
@ -1,222 +0,0 @@
|
||||
From patchwork Wed Sep 18 21:20:49 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
X-Patchwork-Id: 13807210
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
|
||||
[205.220.168.131])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id B81C317967F
|
||||
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:12 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=205.220.168.131
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1726694474; cv=none;
|
||||
b=SYN3tI9xaTiXuxK7CUAD6gXBOqoyS1qZxAGNOXDt4yS1Q6oU0YiwQonIkVrnux7/DC3bCm2JScN5vIxVzkGOkFztaIHlZMM/TRsp6GzSIbZdasVpxySumoe965kRna+5fYAmf4i3wJupfj9p6509u7j6kXzz1ZxlSStR4wLObcE=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1726694474; c=relaxed/simple;
|
||||
bh=yQPaApb7knqLxhkxSrizMfAanw18TDUbxBPbfnhzlV0=;
|
||||
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
|
||||
MIME-Version:Content-Type;
|
||||
b=W+Rk8/tiKUvP6A8WYQFxi97//4Yj4m/rYPXAg0YP+6K+GXDcFK2VD+yEzmymA/fsenli+7ZEJ1zH6XgzLe4+1QFctCYGnq1LPoD01a4AIF8VqJGVdgs6e1ZwCKv8AOLkZUb09QkmM8Ur4R1xFhc4oVqhlvm3NMc24NERWmxzGjI=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com;
|
||||
spf=pass smtp.mailfrom=quicinc.com;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b=XJxqlj7h; arc=none smtp.client-ip=205.220.168.131
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b="XJxqlj7h"
|
||||
Received: from pps.filterd (m0279867.ppops.net [127.0.0.1])
|
||||
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
|
||||
48IHKWuA006417;
|
||||
Wed, 18 Sep 2024 21:21:08 GMT
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
|
||||
cc:content-transfer-encoding:content-type:date:from:in-reply-to
|
||||
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
|
||||
hcoreX5pgczyblwh1gpL6Ax4OV0yrVpAaKX7psGXczI=; b=XJxqlj7hhoW4GYMB
|
||||
+B9r7ajbqV+ZxP+/1uDt5veOBY8aQgsorBoEbZFKm+ccV0u5SQJ/fFSomLg8QYpE
|
||||
iojXUyYsGJMsXSPW+OdC0DQ2JrhDEHWFQa/6c3C0sdBE5IGgTa8YiAmYAx/A1ti1
|
||||
ruMNSyT8H/xEKkR953axz1DOGJZfp9dCtOM5Xw6nrqpeUEYBShgvQ+1LLXqrH8U4
|
||||
qUlYW2vKFKJgZUe97nwRrwOiunhTD4M2ARe6xHqZ7bL+2bW27sRTSI69vGrcEdKM
|
||||
Ied7A8KmlUAN5BBsOj5MeKAaoy0+h4iY/9W3JgDfOu+LwjuAaKzgPNrttmPehdhJ
|
||||
Q8q0JQ==
|
||||
Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com
|
||||
[129.46.96.20])
|
||||
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4kjk65k-1
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:07 +0000 (GMT)
|
||||
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
|
||||
[10.47.209.196])
|
||||
by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
|
||||
48ILL7IZ032342
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:07 GMT
|
||||
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
|
||||
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
|
||||
15.2.1544.9; Wed, 18 Sep 2024 14:21:06 -0700
|
||||
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
To: <ath12k@lists.infradead.org>
|
||||
CC: <linux-wireless@vger.kernel.org>,
|
||||
Pradeep Kumar Chitrapu
|
||||
<quic_pradeepc@quicinc.com>,
|
||||
Muna Sinada <quic_msinada@quicinc.com>,
|
||||
"Jeff
|
||||
Johnson" <quic_jjohnson@quicinc.com>
|
||||
Subject: [PATCH V8 2/9] wifi: ath12k: push EHT MU-MIMO params to hardware
|
||||
Date: Wed, 18 Sep 2024 14:20:49 -0700
|
||||
Message-ID: <20240918212056.4137076-3-quic_pradeepc@quicinc.com>
|
||||
X-Mailer: git-send-email 2.34.1
|
||||
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196)
|
||||
X-QCInternal: smtphost
|
||||
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
|
||||
signatures=585085
|
||||
X-Proofpoint-GUID: DiIEaDHD4453WG2b31qitb3_i0JkAM4u
|
||||
X-Proofpoint-ORIG-GUID: DiIEaDHD4453WG2b31qitb3_i0JkAM4u
|
||||
X-Proofpoint-Virus-Version: vendor=baseguard
|
||||
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
|
||||
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
|
||||
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
|
||||
bulkscore=0 adultscore=0
|
||||
suspectscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0
|
||||
phishscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501
|
||||
spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1
|
||||
engine=8.19.0-2408220000 definitions=main-2409180140
|
||||
|
||||
Currently, only the EHT IE in management frames is updated with
|
||||
respect to MU-MIMO configurations, but this change is not
|
||||
reflected in the hardware. Add support to propagate MU-MIMO
|
||||
configurations to the hardware as well for AP mode. Similar
|
||||
support for STA mode will be added in future.
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/mac.c | 50 +++++++++++++++++++++++++++
|
||||
drivers/net/wireless/ath/ath12k/wmi.h | 21 +++++++++++
|
||||
2 files changed, 71 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -2953,6 +2953,50 @@ static int ath12k_mac_vif_recalc_sta_he_
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int ath12k_mac_set_eht_txbf_conf(struct ath12k_vif *arvif)
|
||||
+{
|
||||
+ u32 param = WMI_VDEV_PARAM_SET_EHT_MU_MODE;
|
||||
+ struct ath12k *ar = arvif->ar;
|
||||
+ u32 value = 0;
|
||||
+ int ret;
|
||||
+
|
||||
+ if (!arvif->vif->bss_conf.eht_support)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.eht_su_beamformer) {
|
||||
+ value |= u32_encode_bits(EHT_SU_BFER_ENABLE, EHT_MODE_SU_TX_BFER);
|
||||
+ if (arvif->vif->bss_conf.eht_mu_beamformer &&
|
||||
+ arvif->vdev_type == WMI_VDEV_TYPE_AP)
|
||||
+ value |= u32_encode_bits(EHT_MU_BFER_ENABLE,
|
||||
+ EHT_MODE_MU_TX_BFER) |
|
||||
+ u32_encode_bits(EHT_DL_MUOFDMA_ENABLE,
|
||||
+ EHT_MODE_DL_OFDMA_MUMIMO) |
|
||||
+ u32_encode_bits(EHT_UL_MUOFDMA_ENABLE,
|
||||
+ EHT_MODE_UL_OFDMA_MUMIMO);
|
||||
+ }
|
||||
+
|
||||
+ if (arvif->vif->type != NL80211_IFTYPE_MESH_POINT) {
|
||||
+ value |= u32_encode_bits(EHT_DL_MUOFDMA_ENABLE, EHT_MODE_DL_OFDMA) |
|
||||
+ u32_encode_bits(EHT_UL_MUOFDMA_ENABLE, EHT_MODE_UL_OFDMA);
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.eht_80mhz_full_bw_ul_mumimo)
|
||||
+ value |= u32_encode_bits(EHT_UL_MUMIMO_ENABLE, EHT_MODE_MUMIMO);
|
||||
+
|
||||
+ if (arvif->vif->bss_conf.eht_su_beamformee)
|
||||
+ value |= u32_encode_bits(EHT_SU_BFEE_ENABLE,
|
||||
+ EHT_MODE_SU_TX_BFEE);
|
||||
+ }
|
||||
+
|
||||
+ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param, value);
|
||||
+ if (ret) {
|
||||
+ ath12k_warn(ar->ab, "failed to set vdev %d EHT MU mode: %d\n",
|
||||
+ arvif->vdev_id, ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void ath12k_bss_assoc(struct ath12k *ar,
|
||||
struct ath12k_vif *arvif,
|
||||
struct ieee80211_bss_conf *bss_conf)
|
||||
@@ -3351,6 +3395,12 @@ static void ath12k_mac_bss_info_changed(
|
||||
ath12k_warn(ar->ab,
|
||||
"failed to set HE TXBF config for vdev: %d\n",
|
||||
arvif->vdev_id);
|
||||
+
|
||||
+ ret = ath12k_mac_set_eht_txbf_conf(arvif);
|
||||
+ if (ret)
|
||||
+ ath12k_warn(ar->ab,
|
||||
+ "failed to set EHT TXBF config for vdev: %d\n",
|
||||
+ arvif->vdev_id);
|
||||
}
|
||||
ath12k_control_beaconing(arvif, info);
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
@@ -1139,6 +1139,7 @@ enum wmi_tlv_vdev_param {
|
||||
WMI_VDEV_PARAM_BSS_COLOR,
|
||||
WMI_VDEV_PARAM_SET_HEMU_MODE,
|
||||
WMI_VDEV_PARAM_HEOPS_0_31 = 0x8003,
|
||||
+ WMI_VDEV_PARAM_SET_EHT_MU_MODE = 0x8005,
|
||||
};
|
||||
|
||||
enum wmi_tlv_peer_flags {
|
||||
@@ -3012,6 +3013,26 @@ struct ath12k_wmi_rx_reorder_queue_remov
|
||||
#define HE_MU_BFER_ENABLE 1
|
||||
#define HE_SU_BFER_ENABLE 1
|
||||
|
||||
+#define EHT_MODE_SU_TX_BFEE BIT(0)
|
||||
+#define EHT_MODE_SU_TX_BFER BIT(1)
|
||||
+#define EHT_MODE_MU_TX_BFEE BIT(2)
|
||||
+#define EHT_MODE_MU_TX_BFER BIT(3)
|
||||
+#define EHT_MODE_DL_OFDMA BIT(4)
|
||||
+#define EHT_MODE_UL_OFDMA BIT(5)
|
||||
+#define EHT_MODE_MUMIMO BIT(6)
|
||||
+#define EHT_MODE_DL_OFDMA_TXBF BIT(7)
|
||||
+#define EHT_MODE_DL_OFDMA_MUMIMO BIT(8)
|
||||
+#define EHT_MODE_UL_OFDMA_MUMIMO BIT(9)
|
||||
+
|
||||
+#define EHT_DL_MUOFDMA_ENABLE 1
|
||||
+#define EHT_UL_MUOFDMA_ENABLE 1
|
||||
+#define EHT_DL_MUMIMO_ENABLE 1
|
||||
+#define EHT_UL_MUMIMO_ENABLE 1
|
||||
+#define EHT_MU_BFEE_ENABLE 1
|
||||
+#define EHT_SU_BFEE_ENABLE 1
|
||||
+#define EHT_MU_BFER_ENABLE 1
|
||||
+#define EHT_SU_BFER_ENABLE 1
|
||||
+
|
||||
#define HE_VHT_SOUNDING_MODE_ENABLE 1
|
||||
#define HE_SU_MU_SOUNDING_MODE_ENABLE 1
|
||||
#define HE_TRIG_NONTRIG_SOUNDING_MODE_ENABLE 1
|
@ -1,162 +0,0 @@
|
||||
From patchwork Wed Sep 18 21:20:50 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
X-Patchwork-Id: 13807213
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com
|
||||
[205.220.180.131])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B2B11CB312
|
||||
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:14 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=205.220.180.131
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1726694475; cv=none;
|
||||
b=uo8JC/iAnxSCZyXzNFarViwWJNwY+JldG9aDgn6LOK7yCxMusODCN3rw4mSCs0sLxHrfxFouDKWpiKeM7hGb/fzQzU2eh6bHNvzhjOqaTjAsJo7sVGj4L2QK1UPb2ZxMke35L51ztNTVhAc7IS17sn6blDZnU+1+RGRKXskHc78=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1726694475; c=relaxed/simple;
|
||||
bh=nhEu2OadboIpWVwShgMmYabjiVuEo2mUKJhJlcUzvgI=;
|
||||
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
|
||||
MIME-Version:Content-Type;
|
||||
b=iPc43CIgA4O9RfgxO3cfBBvDShW3nh4Q/MVoL1JTtx8u/9t1CeFY7KstjtKiPdJ6vxx0yhZwXcwCRFfbZdfRduyybDRKPmgqN/VogzkwizBSFWBL41H02pCvee2mV3poTyZz9CnCJ5L7An5k7ARI3Eo6EwsgaAYIncO/tU2Jsao=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com;
|
||||
spf=pass smtp.mailfrom=quicinc.com;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b=iXyzdRBT; arc=none smtp.client-ip=205.220.180.131
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b="iXyzdRBT"
|
||||
Received: from pps.filterd (m0279869.ppops.net [127.0.0.1])
|
||||
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
|
||||
48I90GrT001584;
|
||||
Wed, 18 Sep 2024 21:21:09 GMT
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
|
||||
cc:content-transfer-encoding:content-type:date:from:in-reply-to
|
||||
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
|
||||
aj0umwCwR0cGrc/Vc7qz7QRYcnU4amMo6KwLL9RZRaA=; b=iXyzdRBTMie5qv2n
|
||||
KocnG3cRtZjxDUMbNTj+in3o4zrIU5RFumLb3ZmgpbCZD9jcmxkc9fcTdtwxUz8e
|
||||
LTodO1mKSkqtOufy45keXIYYJN3lxfFsZtA5bcmG+QCJZJmPaTpMaf9L9Us9e+JZ
|
||||
Ngjh4JNR3UIXn5+UvNGrRNEWeAlCrwf9Z5bWl1mQmwmkVVuH3nMu1IyPidF3tzRk
|
||||
AdQTPkPtpnoGlYwEWL/noPAYTf4OuZrqPCAj31iBfZvq2RjAdWtPx/ayYEQsNKCu
|
||||
xoBLKjb8hppxfGqn06TpV73nTxvhEDwnwBTwfgrr+xVeKvwz6Mrh8aoYBdUeFUAh
|
||||
OiuxDA==
|
||||
Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com
|
||||
[129.46.96.20])
|
||||
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4hf38cn-1
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:08 +0000 (GMT)
|
||||
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
|
||||
[10.47.209.196])
|
||||
by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
|
||||
48ILL7e8005093
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:07 GMT
|
||||
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
|
||||
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
|
||||
15.2.1544.9; Wed, 18 Sep 2024 14:21:07 -0700
|
||||
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
To: <ath12k@lists.infradead.org>
|
||||
CC: <linux-wireless@vger.kernel.org>,
|
||||
Pradeep Kumar Chitrapu
|
||||
<quic_pradeepc@quicinc.com>,
|
||||
Muna Sinada <quic_msinada@quicinc.com>,
|
||||
"Jeff
|
||||
Johnson" <quic_jjohnson@quicinc.com>
|
||||
Subject: [PATCH V8 3/9] wifi: ath12k: move HE MCS mapper to a separate
|
||||
function
|
||||
Date: Wed, 18 Sep 2024 14:20:50 -0700
|
||||
Message-ID: <20240918212056.4137076-4-quic_pradeepc@quicinc.com>
|
||||
X-Mailer: git-send-email 2.34.1
|
||||
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196)
|
||||
X-QCInternal: smtphost
|
||||
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
|
||||
signatures=585085
|
||||
X-Proofpoint-ORIG-GUID: zHmCiFNBcWNOH7v_I9cuj0l6gmfKvBVa
|
||||
X-Proofpoint-GUID: zHmCiFNBcWNOH7v_I9cuj0l6gmfKvBVa
|
||||
X-Proofpoint-Virus-Version: vendor=baseguard
|
||||
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
|
||||
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
|
||||
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
|
||||
priorityscore=1501 mlxscore=0
|
||||
suspectscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015
|
||||
mlxlogscore=999 adultscore=0 malwarescore=0 phishscore=0 impostorscore=0
|
||||
classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000
|
||||
definitions=main-2409180140
|
||||
|
||||
Refactor the HE MCS mapper functionality in
|
||||
ath12k_mac_copy_he_cap() into a new function.
|
||||
|
||||
This helps improve readability, extensibility and will be used
|
||||
when adding support for 160 MHz bandwidth in subsequent patches.
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/mac.c | 22 ++++++++++++++--------
|
||||
1 file changed, 14 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -5519,12 +5519,24 @@ static __le16 ath12k_mac_setup_he_6ghz_c
|
||||
return cpu_to_le16(bcap->he_6ghz_capa);
|
||||
}
|
||||
|
||||
+static void ath12k_mac_set_hemcsmap(struct ath12k_band_cap *band_cap,
|
||||
+ struct ieee80211_sta_he_cap *he_cap)
|
||||
+{
|
||||
+ struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
|
||||
+
|
||||
+ mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
+ mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
+ mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+}
|
||||
+
|
||||
static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap,
|
||||
int iftype, u8 num_tx_chains,
|
||||
struct ieee80211_sta_he_cap *he_cap)
|
||||
{
|
||||
struct ieee80211_he_cap_elem *he_cap_elem = &he_cap->he_cap_elem;
|
||||
- struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
|
||||
|
||||
he_cap->has_he = true;
|
||||
memcpy(he_cap_elem->mac_cap_info, band_cap->he_cap_info,
|
||||
@@ -5562,13 +5574,7 @@ static void ath12k_mac_copy_he_cap(struc
|
||||
break;
|
||||
}
|
||||
|
||||
- mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
- mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
- mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
- mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
- mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
- mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
-
|
||||
+ ath12k_mac_set_hemcsmap(band_cap, he_cap);
|
||||
memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
|
||||
if (he_cap_elem->phy_cap_info[6] &
|
||||
IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT)
|
@ -1,186 +0,0 @@
|
||||
From patchwork Wed Sep 18 21:20:51 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
X-Patchwork-Id: 13807215
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com
|
||||
[205.220.180.131])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A88651CB32C
|
||||
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:14 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=205.220.180.131
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1726694476; cv=none;
|
||||
b=Lkqx2oSLyeGRxKcm+N4Vmg+KOuwHpt6xhgWj9SpyWNXxxWkVExVyHvPrWaP/u4OXd0YjYBJC3Dg0NJYY9WJyL0A3RP8GK++s9CiRloNaEmEjI71S/f3+0HVXu5bCmi8cyiIMFzCpAcNuZ67J7r/WxvNRbeox3iZHmXK1WFUb4Hs=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1726694476; c=relaxed/simple;
|
||||
bh=nv4kc89H7eGC0FLgCwC70zFDhNkClMNiRf5HjDZHHuQ=;
|
||||
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
|
||||
MIME-Version:Content-Type;
|
||||
b=B1oJWv7vHZKRChjamOFJnRzQVtL7qBs7/Ho9GojLQtHyCKtrCEOJt/lWvhkqISf48/5MaQOCdkHhCrQT/eHP9hZ1wnCdeOKXh6Wmk/QYt9yEcc0X6HT5wUxgpaA3PooH/cMlJCX0c8hyhT7XBm6vWnPwQjt/FnLTubA3uj+X8oE=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com;
|
||||
spf=pass smtp.mailfrom=quicinc.com;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b=WweZPnje; arc=none smtp.client-ip=205.220.180.131
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b="WweZPnje"
|
||||
Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
|
||||
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
|
||||
48IACJst031540;
|
||||
Wed, 18 Sep 2024 21:21:09 GMT
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
|
||||
cc:content-transfer-encoding:content-type:date:from:in-reply-to
|
||||
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
|
||||
ARu9Fu0s66NeuLm2pdCBchANS+rlgd275Q/E4KE2T1o=; b=WweZPnjehL/ZQW57
|
||||
4JHJDsl8A5hyljMaJrVPdmZwNktTurJPMpD5z0akqx2dq3bfjzx2rx5NAtMb831x
|
||||
ieysvT1ApK5V32fmb9xzG7FMIU3DH4eqr/9ApZbHFVPTglHrVoVzHJLps3I+Ts5P
|
||||
gi1dsIAdwTai7hW1FchcW/pZ2kJMq6zN7oljoFs7pc1CvzHfIJowQM8gFfslkqlL
|
||||
lvm9A9knvnUlkrEvzgpoZfZxm/91t9bQzkQDTX91wRc0oGR/9liT+z4Sdum2rLwb
|
||||
fri8rhQIw8w1ExGM1nzChPaajmDIsE86ODjDL2xBbd/DcdsVvOYl8ewJ8AX45qNs
|
||||
+LpHtg==
|
||||
Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com
|
||||
[129.46.96.20])
|
||||
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4j6uagq-1
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:09 +0000 (GMT)
|
||||
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
|
||||
[10.47.209.196])
|
||||
by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
|
||||
48ILL8gM005103
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:08 GMT
|
||||
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
|
||||
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
|
||||
15.2.1544.9; Wed, 18 Sep 2024 14:21:07 -0700
|
||||
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
To: <ath12k@lists.infradead.org>
|
||||
CC: <linux-wireless@vger.kernel.org>,
|
||||
Pradeep Kumar Chitrapu
|
||||
<quic_pradeepc@quicinc.com>,
|
||||
Muna Sinada <quic_msinada@quicinc.com>,
|
||||
"Jeff
|
||||
Johnson" <quic_jjohnson@quicinc.com>
|
||||
Subject: [PATCH V8 4/9] wifi: ath12k: generate rx and tx mcs maps for
|
||||
supported HE mcs
|
||||
Date: Wed, 18 Sep 2024 14:20:51 -0700
|
||||
Message-ID: <20240918212056.4137076-5-quic_pradeepc@quicinc.com>
|
||||
X-Mailer: git-send-email 2.34.1
|
||||
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196)
|
||||
X-QCInternal: smtphost
|
||||
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
|
||||
signatures=585085
|
||||
X-Proofpoint-ORIG-GUID: wHJ63GZpWGKZ4XSyQZiVlsARNAgr5CQM
|
||||
X-Proofpoint-GUID: wHJ63GZpWGKZ4XSyQZiVlsARNAgr5CQM
|
||||
X-Proofpoint-Virus-Version: vendor=baseguard
|
||||
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
|
||||
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
|
||||
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
|
||||
phishscore=0 mlxlogscore=999
|
||||
mlxscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 clxscore=1015
|
||||
adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0
|
||||
classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000
|
||||
definitions=main-2409180140
|
||||
|
||||
Generate rx and tx mcs maps in ath12k_mac_set_hemcsmap() based
|
||||
on number of supported tx/rx chains and set them in supported
|
||||
mcs/nss for HE capabilities.
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Co-developed-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
|
||||
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/mac.c | 40 ++++++++++++++++++++-------
|
||||
1 file changed, 30 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -5519,20 +5519,40 @@ static __le16 ath12k_mac_setup_he_6ghz_c
|
||||
return cpu_to_le16(bcap->he_6ghz_capa);
|
||||
}
|
||||
|
||||
-static void ath12k_mac_set_hemcsmap(struct ath12k_band_cap *band_cap,
|
||||
+static void ath12k_mac_set_hemcsmap(struct ath12k *ar,
|
||||
+ struct ath12k_pdev_cap *cap,
|
||||
struct ieee80211_sta_he_cap *he_cap)
|
||||
{
|
||||
struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
|
||||
+ u16 txmcs_map, rxmcs_map;
|
||||
+ u32 i;
|
||||
|
||||
- mcs_nss->rx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
- mcs_nss->tx_mcs_80 = cpu_to_le16(band_cap->he_mcs & 0xffff);
|
||||
- mcs_nss->rx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
- mcs_nss->tx_mcs_160 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
- mcs_nss->rx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
- mcs_nss->tx_mcs_80p80 = cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
|
||||
+ 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))
|
||||
+ txmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
|
||||
+ else
|
||||
+ txmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
|
||||
+
|
||||
+ if (i < ar->num_rx_chains &&
|
||||
+ (ar->cfg_rx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
|
||||
+ rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
|
||||
+ else
|
||||
+ rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
|
||||
+ }
|
||||
+
|
||||
+ mcs_nss->rx_mcs_80 = cpu_to_le16(rxmcs_map & 0xffff);
|
||||
+ mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff);
|
||||
+ mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff);
|
||||
+ mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff);
|
||||
+ mcs_nss->rx_mcs_80p80 = cpu_to_le16(rxmcs_map & 0xffff);
|
||||
+ mcs_nss->tx_mcs_80p80 = cpu_to_le16(txmcs_map & 0xffff);
|
||||
}
|
||||
|
||||
-static void ath12k_mac_copy_he_cap(struct ath12k_band_cap *band_cap,
|
||||
+static void ath12k_mac_copy_he_cap(struct ath12k *ar,
|
||||
+ struct ath12k_band_cap *band_cap,
|
||||
int iftype, u8 num_tx_chains,
|
||||
struct ieee80211_sta_he_cap *he_cap)
|
||||
{
|
||||
@@ -5574,7 +5594,7 @@ static void ath12k_mac_copy_he_cap(struc
|
||||
break;
|
||||
}
|
||||
|
||||
- ath12k_mac_set_hemcsmap(band_cap, he_cap);
|
||||
+ ath12k_mac_set_hemcsmap(ar, &ar->pdev->cap, he_cap);
|
||||
memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
|
||||
if (he_cap_elem->phy_cap_info[6] &
|
||||
IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT)
|
||||
@@ -5763,7 +5783,7 @@ static int ath12k_mac_copy_sband_iftype_
|
||||
|
||||
data[idx].types_mask = BIT(i);
|
||||
|
||||
- ath12k_mac_copy_he_cap(band_cap, i, ar->num_tx_chains, he_cap);
|
||||
+ ath12k_mac_copy_he_cap(ar, band_cap, i, ar->num_tx_chains, he_cap);
|
||||
if (band == NL80211_BAND_6GHZ) {
|
||||
data[idx].he_6ghz_capa.capa =
|
||||
ath12k_mac_setup_he_6ghz_cap(cap, band_cap);
|
@ -1,141 +0,0 @@
|
||||
From patchwork Wed Sep 18 21:20:52 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
X-Patchwork-Id: 13807211
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
|
||||
[205.220.168.131])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77FB41CA6AC
|
||||
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:13 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=205.220.168.131
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1726694475; cv=none;
|
||||
b=RN/ddoo5Vh8RVGeYZ8k8lXTOb7bzs7wSIAQGFjyvpfc9NICOpTDXpM3ai/D/fFtXLR8mFmYa4uIMFdrWML1x/UjZtd+jJnNyL/jo4/t5+ONN0nU4brd/dW7fv/biqLA6CkFbjnw01XnInXLzGT8IIm4NvxBkMy/RVj0tC33y7os=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1726694475; c=relaxed/simple;
|
||||
bh=bsvgv033jSAPUVmS0VlMcScTn/1aM6tw3aACOOiqxvA=;
|
||||
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
|
||||
MIME-Version:Content-Type;
|
||||
b=rDT2TKhzEg9vR1RSVstUP/e9Z+sWhPbag7vxjm3nmkSJBFS5bR72jSO3YnpEGSQLOgd0c+ou8ce0GQOHHZBEpr8VlMP4o6SK8T3BVg4yPiHhqLzwadektVXzAofZ0K+caSvYUjsPvDd2wH1xDyUPHgvr/DjsPh8bhO1MP80pTYk=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com;
|
||||
spf=pass smtp.mailfrom=quicinc.com;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b=DbZeRJ9u; arc=none smtp.client-ip=205.220.168.131
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b="DbZeRJ9u"
|
||||
Received: from pps.filterd (m0279867.ppops.net [127.0.0.1])
|
||||
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
|
||||
48I9TNqc020283;
|
||||
Wed, 18 Sep 2024 21:21:09 GMT
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
|
||||
cc:content-transfer-encoding:content-type:date:from:in-reply-to
|
||||
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
|
||||
azR+5F3oXqRD0oIXJq+q0F3HbuiVUYwPuvX5vVskhnw=; b=DbZeRJ9uo40mL5rR
|
||||
p0cASEsdLU8yr/aYeIXTSWCHBf5P73m5S26EYVv6MqTdcnmRT7flYyQWzotNV+gg
|
||||
oHJpR7L5sN+omhK+7gDPRcm5j29/U9+7rMG7I0JwrfR6KbUUNJkrg+omW45ZdRPS
|
||||
/92XJynSBDgzEGETs0AjLe+PLPW4Ucnncc+YscEVm/dtR4f5vQBYwGdCwv4IuczO
|
||||
FJrEmDh3mj7m6JtNVV+A3LT5qS7PCAbiS7qhTAkDfhH9gDZJuUTO2b6ByyO4UkWp
|
||||
afB41wIc4KUDYsTHkThkApxxp0vHfJJLGCweUi+YKYaqvQETgLhHx/UkSRdoRBII
|
||||
N708pg==
|
||||
Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com
|
||||
[129.46.96.20])
|
||||
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4kjk65m-1
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:09 +0000 (GMT)
|
||||
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
|
||||
[10.47.209.196])
|
||||
by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
|
||||
48ILL8Gi009579
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:08 GMT
|
||||
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
|
||||
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
|
||||
15.2.1544.9; Wed, 18 Sep 2024 14:21:08 -0700
|
||||
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
To: <ath12k@lists.infradead.org>
|
||||
CC: <linux-wireless@vger.kernel.org>,
|
||||
Pradeep Kumar Chitrapu
|
||||
<quic_pradeepc@quicinc.com>,
|
||||
Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Subject: [PATCH V8 5/9] wifi: ath12k: fix TX and RX MCS rate configurations in
|
||||
HE mode
|
||||
Date: Wed, 18 Sep 2024 14:20:52 -0700
|
||||
Message-ID: <20240918212056.4137076-6-quic_pradeepc@quicinc.com>
|
||||
X-Mailer: git-send-email 2.34.1
|
||||
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196)
|
||||
X-QCInternal: smtphost
|
||||
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
|
||||
signatures=585085
|
||||
X-Proofpoint-GUID: JNJY4yItbZ8HP8WQjm82lNqNLkxUdf1v
|
||||
X-Proofpoint-ORIG-GUID: JNJY4yItbZ8HP8WQjm82lNqNLkxUdf1v
|
||||
X-Proofpoint-Virus-Version: vendor=baseguard
|
||||
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
|
||||
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
|
||||
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
|
||||
bulkscore=0 adultscore=0
|
||||
suspectscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0
|
||||
phishscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501
|
||||
spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1
|
||||
engine=8.19.0-2408220000 definitions=main-2409180140
|
||||
|
||||
Currently, the TX and RX MCS rate configurations per peer are
|
||||
reversed when sent to the firmware. As a result, RX MCS rates
|
||||
are configured for TX, and vice versa. This commit rectifies
|
||||
the configuration to match what the firmware expects.
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
|
||||
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/wmi.c | 4 ++--
|
||||
drivers/net/wireless/ath/ath12k/wmi.h | 2 ++
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
@@ -2140,8 +2140,8 @@ int ath12k_wmi_send_peer_assoc_cmd(struc
|
||||
he_mcs->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_HE_RATE_SET,
|
||||
sizeof(*he_mcs));
|
||||
|
||||
- he_mcs->rx_mcs_set = cpu_to_le32(arg->peer_he_rx_mcs_set[i]);
|
||||
- he_mcs->tx_mcs_set = cpu_to_le32(arg->peer_he_tx_mcs_set[i]);
|
||||
+ he_mcs->rx_mcs_set = cpu_to_le32(arg->peer_he_tx_mcs_set[i]);
|
||||
+ he_mcs->tx_mcs_set = cpu_to_le32(arg->peer_he_rx_mcs_set[i]);
|
||||
ptr += sizeof(*he_mcs);
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
@@ -3953,7 +3953,9 @@ struct ath12k_wmi_vht_rate_set_params {
|
||||
|
||||
struct ath12k_wmi_he_rate_set_params {
|
||||
__le32 tlv_header;
|
||||
+ /* MCS at which the peer can receive */
|
||||
__le32 rx_mcs_set;
|
||||
+ /* MCS at which the peer can transmit */
|
||||
__le32 tx_mcs_set;
|
||||
} __packed;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,254 +0,0 @@
|
||||
From patchwork Wed Sep 18 21:20:54 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
X-Patchwork-Id: 13807218
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
|
||||
[205.220.168.131])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7A2C15853D
|
||||
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:29 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=205.220.168.131
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1726694491; cv=none;
|
||||
b=IDDUnQF/Tnpw/FvWitX7ofLgG/RwY2FyN79K1j9v3STIk2mbRSVtS7kUmHv83gWDgLeingrnJyz3kE7pWhAK5Zt+U/d3HoSbyXlaWdr1m98ZLPJnOIO51q8LBaUW4uPaZbMJiRGvTbhFw+0k6FNjQse034o2zQ5vHk1qETT9XsU=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1726694491; c=relaxed/simple;
|
||||
bh=4Sbgjg6TXf4A547Y46Qiyw4U55YEFrIGdUXLZjEx5C0=;
|
||||
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
|
||||
MIME-Version:Content-Type;
|
||||
b=Y+NDqrjfpb1iFWpY9XYrVbCXhYRTFGsK7MN6jcsgZur7Ro+ZQsyZfhkFA+t+Bb52hk2p2N7v1TAdqLDK2CiFXaWPy/JfESHATwktCnNG+8/UL3n0VIjl+qxGTWt3pS/aWzI6yQjM2FB6tKc4kMnGX//RrgXhEIrh1M4ROs3IpJ0=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com;
|
||||
spf=pass smtp.mailfrom=quicinc.com;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b=Kt1nBSex; arc=none smtp.client-ip=205.220.168.131
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b="Kt1nBSex"
|
||||
Received: from pps.filterd (m0279866.ppops.net [127.0.0.1])
|
||||
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
|
||||
48IJrYUI005813;
|
||||
Wed, 18 Sep 2024 21:21:27 GMT
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
|
||||
cc:content-transfer-encoding:content-type:date:from:in-reply-to
|
||||
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
|
||||
7iZtYFy4NRmF2YHXqLd4zDMUbigsFxIkBQ6OeDD3zOs=; b=Kt1nBSex9R0mUQFv
|
||||
fimFwEUDD2mzhj9KyoJnJsvbpzJOV9sBCCp3nPyxHNB66qzQUi/U904HE+wQ26S+
|
||||
Dmo2aGOzcx4GHLU8agTSdb51h1ylcD1ulUXKpEqDIEkWv7leWNteXYTqoj2aUvXQ
|
||||
MH261Yr4HRs5iWT53+FXUrPvY1eipkyG20XH2RcNT7XMMIT29hm5DRVTwU0kzAVU
|
||||
/0hrrSBcgbTJP0KA5zSfO+bFE7fyWSxrjOzt7ugW9KdHlAj5iNAeePRUUlvqSGe7
|
||||
07QprF1ixgWWpsIbUnZdd9UZLPKot8h5Vous/24QLAznqmj/FgipHLT6+Dy61eVq
|
||||
L/T40w==
|
||||
Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com
|
||||
[129.46.96.20])
|
||||
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4jdu9q1-1
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:27 +0000 (GMT)
|
||||
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
|
||||
[10.47.209.196])
|
||||
by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
|
||||
48ILL9Ux020570
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:09 GMT
|
||||
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
|
||||
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
|
||||
15.2.1544.9; Wed, 18 Sep 2024 14:21:08 -0700
|
||||
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
To: <ath12k@lists.infradead.org>
|
||||
CC: <linux-wireless@vger.kernel.org>,
|
||||
Pradeep Kumar Chitrapu
|
||||
<quic_pradeepc@quicinc.com>,
|
||||
Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Subject: [PATCH V8 7/9] wifi: ath12k: clean up 80P80 support
|
||||
Date: Wed, 18 Sep 2024 14:20:54 -0700
|
||||
Message-ID: <20240918212056.4137076-8-quic_pradeepc@quicinc.com>
|
||||
X-Mailer: git-send-email 2.34.1
|
||||
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196)
|
||||
X-QCInternal: smtphost
|
||||
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
|
||||
signatures=585085
|
||||
X-Proofpoint-ORIG-GUID: zOl2cVhwvoAFaH70WioUIdrk_oIr5c-T
|
||||
X-Proofpoint-GUID: zOl2cVhwvoAFaH70WioUIdrk_oIr5c-T
|
||||
X-Proofpoint-Virus-Version: vendor=baseguard
|
||||
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
|
||||
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
|
||||
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
|
||||
phishscore=0 impostorscore=0
|
||||
clxscore=1015 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0
|
||||
priorityscore=1501 spamscore=0 bulkscore=0 lowpriorityscore=0
|
||||
mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1
|
||||
engine=8.19.0-2408220000 definitions=main-2409180141
|
||||
|
||||
Clean up unused 80P80 references as hardware does not support
|
||||
it. This is applicable to both QCN9274 and WCN7850.
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/mac.c | 51 ++++++---------------------
|
||||
drivers/net/wireless/ath/ath12k/wmi.c | 5 +--
|
||||
drivers/net/wireless/ath/ath12k/wmi.h | 1 -
|
||||
3 files changed, 11 insertions(+), 46 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -206,7 +206,7 @@ ath12k_phymodes[NUM_NL80211_BANDS][ATH12
|
||||
[NL80211_CHAN_WIDTH_40] = MODE_11BE_EHT40,
|
||||
[NL80211_CHAN_WIDTH_80] = MODE_11BE_EHT80,
|
||||
[NL80211_CHAN_WIDTH_160] = MODE_11BE_EHT160,
|
||||
- [NL80211_CHAN_WIDTH_80P80] = MODE_11BE_EHT80_80,
|
||||
+ [NL80211_CHAN_WIDTH_80P80] = MODE_UNKNOWN,
|
||||
[NL80211_CHAN_WIDTH_320] = MODE_11BE_EHT320,
|
||||
},
|
||||
[NL80211_BAND_6GHZ] = {
|
||||
@@ -217,7 +217,7 @@ ath12k_phymodes[NUM_NL80211_BANDS][ATH12
|
||||
[NL80211_CHAN_WIDTH_40] = MODE_11BE_EHT40,
|
||||
[NL80211_CHAN_WIDTH_80] = MODE_11BE_EHT80,
|
||||
[NL80211_CHAN_WIDTH_160] = MODE_11BE_EHT160,
|
||||
- [NL80211_CHAN_WIDTH_80P80] = MODE_11BE_EHT80_80,
|
||||
+ [NL80211_CHAN_WIDTH_80P80] = MODE_UNKNOWN,
|
||||
[NL80211_CHAN_WIDTH_320] = MODE_11BE_EHT320,
|
||||
},
|
||||
|
||||
@@ -2390,17 +2390,6 @@ static void ath12k_peer_assoc_h_he(struc
|
||||
|
||||
switch (sta->deflink.bandwidth) {
|
||||
case IEEE80211_STA_RX_BW_160:
|
||||
- if (he_cap->he_cap_elem.phy_cap_info[0] &
|
||||
- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) {
|
||||
- v = ath12k_peer_assoc_h_he_limit(v, he_mcs_mask);
|
||||
- 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);
|
||||
- arg->peer_he_tx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80_80] = v;
|
||||
-
|
||||
- arg->peer_he_mcs_count++;
|
||||
- he_tx_mcs = v;
|
||||
- }
|
||||
v = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_160);
|
||||
arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_160] = v;
|
||||
|
||||
@@ -2658,16 +2647,11 @@ static enum wmi_phy_mode ath12k_mac_get_
|
||||
struct ieee80211_sta *sta)
|
||||
{
|
||||
if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) {
|
||||
- switch (sta->deflink.vht_cap.cap &
|
||||
- IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) {
|
||||
- case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ:
|
||||
+ if (sta->deflink.vht_cap.cap &
|
||||
+ IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ)
|
||||
return MODE_11AC_VHT160;
|
||||
- case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ:
|
||||
- return MODE_11AC_VHT80_80;
|
||||
- default:
|
||||
- /* not sure if this is a valid case? */
|
||||
- return MODE_11AC_VHT160;
|
||||
- }
|
||||
+
|
||||
+ return MODE_UNKNOWN;
|
||||
}
|
||||
|
||||
if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80)
|
||||
@@ -2689,11 +2673,8 @@ static enum wmi_phy_mode ath12k_mac_get_
|
||||
if (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0] &
|
||||
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G)
|
||||
return MODE_11AX_HE160;
|
||||
- else if (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0] &
|
||||
- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
|
||||
- return MODE_11AX_HE80_80;
|
||||
- /* not sure if this is a valid case? */
|
||||
- return MODE_11AX_HE160;
|
||||
+
|
||||
+ return MODE_UNKNOWN;
|
||||
}
|
||||
|
||||
if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80)
|
||||
@@ -2721,14 +2702,7 @@ static enum wmi_phy_mode ath12k_mac_get_
|
||||
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G)
|
||||
return MODE_11BE_EHT160;
|
||||
|
||||
- if (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0] &
|
||||
- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
|
||||
- return MODE_11BE_EHT80_80;
|
||||
-
|
||||
- ath12k_warn(ar->ab, "invalid EHT PHY capability info for 160 Mhz: %d\n",
|
||||
- sta->deflink.he_cap.he_cap_elem.phy_cap_info[0]);
|
||||
-
|
||||
- return MODE_11BE_EHT160;
|
||||
+ return MODE_UNKNOWN;
|
||||
}
|
||||
|
||||
if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80)
|
||||
@@ -5806,8 +5780,6 @@ static void ath12k_mac_set_hemcsmap(stru
|
||||
mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff);
|
||||
mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff);
|
||||
mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff);
|
||||
- mcs_nss->rx_mcs_80p80 = cpu_to_le16(rxmcs_map & 0xffff);
|
||||
- mcs_nss->tx_mcs_80p80 = cpu_to_le16(txmcs_map & 0xffff);
|
||||
}
|
||||
|
||||
static void ath12k_mac_copy_he_cap(struct ath12k *ar,
|
||||
@@ -5829,6 +5801,7 @@ static void ath12k_mac_copy_he_cap(struc
|
||||
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G |
|
||||
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G |
|
||||
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G;
|
||||
+ /* 80PLUS80 is not supported */
|
||||
he_cap_elem->phy_cap_info[0] &=
|
||||
~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G;
|
||||
he_cap_elem->phy_cap_info[5] &=
|
||||
@@ -8495,10 +8468,6 @@ static __le16
|
||||
ath12k_mac_get_tx_mcs_map(const struct ieee80211_sta_he_cap *he_cap)
|
||||
{
|
||||
if (he_cap->he_cap_elem.phy_cap_info[0] &
|
||||
- IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G)
|
||||
- return he_cap->he_mcs_nss_supp.tx_mcs_80p80;
|
||||
-
|
||||
- if (he_cap->he_cap_elem.phy_cap_info[0] &
|
||||
IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G)
|
||||
return he_cap->he_mcs_nss_supp.tx_mcs_160;
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
@@ -986,10 +986,7 @@ static void ath12k_wmi_put_wmi_channel(s
|
||||
|
||||
chan->mhz = cpu_to_le32(arg->freq);
|
||||
chan->band_center_freq1 = cpu_to_le32(arg->band_center_freq1);
|
||||
- if (arg->mode == MODE_11AC_VHT80_80)
|
||||
- chan->band_center_freq2 = cpu_to_le32(arg->band_center_freq2);
|
||||
- else
|
||||
- chan->band_center_freq2 = 0;
|
||||
+ chan->band_center_freq2 = 0;
|
||||
|
||||
chan->info |= le32_encode_bits(arg->mode, WMI_CHAN_INFO_MODE);
|
||||
if (arg->passive)
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
@@ -3633,7 +3633,6 @@ struct wmi_vdev_install_key_arg {
|
||||
#define WMI_HOST_MAX_HE_RATE_SET 3
|
||||
#define WMI_HECAP_TXRX_MCS_NSS_IDX_80 0
|
||||
#define WMI_HECAP_TXRX_MCS_NSS_IDX_160 1
|
||||
-#define WMI_HECAP_TXRX_MCS_NSS_IDX_80_80 2
|
||||
|
||||
struct wmi_rate_set_arg {
|
||||
u32 num_rates;
|
@ -1,399 +0,0 @@
|
||||
From patchwork Wed Sep 18 21:20:55 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
X-Patchwork-Id: 13807216
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com
|
||||
[205.220.180.131])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id C64DB1CB518
|
||||
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:15 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=205.220.180.131
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1726694477; cv=none;
|
||||
b=aWI5JISgL9c0iB/8EAXYKF/Lb2sJoeG+v5+Va4eb/voqwiSQ4FtwPkCC00b9attXvu4dD9wEHGKPW8Uh2kb1tSTl0uNHxijRmLYK2VUWkLHsZ3Pd6VvGoTpbtmOTgsGklZHZiFd+jyWgGkHB4ZBkHSkG9JH6VR44MSIgNj8g14A=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1726694477; c=relaxed/simple;
|
||||
bh=AYJpDHbXZ0n0NNHQi7/aGcqo7YfyoYhv+FrXZ143wMA=;
|
||||
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
|
||||
MIME-Version:Content-Type;
|
||||
b=jD1C2mzFvENculg9HS0v02iWUDzrWXiuU5GXTyC/0BKAJirnQkOUdVm7u0AEPiMxfkktLT3QCJLuvnKu3ZqSXWNbc2zOdUHTyW12fKdDNHib1WYYySBnfqu4EmiJKGcTE57VFlVdbklngOCDTCqHvVgP7YitGg2fWLPqBP/4yhM=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com;
|
||||
spf=pass smtp.mailfrom=quicinc.com;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b=OMqc+btb; arc=none smtp.client-ip=205.220.180.131
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b="OMqc+btb"
|
||||
Received: from pps.filterd (m0279872.ppops.net [127.0.0.1])
|
||||
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
|
||||
48I8sxTR020476;
|
||||
Wed, 18 Sep 2024 21:21:11 GMT
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
|
||||
cc:content-transfer-encoding:content-type:date:from:in-reply-to
|
||||
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
|
||||
dFohRj9vqwjJTRRYk31/1oJCFqLLKUuQ/verxCo/cGo=; b=OMqc+btbHl9cHSxO
|
||||
NauW5WX4C34QsGL/4d03QTtCDlctfB5PRmINiP2/jGcVZk3NZWS3d2f5zjPY7+hd
|
||||
uaUDslDMQwvAj1Jay/we1qNaFIPuzj4c9BbHqvvXa0WiCgQWpBC2h2jcFLXbeVHE
|
||||
5bqH+plXU5cz1d2YbsRpCXsdUWL/+S3u6A6/qxj6UraJ1s/rkE4ndQe/AQuf96Ja
|
||||
ylYiZPdtJJXzB6rPDN1bQsSET/PNXzIkrYTaDLF9A6688WU9izJdAjRcsu8oB8o1
|
||||
U+yftDfoegI7+ZyTZ4JUnQs7zJp171L/qsF0U9RONZCIbSLN9pkTo6xp6CrHGeLQ
|
||||
0tCmwQ==
|
||||
Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com
|
||||
[129.46.96.20])
|
||||
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4j6uagr-1
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:10 +0000 (GMT)
|
||||
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
|
||||
[10.47.209.196])
|
||||
by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
|
||||
48ILL9IB009589
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:09 GMT
|
||||
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
|
||||
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
|
||||
15.2.1544.9; Wed, 18 Sep 2024 14:21:09 -0700
|
||||
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
To: <ath12k@lists.infradead.org>
|
||||
CC: <linux-wireless@vger.kernel.org>,
|
||||
Pradeep Kumar Chitrapu
|
||||
<quic_pradeepc@quicinc.com>,
|
||||
P Praneesh <quic_ppranees@quicinc.com>,
|
||||
"Jeff
|
||||
Johnson" <quic_jjohnson@quicinc.com>
|
||||
Subject: [PATCH V8 8/9] wifi: ath12k: add support for 160 MHz bandwidth
|
||||
Date: Wed, 18 Sep 2024 14:20:55 -0700
|
||||
Message-ID: <20240918212056.4137076-9-quic_pradeepc@quicinc.com>
|
||||
X-Mailer: git-send-email 2.34.1
|
||||
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196)
|
||||
X-QCInternal: smtphost
|
||||
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
|
||||
signatures=585085
|
||||
X-Proofpoint-ORIG-GUID: wO0mnzqAAbcWYLNaoEhU3YfsdCyDJ2hk
|
||||
X-Proofpoint-GUID: wO0mnzqAAbcWYLNaoEhU3YfsdCyDJ2hk
|
||||
X-Proofpoint-Virus-Version: vendor=baseguard
|
||||
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
|
||||
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
|
||||
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
|
||||
phishscore=0 mlxlogscore=999
|
||||
mlxscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 clxscore=1015
|
||||
adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0
|
||||
classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000
|
||||
definitions=main-2409180140
|
||||
|
||||
Add support to configure maximum NSS in 160 MHz bandwidth.
|
||||
Firmware advertises support for handling NSS ratio information
|
||||
as a part of service ready ext event using nss_ratio_enabled
|
||||
flag. Save this information in ath12k_pdev_cap to calculate
|
||||
NSS ratio.
|
||||
|
||||
Additionally, reorder the code by moving
|
||||
ath12k_peer_assoc_h_phymode() before ath12k_peer_assoc_h_vht()
|
||||
to ensure that arg->peer_phymode correctly reflects the bandwidth
|
||||
in the max NSS calculation.
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Co-developed-by: P Praneesh <quic_ppranees@quicinc.com>
|
||||
Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
|
||||
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/core.h | 2 +
|
||||
drivers/net/wireless/ath/ath12k/mac.c | 85 ++++++++++++++++++++++----
|
||||
drivers/net/wireless/ath/ath12k/mac.h | 2 +
|
||||
drivers/net/wireless/ath/ath12k/wmi.c | 19 +++++-
|
||||
drivers/net/wireless/ath/ath12k/wmi.h | 28 +++++++++
|
||||
5 files changed, 124 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/core.h
|
||||
@@ -717,6 +717,8 @@ struct ath12k_pdev_cap {
|
||||
u32 tx_chain_mask_shift;
|
||||
u32 rx_chain_mask_shift;
|
||||
struct ath12k_band_cap band[NUM_NL80211_BANDS];
|
||||
+ bool nss_ratio_enabled;
|
||||
+ u8 nss_ratio_info;
|
||||
};
|
||||
|
||||
struct mlo_timestamp {
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -2050,6 +2050,34 @@ ath12k_peer_assoc_h_vht_limit(u16 tx_mcs
|
||||
return tx_mcs_set;
|
||||
}
|
||||
|
||||
+static u8 ath12k_get_nss_160mhz(struct ath12k *ar,
|
||||
+ u8 max_nss)
|
||||
+{
|
||||
+ u8 nss_ratio_info = ar->pdev->cap.nss_ratio_info;
|
||||
+ u8 max_sup_nss = 0;
|
||||
+
|
||||
+ switch (nss_ratio_info) {
|
||||
+ case WMI_NSS_RATIO_1BY2_NSS:
|
||||
+ max_sup_nss = max_nss >> 1;
|
||||
+ break;
|
||||
+ case WMI_NSS_RATIO_3BY4_NSS:
|
||||
+ ath12k_warn(ar->ab, "WMI_NSS_RATIO_3BY4_NSS not supported\n");
|
||||
+ break;
|
||||
+ case WMI_NSS_RATIO_1_NSS:
|
||||
+ max_sup_nss = max_nss;
|
||||
+ break;
|
||||
+ case WMI_NSS_RATIO_2_NSS:
|
||||
+ ath12k_warn(ar->ab, "WMI_NSS_RATIO_2_NSS not supported\n");
|
||||
+ break;
|
||||
+ default:
|
||||
+ ath12k_warn(ar->ab, "invalid nss ratio received from fw: %d\n",
|
||||
+ nss_ratio_info);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return max_sup_nss;
|
||||
+}
|
||||
+
|
||||
static void ath12k_peer_assoc_h_vht(struct ath12k *ar,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta,
|
||||
@@ -2065,6 +2093,7 @@ static void ath12k_peer_assoc_h_vht(stru
|
||||
u8 max_nss, vht_mcs;
|
||||
int i, vht_nss, nss_idx;
|
||||
bool user_rate_valid = true;
|
||||
+ u32 rx_nss, tx_nss, nss_160;
|
||||
|
||||
if (WARN_ON(ath12k_mac_vif_chan(vif, &def)))
|
||||
return;
|
||||
@@ -2159,10 +2188,24 @@ static void ath12k_peer_assoc_h_vht(stru
|
||||
/* TODO: Check */
|
||||
arg->tx_max_mcs_nss = 0xFF;
|
||||
|
||||
- ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vht peer %pM max_mpdu %d flags 0x%x\n",
|
||||
- sta->addr, arg->peer_max_mpdu, arg->peer_flags);
|
||||
+ if (arg->peer_phymode == MODE_11AC_VHT160) {
|
||||
+ tx_nss = ath12k_get_nss_160mhz(ar, max_nss);
|
||||
+ rx_nss = min(arg->peer_nss, tx_nss);
|
||||
+ arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE;
|
||||
|
||||
- /* TODO: rxnss_override */
|
||||
+ if (!rx_nss) {
|
||||
+ ath12k_warn(ar->ab, "invalid max_nss\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ nss_160 = u32_encode_bits(rx_nss - 1, ATH12K_PEER_RX_NSS_160MHZ);
|
||||
+ arg->peer_bw_rxnss_override |= nss_160;
|
||||
+ }
|
||||
+
|
||||
+ ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
|
||||
+ "mac vht peer %pM max_mpdu %d flags 0x%x nss_override 0x%x\n",
|
||||
+ sta->addr, arg->peer_max_mpdu, arg->peer_flags,
|
||||
+ arg->peer_bw_rxnss_override);
|
||||
}
|
||||
|
||||
static int ath12k_mac_get_max_he_mcs_map(u16 mcs_map, int nss)
|
||||
@@ -2251,6 +2294,7 @@ static void ath12k_peer_assoc_h_he(struc
|
||||
u16 he_tx_mcs = 0, v = 0;
|
||||
int he_nss, nss_idx;
|
||||
bool user_rate_valid = true;
|
||||
+ u32 rx_nss, tx_nss, nss_160;
|
||||
|
||||
if (WARN_ON(ath12k_mac_vif_chan(vif, &def)))
|
||||
return;
|
||||
@@ -2429,11 +2473,28 @@ static void ath12k_peer_assoc_h_he(struc
|
||||
he_mcs_mask[i])
|
||||
max_nss = i + 1;
|
||||
}
|
||||
+ max_nss = min(max_nss, ar->num_tx_chains);
|
||||
arg->peer_nss = min(sta->deflink.rx_nss, max_nss);
|
||||
|
||||
+ if (arg->peer_phymode == MODE_11AX_HE160) {
|
||||
+ tx_nss = ath12k_get_nss_160mhz(ar, max_nss);
|
||||
+ rx_nss = min(arg->peer_nss, tx_nss);
|
||||
+ arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE;
|
||||
+
|
||||
+ if (!rx_nss) {
|
||||
+ ath12k_warn(ar->ab, "invalid max_nss\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ nss_160 = u32_encode_bits(rx_nss - 1, ATH12K_PEER_RX_NSS_160MHZ);
|
||||
+ arg->peer_bw_rxnss_override |= nss_160;
|
||||
+ }
|
||||
+
|
||||
ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
|
||||
- "mac he peer %pM nss %d mcs cnt %d\n",
|
||||
- sta->deflink.addr, arg->peer_nss, arg->peer_he_mcs_count);
|
||||
+ "mac he peer %pM nss %d mcs cnt %d nss_override 0x%x\n",
|
||||
+ sta->deflink.addr, arg->peer_nss,
|
||||
+ arg->peer_he_mcs_count,
|
||||
+ arg->peer_bw_rxnss_override);
|
||||
}
|
||||
|
||||
static void ath12k_peer_assoc_h_he_6ghz(struct ath12k *ar,
|
||||
@@ -2965,13 +3026,13 @@ static void ath12k_peer_assoc_prepare(st
|
||||
ath12k_peer_assoc_h_basic(ar, vif, sta, arg);
|
||||
ath12k_peer_assoc_h_crypto(ar, vif, sta, arg);
|
||||
ath12k_peer_assoc_h_rates(ar, vif, sta, arg);
|
||||
+ ath12k_peer_assoc_h_phymode(ar, vif, sta, arg);
|
||||
ath12k_peer_assoc_h_ht(ar, vif, sta, arg);
|
||||
ath12k_peer_assoc_h_vht(ar, vif, sta, arg);
|
||||
ath12k_peer_assoc_h_he(ar, vif, sta, arg);
|
||||
ath12k_peer_assoc_h_he_6ghz(ar, vif, sta, arg);
|
||||
ath12k_peer_assoc_h_eht(ar, vif, sta, arg);
|
||||
ath12k_peer_assoc_h_qos(ar, vif, sta, arg);
|
||||
- ath12k_peer_assoc_h_phymode(ar, vif, sta, arg);
|
||||
ath12k_peer_assoc_h_smps(sta, arg);
|
||||
|
||||
/* TODO: amsdu_disable req? */
|
||||
@@ -5552,10 +5613,8 @@ ath12k_create_vht_cap(struct ath12k *ar,
|
||||
|
||||
ath12k_set_vht_txbf_cap(ar, &vht_cap.cap);
|
||||
|
||||
- /* TODO: Enable back VHT160 mode once association issues are fixed */
|
||||
- /* Disabling VHT160 and VHT80+80 modes */
|
||||
- vht_cap.cap &= ~IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
|
||||
- vht_cap.cap &= ~IEEE80211_VHT_CAP_SHORT_GI_160;
|
||||
+ /* 80P80 is not supported */
|
||||
+ vht_cap.cap &= ~IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ;
|
||||
|
||||
rxmcs_map = 0;
|
||||
txmcs_map = 0;
|
||||
@@ -9711,7 +9770,8 @@ static int ath12k_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);
|
||||
+ BIT(NL80211_CHAN_WIDTH_80) |
|
||||
+ BIT(NL80211_CHAN_WIDTH_160);
|
||||
|
||||
wiphy->iface_combinations = combinations;
|
||||
wiphy->n_iface_combinations = 1;
|
||||
@@ -9927,6 +9987,9 @@ static int ath12k_mac_hw_register(struct
|
||||
ieee80211_hw_set(hw, SUPPORTS_TX_FRAG);
|
||||
ieee80211_hw_set(hw, REPORTS_LOW_ACK);
|
||||
|
||||
+ if (cap->nss_ratio_enabled)
|
||||
+ ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
|
||||
+
|
||||
if ((ht_cap & WMI_HT_CAP_ENABLED) || ar->supports_6ghz) {
|
||||
ieee80211_hw_set(hw, AMPDU_AGGREGATION);
|
||||
ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW);
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.h
|
||||
@@ -37,6 +37,8 @@ struct ath12k_generic_iter {
|
||||
#define IEEE80211_DISABLE_VHT_MCS_SUPPORT_0_11 BIT(24)
|
||||
|
||||
#define ATH12K_CHAN_WIDTH_NUM 14
|
||||
+#define ATH12K_BW_NSS_MAP_ENABLE BIT(31)
|
||||
+#define ATH12K_PEER_RX_NSS_160MHZ GENMASK(2, 0)
|
||||
|
||||
#define ATH12K_TX_POWER_MAX_VAL 70
|
||||
#define ATH12K_TX_POWER_MIN_VAL 0
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
@@ -525,6 +525,10 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(st
|
||||
pdev_cap->he_mcs = le32_to_cpu(mac_caps->he_supp_mcs_5g);
|
||||
pdev_cap->tx_chain_mask = le32_to_cpu(mac_caps->tx_chain_mask_5g);
|
||||
pdev_cap->rx_chain_mask = le32_to_cpu(mac_caps->rx_chain_mask_5g);
|
||||
+ pdev_cap->nss_ratio_enabled =
|
||||
+ WMI_NSS_RATIO_EN_DIS_GET(mac_caps->nss_ratio);
|
||||
+ pdev_cap->nss_ratio_info =
|
||||
+ WMI_NSS_RATIO_INFO_GET(mac_caps->nss_ratio);
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -982,11 +986,24 @@ int ath12k_wmi_vdev_down(struct ath12k *
|
||||
static void ath12k_wmi_put_wmi_channel(struct ath12k_wmi_channel_params *chan,
|
||||
struct wmi_vdev_start_req_arg *arg)
|
||||
{
|
||||
+ u32 center_freq1 = arg->band_center_freq1;
|
||||
+
|
||||
memset(chan, 0, sizeof(*chan));
|
||||
|
||||
chan->mhz = cpu_to_le32(arg->freq);
|
||||
chan->band_center_freq1 = cpu_to_le32(arg->band_center_freq1);
|
||||
- chan->band_center_freq2 = 0;
|
||||
+ if (arg->mode == MODE_11AX_HE160) {
|
||||
+ if (arg->freq > center_freq1)
|
||||
+ chan->band_center_freq1 =
|
||||
+ cpu_to_le32(center_freq1 + 40);
|
||||
+ else
|
||||
+ chan->band_center_freq1 =
|
||||
+ cpu_to_le32(center_freq1 - 40);
|
||||
+
|
||||
+ chan->band_center_freq2 = cpu_to_le32(arg->band_center_freq1);
|
||||
+ } else {
|
||||
+ chan->band_center_freq2 = 0;
|
||||
+ }
|
||||
|
||||
chan->info |= le32_encode_bits(arg->mode, WMI_CHAN_INFO_MODE);
|
||||
if (arg->passive)
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
@@ -2264,6 +2264,21 @@ enum wmi_direct_buffer_module {
|
||||
WMI_DIRECT_BUF_MAX
|
||||
};
|
||||
|
||||
+/**
|
||||
+ * enum wmi_nss_ratio - NSS ratio received from FW during service ready ext event
|
||||
+ * @WMI_NSS_RATIO_1BY2_NSS: Max nss of 160MHz is equals to half of the max nss of 80MHz
|
||||
+ * @WMI_NSS_RATIO_3BY4_NSS: Max nss of 160MHz is equals to 3/4 of the max nss of 80MHz
|
||||
+ * @WMI_NSS_RATIO_1_NSS: Max nss of 160MHz is equals to the max nss of 80MHz
|
||||
+ * @WMI_NSS_RATIO_2_NSS: Max nss of 160MHz is equals to two times the max nss of 80MHz
|
||||
+ */
|
||||
+
|
||||
+enum wmi_nss_ratio {
|
||||
+ WMI_NSS_RATIO_1BY2_NSS,
|
||||
+ WMI_NSS_RATIO_3BY4_NSS,
|
||||
+ WMI_NSS_RATIO_1_NSS,
|
||||
+ WMI_NSS_RATIO_2_NSS
|
||||
+};
|
||||
+
|
||||
struct ath12k_wmi_pdev_band_arg {
|
||||
u32 pdev_id;
|
||||
u32 start_freq;
|
||||
@@ -2580,6 +2595,12 @@ struct ath12k_wmi_hw_mode_cap_params {
|
||||
} __packed;
|
||||
|
||||
#define WMI_MAX_HECAP_PHY_SIZE (3)
|
||||
+#define WMI_NSS_RATIO_EN_DIS_BITPOS BIT(0)
|
||||
+#define WMI_NSS_RATIO_EN_DIS_GET(_val) \
|
||||
+ le32_get_bits(_val, WMI_NSS_RATIO_EN_DIS_BITPOS)
|
||||
+#define WMI_NSS_RATIO_INFO_BITPOS GENMASK(4, 1)
|
||||
+#define WMI_NSS_RATIO_INFO_GET(_val) \
|
||||
+ le32_get_bits(_val, WMI_NSS_RATIO_INFO_BITPOS)
|
||||
|
||||
/* pdev_id is present in lower 16 bits of pdev_and_hw_link_ids in
|
||||
* ath12k_wmi_mac_phy_caps_params & ath12k_wmi_caps_ext_params.
|
||||
@@ -2621,6 +2642,13 @@ struct ath12k_wmi_mac_phy_caps_params {
|
||||
__le32 he_cap_info_2g_ext;
|
||||
__le32 he_cap_info_5g_ext;
|
||||
__le32 he_cap_info_internal;
|
||||
+ __le32 wireless_modes;
|
||||
+ __le32 low_2ghz_chan_freq;
|
||||
+ __le32 high_2ghz_chan_freq;
|
||||
+ __le32 low_5ghz_chan_freq;
|
||||
+ __le32 high_5ghz_chan_freq;
|
||||
+ __le32 nss_ratio;
|
||||
+
|
||||
} __packed;
|
||||
|
||||
struct ath12k_wmi_hal_reg_caps_ext_params {
|
@ -1,191 +0,0 @@
|
||||
From patchwork Wed Sep 18 21:20:56 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
X-Patchwork-Id: 13807214
|
||||
X-Patchwork-Delegate: quic_jjohnson@quicinc.com
|
||||
Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com
|
||||
[205.220.168.131])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A44471CB32B
|
||||
for <linux-wireless@vger.kernel.org>; Wed, 18 Sep 2024 21:21:14 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=205.220.168.131
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1726694476; cv=none;
|
||||
b=YnQUUZ4IfmLtgtYCtYRGhH8uRGd6VL74IRylGv6Ihb2PMO/n5UdfZlDk/m9w0OH4/sSsqULSz2lupiSTwXCPxc+73uK+OUjIEmCfPlNdrtzK2naXyiXAASPqonpnRBnyoIFwaE8zj8AHUqk5TAajedqpK9EnOaboX2XGYVbe0yI=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1726694476; c=relaxed/simple;
|
||||
bh=TAPBD6g5pYNuC8Odk6t6JkL8GvKdG9H30IPHTEgA7C0=;
|
||||
h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:
|
||||
MIME-Version:Content-Type;
|
||||
b=djAINL+wQRgQaGOI4fotrExnm1Yz5quwEW2I7s85hWLI3gB+HsjwPKWJypllDKm8W0FDcrsoZWFmOrfx0wJ5LIe+OtXJ4ijSG7xcJeGtgDXZ3hAA5ZBk/B+CD+g+NZ3c0mwkSKpUm5dUBPKi1+kJsPuVEwKeCmdMVj8QHSYMXPw=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com;
|
||||
spf=pass smtp.mailfrom=quicinc.com;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b=i4iTJD+Z; arc=none smtp.client-ip=205.220.168.131
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=quicinc.com
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com
|
||||
header.b="i4iTJD+Z"
|
||||
Received: from pps.filterd (m0279863.ppops.net [127.0.0.1])
|
||||
by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id
|
||||
48I9VJ15022098;
|
||||
Wed, 18 Sep 2024 21:21:11 GMT
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=
|
||||
cc:content-transfer-encoding:content-type:date:from:in-reply-to
|
||||
:message-id:mime-version:references:subject:to; s=qcppdkim1; bh=
|
||||
2gwv4CbPGErAHv9NWtZrCSVk7NoZpHzKz9tuTs+8dV4=; b=i4iTJD+ZMXDp8Ul8
|
||||
HTo5IL/NLwS3mnlutEaaL+juUKm+wsFdl/BeMp9CC4H/sapolIhM4Zje9t3H9K0R
|
||||
+z1OxQDEekvWrrfUlikEaUHjOEwQ4YKSPJ+1uAIrbbA3REWeW5z39IITJ3dGU05N
|
||||
hnfPQEiFcPgDbFQv0Iaf434znv8rbOow6dc+M1E6EjpGd92Mq80BpsJqP8Ee0RUr
|
||||
WO3rsws1kXzFs6ELsg/FmC3l6eG9A4z9SUxcZ7QqTaz8aPOAZS/lclN0cOJT7VgK
|
||||
7UNPGoDoJhTmHEX17W/rQR8RiV8c0hMciOuB1sfI7H/1uGkEPMjmfIsEdBjQ/9oa
|
||||
DDiHrg==
|
||||
Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com
|
||||
[129.46.96.20])
|
||||
by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4hfk92c-1
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:11 +0000 (GMT)
|
||||
Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com
|
||||
[10.47.209.196])
|
||||
by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id
|
||||
48ILLA0u011397
|
||||
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
|
||||
Wed, 18 Sep 2024 21:21:10 GMT
|
||||
Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server
|
||||
(version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
|
||||
15.2.1544.9; Wed, 18 Sep 2024 14:21:09 -0700
|
||||
From: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
To: <ath12k@lists.infradead.org>
|
||||
CC: <linux-wireless@vger.kernel.org>,
|
||||
Pradeep Kumar Chitrapu
|
||||
<quic_pradeepc@quicinc.com>,
|
||||
Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
Subject: [PATCH V8 9/9] wifi: ath12k: add extended NSS bandwidth support for
|
||||
160 MHz
|
||||
Date: Wed, 18 Sep 2024 14:20:56 -0700
|
||||
Message-ID: <20240918212056.4137076-10-quic_pradeepc@quicinc.com>
|
||||
X-Mailer: git-send-email 2.34.1
|
||||
In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com>
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-wireless@vger.kernel.org
|
||||
List-Id: <linux-wireless.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-wireless+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-wireless+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To
|
||||
nalasex01a.na.qualcomm.com (10.47.209.196)
|
||||
X-QCInternal: smtphost
|
||||
X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800
|
||||
signatures=585085
|
||||
X-Proofpoint-GUID: Mta6b5FqdCLrvsiUf1WwMHFr8SiJUh5L
|
||||
X-Proofpoint-ORIG-GUID: Mta6b5FqdCLrvsiUf1WwMHFr8SiJUh5L
|
||||
X-Proofpoint-Virus-Version: vendor=baseguard
|
||||
engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29
|
||||
definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01
|
||||
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0
|
||||
priorityscore=1501
|
||||
clxscore=1015 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0
|
||||
impostorscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0
|
||||
bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1
|
||||
engine=8.19.0-2408220000 definitions=main-2409180140
|
||||
|
||||
Currently rx and tx MCS map for 160 MHz under HE capabilities
|
||||
are not updating properly, when 160 MHz is configured with NSS
|
||||
lesser than max NSS support. Fix this by utilizing
|
||||
nss_ratio_enabled and nss_ratio_info fields sent by firmware
|
||||
in service ready event.
|
||||
|
||||
However, if firmware advertises EXT NSS BW support in VHT caps
|
||||
as 1(1x2) and when nss_ratio_info indicates 1:1, reset the EXT
|
||||
NSS BW Support in VHT caps to 0 which indicates 1x1. This is
|
||||
to avoid incorrectly choosing 1:2 NSS ratio when using the
|
||||
default VHT caps advertised by firmware.
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
|
||||
|
||||
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>
|
||||
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/mac.c | 33 ++++++++++++++++++++++-----
|
||||
1 file changed, 27 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -2477,8 +2477,10 @@ static void ath12k_peer_assoc_h_he(struc
|
||||
arg->peer_nss = min(sta->deflink.rx_nss, max_nss);
|
||||
|
||||
if (arg->peer_phymode == MODE_11AX_HE160) {
|
||||
- tx_nss = ath12k_get_nss_160mhz(ar, max_nss);
|
||||
+ tx_nss = ath12k_get_nss_160mhz(ar, ar->num_tx_chains);
|
||||
rx_nss = min(arg->peer_nss, tx_nss);
|
||||
+
|
||||
+ arg->peer_nss = min(sta->deflink.rx_nss, ar->num_rx_chains);
|
||||
arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE;
|
||||
|
||||
if (!rx_nss) {
|
||||
@@ -5636,6 +5638,12 @@ ath12k_create_vht_cap(struct ath12k *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;
|
||||
}
|
||||
|
||||
@@ -5816,11 +5824,12 @@ static void ath12k_mac_set_hemcsmap(stru
|
||||
struct ieee80211_sta_he_cap *he_cap)
|
||||
{
|
||||
struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp;
|
||||
- u16 txmcs_map, rxmcs_map;
|
||||
+ u8 maxtxnss_160 = ath12k_get_nss_160mhz(ar, ar->num_tx_chains);
|
||||
+ u8 maxrxnss_160 = ath12k_get_nss_160mhz(ar, ar->num_rx_chains);
|
||||
+ u16 txmcs_map_160 = 0, rxmcs_map_160 = 0;
|
||||
+ u16 txmcs_map = 0, rxmcs_map = 0;
|
||||
u32 i;
|
||||
|
||||
- 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))
|
||||
@@ -5833,12 +5842,24 @@ static void ath12k_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);
|
||||
}
|
||||
|
||||
mcs_nss->rx_mcs_80 = cpu_to_le16(rxmcs_map & 0xffff);
|
||||
mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff);
|
||||
- mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff);
|
||||
- mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff);
|
||||
+ mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map_160 & 0xffff);
|
||||
+ mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map_160 & 0xffff);
|
||||
}
|
||||
|
||||
static void ath12k_mac_copy_he_cap(struct ath12k *ar,
|
@ -1,273 +0,0 @@
|
||||
From patchwork Tue Apr 23 12:12:33 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Linus Walleij <linus.walleij@linaro.org>
|
||||
X-Patchwork-Id: 1926515
|
||||
Return-Path:
|
||||
<linux-gpio+bounces-5755-incoming=patchwork.ozlabs.org@vger.kernel.org>
|
||||
X-Original-To: incoming@patchwork.ozlabs.org
|
||||
Delivered-To: patchwork-incoming@legolas.ozlabs.org
|
||||
Authentication-Results: legolas.ozlabs.org;
|
||||
dkim=pass (2048-bit key;
|
||||
unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256
|
||||
header.s=google header.b=qX99TQMM;
|
||||
dkim-atps=neutral
|
||||
Authentication-Results: legolas.ozlabs.org;
|
||||
spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org
|
||||
(client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org;
|
||||
envelope-from=linux-gpio+bounces-5755-incoming=patchwork.ozlabs.org@vger.kernel.org;
|
||||
receiver=patchwork.ozlabs.org)
|
||||
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org
|
||||
[IPv6:2604:1380:45e3:2400::1])
|
||||
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
|
||||
key-exchange X25519 server-signature ECDSA (secp384r1))
|
||||
(No client certificate requested)
|
||||
by legolas.ozlabs.org (Postfix) with ESMTPS id 4VP1Gc6RZKz1yZP
|
||||
for <incoming@patchwork.ozlabs.org>; Tue, 23 Apr 2024 22:12:56 +1000 (AEST)
|
||||
Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org
|
||||
[52.25.139.140])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5BB9C28522A
|
||||
for <incoming@patchwork.ozlabs.org>; Tue, 23 Apr 2024 12:12:55 +0000 (UTC)
|
||||
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F83B8563D;
|
||||
Tue, 23 Apr 2024 12:12:41 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org
|
||||
header.b="qX99TQMM"
|
||||
X-Original-To: linux-gpio@vger.kernel.org
|
||||
Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com
|
||||
[209.85.208.179])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8F3C82865
|
||||
for <linux-gpio@vger.kernel.org>; Tue, 23 Apr 2024 12:12:37 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=209.85.208.179
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1713874361; cv=none;
|
||||
b=d6RcvcAu8hBYAK8Io489ZHQpJVXPwuokP6iMcAkbvElCerbXD6jAdqdi+RjDlo5C49GHGO4FQ19UwQn/VE//qSwiK1ulTSBp3OkvAmyb7yYAFnDs9AVNWRw+5/NxeFNn3fj5PyvqVymIbaJKabfrOVNwkz/5JMHxEIJtr6Crmog=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1713874361; c=relaxed/simple;
|
||||
bh=0eXJ5AIjzz1TBGZ8SlshIPrEHZaZwZfYEdof+dSpu4Y=;
|
||||
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;
|
||||
b=EfFtruUxRIGy+jylEiJ2rPEyPCjGCc8ptT9FVxe6s0O/kW38Y6196xVQeiSV2tSKVCEOIO+9HoqmpgdKsJE7gU9++EcrasP96MYpsklYpc2zsWW3b8QEhfxfZ9Ai/idyYihE2u9dQ7a143P/Ij/twDrZTt24wO/mtHDrE5XcCFI=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=linaro.org;
|
||||
spf=pass smtp.mailfrom=linaro.org;
|
||||
dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org
|
||||
header.b=qX99TQMM; arc=none smtp.client-ip=209.85.208.179
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=linaro.org
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=linaro.org
|
||||
Received: by mail-lj1-f179.google.com with SMTP id
|
||||
38308e7fff4ca-2dd041acff1so40839131fa.1
|
||||
for <linux-gpio@vger.kernel.org>;
|
||||
Tue, 23 Apr 2024 05:12:37 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=linaro.org; s=google; t=1713874356; x=1714479156;
|
||||
darn=vger.kernel.org;
|
||||
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
|
||||
:date:from:from:to:cc:subject:date:message-id:reply-to;
|
||||
bh=vysJsMiH5IVqdTs4yMwZxZ7nUmt2aG7eBhkn8qm8hvI=;
|
||||
b=qX99TQMMdHbskFYUaw8c93sIJsUhKmj/WPdyahHcupUhwn5wol4aVoPczkOKYwJZhE
|
||||
eoInxzjAHIl3UNKyvPPrD4MrbLcSoFT6mTFMsgRQYUghsLattmGcqIebu9XT556dBhsf
|
||||
DydmpqGgnTOIa+IEknFxg24mo8Xn2LVmDC7LSGEYykUy1xLHd1NSq56YEaYXC7641xeZ
|
||||
9TOL0rZszeGld5cCS3013EmEeXQGCC3lAP83Eb48vbFXjPojkN0s40rZ2s8YpVsGT0iP
|
||||
LeLVtP/E8XJqi4YipKryKSgbgOvQ1Bclle5+s+2qcJQNnSEjekMwR59BIRs3OZH2SRfN
|
||||
gQdQ==
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20230601; t=1713874356; x=1714479156;
|
||||
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
|
||||
:date:from:x-gm-message-state:from:to:cc:subject:date:message-id
|
||||
:reply-to;
|
||||
bh=vysJsMiH5IVqdTs4yMwZxZ7nUmt2aG7eBhkn8qm8hvI=;
|
||||
b=jEBH4NQ7SzFi2tnb1lgL06IchnBJoscNgKesjlorvou6X/9wDE/VbgxNFKR0zWwdTk
|
||||
BEjG/ifFJxLmM9jdaCKu5cJc4yiDNXp7yZd48D71V34zJ4aINAGAx4hcOKqf95neFknx
|
||||
nsFPpBFnTYFEpCLF0TebVoL6h6ehPzSojmkArzsrMppNvW2cwJ5gDlkqy2y4SezLanmM
|
||||
6iU0ksnwE0bb2iLkahhgo00Ejt33yqxwa+3xBfhOe9oYKSSZYnY7qVq055SSwt9IAq+H
|
||||
REGyJN+GrvupTHagiioYe3LPXDPdOui9ZixXXDllw1t1yGUy+TkJu8xSqtvHEfg81FHP
|
||||
AxtA==
|
||||
X-Forwarded-Encrypted: i=1;
|
||||
AJvYcCUbxzPklfPYrLgyY1I0ycuj7Dh04dcGVonYocA2mzxzlAEV107o0ELlFqr3O9Td+tV/t0eV9ly9YAbTY6n1XPnFXS5dsYYAZw6RHw==
|
||||
X-Gm-Message-State: AOJu0YxsC7zdakTzntbiRFnN2A7yTrR0x+IpR6ce6eGn5kHeqIBi1km+
|
||||
zTVpRulbch3JsmzVDbCbbAAYoBkNgEA568YL6zdjVARnvFwNz1cqatOrR1AXUm0=
|
||||
X-Google-Smtp-Source:
|
||||
AGHT+IHBRMGvaJM98f86Z6m/RfVhK2XejjNGF3EvcRq/4x3oGM0DKpd2PbeCJdgmzHjLPVVbdsNzJg==
|
||||
X-Received: by 2002:a2e:9852:0:b0:2d8:a98d:18e with SMTP id
|
||||
e18-20020a2e9852000000b002d8a98d018emr7955886ljj.8.1713874355700;
|
||||
Tue, 23 Apr 2024 05:12:35 -0700 (PDT)
|
||||
Received: from [192.168.1.140] ([85.235.12.238])
|
||||
by smtp.gmail.com with ESMTPSA id
|
||||
x6-20020a2e7c06000000b002da179d8d25sm1628982ljc.64.2024.04.23.05.12.33
|
||||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||
Tue, 23 Apr 2024 05:12:35 -0700 (PDT)
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Tue, 23 Apr 2024 14:12:33 +0200
|
||||
Subject: [PATCH v2] wifi: ath9k: Obtain system GPIOS from descriptors
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-gpio@vger.kernel.org
|
||||
List-Id: <linux-gpio.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-gpio+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-gpio+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
Message-Id: <20240423-descriptors-wireless-v2-1-6d1d03b30bfa@linaro.org>
|
||||
X-B4-Tracking: v=1; b=H4sIALClJ2YC/22Nyw6CMBBFf4XM2hpanrLyPwyL0o4wCaFkxqCG9
|
||||
N+txKXLc5Nz7g6CTCjQZTswbiQUlgTmlIGb7DKiIp8YTG7KXBujPIpjWh+BRT2JcUYRNbTeXir
|
||||
v7FBUkNSV8U6vI3vrE08kSXgfL5v+rr9gof8HN61yhdo1rvJ125T1dabFcjgHHqGPMX4Ao4iiN
|
||||
LkAAAA=
|
||||
To: Kalle Valo <kvalo@kernel.org>,
|
||||
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
|
||||
Arnd Bergmann <arnd@arndb.de>, Alban Bedel <albeu@free.fr>,
|
||||
Bartosz Golaszewski <brgl@bgdev.pl>, =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rg?=
|
||||
=?utf-8?q?ensen?= <toke@toke.dk>
|
||||
Cc: linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com,
|
||||
linux-gpio@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>
|
||||
X-Mailer: b4 0.13.0
|
||||
|
||||
The ath9k has an odd use of system-wide GPIOs: if the chip
|
||||
does not have internal GPIO capability, it will try to obtain a
|
||||
GPIO line from the system GPIO controller:
|
||||
|
||||
if (BIT(gpio) & ah->caps.gpio_mask)
|
||||
ath9k_hw_gpio_cfg_wmac(...);
|
||||
else if (AR_SREV_SOC(ah))
|
||||
ath9k_hw_gpio_cfg_soc(ah, gpio, out, label);
|
||||
|
||||
Where ath9k_hw_gpio_cfg_soc() will attempt to issue
|
||||
gpio_request_one() passing the local GPIO number of the controller
|
||||
(0..31) to gpio_request_one().
|
||||
|
||||
This is somewhat peculiar and possibly even dangerous: there is
|
||||
nowadays no guarantee of the numbering of these system-wide
|
||||
GPIOs, and assuming that GPIO 0..31 as used by ath9k would
|
||||
correspond to GPIOs 0..31 on the system as a whole seems a bit
|
||||
wild.
|
||||
|
||||
Register all 32 GPIOs at index 0..31 directly in the ATH79K
|
||||
GPIO driver and associate with WIFI if and only if we are probing
|
||||
ATH79K wifi from the AHB bus (used for SoCs).
|
||||
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
Changes in v2:
|
||||
- Define all the descriptors directly in the ATH79K
|
||||
GPIO driver in case the driver want to request them directly.
|
||||
- Link to v1: https://lore.kernel.org/r/20240131-descriptors-wireless-v1-0-e1c7c5d68746@linaro.org
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/hw.c | 29 ++++++++++++-----------
|
||||
drivers/net/wireless/ath/ath9k/hw.h | 3 ++-
|
||||
2 files changed, 32 insertions(+), 15 deletions(-)
|
||||
|
||||
|
||||
---
|
||||
base-commit: 4cece764965020c22cff7665b18a012006359095
|
||||
change-id: 20240122-descriptors-wireless-b8da95dcab35
|
||||
|
||||
Best regards,
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <linux/time.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/etherdevice.h>
|
||||
-#include <linux/gpio.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
#include <linux/unaligned.h>
|
||||
|
||||
#include "hw.h"
|
||||
@@ -2727,19 +2727,25 @@ static void ath9k_hw_gpio_cfg_output_mux
|
||||
static void ath9k_hw_gpio_cfg_soc(struct ath_hw *ah, u32 gpio, bool out,
|
||||
const char *label)
|
||||
{
|
||||
+ enum gpiod_flags flags = out ? GPIOD_OUT_LOW : GPIOD_IN;
|
||||
+ struct gpio_desc *gpiod;
|
||||
int err;
|
||||
|
||||
- if (ah->caps.gpio_requested & BIT(gpio))
|
||||
+ if (ah->gpiods[gpio])
|
||||
return;
|
||||
|
||||
- err = devm_gpio_request_one(ah->dev, gpio, out ? GPIOF_OUT_INIT_LOW : GPIOF_IN, label);
|
||||
- if (err) {
|
||||
+ /* Obtains a system specific GPIO descriptor from another GPIO controller */
|
||||
+ gpiod = gpiod_get_index(NULL, "ath9k", gpio, flags);
|
||||
+
|
||||
+ if (IS_ERR(gpiod)) {
|
||||
+ err = PTR_ERR(gpiod);
|
||||
ath_err(ath9k_hw_common(ah), "request GPIO%d failed:%d\n",
|
||||
gpio, err);
|
||||
return;
|
||||
}
|
||||
|
||||
- ah->caps.gpio_requested |= BIT(gpio);
|
||||
+ gpiod_set_consumer_name(gpiod, label);
|
||||
+ ah->gpiods[gpio] = gpiod;
|
||||
}
|
||||
|
||||
static void ath9k_hw_gpio_cfg_wmac(struct ath_hw *ah, u32 gpio, bool out,
|
||||
@@ -2801,8 +2807,10 @@ void ath9k_hw_gpio_free(struct ath_hw *a
|
||||
|
||||
WARN_ON(gpio >= ah->caps.num_gpio_pins);
|
||||
|
||||
- if (ah->caps.gpio_requested & BIT(gpio))
|
||||
- ah->caps.gpio_requested &= ~BIT(gpio);
|
||||
+ if (ah->gpiods[gpio]) {
|
||||
+ gpiod_put(ah->gpiods[gpio]);
|
||||
+ ah->gpiods[gpio] = NULL;
|
||||
+ }
|
||||
}
|
||||
EXPORT_SYMBOL(ath9k_hw_gpio_free);
|
||||
|
||||
@@ -2830,8 +2838,8 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah,
|
||||
val = REG_READ(ah, AR_GPIO_IN(ah)) & BIT(gpio);
|
||||
else
|
||||
val = MS_REG_READ(AR, gpio);
|
||||
- } else if (BIT(gpio) & ah->caps.gpio_requested) {
|
||||
- val = gpio_get_value(gpio) & BIT(gpio);
|
||||
+ } else if (ah->gpiods[gpio]) {
|
||||
+ val = gpiod_get_value(ah->gpiods[gpio]);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
}
|
||||
@@ -2854,8 +2862,8 @@ void ath9k_hw_set_gpio(struct ath_hw *ah
|
||||
AR7010_GPIO_OUT : AR_GPIO_IN_OUT(ah);
|
||||
|
||||
REG_RMW(ah, out_addr, val << gpio, BIT(gpio));
|
||||
- } else if (BIT(gpio) & ah->caps.gpio_requested) {
|
||||
- gpio_set_value(gpio, val);
|
||||
+ } else if (ah->gpiods[gpio]) {
|
||||
+ gpiod_set_value(ah->gpiods[gpio], val);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
}
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.h
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/delay.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/firmware.h>
|
||||
|
||||
@@ -302,7 +303,6 @@ struct ath9k_hw_capabilities {
|
||||
u8 max_rxchains;
|
||||
u8 num_gpio_pins;
|
||||
u32 gpio_mask;
|
||||
- u32 gpio_requested;
|
||||
u8 rx_hp_qdepth;
|
||||
u8 rx_lp_qdepth;
|
||||
u8 rx_status_len;
|
||||
@@ -783,6 +783,7 @@ struct ath_hw {
|
||||
struct ath9k_hw_capabilities caps;
|
||||
struct ath9k_channel channels[ATH9K_NUM_CHANNELS];
|
||||
struct ath9k_channel *curchan;
|
||||
+ struct gpio_desc *gpiods[32];
|
||||
|
||||
union {
|
||||
struct ar5416_eeprom_def def;
|
@ -8,7 +8,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411.
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -2983,7 +2983,8 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
@@ -2975,7 +2975,8 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
{
|
||||
struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
|
||||
struct ieee80211_channel *channel;
|
||||
@ -18,7 +18,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411.
|
||||
u16 ctl = NO_CTL;
|
||||
|
||||
if (!chan)
|
||||
@@ -2995,9 +2996,14 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
@@ -2987,9 +2988,14 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
channel = chan->chan;
|
||||
chan_pwr = min_t(int, channel->max_power * 2, MAX_COMBINED_POWER);
|
||||
new_pwr = min_t(int, chan_pwr, reg->power_limit);
|
||||
|
@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -3002,6 +3002,10 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
@@ -2994,6 +2994,10 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
if (ant_gain > max_gain)
|
||||
ant_reduction = ant_gain - max_gain;
|
||||
|
||||
|
@ -1,127 +0,0 @@
|
||||
From da57e63c91ce11a640b1d38412be8c0d8655b8d9 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Sat, 4 Jan 2025 14:24:46 -0800
|
||||
Subject: [PATCH] ath9k: use devm for irq and ioremap resource
|
||||
|
||||
Avoids having to manually free. Both of these get called and removed in
|
||||
probe only and are safe to convert.
|
||||
|
||||
devm_platform_ioremap_resource is different as it also calls
|
||||
devm_request_memory_region, which requires non overlapping memory
|
||||
regions. Luckily, that seems to be the case.
|
||||
|
||||
Tested on a TP-Link Archer C7v2.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/ahb.c | 22 ++++++----------------
|
||||
drivers/net/wireless/ath/ath9k/pci.c | 9 +++------
|
||||
2 files changed, 9 insertions(+), 22 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/ahb.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
|
||||
@@ -74,7 +74,6 @@ static int ath_ahb_probe(struct platform
|
||||
void __iomem *mem;
|
||||
struct ath_softc *sc;
|
||||
struct ieee80211_hw *hw;
|
||||
- struct resource *res;
|
||||
const struct platform_device_id *id = platform_get_device_id(pdev);
|
||||
int irq;
|
||||
int ret = 0;
|
||||
@@ -86,16 +85,10 @@ static int ath_ahb_probe(struct platform
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
- if (res == NULL) {
|
||||
- dev_err(&pdev->dev, "no memory resource found\n");
|
||||
- return -ENXIO;
|
||||
- }
|
||||
-
|
||||
- mem = devm_ioremap(&pdev->dev, res->start, resource_size(res));
|
||||
- if (mem == NULL) {
|
||||
+ mem = devm_platform_ioremap_resource(pdev, 0);
|
||||
+ if (IS_ERR(mem)) {
|
||||
dev_err(&pdev->dev, "ioremap failed\n");
|
||||
- return -ENOMEM;
|
||||
+ return PTR_ERR(mem);
|
||||
}
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
@@ -118,16 +111,16 @@ static int ath_ahb_probe(struct platform
|
||||
sc->mem = mem;
|
||||
sc->irq = irq;
|
||||
|
||||
- ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc);
|
||||
+ ret = devm_request_irq(&pdev->dev, irq, ath_isr, IRQF_SHARED, "ath9k", sc);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "request_irq failed\n");
|
||||
- goto err_free_hw;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
ret = ath9k_init_device(id->driver_data, sc, &ath_ahb_bus_ops);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to initialize device\n");
|
||||
- goto err_irq;
|
||||
+ goto err_free_hw;
|
||||
}
|
||||
|
||||
ah = sc->sc_ah;
|
||||
@@ -137,8 +130,6 @@ static int ath_ahb_probe(struct platform
|
||||
|
||||
return 0;
|
||||
|
||||
- err_irq:
|
||||
- free_irq(irq, sc);
|
||||
err_free_hw:
|
||||
ieee80211_free_hw(hw);
|
||||
return ret;
|
||||
@@ -152,7 +143,6 @@ static void ath_ahb_remove(struct platfo
|
||||
struct ath_softc *sc = hw->priv;
|
||||
|
||||
ath9k_deinit_device(sc);
|
||||
- free_irq(sc->irq, sc);
|
||||
ieee80211_free_hw(sc->hw);
|
||||
}
|
||||
}
|
||||
--- a/drivers/net/wireless/ath/ath9k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/pci.c
|
||||
@@ -965,9 +965,9 @@ static int ath_pci_probe(struct pci_dev
|
||||
}
|
||||
|
||||
if (!msi_enabled)
|
||||
- ret = request_irq(pdev->irq, ath_isr, IRQF_SHARED, "ath9k", sc);
|
||||
+ ret = devm_request_irq(&pdev->dev, pdev->irq, ath_isr, IRQF_SHARED, "ath9k", sc);
|
||||
else
|
||||
- ret = request_irq(pdev->irq, ath_isr, 0, "ath9k", sc);
|
||||
+ ret = devm_request_irq(&pdev->dev, pdev->irq, ath_isr, 0, "ath9k", sc);
|
||||
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "request_irq failed\n");
|
||||
@@ -979,7 +979,7 @@ static int ath_pci_probe(struct pci_dev
|
||||
ret = ath9k_init_device(id->device, sc, &ath_pci_bus_ops);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to initialize device\n");
|
||||
- goto err_init;
|
||||
+ goto err_irq;
|
||||
}
|
||||
|
||||
sc->sc_ah->msi_enabled = msi_enabled;
|
||||
@@ -991,8 +991,6 @@ static int ath_pci_probe(struct pci_dev
|
||||
|
||||
return 0;
|
||||
|
||||
-err_init:
|
||||
- free_irq(sc->irq, sc);
|
||||
err_irq:
|
||||
ieee80211_free_hw(hw);
|
||||
return ret;
|
||||
@@ -1006,7 +1004,6 @@ static void ath_pci_remove(struct pci_de
|
||||
if (!is_ath9k_unloaded)
|
||||
sc->sc_ah->ah_flags |= AH_UNPLUGGED;
|
||||
ath9k_deinit_device(sc);
|
||||
- free_irq(sc->irq, sc);
|
||||
ieee80211_free_hw(sc->hw);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
case AR5416_AR9100_DEVID:
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.h
|
||||
@@ -37,6 +37,7 @@
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#define ATHEROS_VENDOR_ID 0x168c
|
||||
|
||||
|
@ -0,0 +1,64 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "ath9k.h"
|
||||
+#include <linux/ath9k_platform.h>
|
||||
|
||||
/********************************/
|
||||
/* LED functions */
|
||||
@@ -108,6 +109,24 @@ int ath_create_gpio_led(struct ath_softc
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int ath_create_platform_led(struct ath_softc *sc,
|
||||
+ const struct gpio_led *gpio)
|
||||
+{
|
||||
+ struct ath_led *led;
|
||||
+ int ret;
|
||||
+
|
||||
+ led = kzalloc(sizeof(*led), GFP_KERNEL);
|
||||
+ if (!led)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ led->gpio = gpio;
|
||||
+ ret = ath_add_led(sc, led);
|
||||
+ if (ret < 0)
|
||||
+ kfree(led);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
void ath_deinit_leds(struct ath_softc *sc)
|
||||
{
|
||||
struct ath_led *led;
|
||||
@@ -124,8 +143,10 @@ void ath_deinit_leds(struct ath_softc *s
|
||||
|
||||
void ath_init_leds(struct ath_softc *sc)
|
||||
{
|
||||
+ struct ath9k_platform_data *pdata = sc->dev->platform_data;
|
||||
char led_name[32];
|
||||
const char *trigger;
|
||||
+ int i;
|
||||
|
||||
INIT_LIST_HEAD(&sc->leds);
|
||||
|
||||
@@ -134,6 +155,17 @@ void ath_init_leds(struct ath_softc *sc)
|
||||
|
||||
ath_fill_led_pin(sc);
|
||||
|
||||
+ if (pdata && pdata->leds && pdata->num_leds)
|
||||
+ for (i = 0; i < pdata->num_leds; i++) {
|
||||
+ if (pdata->leds[i].gpio == sc->sc_ah->led_pin)
|
||||
+ sc->sc_ah->led_pin = -1;
|
||||
+
|
||||
+ ath_create_platform_led(sc, &pdata->leds[i]);
|
||||
+ }
|
||||
+
|
||||
+ if (sc->sc_ah->led_pin < 0)
|
||||
+ return;
|
||||
+
|
||||
snprintf(led_name, sizeof(led_name), "ath9k-%s",
|
||||
wiphy_name(sc->hw->wiphy));
|
||||
|
@ -75,7 +75,7 @@
|
||||
struct ath9k_hw_version {
|
||||
u32 magic;
|
||||
u16 devid;
|
||||
@@ -811,6 +817,8 @@ struct ath_hw {
|
||||
@@ -810,6 +816,8 @@ struct ath_hw {
|
||||
u32 ah_flags;
|
||||
s16 nf_override;
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
bool reset_power_on;
|
||||
bool htc_reset_init;
|
||||
|
||||
@@ -1080,6 +1088,7 @@ void ath9k_hw_check_nav(struct ath_hw *a
|
||||
@@ -1079,6 +1087,7 @@ void ath9k_hw_check_nav(struct ath_hw *a
|
||||
bool ath9k_hw_check_alive(struct ath_hw *ah);
|
||||
|
||||
bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
|
||||
|
@ -13,7 +13,7 @@ Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
@@ -73,8 +73,11 @@ static int ath_add_led(struct ath_softc
|
||||
@@ -74,8 +74,11 @@ static int ath_add_led(struct ath_softc
|
||||
ath9k_hw_gpio_request_out(sc->sc_ah, gpio->gpio, gpio->name,
|
||||
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
||||
|
||||
|
@ -10,32 +10,47 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -25,6 +25,8 @@
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <linux/completion.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/hw_random.h>
|
||||
+#include <linux/gpio/driver.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "debug.h"
|
||||
@@ -1046,6 +1048,10 @@ struct ath_softc {
|
||||
@@ -991,6 +992,14 @@ struct ath_led {
|
||||
struct led_classdev cdev;
|
||||
};
|
||||
|
||||
+#ifdef CONFIG_GPIOLIB
|
||||
+struct ath9k_gpio_chip {
|
||||
+ struct ath_softc *sc;
|
||||
+ char label[32];
|
||||
+ struct gpio_chip gchip;
|
||||
+};
|
||||
+#endif
|
||||
+
|
||||
struct ath_softc {
|
||||
struct ieee80211_hw *hw;
|
||||
struct device *dev;
|
||||
@@ -1046,6 +1055,9 @@ struct ath_softc {
|
||||
#ifdef CPTCFG_MAC80211_LEDS
|
||||
const char *led_default_trigger;
|
||||
struct list_head leds;
|
||||
+#ifdef CONFIG_GPIOLIB
|
||||
+ struct gpio_chip *gpiochip;
|
||||
+ struct gpio_desc *gpiodesc;
|
||||
+ struct ath9k_gpio_chip *gpiochip;
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
#ifdef CPTCFG_ATH9K_DEBUGFS
|
||||
--- a/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
@@ -16,12 +16,120 @@
|
||||
@@ -16,13 +16,135 @@
|
||||
|
||||
#include "ath9k.h"
|
||||
|
||||
#include <linux/ath9k_platform.h>
|
||||
+#include <linux/gpio.h>
|
||||
+
|
||||
+#ifdef CPTCFG_MAC80211_LEDS
|
||||
+
|
||||
+#ifdef CONFIG_GPIOLIB
|
||||
@ -47,9 +62,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+/* gpio_chip handler : set GPIO to input */
|
||||
+static int ath9k_gpio_pin_cfg_input(struct gpio_chip *chip, unsigned offset)
|
||||
+{
|
||||
+ struct ath_softc *sc = gpiochip_get_data(chip);
|
||||
+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip,
|
||||
+ gchip);
|
||||
+
|
||||
+ ath9k_hw_gpio_request_in(sc->sc_ah, offset, "ath9k-gpio");
|
||||
+ ath9k_hw_gpio_request_in(gc->sc->sc_ah, offset, "ath9k-gpio");
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
@ -58,11 +74,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+static int ath9k_gpio_pin_cfg_output(struct gpio_chip *chip, unsigned offset,
|
||||
+ int value)
|
||||
+{
|
||||
+ struct ath_softc *sc = gpiochip_get_data(chip);
|
||||
+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip,
|
||||
+ gchip);
|
||||
+
|
||||
+ ath9k_hw_gpio_request_out(sc->sc_ah, offset, "ath9k-gpio",
|
||||
+ ath9k_hw_gpio_request_out(gc->sc->sc_ah, offset, "ath9k-gpio",
|
||||
+ AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
|
||||
+ ath9k_hw_set_gpio(sc->sc_ah, offset, value);
|
||||
+ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
@ -70,8 +87,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+/* gpio_chip handler : query GPIO direction (0=out, 1=in) */
|
||||
+static int ath9k_gpio_pin_get_dir(struct gpio_chip *chip, unsigned offset)
|
||||
+{
|
||||
+ struct ath_softc *sc = gpiochip_get_data(chip);
|
||||
+ struct ath_hw *ah = sc->sc_ah;
|
||||
+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip,
|
||||
+ gchip);
|
||||
+ struct ath_hw *ah = gc->sc->sc_ah;
|
||||
+
|
||||
+ return !((REG_READ(ah, AR_GPIO_OE_OUT(ah)) >> (offset * 2)) & 3);
|
||||
+}
|
||||
@ -79,59 +97,69 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+/* gpio_chip handler : get GPIO pin value */
|
||||
+static int ath9k_gpio_pin_get(struct gpio_chip *chip, unsigned offset)
|
||||
+{
|
||||
+ struct ath_softc *sc = gpiochip_get_data(chip);
|
||||
+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip,
|
||||
+ gchip);
|
||||
+
|
||||
+ return ath9k_hw_gpio_get(sc->sc_ah, offset);
|
||||
+ return ath9k_hw_gpio_get(gc->sc->sc_ah, offset);
|
||||
+}
|
||||
+
|
||||
+/* gpio_chip handler : set GPIO pin to value */
|
||||
+static void ath9k_gpio_pin_set(struct gpio_chip *chip, unsigned offset,
|
||||
+ int value)
|
||||
+{
|
||||
+ struct ath_softc *sc = gpiochip_get_data(chip);
|
||||
+ struct ath9k_gpio_chip *gc = container_of(chip, struct ath9k_gpio_chip,
|
||||
+ gchip);
|
||||
+
|
||||
+ ath9k_hw_set_gpio(sc->sc_ah, offset, value);
|
||||
+ ath9k_hw_set_gpio(gc->sc->sc_ah, offset, value);
|
||||
+}
|
||||
+
|
||||
+/* register GPIO chip */
|
||||
+static void ath9k_register_gpio_chip(struct ath_softc *sc)
|
||||
+{
|
||||
+ struct gpio_chip *gc = sc->gpiochip;
|
||||
+ struct ath9k_gpio_chip *gc;
|
||||
+ struct ath_hw *ah = sc->sc_ah;
|
||||
+
|
||||
+ gc = kzalloc(sizeof(struct gpio_chip), GFP_KERNEL);
|
||||
+ gc = kzalloc(sizeof(struct ath9k_gpio_chip), GFP_KERNEL);
|
||||
+ if (!gc)
|
||||
+ return;
|
||||
+
|
||||
+ gc->label = kasprintf(GFP_KERNEL, "ath9k-%s",
|
||||
+ wiphy_name(sc->hw->wiphy));
|
||||
+ gc->parent = sc->dev;
|
||||
+ gc->base = -1; /* determine base automatically */
|
||||
+ gc->ngpio = ah->caps.num_gpio_pins;
|
||||
+ gc->direction_input = ath9k_gpio_pin_cfg_input;
|
||||
+ gc->direction_output = ath9k_gpio_pin_cfg_output;
|
||||
+ gc->get_direction = ath9k_gpio_pin_get_dir;
|
||||
+ gc->get = ath9k_gpio_pin_get;
|
||||
+ gc->set = ath9k_gpio_pin_set;
|
||||
+ gc->sc = sc;
|
||||
+ snprintf(gc->label, sizeof(gc->label), "ath9k-%s",
|
||||
+ wiphy_name(sc->hw->wiphy));
|
||||
+#ifdef CONFIG_OF
|
||||
+ gc->gchip.parent = sc->dev;
|
||||
+#endif
|
||||
+ gc->gchip.label = gc->label;
|
||||
+ gc->gchip.base = -1; /* determine base automatically */
|
||||
+ gc->gchip.ngpio = ah->caps.num_gpio_pins;
|
||||
+ gc->gchip.direction_input = ath9k_gpio_pin_cfg_input;
|
||||
+ gc->gchip.direction_output = ath9k_gpio_pin_cfg_output;
|
||||
+ gc->gchip.get_direction = ath9k_gpio_pin_get_dir;
|
||||
+ gc->gchip.get = ath9k_gpio_pin_get;
|
||||
+ gc->gchip.set = ath9k_gpio_pin_set;
|
||||
+
|
||||
+ if (gpiochip_add_data(gc, sc)) {
|
||||
+ kfree(gc->label);
|
||||
+ if (gpiochip_add(&gc->gchip)) {
|
||||
+ kfree(gc);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+#ifdef CONFIG_OF
|
||||
+ gc->gchip.owner = NULL;
|
||||
+#endif
|
||||
+ sc->gpiochip = gc;
|
||||
+}
|
||||
+
|
||||
+/* remove GPIO chip */
|
||||
+static void ath9k_unregister_gpio_chip(struct ath_softc *sc)
|
||||
+{
|
||||
+ struct gpio_chip *gc = sc->gpiochip;
|
||||
+ struct ath9k_gpio_chip *gc = sc->gpiochip;
|
||||
+
|
||||
+ if (!gc)
|
||||
+ return;
|
||||
+
|
||||
+ gpiochip_remove(gc);
|
||||
+ kfree(gc->label);
|
||||
+ gpiochip_remove(&gc->gchip);
|
||||
+ kfree(gc);
|
||||
+ sc->gpiochip = NULL;
|
||||
+}
|
||||
+
|
||||
+#else /* CONFIG_GPIOLIB */
|
||||
@ -145,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+}
|
||||
+
|
||||
+#endif /* CONFIG_GPIOLIB */
|
||||
+
|
||||
|
||||
/********************************/
|
||||
/* LED functions */
|
||||
/********************************/
|
||||
@ -155,27 +183,27 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
static void ath_fill_led_pin(struct ath_softc *sc)
|
||||
{
|
||||
struct ath_hw *ah = sc->sc_ah;
|
||||
@@ -79,6 +187,12 @@ static int ath_add_led(struct ath_softc
|
||||
@@ -80,6 +202,12 @@ static int ath_add_led(struct ath_softc
|
||||
else
|
||||
ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low);
|
||||
|
||||
+#ifdef CONFIG_GPIOLIB
|
||||
+ /* If there is GPIO chip configured, reserve LED pin */
|
||||
+ if (sc->gpiochip)
|
||||
+ sc->gpiodesc = gpiod_get(sc->dev, gpio->name, GPIOD_ASIS);
|
||||
+ gpio_request(sc->gpiochip->gchip.base + gpio->gpio, gpio->name);
|
||||
+#endif
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -117,16 +231,23 @@ void ath_deinit_leds(struct ath_softc *s
|
||||
@@ -136,17 +264,24 @@ void ath_deinit_leds(struct ath_softc *s
|
||||
|
||||
while (!list_empty(&sc->leds)) {
|
||||
led = list_first_entry(&sc->leds, struct ath_led, list);
|
||||
+#ifdef CONFIG_GPIOLIB
|
||||
+ /* If there is GPIO chip configured, free LED pin */
|
||||
+ if (sc->gpiochip)
|
||||
+ gpiod_put(sc->gpiodesc);
|
||||
+ gpio_free(sc->gpiochip->gchip.base + led->gpio->gpio);
|
||||
+#endif
|
||||
list_del(&led->list);
|
||||
ath_led_brightness(&led->cdev, LED_OFF);
|
||||
@ -188,11 +216,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
void ath_init_leds(struct ath_softc *sc)
|
||||
{
|
||||
struct ath9k_platform_data *pdata = sc->dev->platform_data;
|
||||
+ struct device_node *np = sc->dev->of_node;
|
||||
char led_name[32];
|
||||
const char *trigger;
|
||||
|
||||
@@ -135,6 +256,15 @@ void ath_init_leds(struct ath_softc *sc)
|
||||
int i;
|
||||
@@ -156,6 +291,15 @@ void ath_init_leds(struct ath_softc *sc)
|
||||
if (AR_SREV_9100(sc->sc_ah))
|
||||
return;
|
||||
|
||||
@ -207,4 +236,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+
|
||||
ath_fill_led_pin(sc);
|
||||
|
||||
snprintf(led_name, sizeof(led_name), "ath9k-%s",
|
||||
if (pdata && pdata->leds && pdata->num_leds)
|
||||
@@ -180,6 +324,7 @@ void ath_init_leds(struct ath_softc *sc)
|
||||
ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger,
|
||||
!sc->sc_ah->config.led_active_high);
|
||||
}
|
||||
+
|
||||
#endif
|
||||
|
||||
/*******************/
|
||||
|
@ -0,0 +1,130 @@
|
||||
From: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
|
||||
Subject: [PATCH v5 5/8] mac80211: ath9k: enable GPIO buttons
|
||||
|
||||
Enable platform-defined GPIO button support for ath9k device.
|
||||
Key poller is activated for attached platform buttons.
|
||||
Requires ath9k GPIO chip access.
|
||||
|
||||
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -1057,6 +1057,7 @@ struct ath_softc {
|
||||
struct list_head leds;
|
||||
#ifdef CONFIG_GPIOLIB
|
||||
struct ath9k_gpio_chip *gpiochip;
|
||||
+ struct platform_device *btnpdev; /* gpio-keys-polled */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
@@ -17,6 +17,8 @@
|
||||
#include "ath9k.h"
|
||||
#include <linux/ath9k_platform.h>
|
||||
#include <linux/gpio.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/gpio_keys.h>
|
||||
|
||||
#ifdef CPTCFG_MAC80211_LEDS
|
||||
|
||||
@@ -129,6 +131,67 @@ static void ath9k_unregister_gpio_chip(s
|
||||
sc->gpiochip = NULL;
|
||||
}
|
||||
|
||||
+/******************/
|
||||
+/* GPIO Buttons */
|
||||
+/******************/
|
||||
+
|
||||
+/* add GPIO buttons */
|
||||
+static void ath9k_init_buttons(struct ath_softc *sc)
|
||||
+{
|
||||
+ struct ath9k_platform_data *pdata = sc->dev->platform_data;
|
||||
+ struct platform_device *pdev;
|
||||
+ struct gpio_keys_platform_data gkpdata;
|
||||
+ struct gpio_keys_button *bt;
|
||||
+ int i;
|
||||
+
|
||||
+ if (!sc->gpiochip)
|
||||
+ return;
|
||||
+
|
||||
+ if (!pdata || !pdata->btns || !pdata->num_btns)
|
||||
+ return;
|
||||
+
|
||||
+ bt = devm_kmemdup(sc->dev, pdata->btns,
|
||||
+ pdata->num_btns * sizeof(struct gpio_keys_button),
|
||||
+ GFP_KERNEL);
|
||||
+ if (!bt)
|
||||
+ return;
|
||||
+
|
||||
+ for (i = 0; i < pdata->num_btns; i++) {
|
||||
+ if (pdata->btns[i].gpio == sc->sc_ah->led_pin)
|
||||
+ sc->sc_ah->led_pin = -1;
|
||||
+
|
||||
+ ath9k_hw_gpio_request_in(sc->sc_ah, pdata->btns[i].gpio,
|
||||
+ "ath9k-gpio");
|
||||
+ bt[i].gpio = sc->gpiochip->gchip.base + pdata->btns[i].gpio;
|
||||
+ }
|
||||
+
|
||||
+ memset(&gkpdata, 0, sizeof(struct gpio_keys_platform_data));
|
||||
+ gkpdata.buttons = bt;
|
||||
+ gkpdata.nbuttons = pdata->num_btns;
|
||||
+ gkpdata.poll_interval = pdata->btn_poll_interval;
|
||||
+
|
||||
+ pdev = platform_device_register_data(sc->dev, "gpio-keys-polled",
|
||||
+ PLATFORM_DEVID_AUTO, &gkpdata,
|
||||
+ sizeof(gkpdata));
|
||||
+ if (!IS_ERR_OR_NULL(pdev))
|
||||
+ sc->btnpdev = pdev;
|
||||
+ else {
|
||||
+ sc->btnpdev = NULL;
|
||||
+ devm_kfree(sc->dev, bt);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* remove GPIO buttons */
|
||||
+static void ath9k_deinit_buttons(struct ath_softc *sc)
|
||||
+{
|
||||
+ if (!sc->gpiochip || !sc->btnpdev)
|
||||
+ return;
|
||||
+
|
||||
+ platform_device_unregister(sc->btnpdev);
|
||||
+
|
||||
+ sc->btnpdev = NULL;
|
||||
+}
|
||||
+
|
||||
#else /* CONFIG_GPIOLIB */
|
||||
|
||||
static inline void ath9k_register_gpio_chip(struct ath_softc *sc)
|
||||
@@ -139,6 +202,14 @@ static inline void ath9k_unregister_gpio
|
||||
{
|
||||
}
|
||||
|
||||
+static inline void ath9k_init_buttons(struct ath_softc *sc)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static inline void ath9k_deinit_buttons(struct ath_softc *sc)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
#endif /* CONFIG_GPIOLIB */
|
||||
|
||||
/********************************/
|
||||
@@ -262,6 +333,7 @@ void ath_deinit_leds(struct ath_softc *s
|
||||
{
|
||||
struct ath_led *led;
|
||||
|
||||
+ ath9k_deinit_buttons(sc);
|
||||
while (!list_empty(&sc->leds)) {
|
||||
led = list_first_entry(&sc->leds, struct ath_led, list);
|
||||
#ifdef CONFIG_GPIOLIB
|
||||
@@ -301,6 +373,7 @@ void ath_init_leds(struct ath_softc *sc)
|
||||
}
|
||||
|
||||
ath_fill_led_pin(sc);
|
||||
+ ath9k_init_buttons(sc);
|
||||
|
||||
if (pdata && pdata->leds && pdata->num_leds)
|
||||
for (i = 0; i < pdata->num_leds; i++) {
|
@ -209,7 +209,7 @@
|
||||
static int ath_ahb_probe(struct platform_device *pdev)
|
||||
{
|
||||
void __iomem *mem;
|
||||
@@ -79,6 +273,17 @@ static int ath_ahb_probe(struct platform
|
||||
@@ -80,6 +274,17 @@ static int ath_ahb_probe(struct platform
|
||||
int ret = 0;
|
||||
struct ath_hw *ah;
|
||||
char hw_name[64];
|
||||
@ -227,24 +227,24 @@
|
||||
|
||||
if (!dev_get_platdata(&pdev->dev)) {
|
||||
dev_err(&pdev->dev, "no platform data specified\n");
|
||||
@@ -111,17 +316,23 @@ static int ath_ahb_probe(struct platform
|
||||
@@ -118,17 +323,23 @@ static int ath_ahb_probe(struct platform
|
||||
sc->mem = mem;
|
||||
sc->irq = irq;
|
||||
|
||||
+#ifdef CONFIG_OF
|
||||
+ dev_id = of_ath_ahb_probe(pdev);
|
||||
+#endif
|
||||
ret = devm_request_irq(&pdev->dev, irq, ath_isr, IRQF_SHARED, "ath9k", sc);
|
||||
ret = request_irq(irq, ath_isr, IRQF_SHARED, "ath9k", sc);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "request_irq failed\n");
|
||||
return ret;
|
||||
goto err_free_hw;
|
||||
}
|
||||
|
||||
- ret = ath9k_init_device(id->driver_data, sc, &ath_ahb_bus_ops);
|
||||
+ ret = ath9k_init_device(dev_id, sc, &ath_ahb_bus_ops);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to initialize device\n");
|
||||
goto err_free_hw;
|
||||
goto err_irq;
|
||||
}
|
||||
+#ifdef CONFIG_OF
|
||||
+ pdev->dev.platform_data = NULL;
|
||||
@ -252,7 +252,7 @@
|
||||
|
||||
ah = sc->sc_ah;
|
||||
ath9k_hw_name(ah, hw_name, sizeof(hw_name));
|
||||
@@ -152,6 +363,9 @@ static struct platform_driver ath_ahb_dr
|
||||
@@ -162,6 +373,9 @@ static struct platform_driver ath_ahb_dr
|
||||
.remove_new = ath_ahb_remove,
|
||||
.driver = {
|
||||
.name = "ath9k",
|
||||
@ -264,15 +264,15 @@
|
||||
};
|
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -27,6 +27,7 @@
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <linux/time.h>
|
||||
#include <linux/hw_random.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
+#include <linux/reset.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "debug.h"
|
||||
@@ -1006,6 +1007,9 @@ struct ath_softc {
|
||||
@@ -1013,6 +1014,9 @@ struct ath_softc {
|
||||
struct ath_hw *sc_ah;
|
||||
void __iomem *mem;
|
||||
int irq;
|
||||
|
@ -43,8 +43,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+compat-$(CPTCFG_KERNEL_5_15) += backport-5.15.o backport-genetlink.o
|
||||
+compat-$(CPTCFG_KERNEL_6_1) += backport-genetlink.o
|
||||
compat-$(CPTCFG_KERNEL_6_4) += backport-6.4.o
|
||||
compat-$(CPTCFG_KERNEL_6_11) += backport-6.11.o
|
||||
|
||||
compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_LIB_ARC4) += lib-crypto-arc4.o
|
||||
--- a/compat/backport-genetlink.c
|
||||
+++ b/compat/backport-genetlink.c
|
||||
@@ -17,6 +17,7 @@
|
||||
|
@ -1,20 +0,0 @@
|
||||
Remove not needed warning when get peer unmap
|
||||
event from the firmware. This is not critical
|
||||
message. Instead print this as a debug message.
|
||||
|
||||
Signed-off-by: Janusz Dziedzic <janusz.dziedzic at tieto.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath10k/txrx.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/txrx.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
|
||||
@@ -266,7 +266,7 @@ void ath10k_peer_unmap_event(struct ath1
|
||||
spin_lock_bh(&ar->data_lock);
|
||||
peer = ath10k_peer_find_by_id(ar, ev->peer_id);
|
||||
if (!peer) {
|
||||
- ath10k_warn(ar, "peer-unmap-event: unknown peer id %d\n",
|
||||
+ ath10k_dbg(ar, ATH10K_DBG_HTT, "peer-unmap-event: unknown peer id %d\n",
|
||||
ev->peer_id);
|
||||
goto exit;
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/pci.c
|
||||
@@ -1975,6 +1975,7 @@ static int ath10k_pci_hif_start(struct a
|
||||
|
||||
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif start\n");
|
||||
|
||||
+ dev_set_threaded(ar->napi_dev, true);
|
||||
ath10k_core_napi_enable(ar);
|
||||
|
||||
ath10k_pci_irq_enable(ar);
|
||||
--- a/drivers/net/wireless/ath/ath10k/sdio.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/sdio.c
|
||||
@@ -1863,6 +1863,7 @@ static int ath10k_sdio_hif_start(struct
|
||||
struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar);
|
||||
int ret;
|
||||
|
||||
+ dev_set_threaded(&ar->napi_dev, true);
|
||||
ath10k_core_napi_enable(ar);
|
||||
|
||||
/* Sleep 20 ms before HIF interrupts are disabled.
|
||||
--- a/drivers/net/wireless/ath/ath10k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/core.c
|
||||
@@ -3708,6 +3708,10 @@ struct ath10k *ath10k_core_create(size_t
|
||||
if (!ar->napi_dev)
|
||||
goto err_free_tx_complete;
|
||||
|
||||
+ snprintf(ar->napi_dev->name, sizeof(ar->napi_dev->name), "ath10k_%s",
|
||||
+ wiphy_name(ar->hw->wiphy));
|
||||
+ dev_set_threaded(ar->napi_dev, true);
|
||||
+
|
||||
ret = ath10k_coredump_create(ar);
|
||||
if (ret)
|
||||
goto err_free_netdev;
|
||||
--- a/drivers/net/wireless/ath/ath10k/ahb.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/ahb.c
|
||||
@@ -622,6 +622,7 @@ static int ath10k_ahb_hif_start(struct a
|
||||
ath10k_core_napi_enable(ar);
|
||||
ath10k_ce_enable_interrupts(ar);
|
||||
ath10k_pci_enable_intx_irq(ar);
|
||||
+ dev_set_threaded(&ar->napi_dev, true);
|
||||
|
||||
ath10k_pci_rx_post(ar);
|
||||
|
@ -1,48 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -4275,22 +4275,28 @@ static int ath11k_clear_peer_keys(struct
|
||||
int ret;
|
||||
int i;
|
||||
u32 flags = 0;
|
||||
+ struct ieee80211_key_conf *keys[WMI_MAX_KEY_INDEX + 1];
|
||||
|
||||
lockdep_assert_held(&ar->conf_mutex);
|
||||
|
||||
spin_lock_bh(&ab->base_lock);
|
||||
peer = ath11k_peer_find(ab, arvif->vdev_id, addr);
|
||||
- spin_unlock_bh(&ab->base_lock);
|
||||
-
|
||||
- if (!peer)
|
||||
+ if (!peer) {
|
||||
+ spin_unlock_bh(&ab->base_lock);
|
||||
return -ENOENT;
|
||||
+ }
|
||||
+ for (i = 0; i < ARRAY_SIZE(keys); i++) {
|
||||
+ keys[i]= peer->keys[i];
|
||||
+ peer->keys[i]= NULL;
|
||||
+ }
|
||||
+ spin_unlock_bh(&ab->base_lock);
|
||||
|
||||
- for (i = 0; i < ARRAY_SIZE(peer->keys); i++) {
|
||||
- if (!peer->keys[i])
|
||||
+ for (i = 0; i < ARRAY_SIZE(keys); i++) {
|
||||
+ if (!keys[i])
|
||||
continue;
|
||||
|
||||
/* key flags are not required to delete the key */
|
||||
- ret = ath11k_install_key(arvif, peer->keys[i],
|
||||
+ ret = ath11k_install_key(arvif, keys[i],
|
||||
DISABLE_KEY, addr, flags);
|
||||
if (ret < 0 && first_errno == 0)
|
||||
first_errno = ret;
|
||||
@@ -4298,10 +4304,6 @@ static int ath11k_clear_peer_keys(struct
|
||||
if (ret < 0)
|
||||
ath11k_warn(ab, "failed to remove peer key %d: %d\n",
|
||||
i, ret);
|
||||
-
|
||||
- spin_lock_bh(&ab->base_lock);
|
||||
- peer->keys[i] = NULL;
|
||||
- spin_unlock_bh(&ab->base_lock);
|
||||
}
|
||||
|
||||
return first_errno;
|
@ -1,671 +0,0 @@
|
||||
From 4635ca1f29bc5838d556b09e3c186b76a5198ddb Mon Sep 17 00:00:00 2001
|
||||
From: Manikanta Pubbisetty <mpubbise@codeaurora.org>
|
||||
Date: Fri, 18 Aug 2023 11:43:33 +0530
|
||||
Subject: [PATCH] ath11k: add rx histogram stats
|
||||
|
||||
Adding rx rate table and byte level peer rx statistics. Also,
|
||||
adding a debugfs knob to reset rx stats specific to the peer.
|
||||
|
||||
Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/core.h | 19 ++-
|
||||
drivers/net/wireless/ath/ath11k/debugfs_sta.c | 152 ++++++++++++++++--
|
||||
drivers/net/wireless/ath/ath11k/dp_rx.c | 95 +++++++++--
|
||||
drivers/net/wireless/ath/ath11k/dp_rx.h | 19 +++
|
||||
drivers/net/wireless/ath/ath11k/hal_rx.c | 85 +++++++---
|
||||
drivers/net/wireless/ath/ath11k/hal_rx.h | 21 +++
|
||||
drivers/net/wireless/ath/ath11k/hw.c | 18 +++
|
||||
drivers/net/wireless/ath/ath11k/hw.h | 1 +
|
||||
8 files changed, 351 insertions(+), 59 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
||||
@@ -44,6 +44,8 @@
|
||||
|
||||
#define ATH11K_INVALID_HW_MAC_ID 0xFF
|
||||
#define ATH11K_CONNECTION_LOSS_HZ (3 * HZ)
|
||||
+#define ATH11K_RX_RATE_TABLE_NUM 320
|
||||
+#define ATH11K_RX_RATE_TABLE_11AX_NUM 576
|
||||
|
||||
#define ATH11K_QCN6122_USERPD_2 1
|
||||
#define ATH11K_QCN6122_USERPD_3 2
|
||||
@@ -429,6 +431,17 @@ struct ath11k_vif_iter {
|
||||
struct ath11k_vif *arvif;
|
||||
};
|
||||
|
||||
+struct ath11k_rx_peer_rate_stats {
|
||||
+ u64 ht_mcs_count[HAL_RX_MAX_MCS_HT + 1];
|
||||
+ u64 vht_mcs_count[HAL_RX_MAX_MCS_VHT + 1];
|
||||
+ u64 he_mcs_count[HAL_RX_MAX_MCS_HE + 1];
|
||||
+ u64 nss_count[HAL_RX_MAX_NSS];
|
||||
+ u64 bw_count[HAL_RX_BW_MAX];
|
||||
+ u64 gi_count[HAL_RX_GI_MAX];
|
||||
+ u64 legacy_count[HAL_RX_MAX_NUM_LEGACY_RATES];
|
||||
+ u64 rx_rate[ATH11K_RX_RATE_TABLE_11AX_NUM];
|
||||
+};
|
||||
+
|
||||
struct ath11k_rx_peer_stats {
|
||||
u64 num_msdu;
|
||||
u64 num_mpdu_fcs_ok;
|
||||
@@ -440,10 +453,6 @@ struct ath11k_rx_peer_stats {
|
||||
u64 non_ampdu_msdu_count;
|
||||
u64 stbc_count;
|
||||
u64 beamformed_count;
|
||||
- u64 mcs_count[HAL_RX_MAX_MCS + 1];
|
||||
- u64 nss_count[HAL_RX_MAX_NSS];
|
||||
- u64 bw_count[HAL_RX_BW_MAX];
|
||||
- u64 gi_count[HAL_RX_GI_MAX];
|
||||
u64 coding_count[HAL_RX_SU_MU_CODING_MAX];
|
||||
u64 tid_count[IEEE80211_NUM_TIDS + 1];
|
||||
u64 pream_cnt[HAL_RX_PREAMBLE_MAX];
|
||||
@@ -451,6 +460,8 @@ struct ath11k_rx_peer_stats {
|
||||
u64 rx_duration;
|
||||
u64 dcm_count;
|
||||
u64 ru_alloc_cnt[HAL_RX_RU_ALLOC_TYPE_MAX];
|
||||
+ struct ath11k_rx_peer_rate_stats pkt_stats;
|
||||
+ struct ath11k_rx_peer_rate_stats byte_stats;
|
||||
};
|
||||
|
||||
#define ATH11K_HE_MCS_NUM 12
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "peer.h"
|
||||
#include "debug.h"
|
||||
#include "dp_tx.h"
|
||||
+#include "dp_rx.h"
|
||||
#include "debugfs_htt_stats.h"
|
||||
|
||||
void ath11k_debugfs_sta_add_tx_stats(struct ath11k_sta *arsta,
|
||||
@@ -248,8 +249,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;
|
||||
- const int size = 4096;
|
||||
+ const int size = 4 * 4096;
|
||||
char *buf;
|
||||
+ int he_rates_avail = (rx_stats->pream_cnt[HAL_RX_PREAMBLE_11AX] > 1) ? 1 : 0;
|
||||
+ int rate_table_len = he_rates_avail ? ATH11K_RX_RATE_TABLE_11AX_NUM :
|
||||
+ ATH11K_RX_RATE_TABLE_NUM;
|
||||
+ char *legacy_rate_str[] = {"1Mbps", "2Mbps", "5.5Mbps", "6Mbps",
|
||||
+ "9Mbps", "11Mbps", "12Mbps", "18Mbps",
|
||||
+ "24Mbps", "36 Mbps", "48Mbps", "54Mbps"};
|
||||
|
||||
if (!rx_stats)
|
||||
return -ENOENT;
|
||||
@@ -280,14 +287,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);
|
||||
- len += scnprintf(buf + len, size - len,
|
||||
- "GI: 0.8us %llu 0.4us %llu 1.6us %llu 3.2us %llu\n",
|
||||
- rx_stats->gi_count[0], rx_stats->gi_count[1],
|
||||
- rx_stats->gi_count[2], rx_stats->gi_count[3]);
|
||||
- len += scnprintf(buf + len, size - len,
|
||||
- "BW: 20Mhz %llu 40Mhz %llu 80Mhz %llu 160Mhz %llu\n",
|
||||
- rx_stats->bw_count[0], rx_stats->bw_count[1],
|
||||
- rx_stats->bw_count[2], rx_stats->bw_count[3]);
|
||||
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,
|
||||
@@ -302,14 +301,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]);
|
||||
- len += scnprintf(buf + len, size - len, "\nMCS(0-11) Legacy MCS(12):");
|
||||
- for (i = 0; i < HAL_RX_MAX_MCS + 1; i++)
|
||||
- len += scnprintf(buf + len, size - len, "%llu ", rx_stats->mcs_count[i]);
|
||||
- len += scnprintf(buf + len, size - len, "\nNSS(1-8):");
|
||||
- for (i = 0; i < HAL_RX_MAX_NSS; i++)
|
||||
- len += scnprintf(buf + len, size - len, "%llu ", rx_stats->nss_count[i]);
|
||||
- len += scnprintf(buf + len, size - len, "\nRX Duration:%llu ",
|
||||
+ len += scnprintf(buf + len, size - len, "\nRX Duration:%llu\n",
|
||||
rx_stats->rx_duration);
|
||||
+
|
||||
+ len += scnprintf(buf + len, size - len, "\nRX success packet stats:\n");
|
||||
+ len += scnprintf(buf + len, size - len, "\nHE packet stats:\n");
|
||||
+ for (i = 0; i <= HAL_RX_MAX_MCS_HE; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "MCS %d: %llu%s", i,
|
||||
+ rx_stats->pkt_stats.he_mcs_count[i],
|
||||
+ (i + 1) % 6 ? "\t" : "\n");
|
||||
+ len += scnprintf(buf + len, size - len, "\nVHT packet stats:\n");
|
||||
+ for (i = 0; i <= HAL_RX_MAX_MCS_VHT; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "MCS %d: %llu%s", i,
|
||||
+ rx_stats->pkt_stats.vht_mcs_count[i],
|
||||
+ (i + 1) % 5 ? "\t" : "\n");
|
||||
+ len += scnprintf(buf + len, size - len, "\nHT packet stats:\n");
|
||||
+ for (i = 0; i <= HAL_RX_MAX_MCS_HT; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "MCS %d: %llu%s", i,
|
||||
+ rx_stats->pkt_stats.ht_mcs_count[i],
|
||||
+ (i + 1) % 8 ? "\t" : "\n");
|
||||
+ len += scnprintf(buf + len, size - len, "\nLegacy rate packet stats:\n");
|
||||
+ for (i = 0; i < HAL_RX_MAX_NUM_LEGACY_RATES; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "%s: %llu%s", legacy_rate_str[i],
|
||||
+ rx_stats->pkt_stats.legacy_count[i],
|
||||
+ (i + 1) % 4 ? "\t" : "\n");
|
||||
+ len += scnprintf(buf + len, size - len, "\nNSS packet stats:\n");
|
||||
+ for (i = 0; i < HAL_RX_MAX_NSS; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "%dx%d: %llu ", i + 1, i + 1,
|
||||
+ rx_stats->pkt_stats.nss_count[i]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\n\nGI: 0.8us %llu 0.4us %llu 1.6us %llu 3.2us %llu\n",
|
||||
+ rx_stats->pkt_stats.gi_count[0],
|
||||
+ rx_stats->pkt_stats.gi_count[1],
|
||||
+ rx_stats->pkt_stats.gi_count[2],
|
||||
+ rx_stats->pkt_stats.gi_count[3]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "BW: 20Mhz %llu 40Mhz %llu 80Mhz %llu 160Mhz %llu\n",
|
||||
+ rx_stats->pkt_stats.bw_count[0],
|
||||
+ rx_stats->pkt_stats.bw_count[1],
|
||||
+ rx_stats->pkt_stats.bw_count[2],
|
||||
+ rx_stats->pkt_stats.bw_count[3]);
|
||||
+ len += scnprintf(buf + len, size - len, "\nRate Table (packets):\n");
|
||||
+ for (i = 0; i < rate_table_len; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "%10llu%s",
|
||||
+ rx_stats->pkt_stats.rx_rate[i],
|
||||
+ (i + 1) % (he_rates_avail ? 12 : 8) ? "\t" : "\n");
|
||||
+
|
||||
+ len += scnprintf(buf + len, size - len, "\nRX success byte stats:\n");
|
||||
+ len += scnprintf(buf + len, size - len, "\nHE byte stats:\n");
|
||||
+ for (i = 0; i <= HAL_RX_MAX_MCS_HE; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "MCS %d: %llu%s", i,
|
||||
+ rx_stats->byte_stats.he_mcs_count[i],
|
||||
+ (i + 1) % 6 ? "\t" : "\n");
|
||||
+
|
||||
+ len += scnprintf(buf + len, size - len, "\nVHT byte stats:\n");
|
||||
+ for (i = 0; i <= HAL_RX_MAX_MCS_VHT; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "MCS %d: %llu%s", i,
|
||||
+ rx_stats->byte_stats.vht_mcs_count[i],
|
||||
+ (i + 1) % 5 ? "\t" : "\n");
|
||||
+ len += scnprintf(buf + len, size - len, "\nHT byte stats:\n");
|
||||
+ for (i = 0; i <= HAL_RX_MAX_MCS_HT; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "MCS %d: %llu%s", i,
|
||||
+ rx_stats->byte_stats.ht_mcs_count[i],
|
||||
+ (i + 1) % 8 ? "\t" : "\n");
|
||||
+ len += scnprintf(buf + len, size - len, "\nLegacy rate byte stats:\n");
|
||||
+ for (i = 0; i < HAL_RX_MAX_NUM_LEGACY_RATES; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "%s: %llu%s", legacy_rate_str[i],
|
||||
+ rx_stats->byte_stats.legacy_count[i],
|
||||
+ (i + 1) % 4 ? "\t" : "\n");
|
||||
+ len += scnprintf(buf + len, size - len, "\nNSS byte stats:\n");
|
||||
+ for (i = 0; i < HAL_RX_MAX_NSS; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "%dx%d: %llu ", i + 1, i + 1,
|
||||
+ rx_stats->byte_stats.nss_count[i]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\n\nGI: 0.8us %llu 0.4us %llu 1.6us %llu 3.2us %llu\n",
|
||||
+ rx_stats->byte_stats.gi_count[0],
|
||||
+ rx_stats->byte_stats.gi_count[1],
|
||||
+ rx_stats->byte_stats.gi_count[2],
|
||||
+ rx_stats->byte_stats.gi_count[3]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "BW: 20Mhz %llu 40Mhz %llu 80Mhz %llu 160Mhz %llu\n",
|
||||
+ rx_stats->byte_stats.bw_count[0],
|
||||
+ rx_stats->byte_stats.bw_count[1],
|
||||
+ rx_stats->byte_stats.bw_count[2],
|
||||
+ rx_stats->byte_stats.bw_count[3]);
|
||||
+ len += scnprintf(buf + len, size - len, "\nRate Table (bytes):\n");
|
||||
+ for (i = 0; i < rate_table_len; i++)
|
||||
+ len += scnprintf(buf + len, size - len, "%10llu%s",
|
||||
+ rx_stats->byte_stats.rx_rate[i],
|
||||
+ (i + 1) % (he_rates_avail ? 12 : 8) ? "\t" : "\n");
|
||||
+
|
||||
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],
|
||||
@@ -848,6 +929,40 @@ static const struct file_operations fops
|
||||
.llseek = default_llseek,
|
||||
};
|
||||
|
||||
+static ssize_t ath11k_dbg_sta_reset_rx_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->rx_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->rx_stats, 0, sizeof(*arsta->rx_stats));
|
||||
+ spin_unlock_bh(&ar->ab->base_lock);
|
||||
+
|
||||
+ ret = count;
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations fops_reset_rx_stats = {
|
||||
+ .write = ath11k_dbg_sta_reset_rx_stats,
|
||||
+ .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)
|
||||
{
|
||||
@@ -856,9 +971,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_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,
|
||||
+ &fops_reset_rx_stats);
|
||||
+ }
|
||||
|
||||
debugfs_create_file("htt_peer_stats", 0400, dir, sta,
|
||||
&fops_htt_peer_stats);
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -2753,10 +2753,43 @@ exit:
|
||||
return total_msdu_reaped;
|
||||
}
|
||||
|
||||
+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,
|
||||
+ u32 num_msdu)
|
||||
+{
|
||||
+ u32 rate_idx = 0;
|
||||
+ u32 mcs_idx = ppdu_info->mcs;
|
||||
+ u32 nss_idx = ppdu_info->nss - 1;
|
||||
+ u32 bw_idx = ppdu_info->bw;
|
||||
+ u32 gi_idx = ppdu_info->gi;
|
||||
+
|
||||
+ if ((mcs_idx > HAL_RX_MAX_MCS_HE) || (nss_idx >= HAL_RX_MAX_NSS) ||
|
||||
+ (bw_idx >= HAL_RX_BW_MAX) || (gi_idx >= HAL_RX_GI_MAX)) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11N ||
|
||||
+ ppdu_info->preamble_type == HAL_RX_PREAMBLE_11AC) {
|
||||
+ rate_idx = mcs_idx * 8 + 8 * 10 * nss_idx;
|
||||
+ rate_idx += bw_idx * 2 + gi_idx;
|
||||
+ } else if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11AX) {
|
||||
+ gi_idx = ath11k_he_gi_to_nl80211_he_gi(ppdu_info->gi);
|
||||
+ rate_idx = mcs_idx * 12 + 12 * 12 * nss_idx;
|
||||
+ rate_idx += bw_idx * 3 + gi_idx;
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ rx_stats->pkt_stats.rx_rate[rate_idx] += num_msdu;
|
||||
+ rx_stats->byte_stats.rx_rate[rate_idx] += ppdu_info->mpdu_len;
|
||||
+}
|
||||
+
|
||||
static void ath11k_dp_rx_update_peer_stats(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;
|
||||
int i;
|
||||
|
||||
@@ -2766,6 +2799,8 @@ static void ath11k_dp_rx_update_peer_sta
|
||||
arsta->rssi_comb = ppdu_info->rssi_comb;
|
||||
ewma_avg_rssi_add(&arsta->avg_rssi, ppdu_info->rssi_comb);
|
||||
|
||||
+ 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;
|
||||
|
||||
@@ -2782,18 +2817,6 @@ static void ath11k_dp_rx_update_peer_sta
|
||||
ppdu_info->tid = IEEE80211_NUM_TIDS;
|
||||
}
|
||||
|
||||
- if (ppdu_info->nss > 0 && ppdu_info->nss <= HAL_RX_MAX_NSS)
|
||||
- rx_stats->nss_count[ppdu_info->nss - 1] += num_msdu;
|
||||
-
|
||||
- if (ppdu_info->mcs <= HAL_RX_MAX_MCS)
|
||||
- rx_stats->mcs_count[ppdu_info->mcs] += num_msdu;
|
||||
-
|
||||
- if (ppdu_info->gi < HAL_RX_GI_MAX)
|
||||
- rx_stats->gi_count[ppdu_info->gi] += num_msdu;
|
||||
-
|
||||
- if (ppdu_info->bw < HAL_RX_BW_MAX)
|
||||
- rx_stats->bw_count[ppdu_info->bw] += num_msdu;
|
||||
-
|
||||
if (ppdu_info->ldpc < HAL_RX_SU_MU_CODING_MAX)
|
||||
rx_stats->coding_count[ppdu_info->ldpc] += num_msdu;
|
||||
|
||||
@@ -2822,8 +2845,6 @@ 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;
|
||||
|
||||
- arsta->rssi_comb = ppdu_info->rssi_comb;
|
||||
-
|
||||
BUILD_BUG_ON(ARRAY_SIZE(arsta->chain_signal) >
|
||||
ARRAY_SIZE(ppdu_info->rssi_chain_pri20));
|
||||
|
||||
@@ -2832,6 +2853,52 @@ static void ath11k_dp_rx_update_peer_sta
|
||||
|
||||
rx_stats->rx_duration += ppdu_info->rx_duration;
|
||||
arsta->rx_duration = rx_stats->rx_duration;
|
||||
+
|
||||
+ if (ppdu_info->nss > 0 && ppdu_info->nss <= HAL_RX_MAX_NSS) {
|
||||
+ rx_stats->pkt_stats.nss_count[ppdu_info->nss - 1] += num_msdu;
|
||||
+ rx_stats->byte_stats.nss_count[ppdu_info->nss - 1] += ppdu_info->mpdu_len;
|
||||
+ }
|
||||
+
|
||||
+ if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11N &&
|
||||
+ ppdu_info->mcs <= HAL_RX_MAX_MCS_HT) {
|
||||
+ rx_stats->pkt_stats.ht_mcs_count[ppdu_info->mcs] += num_msdu;
|
||||
+ rx_stats->byte_stats.ht_mcs_count[ppdu_info->mcs] += ppdu_info->mpdu_len;
|
||||
+ /* To fit into rate table for HT packets */
|
||||
+ ppdu_info->mcs = ppdu_info->mcs % 8;
|
||||
+ }
|
||||
+
|
||||
+ if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11AC &&
|
||||
+ ppdu_info->mcs <= HAL_RX_MAX_MCS_VHT) {
|
||||
+ rx_stats->pkt_stats.vht_mcs_count[ppdu_info->mcs] += num_msdu;
|
||||
+ rx_stats->byte_stats.vht_mcs_count[ppdu_info->mcs] += ppdu_info->mpdu_len;
|
||||
+ }
|
||||
+
|
||||
+ if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11AX &&
|
||||
+ ppdu_info->mcs <= HAL_RX_MAX_MCS_HE) {
|
||||
+ rx_stats->pkt_stats.he_mcs_count[ppdu_info->mcs] += num_msdu;
|
||||
+ rx_stats->byte_stats.he_mcs_count[ppdu_info->mcs] += ppdu_info->mpdu_len;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ if ((ppdu_info->preamble_type == HAL_RX_PREAMBLE_11A ||
|
||||
+ ppdu_info->preamble_type == HAL_RX_PREAMBLE_11B) &&
|
||||
+ ppdu_info->rate < HAL_RX_LEGACY_RATE_INVALID) {
|
||||
+ rx_stats->pkt_stats.legacy_count[ppdu_info->rate] += num_msdu;
|
||||
+ rx_stats->byte_stats.legacy_count[ppdu_info->rate] += ppdu_info->mpdu_len;
|
||||
+ }
|
||||
+
|
||||
+ if (ppdu_info->gi < HAL_RX_GI_MAX) {
|
||||
+ rx_stats->pkt_stats.gi_count[ppdu_info->gi] += num_msdu;
|
||||
+ rx_stats->byte_stats.gi_count[ppdu_info->gi] += ppdu_info->mpdu_len;
|
||||
+ }
|
||||
+
|
||||
+ if (ppdu_info->bw < HAL_RX_BW_MAX) {
|
||||
+ rx_stats->pkt_stats.bw_count[ppdu_info->bw] += num_msdu;
|
||||
+ rx_stats->byte_stats.bw_count[ppdu_info->bw] += ppdu_info->mpdu_len;
|
||||
+ }
|
||||
+
|
||||
+ ath11k_dp_rx_update_peer_rate_table_stats(rx_stats, ppdu_info, num_msdu);
|
||||
+
|
||||
}
|
||||
|
||||
static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf(struct ath11k_base *ab,
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.h
|
||||
@@ -42,6 +42,25 @@ struct ath11k_dp_rfc1042_hdr {
|
||||
__be16 snap_type;
|
||||
} __packed;
|
||||
|
||||
+static inline u32 ath11k_he_gi_to_nl80211_he_gi(u8 sgi)
|
||||
+{
|
||||
+ u32 ret = 0;
|
||||
+
|
||||
+ switch (sgi) {
|
||||
+ case RX_MSDU_START_SGI_0_8_US:
|
||||
+ ret = NL80211_RATE_INFO_HE_GI_0_8;
|
||||
+ break;
|
||||
+ case RX_MSDU_START_SGI_1_6_US:
|
||||
+ ret = NL80211_RATE_INFO_HE_GI_1_6;
|
||||
+ break;
|
||||
+ case RX_MSDU_START_SGI_3_2_US:
|
||||
+ ret = NL80211_RATE_INFO_HE_GI_3_2;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
int ath11k_dp_rx_ampdu_start(struct ath11k *ar,
|
||||
struct ieee80211_ampdu_params *params);
|
||||
int ath11k_dp_rx_ampdu_stop(struct ath11k *ar,
|
||||
--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
|
||||
@@ -976,44 +976,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);
|
||||
- ppdu_info->gi = info1 & HAL_RX_HT_SIG_INFO_INFO1_GI;
|
||||
-
|
||||
- switch (ppdu_info->mcs) {
|
||||
- case 0 ... 7:
|
||||
- ppdu_info->nss = 1;
|
||||
- break;
|
||||
- case 8 ... 15:
|
||||
- ppdu_info->nss = 2;
|
||||
- break;
|
||||
- case 16 ... 23:
|
||||
- ppdu_info->nss = 3;
|
||||
- break;
|
||||
- case 24 ... 31:
|
||||
- ppdu_info->nss = 4;
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if (ppdu_info->nss > 1)
|
||||
- ppdu_info->mcs = ppdu_info->mcs % 8;
|
||||
-
|
||||
+ ppdu_info->gi = FIELD_GET(HAL_RX_HT_SIG_INFO_INFO1_GI, info1);
|
||||
+ ppdu_info->nss = (ppdu_info->mcs >> 3) + 1;
|
||||
ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU;
|
||||
break;
|
||||
}
|
||||
case HAL_PHYRX_L_SIG_B: {
|
||||
struct hal_rx_lsig_b_info *lsigb =
|
||||
(struct hal_rx_lsig_b_info *)tlv_data;
|
||||
+ u8 rate;
|
||||
+
|
||||
+ rate = FIELD_GET(HAL_RX_LSIG_B_INFO_INFO0_RATE,
|
||||
+ __le32_to_cpu(lsigb->info0));
|
||||
|
||||
- ppdu_info->rate = FIELD_GET(HAL_RX_LSIG_B_INFO_INFO0_RATE,
|
||||
- __le32_to_cpu(lsigb->info0));
|
||||
+ switch (rate) {
|
||||
+ case 1:
|
||||
+ rate = HAL_RX_LEGACY_RATE_1_MBPS;
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ case 5:
|
||||
+ rate = HAL_RX_LEGACY_RATE_2_MBPS;
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ case 6:
|
||||
+ rate = HAL_RX_LEGACY_RATE_5_5_MBPS;
|
||||
+ break;
|
||||
+ case 4:
|
||||
+ case 7:
|
||||
+ rate = HAL_RX_LEGACY_RATE_11_MBPS;
|
||||
+ break;
|
||||
+ default:
|
||||
+ rate = HAL_RX_LEGACY_RATE_INVALID;
|
||||
+ }
|
||||
+ ppdu_info->rate = rate;
|
||||
ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU;
|
||||
break;
|
||||
}
|
||||
case HAL_PHYRX_L_SIG_A: {
|
||||
struct hal_rx_lsig_a_info *lsiga =
|
||||
(struct hal_rx_lsig_a_info *)tlv_data;
|
||||
+ u8 rate;
|
||||
|
||||
- ppdu_info->rate = FIELD_GET(HAL_RX_LSIG_A_INFO_INFO0_RATE,
|
||||
- __le32_to_cpu(lsiga->info0));
|
||||
+ rate = FIELD_GET(HAL_RX_LSIG_A_INFO_INFO0_RATE,
|
||||
+ __le32_to_cpu(lsiga->info0));
|
||||
+ switch (rate) {
|
||||
+ case 8:
|
||||
+ rate = HAL_RX_LEGACY_RATE_48_MBPS;
|
||||
+ break;
|
||||
+ case 9:
|
||||
+ rate = HAL_RX_LEGACY_RATE_24_MBPS;
|
||||
+ break;
|
||||
+ case 10:
|
||||
+ rate = HAL_RX_LEGACY_RATE_12_MBPS;
|
||||
+ break;
|
||||
+ case 11:
|
||||
+ rate = HAL_RX_LEGACY_RATE_6_MBPS;
|
||||
+ break;
|
||||
+ case 12:
|
||||
+ rate = HAL_RX_LEGACY_RATE_54_MBPS;
|
||||
+ break;
|
||||
+ case 13:
|
||||
+ rate = HAL_RX_LEGACY_RATE_36_MBPS;
|
||||
+ break;
|
||||
+ case 14:
|
||||
+ rate = HAL_RX_LEGACY_RATE_18_MBPS;
|
||||
+ break;
|
||||
+ case 15:
|
||||
+ rate = HAL_RX_LEGACY_RATE_9_MBPS;
|
||||
+ break;
|
||||
+ default:
|
||||
+ rate = HAL_RX_LEGACY_RATE_INVALID;
|
||||
+ }
|
||||
+ ppdu_info->rate = rate;
|
||||
ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU;
|
||||
break;
|
||||
}
|
||||
@@ -1471,6 +1505,9 @@ ath11k_hal_rx_parse_mon_status_tlv(struc
|
||||
peer_id = ath11k_hal_rx_mpduinfo_get_peerid(ab, mpdu_info);
|
||||
if (peer_id)
|
||||
ppdu_info->peer_id = peer_id;
|
||||
+
|
||||
+ ppdu_info->mpdu_len += ab->hw_params.hw_ops->rx_desc_get_hal_mpdu_len(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
|
||||
@@ -20,7 +20,11 @@ struct hal_rx_wbm_rel_info {
|
||||
#define VHT_SIG_SU_NSS_MASK 0x7
|
||||
|
||||
#define HAL_RX_MAX_MCS 12
|
||||
+#define HAL_RX_MAX_MCS_HT 31
|
||||
+#define HAL_RX_MAX_MCS_VHT 9
|
||||
+#define HAL_RX_MAX_MCS_HE 11
|
||||
#define HAL_RX_MAX_NSS 8
|
||||
+#define HAL_RX_MAX_NUM_LEGACY_RATES 12
|
||||
|
||||
struct hal_rx_mon_status_tlv_hdr {
|
||||
u32 hdr;
|
||||
@@ -104,6 +108,22 @@ struct hal_rx_user_status {
|
||||
u32 mpdu_err_byte_count;
|
||||
};
|
||||
|
||||
+enum hal_rx_legacy_rate {
|
||||
+ HAL_RX_LEGACY_RATE_1_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_2_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_5_5_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_6_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_9_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_11_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_12_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_18_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_24_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_36_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_48_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_54_MBPS,
|
||||
+ HAL_RX_LEGACY_RATE_INVALID,
|
||||
+};
|
||||
+
|
||||
#define HAL_TLV_STATUS_PPDU_NOT_DONE HAL_RX_MON_STATUS_PPDU_NOT_DONE
|
||||
#define HAL_TLV_STATUS_PPDU_DONE HAL_RX_MON_STATUS_PPDU_DONE
|
||||
#define HAL_TLV_STATUS_BUF_DONE HAL_RX_MON_STATUS_BUF_DONE
|
||||
@@ -128,6 +148,7 @@ struct hal_rx_mon_ppdu_info {
|
||||
u32 num_mpdu_fcs_ok;
|
||||
u32 num_mpdu_fcs_err;
|
||||
u32 preamble_type;
|
||||
+ u32 mpdu_len;
|
||||
u16 chan_num;
|
||||
u16 tcp_msdu_count;
|
||||
u16 tcp_ack_msdu_count;
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.c
|
||||
@@ -900,6 +900,17 @@ static u32 ath11k_hw_wcn6750_get_tcl_rin
|
||||
return skb_get_hash(skb);
|
||||
}
|
||||
|
||||
+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 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));
|
||||
+}
|
||||
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,
|
||||
@@ -938,6 +949,7 @@ 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,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
|
||||
};
|
||||
|
||||
const struct ath11k_hw_ops ipq6018_ops = {
|
||||
@@ -978,6 +990,7 @@ 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,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
|
||||
};
|
||||
|
||||
const struct ath11k_hw_ops qca6390_ops = {
|
||||
@@ -1018,6 +1031,7 @@ const struct ath11k_hw_ops qca6390_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,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
|
||||
};
|
||||
|
||||
const struct ath11k_hw_ops qcn9074_ops = {
|
||||
@@ -1058,6 +1072,7 @@ const struct ath11k_hw_ops qcn9074_ops =
|
||||
.rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
|
||||
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len,
|
||||
};
|
||||
|
||||
const struct ath11k_hw_ops wcn6855_ops = {
|
||||
@@ -1098,6 +1113,7 @@ const struct ath11k_hw_ops wcn6855_ops =
|
||||
.rx_desc_mac_addr2_valid = ath11k_hw_wcn6855_rx_desc_mac_addr2_valid,
|
||||
.rx_desc_mpdu_start_addr2 = ath11k_hw_wcn6855_rx_desc_mpdu_start_addr2,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_ipq8074_rx_desc_get_hal_mpdu_len,
|
||||
};
|
||||
|
||||
const struct ath11k_hw_ops wcn6750_ops = {
|
||||
@@ -1179,6 +1195,7 @@ const struct ath11k_hw_ops ipq5018_ops =
|
||||
.rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
|
||||
.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
|
||||
.get_ring_selector = ath11k_hw_ipq8074_get_tcl_ring_selector,
|
||||
+ .rx_desc_get_hal_mpdu_len = ath11k_hw_qcn9074_rx_desc_get_hal_mpdu_len,
|
||||
};
|
||||
|
||||
#define ATH11K_TX_RING_MASK_0 BIT(0)
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
||||
@@ -276,6 +276,7 @@ struct ath11k_hw_ops {
|
||||
bool (*rx_desc_mac_addr2_valid)(struct hal_rx_desc *desc);
|
||||
u8* (*rx_desc_mpdu_start_addr2)(struct hal_rx_desc *desc);
|
||||
u32 (*get_ring_selector)(struct sk_buff *skb);
|
||||
+ u32 (*rx_desc_get_hal_mpdu_len)(struct hal_rx_mpdu_info *mpdu_info);
|
||||
};
|
||||
|
||||
extern const struct ath11k_hw_ops ipq8074_ops;
|
@ -1,774 +0,0 @@
|
||||
From e4f16128c53b48f166301085cecc23f77bf3ff8e Mon Sep 17 00:00:00 2001
|
||||
From: Miles Hu <milehu@codeaurora.org>
|
||||
Date: Fri, 11 Oct 2019 19:24:06 -0700
|
||||
Subject: [PATCH] ath11k: add HE stats in peer stats packet counters for MIMO
|
||||
and OFDMA
|
||||
|
||||
Signed-off-by: Miles Hu <milehu@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/core.h | 23 ++++-
|
||||
drivers/net/wireless/ath/ath11k/debugfs_sta.c | 127 +++++++++++++++++++++++++-
|
||||
drivers/net/wireless/ath/ath11k/dp.h | 21 ++++-
|
||||
drivers/net/wireless/ath/ath11k/dp_rx.c | 17 +++-
|
||||
drivers/net/wireless/ath/ath11k/rx_desc.h | 5 +
|
||||
5 files changed, 185 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "dbring.h"
|
||||
#include "spectral.h"
|
||||
#include "wow.h"
|
||||
+#include "rx_desc.h"
|
||||
#include "fw.h"
|
||||
|
||||
#define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK)
|
||||
@@ -522,6 +523,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];
|
||||
+ u64 transmit_type[ATH11K_COUNTER_TYPE_MAX][HAL_RX_RECEPTION_TYPE_MAX];
|
||||
+ u64 ru_loc[ATH11K_COUNTER_TYPE_MAX][HAL_RX_RU_ALLOC_TYPE_MAX];
|
||||
};
|
||||
|
||||
struct ath11k_htt_tx_stats {
|
||||
@@ -529,6 +532,9 @@ struct ath11k_htt_tx_stats {
|
||||
u64 tx_duration;
|
||||
u64 ba_fails;
|
||||
u64 ack_fails;
|
||||
+ u16 ru_start;
|
||||
+ u16 ru_tones;
|
||||
+ u32 mu_group[MAX_MU_GROUP_ID];
|
||||
};
|
||||
|
||||
struct ath11k_per_ppdu_tx_stats {
|
||||
@@ -645,11 +651,16 @@ struct ath11k_per_peer_tx_stats {
|
||||
u32 succ_bytes;
|
||||
u32 retry_bytes;
|
||||
u32 failed_bytes;
|
||||
+ u32 duration;
|
||||
u16 succ_pkts;
|
||||
u16 retry_pkts;
|
||||
u16 failed_pkts;
|
||||
- u32 duration;
|
||||
+ u16 ru_start;
|
||||
+ u16 ru_tones;
|
||||
u8 ba_fails;
|
||||
+ u8 ppdu_type;
|
||||
+ u32 mu_grpid;
|
||||
+ u32 mu_pos;
|
||||
bool is_ampdu;
|
||||
};
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c
|
||||
@@ -14,13 +14,39 @@
|
||||
#include "dp_rx.h"
|
||||
#include "debugfs_htt_stats.h"
|
||||
|
||||
+static inline u32 ath11k_he_tones_in_ru_to_nl80211_he_ru_alloc(u16 ru_tones)
|
||||
+{
|
||||
+ u32 ret = 0;
|
||||
+ switch (ru_tones) {
|
||||
+ case 26:
|
||||
+ ret = NL80211_RATE_INFO_HE_RU_ALLOC_26;
|
||||
+ break;
|
||||
+ case 52:
|
||||
+ ret = NL80211_RATE_INFO_HE_RU_ALLOC_52;
|
||||
+ break;
|
||||
+ case 106:
|
||||
+ ret = NL80211_RATE_INFO_HE_RU_ALLOC_106;
|
||||
+ break;
|
||||
+ case 242:
|
||||
+ ret = NL80211_RATE_INFO_HE_RU_ALLOC_242;
|
||||
+ break;
|
||||
+ case 484:
|
||||
+ ret = NL80211_RATE_INFO_HE_RU_ALLOC_484;
|
||||
+ break;
|
||||
+ case 996:
|
||||
+ ret = NL80211_RATE_INFO_HE_RU_ALLOC_996;
|
||||
+ break;
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
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;
|
||||
- int gi, mcs, bw, nss;
|
||||
+ int gi, mcs, bw, nss, ru_type, ppdu_type;
|
||||
|
||||
if (!arsta->tx_stats)
|
||||
return;
|
||||
@@ -65,6 +91,43 @@ void ath11k_debugfs_sta_add_tx_stats(str
|
||||
STATS_OP_FMT(RETRY).legacy[1][mcs] += peer_stats->retry_pkts;
|
||||
}
|
||||
|
||||
+ ppdu_type = peer_stats->ppdu_type;
|
||||
+ if ((ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA ||
|
||||
+ ppdu_type == HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA) &&
|
||||
+ (txrate->flags & RATE_INFO_FLAGS_HE_MCS)){
|
||||
+ ru_type = peer_stats->ru_tones;
|
||||
+
|
||||
+ if (ru_type <= NL80211_RATE_INFO_HE_RU_ALLOC_996) {
|
||||
+ STATS_OP_FMT(SUCC).ru_loc[0][ru_type] += peer_stats->succ_bytes;
|
||||
+ STATS_OP_FMT(SUCC).ru_loc[1][ru_type] += peer_stats->succ_pkts;
|
||||
+ STATS_OP_FMT(FAIL).ru_loc[0][ru_type] += peer_stats->failed_bytes;
|
||||
+ STATS_OP_FMT(FAIL).ru_loc[1][ru_type] += peer_stats->failed_pkts;
|
||||
+ STATS_OP_FMT(RETRY).ru_loc[0][ru_type] += peer_stats->retry_bytes;
|
||||
+ STATS_OP_FMT(RETRY).ru_loc[1][ru_type] += peer_stats->retry_pkts;
|
||||
+ if (peer_stats->is_ampdu) {
|
||||
+ STATS_OP_FMT(AMPDU).ru_loc[0][ru_type] +=
|
||||
+ peer_stats->succ_bytes + peer_stats->retry_bytes;
|
||||
+ STATS_OP_FMT(AMPDU).ru_loc[1][ru_type] +=
|
||||
+ peer_stats->succ_pkts + peer_stats->retry_pkts;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (ppdu_type < HTT_PPDU_STATS_PPDU_TYPE_MAX) {
|
||||
+ STATS_OP_FMT(SUCC).transmit_type[0][ppdu_type] += peer_stats->succ_bytes;
|
||||
+ STATS_OP_FMT(SUCC).transmit_type[1][ppdu_type] += peer_stats->succ_pkts;
|
||||
+ STATS_OP_FMT(FAIL).transmit_type[0][ppdu_type] += peer_stats->failed_bytes;
|
||||
+ STATS_OP_FMT(FAIL).transmit_type[1][ppdu_type] += peer_stats->failed_pkts;
|
||||
+ STATS_OP_FMT(RETRY).transmit_type[0][ppdu_type] += peer_stats->retry_bytes;
|
||||
+ STATS_OP_FMT(RETRY).transmit_type[1][ppdu_type] += peer_stats->retry_pkts;
|
||||
+ if (peer_stats->is_ampdu) {
|
||||
+ STATS_OP_FMT(AMPDU).transmit_type[0][ppdu_type] +=
|
||||
+ peer_stats->succ_bytes + peer_stats->retry_bytes;
|
||||
+ STATS_OP_FMT(AMPDU).transmit_type[1][ppdu_type] +=
|
||||
+ peer_stats->succ_pkts + peer_stats->retry_pkts;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (peer_stats->is_ampdu) {
|
||||
tx_stats->ba_fails += peer_stats->ba_fails;
|
||||
|
||||
@@ -125,6 +188,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;
|
||||
+
|
||||
+ tx_stats->ru_start = peer_stats->ru_start;
|
||||
+ tx_stats->ru_tones = peer_stats->ru_tones;
|
||||
+
|
||||
+ if (peer_stats->mu_grpid <= MAX_MU_GROUP_ID &&
|
||||
+ peer_stats->ppdu_type != HTT_PPDU_STATS_PPDU_TYPE_SU) {
|
||||
+ if (peer_stats->mu_grpid & (MAX_MU_GROUP_ID - 1))
|
||||
+ tx_stats->mu_group[peer_stats->mu_grpid] =
|
||||
+ (peer_stats->mu_pos + 1);
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
void ath11k_debugfs_sta_update_txcompl(struct ath11k *ar,
|
||||
@@ -141,12 +215,13 @@ static ssize_t ath11k_dbg_sta_dump_tx_st
|
||||
struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta);
|
||||
struct ath11k *ar = arsta->arvif->ar;
|
||||
struct ath11k_htt_data_stats *stats;
|
||||
- static const char *str_name[ATH11K_STATS_TYPE_MAX] = {"succ", "fail",
|
||||
+ static const char *str_name[ATH11K_STATS_TYPE_MAX] = {"success", "fail",
|
||||
"retry", "ampdu"};
|
||||
static const char *str[ATH11K_COUNTER_TYPE_MAX] = {"bytes", "packets"};
|
||||
int len = 0, i, j, k, retval = 0;
|
||||
const int size = 2 * 4096;
|
||||
- char *buf;
|
||||
+ char *buf, mu_group_id[MAX_MU_GROUP_LENGTH] = {0};
|
||||
+ u32 index;
|
||||
|
||||
if (!arsta->tx_stats)
|
||||
return -ENOENT;
|
||||
@@ -164,45 +239,46 @@ static ssize_t ath11k_dbg_sta_dump_tx_st
|
||||
len += scnprintf(buf + len, size - len, "%s_%s\n",
|
||||
str_name[k],
|
||||
str[j]);
|
||||
+ len += scnprintf(buf + len, size - len, "==========\n");
|
||||
len += scnprintf(buf + len, size - len,
|
||||
- " HE MCS %s\n",
|
||||
+ " HE MCS %s\n\t",
|
||||
str[j]);
|
||||
for (i = 0; i < ATH11K_HE_MCS_NUM; i++)
|
||||
len += scnprintf(buf + len, size - len,
|
||||
- " %llu ",
|
||||
+ "%llu ",
|
||||
stats->he[j][i]);
|
||||
len += scnprintf(buf + len, size - len, "\n");
|
||||
len += scnprintf(buf + len, size - len,
|
||||
- " VHT MCS %s\n",
|
||||
+ " VHT MCS %s\n\t",
|
||||
str[j]);
|
||||
for (i = 0; i < ATH11K_VHT_MCS_NUM; i++)
|
||||
len += scnprintf(buf + len, size - len,
|
||||
- " %llu ",
|
||||
+ "%llu ",
|
||||
stats->vht[j][i]);
|
||||
len += scnprintf(buf + len, size - len, "\n");
|
||||
- len += scnprintf(buf + len, size - len, " HT MCS %s\n",
|
||||
+ len += scnprintf(buf + len, size - len, " HT MCS %s\n\t",
|
||||
str[j]);
|
||||
for (i = 0; i < ATH11K_HT_MCS_NUM; i++)
|
||||
len += scnprintf(buf + len, size - len,
|
||||
- " %llu ", stats->ht[j][i]);
|
||||
+ "%llu ", stats->ht[j][i]);
|
||||
len += scnprintf(buf + len, size - len, "\n");
|
||||
len += scnprintf(buf + len, size - len,
|
||||
" BW %s (20,40,80,160 MHz)\n", str[j]);
|
||||
len += scnprintf(buf + len, size - len,
|
||||
- " %llu %llu %llu %llu\n",
|
||||
+ "\t%llu %llu %llu %llu\n",
|
||||
stats->bw[j][0], stats->bw[j][1],
|
||||
stats->bw[j][2], stats->bw[j][3]);
|
||||
len += scnprintf(buf + len, size - len,
|
||||
" NSS %s (1x1,2x2,3x3,4x4)\n", str[j]);
|
||||
len += scnprintf(buf + len, size - len,
|
||||
- " %llu %llu %llu %llu\n",
|
||||
+ "\t%llu %llu %llu %llu\n",
|
||||
stats->nss[j][0], stats->nss[j][1],
|
||||
stats->nss[j][2], stats->nss[j][3]);
|
||||
len += scnprintf(buf + len, size - len,
|
||||
" GI %s (0.4us,0.8us,1.6us,3.2us)\n",
|
||||
str[j]);
|
||||
len += scnprintf(buf + len, size - len,
|
||||
- " %llu %llu %llu %llu\n",
|
||||
+ "\t%llu %llu %llu %llu\n",
|
||||
stats->gi[j][0], stats->gi[j][1],
|
||||
stats->gi[j][2], stats->gi[j][3]);
|
||||
len += scnprintf(buf + len, size - len,
|
||||
@@ -211,10 +287,68 @@ 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]);
|
||||
- len += scnprintf(buf + len, size - len, "\n");
|
||||
+
|
||||
+ len += scnprintf(buf + len, size - len, "\n ru %s: \n", str[j]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tru 26: %llu\n", stats->ru_loc[j][0]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tru 52: %llu \n", stats->ru_loc[j][1]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tru 106: %llu \n", stats->ru_loc[j][2]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tru 242: %llu \n", stats->ru_loc[j][3]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tru 484: %llu \n", stats->ru_loc[j][4]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tru 996: %llu \n", stats->ru_loc[j][5]);
|
||||
+
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ " ppdu type %s: \n", str[j]);
|
||||
+ if (k == ATH11K_STATS_TYPE_FAIL ||
|
||||
+ k == ATH11K_STATS_TYPE_RETRY) {
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tSU/MIMO: %llu\n",
|
||||
+ stats->transmit_type[j][0]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tOFDMA/OFDMA_MIMO: %llu\n",
|
||||
+ stats->transmit_type[j][2]);
|
||||
+ } else {
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tSU: %llu\n",
|
||||
+ stats->transmit_type[j][0]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tMIMO: %llu\n",
|
||||
+ stats->transmit_type[j][1]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tOFDMA: %llu\n",
|
||||
+ stats->transmit_type[j][2]);
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\tOFDMA_MIMO: %llu\n",
|
||||
+ stats->transmit_type[j][3]);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
+ len += scnprintf(buf + len, size - len, "\n");
|
||||
+
|
||||
+ for (i = 0; i < MAX_MU_GROUP_ID;) {
|
||||
+ index = 0;
|
||||
+ for (j = 0; j < MAX_MU_GROUP_SHOW && i < MAX_MU_GROUP_ID;
|
||||
+ j++) {
|
||||
+ index += snprintf(&mu_group_id[index],
|
||||
+ MAX_MU_GROUP_LENGTH - index,
|
||||
+ " %d",
|
||||
+ arsta->tx_stats->mu_group[i]);
|
||||
+ i++;
|
||||
+ }
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "User position list for GID %02d->%d: [%s]\n",
|
||||
+ i - MAX_MU_GROUP_SHOW, i - 1, mu_group_id);
|
||||
+ }
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\nLast Packet RU index [%d], Size [%d]\n",
|
||||
+ arsta->tx_stats->ru_start, arsta->tx_stats->ru_tones);
|
||||
+
|
||||
len += scnprintf(buf + len, size - len,
|
||||
"\nTX duration\n %llu usecs\n",
|
||||
arsta->tx_stats->tx_duration);
|
||||
@@ -222,6 +356,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);
|
||||
+
|
||||
spin_unlock_bh(&ar->data_lock);
|
||||
|
||||
if (len > size)
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp.h
|
||||
@@ -603,6 +603,45 @@ enum htt_ppdu_stats_tag_type {
|
||||
BIT(HTT_PPDU_STATS_TAG_TX_MGMTCTRL_PAYLOAD) | \
|
||||
HTT_PPDU_STATS_TAG_DEFAULT)
|
||||
|
||||
+#define HTT_STATS_FRAMECTRL_TYPE_MASK 0x0C
|
||||
+#define HTT_STATS_GET_FRAME_CTRL_TYPE(_val) \
|
||||
+ (((_val) & HTT_STATS_FRAMECTRL_TYPE_MASK) >> 2)
|
||||
+#define HTT_STATS_FRAME_CTRL_TYPE_MGMT 0x0
|
||||
+#define HTT_STATS_FRAME_CTRL_TYPE_CTRL 0x1
|
||||
+#define HTT_STATS_FRAME_CTRL_TYPE_DATA 0x2
|
||||
+#define HTT_STATS_FRAME_CTRL_TYPE_RESV 0x3
|
||||
+
|
||||
+enum htt_stats_frametype {
|
||||
+ HTT_STATS_FTYPE_SGEN_NDPA = 0,
|
||||
+ HTT_STATS_FTYPE_SGEN_NDP,
|
||||
+ HTT_STATS_FTYPE_SGEN_BRP,
|
||||
+ HTT_STATS_FTYPE_SGEN_BAR,
|
||||
+ HTT_STATS_FTYPE_SGEN_RTS,
|
||||
+ HTT_STATS_FTYPE_SGEN_CTS,
|
||||
+ HTT_STATS_FTYPE_SGEN_CFEND,
|
||||
+ HTT_STATS_FTYPE_SGEN_AX_NDPA,
|
||||
+ HTT_STATS_FTYPE_SGEN_AX_NDP,
|
||||
+ HTT_STATS_FTYPE_SGEN_MU_TRIG,
|
||||
+ HTT_STATS_FTYPE_SGEN_MU_BAR,
|
||||
+ HTT_STATS_FTYPE_SGEN_MU_BRP,
|
||||
+ HTT_STATS_FTYPE_SGEN_MU_RTS,
|
||||
+ HTT_STATS_FTYPE_SGEN_MU_BSR,
|
||||
+ HTT_STATS_FTYPE_SGEN_UL_BSR,
|
||||
+ HTT_STATS_FTYPE_SGEN_UL_BSR_TRIGGER = HTT_STATS_FTYPE_SGEN_UL_BSR,
|
||||
+ HTT_STATS_FTYPE_TIDQ_DATA_SU,
|
||||
+ HTT_STATS_FTYPE_TIDQ_DATA_MU,
|
||||
+ HTT_STATS_FTYPE_SGEN_UL_BSR_RESP,
|
||||
+ HTT_STATS_FTYPE_SGEN_QOS_NULL,
|
||||
+ HTT_STATS_FTYPE_MAX,
|
||||
+};
|
||||
+
|
||||
+enum htt_stats_internal_ppdu_frametype {
|
||||
+ HTT_STATS_PPDU_FTYPE_CTRL,
|
||||
+ HTT_STATS_PPDU_FTYPE_DATA,
|
||||
+ HTT_STATS_PPDU_FTYPE_BAR,
|
||||
+ HTT_STATS_PPDU_FTYPE_MAX
|
||||
+};
|
||||
+
|
||||
/* HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG Message
|
||||
*
|
||||
* details:
|
||||
@@ -1242,6 +1281,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)
|
||||
|
||||
+enum HTT_PPDU_STATS_PPDU_TYPE {
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_SU,
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO,
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA,
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA,
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_UL_TRIG,
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_BURST_BCN,
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP,
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG,
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_UL_RESP,
|
||||
+ HTT_PPDU_STATS_PPDU_TYPE_MAX
|
||||
+};
|
||||
+
|
||||
#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)
|
||||
|
||||
@@ -1269,6 +1321,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)
|
||||
+#define HTT_USR_RATE_PPDU_TYPE(_val) \
|
||||
+ FIELD_GET(HTT_PPDU_STATS_USER_RATE_INFO1_PPDU_TYPE_M, _val)
|
||||
+#define HTT_USR_RATE_MU_GRPID(_val) \
|
||||
+ FIELD_GET(HTT_PPDU_STATS_USER_RATE_INFO0_MU_GROUP_ID_M, _val)
|
||||
+#define HTT_USR_RATE_USR_POS(_val) \
|
||||
+ FIELD_GET(HTT_PPDU_STATS_USER_RATE_INFO0_USER_POS_M, _val)
|
||||
|
||||
#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)
|
||||
@@ -1360,16 +1418,33 @@ struct htt_ppdu_stats_usr_cmpltn_ack_ba_
|
||||
u32 success_bytes;
|
||||
} __packed;
|
||||
|
||||
+#define HTT_PPDU_STATS_USR_CMN_FLAG_DELAYBA BIT(14)
|
||||
+#define HTT_PPDU_STATS_USR_CMN_HDR_SW_PEERID GENMASK(31, 16)
|
||||
+#define HTT_PPDU_STATS_USR_CMN_CTL_FRM_CTRL GENMASK(15, 0)
|
||||
+
|
||||
+struct htt_ppdu_stats_user_common {
|
||||
+ u8 tid_num;
|
||||
+ u8 vdev_id;
|
||||
+ u16 sw_peer_id;
|
||||
+ u32 info;
|
||||
+ u32 ctrl;
|
||||
+ u32 buffer_paddr_31_0;
|
||||
+ u32 buffer_paddr_39_32;
|
||||
+ u32 host_opaque_cookie;
|
||||
+} __packed;
|
||||
+
|
||||
struct htt_ppdu_user_stats {
|
||||
u16 peer_id;
|
||||
+ u16 delay_ba;
|
||||
u32 tlv_flags;
|
||||
bool is_valid_peer_id;
|
||||
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;
|
||||
};
|
||||
|
||||
-#define HTT_PPDU_STATS_MAX_USERS 8
|
||||
+#define HTT_PPDU_STATS_MAX_USERS 37
|
||||
#define HTT_PPDU_DESC_MAX_DEPTH 16
|
||||
|
||||
struct htt_ppdu_stats {
|
||||
@@ -1378,7 +1453,7 @@ struct htt_ppdu_stats {
|
||||
};
|
||||
|
||||
struct htt_ppdu_stats_info {
|
||||
- u32 ppdu_id;
|
||||
+ u32 tlv_bitmap, ppdu_id, frame_type, frame_ctrl, delay_ba, bar_num_users;
|
||||
struct htt_ppdu_stats ppdu_stats;
|
||||
struct list_head list;
|
||||
};
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -1244,9 +1244,10 @@ static int ath11k_htt_tlv_ppdu_stats_par
|
||||
void *data)
|
||||
{
|
||||
struct htt_ppdu_stats_info *ppdu_info;
|
||||
- struct htt_ppdu_user_stats *user_stats;
|
||||
+ struct htt_ppdu_user_stats *user_stats = NULL;
|
||||
int cur_user;
|
||||
u16 peer_id;
|
||||
+ u32 frame_type;
|
||||
|
||||
ppdu_info = data;
|
||||
|
||||
@@ -1259,6 +1260,26 @@ static int ath11k_htt_tlv_ppdu_stats_par
|
||||
}
|
||||
memcpy((void *)&ppdu_info->ppdu_stats.common, ptr,
|
||||
sizeof(struct htt_ppdu_stats_common));
|
||||
+ frame_type =
|
||||
+ FIELD_GET(HTT_PPDU_STATS_CMN_FLAGS_FRAME_TYPE_M,
|
||||
+ ppdu_info->ppdu_stats.common.flags);
|
||||
+ switch (frame_type) {
|
||||
+ case HTT_STATS_FTYPE_TIDQ_DATA_SU:
|
||||
+ case HTT_STATS_FTYPE_TIDQ_DATA_MU:
|
||||
+ if (HTT_STATS_GET_FRAME_CTRL_TYPE(ppdu_info->frame_ctrl) <= HTT_STATS_FRAME_CTRL_TYPE_CTRL)
|
||||
+ ppdu_info->frame_type = HTT_STATS_PPDU_FTYPE_CTRL;
|
||||
+ else
|
||||
+ ppdu_info->frame_type = HTT_STATS_PPDU_FTYPE_DATA;
|
||||
+ break;
|
||||
+ case HTT_STATS_FTYPE_SGEN_MU_BAR:
|
||||
+ case HTT_STATS_FTYPE_SGEN_BAR:
|
||||
+ ppdu_info->frame_type = HTT_STATS_PPDU_FTYPE_BAR;
|
||||
+ break;
|
||||
+ default:
|
||||
+ ppdu_info->frame_type = HTT_STATS_PPDU_FTYPE_CTRL;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
break;
|
||||
case HTT_PPDU_STATS_TAG_USR_RATE:
|
||||
if (len < sizeof(struct htt_ppdu_stats_user_rate)) {
|
||||
@@ -1291,6 +1312,7 @@ static int ath11k_htt_tlv_ppdu_stats_par
|
||||
peer_id);
|
||||
if (cur_user < 0)
|
||||
return -EINVAL;
|
||||
+ ppdu_info->bar_num_users += 1;
|
||||
user_stats = &ppdu_info->ppdu_stats.user_stats[cur_user];
|
||||
user_stats->peer_id = peer_id;
|
||||
user_stats->is_valid_peer_id = true;
|
||||
@@ -1319,44 +1341,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;
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-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),
|
||||
- void *data)
|
||||
-{
|
||||
- const struct htt_tlv *tlv;
|
||||
- const void *begin = ptr;
|
||||
- u16 tlv_tag, tlv_len;
|
||||
- int ret = -EINVAL;
|
||||
-
|
||||
- while (len > 0) {
|
||||
- if (len < sizeof(*tlv)) {
|
||||
- ath11k_err(ab, "htt tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n",
|
||||
- ptr - begin, len, sizeof(*tlv));
|
||||
+ case HTT_PPDU_STATS_TAG_USR_COMMON:
|
||||
+ if (len < sizeof(struct htt_ppdu_stats_user_common)) {
|
||||
+ ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n",
|
||||
+ len, tag);
|
||||
return -EINVAL;
|
||||
}
|
||||
- tlv = (struct htt_tlv *)ptr;
|
||||
- tlv_tag = FIELD_GET(HTT_TLV_TAG, tlv->header);
|
||||
- tlv_len = FIELD_GET(HTT_TLV_LEN, tlv->header);
|
||||
- ptr += sizeof(*tlv);
|
||||
- len -= sizeof(*tlv);
|
||||
-
|
||||
- if (tlv_len > len) {
|
||||
- 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,
|
||||
+ peer_id);
|
||||
+ if (cur_user < 0)
|
||||
return -EINVAL;
|
||||
- }
|
||||
- ret = iter(ab, tlv_tag, tlv_len, ptr, data);
|
||||
- if (ret == -ENOMEM)
|
||||
- return ret;
|
||||
-
|
||||
- ptr += tlv_len;
|
||||
- len -= tlv_len;
|
||||
+ user_stats = &ppdu_info->ppdu_stats.user_stats[cur_user];
|
||||
+ memcpy(&user_stats->common, ptr,
|
||||
+ sizeof(struct htt_ppdu_stats_user_common));
|
||||
+ ppdu_info->frame_ctrl = FIELD_GET(HTT_PPDU_STATS_USR_CMN_CTL_FRM_CTRL,
|
||||
+ user_stats->common.ctrl);
|
||||
+ user_stats->delay_ba = FIELD_GET(HTT_PPDU_STATS_USR_CMN_FLAG_DELAYBA,
|
||||
+ user_stats->common.info);
|
||||
+ ppdu_info->delay_ba = user_stats->delay_ba;
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
}
|
||||
+ ppdu_info->tlv_bitmap |= BIT(tag);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1374,8 +1382,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;
|
||||
- u32 succ_bytes = 0;
|
||||
- u16 rate = 0, succ_pkts = 0;
|
||||
+ u32 succ_bytes = 0, ppdu_type, mu_grpid, mu_pos;
|
||||
+ u16 rate = 0, succ_pkts = 0, ru_tone, ru_start;
|
||||
u32 tx_duration = 0;
|
||||
u8 tid = HTT_PPDU_STATS_NON_QOS_TID;
|
||||
bool is_ampdu = false;
|
||||
@@ -1406,6 +1414,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);
|
||||
+ ppdu_type = HTT_USR_RATE_PPDU_TYPE(user_rate->info1);
|
||||
+ mu_grpid = HTT_USR_RATE_MU_GRPID(user_rate->info0);
|
||||
+ mu_pos = HTT_USR_RATE_USR_POS(user_rate->info0);
|
||||
+ ru_start = user_rate->ru_start;
|
||||
+ ru_tone = user_rate->ru_end;
|
||||
|
||||
/* Note: If host configured fixed rates and in some other special
|
||||
* cases, the broadcast/management frames are sent in different rates.
|
||||
@@ -1500,6 +1513,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);
|
||||
+ peer_stats->ppdu_type = ppdu_type;
|
||||
+ peer_stats->ru_tones = ru_tone;
|
||||
+ peer_stats->ru_start = ru_start;
|
||||
+ peer_stats->mu_grpid = mu_grpid;
|
||||
+ peer_stats->mu_pos = mu_pos;
|
||||
+ peer_stats->ru_tones = arsta->txrate.he_ru_alloc;
|
||||
|
||||
if (ath11k_debugfs_is_extd_tx_stats_enabled(ar))
|
||||
ath11k_debugfs_sta_add_tx_stats(arsta, peer_stats, rate_idx);
|
||||
@@ -1552,13 +1571,89 @@ struct htt_ppdu_stats_info *ath11k_dp_ht
|
||||
return ppdu_info;
|
||||
}
|
||||
|
||||
+void ath11k_copy_to_delay_stats(struct ath11k_peer *peer,
|
||||
+ struct htt_ppdu_user_stats* usr_stats)
|
||||
+{
|
||||
+ peer->ppdu_stats_delayba.reserved0 = usr_stats->rate.reserved0;
|
||||
+ peer->ppdu_stats_delayba.sw_peer_id = usr_stats->rate.sw_peer_id;
|
||||
+ peer->ppdu_stats_delayba.info0 = usr_stats->rate.info0;
|
||||
+ peer->ppdu_stats_delayba.ru_end = usr_stats->rate.ru_end;
|
||||
+ peer->ppdu_stats_delayba.ru_start = usr_stats->rate.ru_start;
|
||||
+ peer->ppdu_stats_delayba.info1 = usr_stats->rate.info1;
|
||||
+ peer->ppdu_stats_delayba.rate_flags = usr_stats->rate.rate_flags;
|
||||
+ peer->ppdu_stats_delayba.resp_rate_flags = usr_stats->rate.resp_rate_flags;
|
||||
+
|
||||
+ peer->delayba_flag = true;
|
||||
+}
|
||||
+
|
||||
+void ath11k_copy_to_bar(struct ath11k_peer *peer,
|
||||
+ struct htt_ppdu_user_stats* usr_stats)
|
||||
+{
|
||||
+ usr_stats->rate.reserved0 = peer->ppdu_stats_delayba.reserved0;
|
||||
+ usr_stats->rate.sw_peer_id = peer->ppdu_stats_delayba.sw_peer_id;
|
||||
+ usr_stats->rate.info0 = peer->ppdu_stats_delayba.info0;
|
||||
+ usr_stats->rate.ru_end = peer->ppdu_stats_delayba.ru_end;
|
||||
+ usr_stats->rate.ru_start = peer->ppdu_stats_delayba.ru_start;
|
||||
+ usr_stats->rate.info1 = peer->ppdu_stats_delayba.info1;
|
||||
+ usr_stats->rate.rate_flags = peer->ppdu_stats_delayba.rate_flags;
|
||||
+ usr_stats->rate.resp_rate_flags = peer->ppdu_stats_delayba.resp_rate_flags;
|
||||
+
|
||||
+ peer->delayba_flag = false;
|
||||
+}
|
||||
+
|
||||
+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),
|
||||
+ void *data)
|
||||
+{
|
||||
+ const struct htt_tlv *tlv;
|
||||
+ const void *begin = ptr;
|
||||
+ u16 tlv_tag, tlv_len;
|
||||
+ int ret = -EINVAL;
|
||||
+ struct htt_ppdu_stats_info * ppdu_info = NULL;
|
||||
+
|
||||
+ 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",
|
||||
+ ptr - begin, len, sizeof(*tlv));
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ tlv = (struct htt_tlv *)ptr;
|
||||
+ tlv_tag = FIELD_GET(HTT_TLV_TAG, tlv->header);
|
||||
+ tlv_len = FIELD_GET(HTT_TLV_LEN, tlv->header);
|
||||
+ ptr += sizeof(*tlv);
|
||||
+ 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",
|
||||
+ tlv_tag, ptr - begin, len, tlv_len);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ ret = iter(ab, tlv_tag, tlv_len, ptr, ppdu_info);
|
||||
+ if (ret == -ENOMEM)
|
||||
+ return ret;
|
||||
+
|
||||
+ ptr += tlv_len;
|
||||
+ len -= tlv_len;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
struct ath11k_htt_ppdu_stats_msg *msg;
|
||||
struct htt_ppdu_stats_info *ppdu_info;
|
||||
+ struct ath11k_peer *peer = NULL;
|
||||
+ struct htt_ppdu_user_stats* usr_stats = NULL;
|
||||
+ u32 peer_id = 0;
|
||||
struct ath11k *ar;
|
||||
- int ret;
|
||||
+ int ret, i;
|
||||
u8 pdev_id;
|
||||
u32 ppdu_id, len;
|
||||
|
||||
@@ -1593,6 +1688,47 @@ static int ath11k_htt_pull_ppdu_stats(st
|
||||
goto out_unlock_data;
|
||||
}
|
||||
|
||||
+ /* back up data rate tlv for all peers */
|
||||
+ if (ppdu_info->frame_type == HTT_STATS_PPDU_FTYPE_DATA &&
|
||||
+ (ppdu_info->tlv_bitmap & (1 << HTT_PPDU_STATS_TAG_USR_COMMON)) &&
|
||||
+ ppdu_info->delay_ba) {
|
||||
+
|
||||
+ for (i = 0; i < ppdu_info->ppdu_stats.common.num_users; i++) {
|
||||
+ peer_id = ppdu_info->ppdu_stats.user_stats[i].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;
|
||||
+ }
|
||||
+
|
||||
+ usr_stats = &ppdu_info->ppdu_stats.user_stats[i];
|
||||
+ if (usr_stats->delay_ba)
|
||||
+ ath11k_copy_to_delay_stats(peer, usr_stats);
|
||||
+ spin_unlock_bh(&ab->base_lock);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* restore all peers' data rate tlv to mu-bar tlv */
|
||||
+ if (ppdu_info->frame_type == HTT_STATS_PPDU_FTYPE_BAR &&
|
||||
+ (ppdu_info->tlv_bitmap & (1 << HTT_PPDU_STATS_TAG_USR_COMMON))) {
|
||||
+
|
||||
+ for (i = 0; i < ppdu_info->bar_num_users; i++) {
|
||||
+ peer_id = ppdu_info->ppdu_stats.user_stats[i].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;
|
||||
+ }
|
||||
+
|
||||
+ usr_stats = &ppdu_info->ppdu_stats.user_stats[i];
|
||||
+ if (peer->delayba_flag)
|
||||
+ ath11k_copy_to_bar(peer, usr_stats);
|
||||
+ spin_unlock_bh(&ab->base_lock);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
out_unlock_data:
|
||||
spin_unlock_bh(&ar->data_lock);
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/rx_desc.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/rx_desc.h
|
||||
@@ -1495,6 +1495,11 @@ struct hal_rx_desc {
|
||||
} u;
|
||||
} __packed;
|
||||
|
||||
+#define MAX_USER_POS 8
|
||||
+#define MAX_MU_GROUP_ID 64
|
||||
+#define MAX_MU_GROUP_SHOW 16
|
||||
+#define MAX_MU_GROUP_LENGTH (6 * MAX_MU_GROUP_SHOW)
|
||||
+
|
||||
#define HAL_RX_RU_ALLOC_TYPE_MAX 6
|
||||
#define RU_26 1
|
||||
#define RU_52 2
|
||||
--- a/drivers/net/wireless/ath/ath11k/peer.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/peer.h
|
||||
@@ -7,6 +7,17 @@
|
||||
#ifndef ATH11K_PEER_H
|
||||
#define ATH11K_PEER_H
|
||||
|
||||
+struct ppdu_user_delayba {
|
||||
+ u8 reserved0;
|
||||
+ u16 sw_peer_id;
|
||||
+ u32 info0;
|
||||
+ u16 ru_end;
|
||||
+ u16 ru_start;
|
||||
+ u32 info1;
|
||||
+ u32 rate_flags;
|
||||
+ u32 resp_rate_flags;
|
||||
+};
|
||||
+
|
||||
struct ath11k_peer {
|
||||
struct list_head list;
|
||||
struct ieee80211_sta *sta;
|
||||
@@ -36,6 +47,8 @@ struct ath11k_peer {
|
||||
u16 sec_type_grp;
|
||||
bool is_authorized;
|
||||
bool dp_setup_done;
|
||||
+ struct ppdu_user_delayba ppdu_stats_delayba;
|
||||
+ bool delayba_flag;
|
||||
};
|
||||
|
||||
void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id);
|
@ -1,15 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -28,10 +28,10 @@ module_param_named(crypto_mode, ath11k_c
|
||||
MODULE_PARM_DESC(crypto_mode, "crypto mode: 0-hardware, 1-software");
|
||||
|
||||
/* 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))");
|
||||
|
||||
bool ath11k_ftm_mode;
|
||||
module_param_named(ftm_mode, ath11k_ftm_mode, bool, 0444);
|
@ -1,82 +0,0 @@
|
||||
From 3827a38706dcf081992fccf30957b29e81a25e5c Mon Sep 17 00:00:00 2001
|
||||
From: Miles Hu <milehu@codeaurora.org>
|
||||
Date: Mon, 25 Nov 2019 10:24:41 -0800
|
||||
Subject: [PATCH] ath11k: fix ul-ofdma counter always zero in peer stats
|
||||
|
||||
The problem is caused by RSSI_LEGACY tlv is not handled properly.
|
||||
All ul mu receiption information need to be extracted from the tlv.
|
||||
|
||||
Signed-off-by: Miles Hu <milehu@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/debugfs_sta.c | 7 -------
|
||||
drivers/net/wireless/ath/ath11k/hal_rx.c | 17 +++++++++++++++++
|
||||
drivers/net/wireless/ath/ath11k/hal_rx.h | 8 ++++++++
|
||||
3 files changed, 25 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c
|
||||
@@ -526,13 +526,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");
|
||||
|
||||
- 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],
|
||||
- rx_stats->ru_alloc_cnt[1], rx_stats->ru_alloc_cnt[2],
|
||||
- rx_stats->ru_alloc_cnt[3], rx_stats->ru_alloc_cnt[4],
|
||||
- rx_stats->ru_alloc_cnt[5]);
|
||||
-
|
||||
len += scnprintf(buf + len, size - len, "\n");
|
||||
|
||||
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
|
||||
@@ -1479,6 +1479,7 @@ ath11k_hal_rx_parse_mon_status_tlv(struc
|
||||
ab->wmi_ab.svc_map);
|
||||
struct hal_rx_phyrx_rssi_legacy_info *rssi =
|
||||
(struct hal_rx_phyrx_rssi_legacy_info *)tlv_data;
|
||||
+ u32 reception_type = 0;
|
||||
|
||||
/* TODO: Please note that the combined rssi will not be accurate
|
||||
* in MU case. Rssi in MU needs to be retrieved from
|
||||
@@ -1488,6 +1489,22 @@ ath11k_hal_rx_parse_mon_status_tlv(struc
|
||||
FIELD_GET(HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO0_RSSI_COMB,
|
||||
__le32_to_cpu(rssi->info0));
|
||||
|
||||
+ reception_type =
|
||||
+ FIELD_GET(HAL_RX_PHYRX_RSSI_LEGACY_INFO_RSVD1_RECEPTION,
|
||||
+ __le32_to_cpu(rssi->rsvd[0]));
|
||||
+
|
||||
+ switch (reception_type) {
|
||||
+ case HAL_RECEPTION_TYPE_ULOFMDA:
|
||||
+ ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_OFDMA;
|
||||
+ break;
|
||||
+ case HAL_RECEPTION_TYPE_ULMIMO:
|
||||
+ ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_MU_MIMO;
|
||||
+ break;
|
||||
+ default:
|
||||
+ ppdu_info->reception_type = HAL_RX_RECEPTION_TYPE_SU;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
if (db2dbm) {
|
||||
for (i = 0; i < ARRAY_SIZE(rssi->preamble); i++) {
|
||||
ppdu_info->rssi_chain_pri20[i] =
|
||||
--- a/drivers/net/wireless/ath/ath11k/hal_rx.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
|
||||
@@ -415,6 +415,15 @@ struct hal_rx_he_sig_b2_ofdma_info {
|
||||
|
||||
#define HAL_RX_PHYRX_RSSI_LEGACY_INFO_INFO0_RSSI_COMB GENMASK(15, 8)
|
||||
|
||||
+#define HAL_RX_PHYRX_RSSI_LEGACY_INFO_RSVD1_RECEPTION GENMASK(3, 0)
|
||||
+
|
||||
+enum hal_rx_ul_reception_type {
|
||||
+ HAL_RECEPTION_TYPE_ULOFMDA,
|
||||
+ HAL_RECEPTION_TYPE_ULMIMO,
|
||||
+ HAL_RECEPTION_TYPE_OTHER,
|
||||
+ HAL_RECEPTION_TYPE_FRAMELESS
|
||||
+};
|
||||
+
|
||||
#define HAL_RX_PHYRX_RSSI_PREAMBLE_PRI20 GENMASK(7, 0)
|
||||
|
||||
struct hal_rx_phyrx_chain_rssi {
|
@ -1,51 +0,0 @@
|
||||
drivers/net/wireless/ath/ath11k/dp_rx.c | 3 ++-
|
||||
drivers/net/wireless/ath/ath11k/hal_rx.c | 3 +++
|
||||
drivers/net/wireless/ath/ath11k/hal_rx.h | 2 ++
|
||||
3 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -5509,8 +5509,11 @@ int ath11k_dp_rx_process_mon_status(stru
|
||||
goto next_skb;
|
||||
}
|
||||
|
||||
- arsta = ath11k_sta_to_arsta(peer->sta);
|
||||
- ath11k_dp_rx_update_peer_stats(arsta, ppdu_info);
|
||||
+ if ((ppdu_info->fc_valid) &&
|
||||
+ (ppdu_info->ast_index != HAL_AST_IDX_INVALID)) {
|
||||
+ arsta = (struct ath11k_sta *)peer->sta->drv_priv;
|
||||
+ ath11k_dp_rx_update_peer_stats(arsta, ppdu_info);
|
||||
+ }
|
||||
|
||||
if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr))
|
||||
trace_ath11k_htt_rxdesc(ar, skb->data, log_type, rx_buf_sz);
|
||||
--- a/drivers/net/wireless/ath/ath11k/hal_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.c
|
||||
@@ -901,6 +901,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));
|
||||
+ ppdu_info->fc_valid =
|
||||
+ FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO1_FC_VALID,
|
||||
+ __le32_to_cpu(eu_stats->info1));
|
||||
ppdu_info->tid =
|
||||
ffs(FIELD_GET(HAL_RX_PPDU_END_USER_STATS_INFO7_TID_BITMAP,
|
||||
__le32_to_cpu(eu_stats->info7))) - 1;
|
||||
--- a/drivers/net/wireless/ath/ath11k/hal_rx.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
|
||||
@@ -71,6 +71,7 @@ enum hal_rx_reception_type {
|
||||
};
|
||||
|
||||
#define HAL_RX_FCS_LEN 4
|
||||
+#define HAL_AST_IDX_INVALID 0xFFFF
|
||||
|
||||
enum hal_rx_mon_status {
|
||||
HAL_RX_MON_STATUS_PPDU_NOT_DONE,
|
||||
@@ -172,6 +173,7 @@ struct hal_rx_mon_ppdu_info {
|
||||
u8 rssi_comb;
|
||||
u8 rssi_chain_pri20[HAL_RX_MAX_NSS];
|
||||
u16 tid;
|
||||
+ u8 fc_valid;
|
||||
u16 ht_flags;
|
||||
u16 vht_flags;
|
||||
u16 he_flags;
|
@ -1,452 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c
|
||||
@@ -525,6 +525,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");
|
||||
+ len += scnprintf(buf + len, size - len,
|
||||
+ "\nDCM: %llu\nRU26: %llu \nRU52: %llu \nRU106: %llu \nRU242: %llu \nRU484: %llu \nRU996: %llu\n",
|
||||
+ rx_stats->dcm_count, rx_stats->ru_alloc_cnt[0],
|
||||
+ rx_stats->ru_alloc_cnt[1], rx_stats->ru_alloc_cnt[2],
|
||||
+ rx_stats->ru_alloc_cnt[3], rx_stats->ru_alloc_cnt[4],
|
||||
+ rx_stats->ru_alloc_cnt[5]);
|
||||
|
||||
len += scnprintf(buf + len, size - len, "\n");
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -2892,11 +2892,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,
|
||||
+ struct hal_rx_user_status* user_stats,
|
||||
u32 num_msdu)
|
||||
{
|
||||
u32 rate_idx = 0;
|
||||
- u32 mcs_idx = ppdu_info->mcs;
|
||||
- u32 nss_idx = ppdu_info->nss - 1;
|
||||
+ u32 mcs_idx = (user_stats) ? user_stats->mcs : ppdu_info->mcs;
|
||||
+ u32 nss_idx = (user_stats) ? user_stats->nss - 1 : ppdu_info->nss - 1;
|
||||
u32 bw_idx = ppdu_info->bw;
|
||||
u32 gi_idx = ppdu_info->gi;
|
||||
|
||||
@@ -2918,10 +2919,13 @@ ath11k_dp_rx_update_peer_rate_table_stat
|
||||
}
|
||||
|
||||
rx_stats->pkt_stats.rx_rate[rate_idx] += num_msdu;
|
||||
- rx_stats->byte_stats.rx_rate[rate_idx] += ppdu_info->mpdu_len;
|
||||
+ if (user_stats)
|
||||
+ rx_stats->byte_stats.rx_rate[rate_idx] += user_stats->mpdu_ok_byte_count;
|
||||
+ else
|
||||
+ rx_stats->byte_stats.rx_rate[rate_idx] += ppdu_info->mpdu_len;
|
||||
}
|
||||
|
||||
-static void ath11k_dp_rx_update_peer_stats(struct ath11k_sta *arsta,
|
||||
+static void ath11k_dp_rx_update_peer_su_stats(struct ath11k_sta *arsta,
|
||||
struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
{
|
||||
struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats;
|
||||
@@ -2979,7 +2983,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;
|
||||
- rx_stats->ru_alloc_cnt[ppdu_info->ru_alloc] += num_msdu;
|
||||
|
||||
BUILD_BUG_ON(ARRAY_SIZE(arsta->chain_signal) >
|
||||
ARRAY_SIZE(ppdu_info->rssi_chain_pri20));
|
||||
@@ -2997,10 +3000,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) {
|
||||
- rx_stats->pkt_stats.ht_mcs_count[ppdu_info->mcs] += num_msdu;
|
||||
- rx_stats->byte_stats.ht_mcs_count[ppdu_info->mcs] += ppdu_info->mpdu_len;
|
||||
- /* To fit into rate table for HT packets */
|
||||
- ppdu_info->mcs = ppdu_info->mcs % 8;
|
||||
+ rx_stats->pkt_stats.ht_mcs_count[ppdu_info->mcs] += num_msdu;
|
||||
+ rx_stats->byte_stats.ht_mcs_count[ppdu_info->mcs] += ppdu_info->mpdu_len;
|
||||
+ /* To fit into rate table for HT packets */
|
||||
+ ppdu_info->mcs = ppdu_info->mcs % 8;
|
||||
}
|
||||
|
||||
if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11AC &&
|
||||
@@ -3033,7 +3036,120 @@ static void ath11k_dp_rx_update_peer_sta
|
||||
rx_stats->byte_stats.bw_count[ppdu_info->bw] += ppdu_info->mpdu_len;
|
||||
}
|
||||
|
||||
- ath11k_dp_rx_update_peer_rate_table_stats(rx_stats, ppdu_info, num_msdu);
|
||||
+ ath11k_dp_rx_update_peer_rate_table_stats(rx_stats, ppdu_info, NULL, num_msdu);
|
||||
+
|
||||
+}
|
||||
+
|
||||
+static void ath11k_dp_rx_update_user_stats(struct ath11k *ar,
|
||||
+ struct hal_rx_mon_ppdu_info *ppdu_info,
|
||||
+ u32 uid)
|
||||
+{
|
||||
+ struct ath11k_sta *arsta = NULL;
|
||||
+ struct ath11k_rx_peer_stats *rx_stats = NULL;
|
||||
+ struct hal_rx_user_status* user_stats = &ppdu_info->userstats[uid];
|
||||
+ struct ath11k_peer *peer;
|
||||
+ u32 num_msdu;
|
||||
+
|
||||
+ if (user_stats->ast_index == 0 || user_stats->ast_index == 0xFFFF)
|
||||
+ return;
|
||||
+
|
||||
+ peer = ath11k_peer_find_by_ast(ar->ab, user_stats->ast_index);
|
||||
+
|
||||
+ if (peer == NULL) {
|
||||
+ ath11k_warn(ar->ab, "peer ast idx %d can't be found\n",
|
||||
+ user_stats->ast_index);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ arsta = (struct ath11k_sta *)peer->sta->drv_priv;
|
||||
+ rx_stats = arsta->rx_stats;
|
||||
+
|
||||
+ if (!rx_stats)
|
||||
+ return;
|
||||
+
|
||||
+ arsta->rssi_comb = ppdu_info->rssi_comb;
|
||||
+
|
||||
+ num_msdu = user_stats->tcp_msdu_count + user_stats->tcp_ack_msdu_count +
|
||||
+ user_stats->udp_msdu_count + user_stats->other_msdu_count;
|
||||
+
|
||||
+ rx_stats->num_msdu += num_msdu;
|
||||
+ rx_stats->tcp_msdu_count += user_stats->tcp_msdu_count +
|
||||
+ user_stats->tcp_ack_msdu_count;
|
||||
+ rx_stats->udp_msdu_count += user_stats->udp_msdu_count;
|
||||
+ rx_stats->other_msdu_count += user_stats->other_msdu_count;
|
||||
+
|
||||
+ if (ppdu_info->ldpc < HAL_RX_SU_MU_CODING_MAX)
|
||||
+ rx_stats->coding_count[ppdu_info->ldpc] += num_msdu;
|
||||
+
|
||||
+ if (user_stats->tid <= IEEE80211_NUM_TIDS)
|
||||
+ rx_stats->tid_count[user_stats->tid] += num_msdu;
|
||||
+
|
||||
+ if (user_stats->preamble_type < HAL_RX_PREAMBLE_MAX)
|
||||
+ rx_stats->pream_cnt[user_stats->preamble_type] += num_msdu;
|
||||
+
|
||||
+ if (ppdu_info->reception_type < HAL_RX_RECEPTION_TYPE_MAX)
|
||||
+ rx_stats->reception_type[ppdu_info->reception_type] += num_msdu;
|
||||
+
|
||||
+ if (ppdu_info->is_stbc)
|
||||
+ rx_stats->stbc_count += num_msdu;
|
||||
+
|
||||
+ if (ppdu_info->beamformed)
|
||||
+ rx_stats->beamformed_count += num_msdu;
|
||||
+
|
||||
+ if (user_stats->mpdu_cnt_fcs_ok > 1)
|
||||
+ rx_stats->ampdu_msdu_count += num_msdu;
|
||||
+ else
|
||||
+ rx_stats->non_ampdu_msdu_count += num_msdu;
|
||||
+
|
||||
+ rx_stats->num_mpdu_fcs_ok += user_stats->mpdu_cnt_fcs_ok;
|
||||
+ rx_stats->num_mpdu_fcs_err += user_stats->mpdu_cnt_fcs_err;
|
||||
+ rx_stats->dcm_count += ppdu_info->dcm;
|
||||
+ if (ppdu_info->reception_type == HAL_RX_RECEPTION_TYPE_MU_OFDMA ||
|
||||
+ ppdu_info->reception_type == HAL_RX_RECEPTION_TYPE_MU_OFDMA_MIMO)
|
||||
+ rx_stats->ru_alloc_cnt[user_stats->ul_ofdma_ru_size] += num_msdu;
|
||||
+
|
||||
+ rx_stats->rx_duration += ppdu_info->rx_duration;
|
||||
+ arsta->rx_duration = rx_stats->rx_duration;
|
||||
+
|
||||
+ if (user_stats->nss > 0 && user_stats->nss <= HAL_RX_MAX_NSS) {
|
||||
+ rx_stats->pkt_stats.nss_count[user_stats->nss - 1] += num_msdu;
|
||||
+ rx_stats->byte_stats.nss_count[user_stats->nss - 1] += user_stats->mpdu_ok_byte_count;
|
||||
+ }
|
||||
+
|
||||
+ if (user_stats->preamble_type == HAL_RX_PREAMBLE_11AX &&
|
||||
+ user_stats->mcs <= HAL_RX_MAX_MCS_HE) {
|
||||
+ rx_stats->pkt_stats.he_mcs_count[user_stats->mcs] += num_msdu;
|
||||
+ rx_stats->byte_stats.he_mcs_count[user_stats->mcs] += user_stats->mpdu_ok_byte_count;
|
||||
+ }
|
||||
+
|
||||
+ if (ppdu_info->gi < HAL_RX_GI_MAX) {
|
||||
+ rx_stats->pkt_stats.gi_count[ppdu_info->gi] += num_msdu;
|
||||
+ rx_stats->byte_stats.gi_count[ppdu_info->gi] += user_stats->mpdu_ok_byte_count;
|
||||
+ }
|
||||
+
|
||||
+ if (ppdu_info->bw < HAL_RX_BW_MAX) {
|
||||
+ rx_stats->pkt_stats.bw_count[ppdu_info->bw] += num_msdu;
|
||||
+ rx_stats->byte_stats.bw_count[ppdu_info->bw] += user_stats->mpdu_ok_byte_count;
|
||||
+ }
|
||||
+
|
||||
+ ath11k_dp_rx_update_peer_rate_table_stats(rx_stats, ppdu_info, user_stats, num_msdu);
|
||||
+}
|
||||
+
|
||||
+static void ath11k_dp_rx_update_peer_mu_stats(struct ath11k *ar,
|
||||
+ struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
+{
|
||||
+ u32 num_users, i;
|
||||
+
|
||||
+ if (!ath11k_debugfs_is_extd_rx_stats_enabled(ar))
|
||||
+ return;
|
||||
+
|
||||
+ num_users = ppdu_info->num_users;
|
||||
+ if (num_users > HAL_MAX_UL_MU_USERS)
|
||||
+ num_users = HAL_MAX_UL_MU_USERS;
|
||||
+
|
||||
+ for (i = 0; i < num_users; i++) {
|
||||
+ ath11k_dp_rx_update_user_stats(ar, ppdu_info, i);
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
@@ -5435,6 +5551,55 @@ static void ath11k_dp_rx_mon_dest_proces
|
||||
}
|
||||
}
|
||||
|
||||
+void ath11k_dp_rx_mon_process_ulofdma(struct hal_rx_mon_ppdu_info *ppdu_info)
|
||||
+{
|
||||
+ struct hal_rx_user_status *rx_user_status;
|
||||
+ u32 num_users;
|
||||
+ uint32_t i;
|
||||
+ uint32_t mu_ul_user_v0_word0;
|
||||
+ uint32_t mu_ul_user_v0_word1;
|
||||
+ uint32_t ru_size;
|
||||
+
|
||||
+ if (!(ppdu_info->reception_type == HAL_RX_RECEPTION_TYPE_MU_OFDMA ||
|
||||
+ ppdu_info->reception_type == HAL_RX_RECEPTION_TYPE_MU_OFDMA_MIMO))
|
||||
+ return;
|
||||
+
|
||||
+ num_users = ppdu_info->num_users;
|
||||
+ if (num_users > HAL_MAX_UL_MU_USERS)
|
||||
+ num_users = HAL_MAX_UL_MU_USERS;
|
||||
+
|
||||
+ for (i = 0; i < num_users; i++) {
|
||||
+ rx_user_status = &ppdu_info->userstats[i];
|
||||
+ mu_ul_user_v0_word0 =
|
||||
+ rx_user_status->ul_ofdma_user_v0_word0;
|
||||
+ mu_ul_user_v0_word1 =
|
||||
+ rx_user_status->ul_ofdma_user_v0_word1;
|
||||
+
|
||||
+ if (FIELD_GET(HAL_RX_UL_OFDMA_USER_INFO_V0_W0_VALID,
|
||||
+ mu_ul_user_v0_word0) &&
|
||||
+ !FIELD_GET(HAL_RX_UL_OFDMA_USER_INFO_V0_W0_VER,
|
||||
+ mu_ul_user_v0_word0)) {
|
||||
+ rx_user_status->mcs =
|
||||
+ FIELD_GET(HAL_RX_UL_OFDMA_USER_INFO_V0_W1_MCS,
|
||||
+ mu_ul_user_v0_word1);
|
||||
+ rx_user_status->nss =
|
||||
+ FIELD_GET(HAL_RX_UL_OFDMA_USER_INFO_V0_W1_NSS,
|
||||
+ mu_ul_user_v0_word1) + 1;
|
||||
+
|
||||
+ rx_user_status->ofdma_info_valid = 1;
|
||||
+ rx_user_status->ul_ofdma_ru_start_index =
|
||||
+ FIELD_GET(HAL_RX_UL_OFDMA_USER_INFO_V0_W1_RU_START,
|
||||
+ mu_ul_user_v0_word1);
|
||||
+
|
||||
+ ru_size = FIELD_GET(HAL_RX_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE,
|
||||
+ mu_ul_user_v0_word1);
|
||||
+ rx_user_status->ul_ofdma_ru_width = ru_size;
|
||||
+ rx_user_status->ul_ofdma_ru_size = ru_size;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
+
|
||||
int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
|
||||
struct napi_struct *napi, int budget)
|
||||
{
|
||||
@@ -5511,8 +5676,13 @@ int ath11k_dp_rx_process_mon_status(stru
|
||||
|
||||
if ((ppdu_info->fc_valid) &&
|
||||
(ppdu_info->ast_index != HAL_AST_IDX_INVALID)) {
|
||||
- arsta = (struct ath11k_sta *)peer->sta->drv_priv;
|
||||
- ath11k_dp_rx_update_peer_stats(arsta, ppdu_info);
|
||||
+ 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);
|
||||
+ } else {
|
||||
+ ath11k_dp_rx_mon_process_ulofdma(ppdu_info);
|
||||
+ ath11k_dp_rx_update_peer_mu_stats(ar, ppdu_info);
|
||||
+ }
|
||||
}
|
||||
|
||||
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
|
||||
@@ -805,7 +805,6 @@ void ath11k_hal_reo_init_cmd_ring(struct
|
||||
}
|
||||
}
|
||||
|
||||
-#define HAL_MAX_UL_MU_USERS 37
|
||||
static inline void
|
||||
ath11k_hal_rx_handle_ofdma_info(void *rx_tlv,
|
||||
struct hal_rx_user_status *rx_user_status)
|
||||
@@ -837,6 +836,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;
|
||||
+ rx_user_status->tcp_ack_msdu_count =
|
||||
+ ppdu_info->tcp_ack_msdu_count;
|
||||
rx_user_status->tcp_msdu_count =
|
||||
ppdu_info->tcp_msdu_count;
|
||||
rx_user_status->udp_msdu_count =
|
||||
@@ -860,6 +861,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;
|
||||
+ memcpy(&rx_user_status->mpdu_fcs_ok_bitmap[0], &ppdu_info->mpdu_fcs_ok_bitmap[0],
|
||||
+ HAL_RX_NUM_WORDS_PER_PPDU_BITMAP *
|
||||
+ sizeof(ppdu_info->mpdu_fcs_ok_bitmap[0]));
|
||||
|
||||
ath11k_hal_rx_populate_byte_count(rx_tlv, ppdu_info, rx_user_status);
|
||||
}
|
||||
@@ -889,6 +893,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);
|
||||
+
|
||||
+ if (ppdu_info->ppdu_id != ppdu_info->last_ppdu_id) {
|
||||
+ ppdu_info->last_ppdu_id = ppdu_info->ppdu_id;
|
||||
+ ppdu_info->num_users = 0;
|
||||
+ memset(&ppdu_info->mpdu_fcs_ok_bitmap, 0,
|
||||
+ HAL_RX_NUM_WORDS_PER_PPDU_BITMAP *
|
||||
+ sizeof(ppdu_info->mpdu_fcs_ok_bitmap[0]));
|
||||
+ }
|
||||
break;
|
||||
}
|
||||
case HAL_RX_PPDU_END_USER_STATS: {
|
||||
@@ -943,15 +955,16 @@ ath11k_hal_rx_parse_mon_status_tlv(struc
|
||||
|
||||
if (userid < HAL_MAX_UL_MU_USERS) {
|
||||
struct hal_rx_user_status *rxuser_stats =
|
||||
- &ppdu_info->userstats;
|
||||
+ &ppdu_info->userstats[userid];
|
||||
+ ppdu_info->num_users += 1;
|
||||
|
||||
ath11k_hal_rx_handle_ofdma_info(tlv_data, rxuser_stats);
|
||||
ath11k_hal_rx_populate_mu_user_info(tlv_data, ppdu_info,
|
||||
rxuser_stats);
|
||||
}
|
||||
- ppdu_info->userstats.mpdu_fcs_ok_bitmap[0] =
|
||||
+ ppdu_info->mpdu_fcs_ok_bitmap[0] =
|
||||
__le32_to_cpu(eu_stats->rsvd1[0]);
|
||||
- ppdu_info->userstats.mpdu_fcs_ok_bitmap[1] =
|
||||
+ ppdu_info->mpdu_fcs_ok_bitmap[1] =
|
||||
__le32_to_cpu(eu_stats->rsvd1[1]);
|
||||
|
||||
break;
|
||||
@@ -959,12 +972,12 @@ ath11k_hal_rx_parse_mon_status_tlv(struc
|
||||
case HAL_RX_PPDU_END_USER_STATS_EXT: {
|
||||
struct hal_rx_ppdu_end_user_stats_ext *eu_stats =
|
||||
(struct hal_rx_ppdu_end_user_stats_ext *)tlv_data;
|
||||
- ppdu_info->userstats.mpdu_fcs_ok_bitmap[2] = eu_stats->info1;
|
||||
- ppdu_info->userstats.mpdu_fcs_ok_bitmap[3] = eu_stats->info2;
|
||||
- ppdu_info->userstats.mpdu_fcs_ok_bitmap[4] = eu_stats->info3;
|
||||
- ppdu_info->userstats.mpdu_fcs_ok_bitmap[5] = eu_stats->info4;
|
||||
- ppdu_info->userstats.mpdu_fcs_ok_bitmap[6] = eu_stats->info5;
|
||||
- ppdu_info->userstats.mpdu_fcs_ok_bitmap[7] = eu_stats->info6;
|
||||
+ ppdu_info->mpdu_fcs_ok_bitmap[2] = eu_stats->info1;
|
||||
+ ppdu_info->mpdu_fcs_ok_bitmap[3] = eu_stats->info2;
|
||||
+ ppdu_info->mpdu_fcs_ok_bitmap[4] = eu_stats->info3;
|
||||
+ ppdu_info->mpdu_fcs_ok_bitmap[5] = eu_stats->info4;
|
||||
+ ppdu_info->mpdu_fcs_ok_bitmap[6] = eu_stats->info5;
|
||||
+ ppdu_info->mpdu_fcs_ok_bitmap[7] = eu_stats->info6;
|
||||
break;
|
||||
}
|
||||
case HAL_PHYRX_HT_SIG: {
|
||||
--- a/drivers/net/wireless/ath/ath11k/hal_rx.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hal_rx.h
|
||||
@@ -73,6 +73,10 @@ enum hal_rx_reception_type {
|
||||
#define HAL_RX_FCS_LEN 4
|
||||
#define HAL_AST_IDX_INVALID 0xFFFF
|
||||
|
||||
+#define HAL_MAX_UL_MU_USERS 37
|
||||
+#define HAL_RX_MAX_MPDU 256
|
||||
+#define HAL_RX_NUM_WORDS_PER_PPDU_BITMAP (HAL_RX_MAX_MPDU >> 5)
|
||||
+
|
||||
enum hal_rx_mon_status {
|
||||
HAL_RX_MON_STATUS_PPDU_NOT_DONE,
|
||||
HAL_RX_MON_STATUS_PPDU_DONE,
|
||||
@@ -83,14 +87,15 @@ struct hal_rx_user_status {
|
||||
u32 mcs:4,
|
||||
nss:3,
|
||||
ofdma_info_valid:1,
|
||||
- dl_ofdma_ru_start_index:7,
|
||||
- dl_ofdma_ru_width:7,
|
||||
- dl_ofdma_ru_size:8;
|
||||
+ ul_ofdma_ru_start_index:7,
|
||||
+ ul_ofdma_ru_width:7,
|
||||
+ ul_ofdma_ru_size:8;
|
||||
u32 ul_ofdma_user_v0_word0;
|
||||
u32 ul_ofdma_user_v0_word1;
|
||||
u32 ast_index;
|
||||
u32 tid;
|
||||
u16 tcp_msdu_count;
|
||||
+ u16 tcp_ack_msdu_count;
|
||||
u16 udp_msdu_count;
|
||||
u16 other_msdu_count;
|
||||
u16 frame_control;
|
||||
@@ -104,7 +109,7 @@ struct hal_rx_user_status {
|
||||
u8 rs_flags;
|
||||
u32 mpdu_cnt_fcs_ok;
|
||||
u32 mpdu_cnt_fcs_err;
|
||||
- u32 mpdu_fcs_ok_bitmap[8];
|
||||
+ u32 mpdu_fcs_ok_bitmap[HAL_RX_NUM_WORDS_PER_PPDU_BITMAP];
|
||||
u32 mpdu_ok_byte_count;
|
||||
u32 mpdu_err_byte_count;
|
||||
};
|
||||
@@ -145,6 +150,7 @@ struct hal_sw_mon_ring_entries {
|
||||
|
||||
struct hal_rx_mon_ppdu_info {
|
||||
u32 ppdu_id;
|
||||
+ u32 last_ppdu_id;
|
||||
u32 ppdu_ts;
|
||||
u32 num_mpdu_fcs_ok;
|
||||
u32 num_mpdu_fcs_err;
|
||||
@@ -213,9 +219,20 @@ struct hal_rx_mon_ppdu_info {
|
||||
u8 ltf_size;
|
||||
u8 rxpcu_filter_pass;
|
||||
char rssi_chain[8][8];
|
||||
- struct hal_rx_user_status userstats;
|
||||
+ 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];
|
||||
};
|
||||
|
||||
+#define HAL_RX_UL_OFDMA_USER_INFO_V0_W0_VALID BIT(30)
|
||||
+#define HAL_RX_UL_OFDMA_USER_INFO_V0_W0_VER BIT(31)
|
||||
+#define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_NSS GENMASK(2, 0)
|
||||
+#define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_MCS GENMASK(6, 3)
|
||||
+#define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_LDPC BIT(7)
|
||||
+#define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_DCM BIT(8)
|
||||
+#define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_RU_START GENMASK(15, 9)
|
||||
+#define HAL_RX_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE GENMASK(18, 16)
|
||||
+
|
||||
#define HAL_RX_PPDU_START_INFO0_PPDU_ID GENMASK(15, 0)
|
||||
|
||||
struct hal_rx_ppdu_start {
|
||||
--- a/drivers/net/wireless/ath/ath11k/peer.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/peer.c
|
||||
@@ -93,6 +93,20 @@ struct ath11k_peer *ath11k_peer_find_by_
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+struct ath11k_peer *ath11k_peer_find_by_ast(struct ath11k_base *ab,
|
||||
+ int ast_hash)
|
||||
+{
|
||||
+ struct ath11k_peer *peer;
|
||||
+
|
||||
+ lockdep_assert_held(&ab->base_lock);
|
||||
+
|
||||
+ list_for_each_entry(peer, &ab->peers, list)
|
||||
+ if (ast_hash == peer->ast_hash)
|
||||
+ return peer;
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id)
|
||||
{
|
||||
struct ath11k_peer *peer;
|
||||
--- a/drivers/net/wireless/ath/ath11k/peer.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/peer.h
|
||||
@@ -59,6 +59,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);
|
||||
+struct ath11k_peer *ath11k_peer_find_by_ast(struct ath11k_base *ab, int ast_hash);
|
||||
void ath11k_peer_cleanup(struct ath11k *ar, u32 vdev_id);
|
||||
int ath11k_peer_delete(struct ath11k *ar, u32 vdev_id, u8 *addr);
|
||||
int ath11k_peer_create(struct ath11k *ar, struct ath11k_vif *arvif,
|
@ -1,55 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -2296,6 +2296,42 @@ static void ath11k_dp_rx_h_undecap_eth(s
|
||||
ether_addr_copy(ieee80211_get_SA(hdr), sa);
|
||||
}
|
||||
|
||||
+static void ath11k_dp_rx_h_undecap_snap(struct ath11k *ar,
|
||||
+ struct sk_buff *msdu,
|
||||
+ u8 *first_hdr,
|
||||
+ enum hal_encrypt_type enctype,
|
||||
+ struct ieee80211_rx_status *status)
|
||||
+{
|
||||
+ struct ieee80211_hdr *hdr;
|
||||
+ size_t hdr_len;
|
||||
+ u8 l3_pad_bytes;
|
||||
+ struct hal_rx_desc *rx_desc;
|
||||
+
|
||||
+ /* Delivered decapped frame:
|
||||
+ * [amsdu header] <-- replaced with 802.11 hdr
|
||||
+ * [rfc1042/llc]
|
||||
+ * [payload]
|
||||
+ */
|
||||
+
|
||||
+ rx_desc = (void *)msdu->data - sizeof(*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);
|
||||
+
|
||||
+ hdr = (struct ieee80211_hdr *)first_hdr;
|
||||
+ hdr_len = ieee80211_hdrlen(hdr->frame_control);
|
||||
+
|
||||
+ 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));
|
||||
+ }
|
||||
+
|
||||
+ memcpy(skb_push(msdu, hdr_len), hdr, hdr_len);
|
||||
+}
|
||||
+
|
||||
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,
|
||||
@@ -2337,7 +2373,8 @@ static void ath11k_dp_rx_h_undecap(struc
|
||||
enctype, status);
|
||||
break;
|
||||
case DP_RX_DECAP_TYPE_8023:
|
||||
- /* TODO: Handle undecap for these formats */
|
||||
+ ath11k_dp_rx_h_undecap_snap(ar, msdu, first_hdr,
|
||||
+ enctype, status);
|
||||
break;
|
||||
}
|
||||
}
|
@ -1,308 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/average.h>
|
||||
#include <linux/firmware.h>
|
||||
|
||||
+#include "fw.h"
|
||||
#include "qmi.h"
|
||||
#include "htc.h"
|
||||
#include "wmi.h"
|
||||
@@ -32,7 +33,6 @@
|
||||
#include "spectral.h"
|
||||
#include "wow.h"
|
||||
#include "rx_desc.h"
|
||||
-#include "fw.h"
|
||||
|
||||
#define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK)
|
||||
|
||||
@@ -362,6 +362,16 @@ struct ath11k_reg_tpc_power_info {
|
||||
struct ath11k_chan_power_info chan_power_info[ATH11K_NUM_PWR_LEVELS];
|
||||
};
|
||||
|
||||
+#define ATH11K_STATS_MGMT_FRM_TYPE_MAX 16
|
||||
+
|
||||
+struct ath11k_mgmt_frame_stats {
|
||||
+ u32 tx_succ_cnt[ATH11K_STATS_MGMT_FRM_TYPE_MAX];
|
||||
+ u32 tx_fail_cnt[ATH11K_STATS_MGMT_FRM_TYPE_MAX];
|
||||
+ u32 rx_cnt[ATH11K_STATS_MGMT_FRM_TYPE_MAX];
|
||||
+ u32 tx_compl_succ[ATH11K_STATS_MGMT_FRM_TYPE_MAX];
|
||||
+ u32 tx_compl_fail[ATH11K_STATS_MGMT_FRM_TYPE_MAX];
|
||||
+};
|
||||
+
|
||||
struct ath11k_vif {
|
||||
u32 vdev_id;
|
||||
enum wmi_vdev_type vdev_type;
|
||||
@@ -418,7 +428,7 @@ struct ath11k_vif {
|
||||
struct ath11k_rekey_data rekey_data;
|
||||
|
||||
struct ath11k_reg_tpc_power_info reg_tpc_info;
|
||||
-
|
||||
+ struct ath11k_mgmt_frame_stats mgmt_stats;
|
||||
/* Must be last - ends in a flexible-array member.
|
||||
*
|
||||
* FIXME: Driver should not copy struct ieee80211_chanctx_conf,
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs.c
|
||||
@@ -1589,6 +1589,87 @@ static const struct file_operations fops
|
||||
.llseek = default_llseek,
|
||||
};
|
||||
|
||||
+static ssize_t ath11k_dump_mgmt_stats(struct file *file, char __user *ubuf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct ath11k *ar = file->private_data;
|
||||
+ struct ath11k_vif *arvif = NULL;
|
||||
+ struct ath11k_mgmt_frame_stats *mgmt_stats;
|
||||
+ int len = 0, ret, i;
|
||||
+ int size = (TARGET_NUM_VDEVS(ar->ab) - 1) * 1500;
|
||||
+ char *buf;
|
||||
+ const char *mgmt_frm_type[ATH11K_STATS_MGMT_FRM_TYPE_MAX-1] = {"assoc_req", "assoc_resp",
|
||||
+ "reassoc_req", "reassoc_resp",
|
||||
+ "probe_req", "probe_resp",
|
||||
+ "timing_advertisement", "reserved",
|
||||
+ "beacon", "atim", "disassoc",
|
||||
+ "auth", "deauth", "action", "action_no_ack"};
|
||||
+
|
||||
+ if (ar->state != ATH11K_STATE_ON)
|
||||
+ return -ENETDOWN;
|
||||
+
|
||||
+ buf = kzalloc(size, GFP_KERNEL);
|
||||
+ if (!buf)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ mutex_lock(&ar->conf_mutex);
|
||||
+ spin_lock_bh(&ar->data_lock);
|
||||
+
|
||||
+ list_for_each_entry (arvif, &ar->arvifs, list) {
|
||||
+ if (!arvif)
|
||||
+ break;
|
||||
+
|
||||
+ if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR)
|
||||
+ continue;
|
||||
+
|
||||
+ mgmt_stats = &arvif->mgmt_stats;
|
||||
+ len += scnprintf(buf + len, size - len, "MGMT frame stats for vdev %u :\n",
|
||||
+ arvif->vdev_id);
|
||||
+ len += scnprintf(buf + len, size - len, " TX stats :\n ");
|
||||
+ len += scnprintf(buf + len, size - len, " Success frames:\n");
|
||||
+ for (i = 0; i < ATH11K_STATS_MGMT_FRM_TYPE_MAX-1; i++)
|
||||
+ len += scnprintf(buf + len, size - len, " %s: %d\n", mgmt_frm_type[i],
|
||||
+ mgmt_stats->tx_succ_cnt[i]);
|
||||
+
|
||||
+ len += scnprintf(buf + len, size - len, " Failed frames:\n");
|
||||
+
|
||||
+ for (i = 0; i < ATH11K_STATS_MGMT_FRM_TYPE_MAX-1; i++)
|
||||
+ len += scnprintf(buf + len, size - len, " %s: %d\n", mgmt_frm_type[i],
|
||||
+ mgmt_stats->tx_fail_cnt[i]);
|
||||
+
|
||||
+ len += scnprintf(buf + len, size - len, " RX stats :\n");
|
||||
+ len += scnprintf(buf + len, size - len, " Success frames:\n");
|
||||
+ for (i = 0; i < ATH11K_STATS_MGMT_FRM_TYPE_MAX-1; i++)
|
||||
+ len += scnprintf(buf + len, size - len, " %s: %d\n", mgmt_frm_type[i],
|
||||
+ mgmt_stats->rx_cnt[i]);
|
||||
+
|
||||
+ len += scnprintf(buf + len, size - len, " Tx completion stats :\n");
|
||||
+ len += scnprintf(buf + len, size - len, " success completions:\n");
|
||||
+ for (i = 0; i < ATH11K_STATS_MGMT_FRM_TYPE_MAX-1; i++)
|
||||
+ len += scnprintf(buf + len, size - len, " %s: %d\n", mgmt_frm_type[i],
|
||||
+ mgmt_stats->tx_compl_succ[i]);
|
||||
+ len += scnprintf(buf + len, size - len, " failure completions:\n");
|
||||
+ for (i = 0; i < ATH11K_STATS_MGMT_FRM_TYPE_MAX-1; i++)
|
||||
+ len += scnprintf(buf + len, size - len, " %s: %d\n", mgmt_frm_type[i],
|
||||
+ mgmt_stats->tx_compl_fail[i]);
|
||||
+ }
|
||||
+
|
||||
+ spin_unlock_bh(&ar->data_lock);
|
||||
+
|
||||
+ if (len > size)
|
||||
+ len = size;
|
||||
+
|
||||
+ ret = simple_read_from_buffer(ubuf, count, ppos, buf, len);
|
||||
+ mutex_unlock(&ar->conf_mutex);
|
||||
+ kfree(buf);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations fops_dump_mgmt_stats = {
|
||||
+ .read = ath11k_dump_mgmt_stats,
|
||||
+ .open = simple_open
|
||||
+};
|
||||
+
|
||||
int ath11k_debugfs_register(struct ath11k *ar)
|
||||
{
|
||||
struct ath11k_base *ab = ar->ab;
|
||||
@@ -1621,6 +1702,9 @@ int ath11k_debugfs_register(struct ath11
|
||||
debugfs_create_file("fw_dbglog_config", 0600,
|
||||
ar->debug.debugfs_pdev, ar,
|
||||
&fops_fw_dbglog);
|
||||
+ 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
|
||||
@@ -6035,9 +6035,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_lockless(q) >= ATH11K_TX_MGMT_NUM_PENDING_MAX) {
|
||||
@@ -6063,9 +6063,11 @@ 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;
|
||||
struct ath11k_sta *arsta = NULL;
|
||||
u32 info_flags = info->flags;
|
||||
bool is_prb_rsp;
|
||||
+ u16 frm_type = 0;
|
||||
int ret;
|
||||
|
||||
memset(skb_cb, 0, sizeof(*skb_cb));
|
||||
@@ -6079,12 +6081,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) {
|
||||
- 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);
|
||||
+ 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
|
||||
@@ -458,6 +458,7 @@ int ath11k_peer_create(struct ath11k *ar
|
||||
|
||||
peer->sec_type = HAL_ENCRYPT_TYPE_OPEN;
|
||||
peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN;
|
||||
+ peer->vif = arvif->vif;
|
||||
|
||||
if (sta) {
|
||||
arsta = ath11k_sta_to_arsta(sta);
|
||||
--- a/drivers/net/wireless/ath/ath11k/peer.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/peer.h
|
||||
@@ -21,6 +21,7 @@ struct ppdu_user_delayba {
|
||||
struct ath11k_peer {
|
||||
struct list_head list;
|
||||
struct ieee80211_sta *sta;
|
||||
+ struct ieee80211_vif *vif;
|
||||
int vdev_id;
|
||||
u8 addr[ETH_ALEN];
|
||||
int peer_id;
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -5943,6 +5943,12 @@ static int wmi_process_mgmt_tx_comp(stru
|
||||
struct sk_buff *msdu;
|
||||
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;
|
||||
int num_mgmt;
|
||||
|
||||
spin_lock_bh(&ar->txmgmt_idr_lock);
|
||||
@@ -5970,6 +5976,31 @@ static int wmi_process_mgmt_tx_comp(stru
|
||||
info->status.ack_signal = tx_compl_param->ack_rssi;
|
||||
}
|
||||
|
||||
+ 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->ab, 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 (!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);
|
||||
|
||||
num_mgmt = atomic_dec_if_positive(&ar->num_pending_mgmt_tx);
|
||||
@@ -7549,6 +7580,11 @@ static void ath11k_mgmt_rx_event(struct
|
||||
struct ieee80211_hdr *hdr;
|
||||
u16 fc;
|
||||
struct ieee80211_supported_band *sband;
|
||||
+ struct ath11k_peer *peer;
|
||||
+ struct ieee80211_vif *vif;
|
||||
+ struct ath11k_vif *arvif;
|
||||
+ struct ath11k_mgmt_frame_stats *mgmt_stats;
|
||||
+ u16 frm_type = 0;
|
||||
|
||||
if (ath11k_pull_mgmt_rx_params_tlv(ab, skb, &rx_ev) != 0) {
|
||||
ath11k_warn(ab, "failed to extract mgmt rx event");
|
||||
@@ -7614,7 +7650,34 @@ static void ath11k_mgmt_rx_event(struct
|
||||
|
||||
hdr = (struct ieee80211_hdr *)skb->data;
|
||||
fc = le16_to_cpu(hdr->frame_control);
|
||||
+ frm_type = FIELD_GET(IEEE80211_FCTL_STYPE, fc);
|
||||
+
|
||||
+ spin_lock_bh(&ab->base_lock);
|
||||
+
|
||||
+ peer = ath11k_peer_find_by_addr(ab, hdr->addr1);
|
||||
+ if(!peer)
|
||||
+ peer = ath11k_peer_find_by_addr(ab, hdr->addr3);
|
||||
+ if (!peer) {
|
||||
+ spin_unlock_bh(&ab->base_lock);
|
||||
+ goto skip_mgmt_stats;
|
||||
+ }
|
||||
+
|
||||
+ 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);
|
||||
+ mgmt_stats = &arvif->mgmt_stats;
|
||||
+ mgmt_stats->rx_cnt[frm_type]++;
|
||||
+
|
||||
+ spin_unlock_bh(&ar->data_lock);
|
||||
|
||||
+skip_mgmt_stats:
|
||||
/* Firmware is guaranteed to report all essential management frames via
|
||||
* WMI while it can deliver some extra via HTT. Since there can be
|
||||
* duplicates split the reporting wrt monitor/sniffing.
|
@ -1,146 +0,0 @@
|
||||
From 41363c3109235a96d90d5946bbc01d1cc8dad47e Mon Sep 17 00:00:00 2001
|
||||
From: Anilkumar Kolli <akolli@codeaurora.org>
|
||||
Date: Sun, 6 Sep 2020 11:01:38 +0530
|
||||
Subject: [PATCH] ath11k: update debugfs support for mupltiple radios in PCI
|
||||
bus
|
||||
|
||||
debugfs_ath11k struct is moved to ath11k_core, since its common
|
||||
for both pci and ahb.
|
||||
|
||||
Current ath11k_pci insmod fails if there are multiple PCI rdaios,
|
||||
debugfs directory is created with soc_name and bus_id to allow
|
||||
creating debugfs directory for second PCI radio.
|
||||
|
||||
with this Debugfs entries looks like,
|
||||
# ls -l /sys/kernel/debug/ath11k/
|
||||
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
|
||||
|
||||
# ls -l /sys/kernel/debug/ath11k/qcn9000 hw1.0_0000:01:00.0
|
||||
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 <akolli@codeaurora.org>
|
||||
---
|
||||
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
|
||||
@@ -2367,5 +2367,17 @@ err_sc_free:
|
||||
}
|
||||
EXPORT_SYMBOL(ath11k_core_alloc);
|
||||
|
||||
+int ath11k_init(void)
|
||||
+{
|
||||
+ return ath11k_debugfs_create();
|
||||
+}
|
||||
+module_init(ath11k_init);
|
||||
+
|
||||
+void ath11k_exit(void)
|
||||
+{
|
||||
+ ath11k_debugfs_destroy();
|
||||
+}
|
||||
+module_exit(ath11k_exit);
|
||||
+
|
||||
MODULE_DESCRIPTION("Core module for Qualcomm Atheros 802.11ax wireless LAN cards.");
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs.c
|
||||
@@ -17,6 +17,8 @@
|
||||
#include "peer.h"
|
||||
#include "hif.h"
|
||||
|
||||
+struct dentry *debugfs_ath11k;
|
||||
+
|
||||
static const char *htt_bp_umac_ring[HTT_SW_UMAC_RING_IDX_MAX] = {
|
||||
"REO2SW1_RING",
|
||||
"REO2SW2_RING",
|
||||
@@ -992,8 +994,6 @@ int ath11k_debugfs_pdev_create(struct at
|
||||
|
||||
void ath11k_debugfs_pdev_destroy(struct ath11k_base *ab)
|
||||
{
|
||||
- debugfs_remove_recursive(ab->debugfs_soc);
|
||||
- ab->debugfs_soc = NULL;
|
||||
}
|
||||
|
||||
int ath11k_debugfs_soc_create(struct ath11k_base *ab)
|
||||
@@ -1046,6 +1046,24 @@ void ath11k_debugfs_soc_destroy(struct a
|
||||
}
|
||||
EXPORT_SYMBOL(ath11k_debugfs_soc_destroy);
|
||||
|
||||
+int ath11k_debugfs_create(void)
|
||||
+{
|
||||
+ debugfs_ath11k = debugfs_create_dir("ath11k", NULL);
|
||||
+ if (IS_ERR_OR_NULL(debugfs_ath11k)) {
|
||||
+ if (IS_ERR(debugfs_ath11k))
|
||||
+ return PTR_ERR(debugfs_ath11k);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void ath11k_debugfs_destroy(void)
|
||||
+{
|
||||
+ debugfs_remove_recursive(debugfs_ath11k);
|
||||
+ debugfs_ath11k = NULL;
|
||||
+}
|
||||
+
|
||||
void ath11k_debugfs_fw_stats_init(struct ath11k *ar)
|
||||
{
|
||||
struct dentry *fwstats_dir = debugfs_create_dir("fw_stats",
|
||||
@@ -1676,6 +1694,9 @@ int ath11k_debugfs_register(struct ath11
|
||||
char pdev_name[10];
|
||||
char buf[100] = {0};
|
||||
|
||||
+ if (!(IS_ERR_OR_NULL(ar->debug.debugfs_pdev)))
|
||||
+ return 0;
|
||||
+
|
||||
snprintf(pdev_name, sizeof(pdev_name), "%s%u", "mac", ar->pdev_idx);
|
||||
|
||||
ar->debug.debugfs_pdev = debugfs_create_dir(pdev_name, ab->debugfs_soc);
|
||||
@@ -1753,6 +1774,9 @@ void ath11k_debugfs_unregister(struct at
|
||||
kfree(dbr_debug);
|
||||
ar->debug.dbr_debug[i] = NULL;
|
||||
}
|
||||
+
|
||||
+ debugfs_remove_recursive(ar->debug.debugfs_pdev);
|
||||
+ ar->debug.debugfs_pdev = NULL;
|
||||
}
|
||||
|
||||
static ssize_t ath11k_write_twt_add_dialog(struct file *file,
|
||||
--- a/drivers/net/wireless/ath/ath11k/debugfs.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/debugfs.h
|
||||
@@ -264,6 +264,8 @@ struct ath11k_fw_dbglog {
|
||||
};
|
||||
|
||||
#ifdef CPTCFG_ATH11K_DEBUGFS
|
||||
+int ath11k_debugfs_create(void);
|
||||
+void ath11k_debugfs_destroy(void);
|
||||
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);
|
||||
@@ -315,6 +317,15 @@ void ath11k_debugfs_add_dbring_entry(str
|
||||
struct hal_srng *srng);
|
||||
|
||||
#else
|
||||
+static inline int ath11k_debugfs_create(void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void ath11k_debugfs_destroy(void)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
static inline int ath11k_debugfs_soc_create(struct ath11k_base *ab)
|
||||
{
|
||||
return 0;
|
@ -1,21 +0,0 @@
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -10215,6 +10215,8 @@ static int __ath11k_mac_register(struct
|
||||
wiphy_ext_feature_set(ar->hw->wiphy,
|
||||
NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT);
|
||||
|
||||
+ wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT);
|
||||
+
|
||||
ar->hw->queues = ATH11K_HW_MAX_QUEUES;
|
||||
ar->hw->wiphy->tx_queue_len = ATH11K_QUEUE_LEN;
|
||||
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
|
||||
@@ -4175,6 +4175,7 @@ ath11k_wmi_copy_resource_config(struct w
|
||||
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->flag1;
|
||||
+ wmi_cfg->flag1 |= 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;
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user