wifi: aic: Add AIC8800D80 and D80N SDIO FullMAC driver
Subsystems (2)
v5 cover wifi: aic: Add AIC8800D80 and D80N SDIO FullMAC driver
This series adds an SDIO FullMAC Wi-Fi driver for AIC8800D80 U02 and AIC8800D80N devices, with an initial station-mode configuration using cfg80211/nl80211 on the 2.4 GHz and 5 GHz bands.
This is the first non-RFC revision, following RFC v1 through v4. It reworks the driver into a single aic8800_fdrv module, adds D80N support and documents the SDIO device tree binding. Firmware boot, transport and network-interface lifecycle are managed within the same driver.
The series is organized as follows:
1. register the vendor prefix and document the SDIO Wi-Fi binding;
2. add firmware definitions, command/event handling, SDIO transport
and D80/D80N chip-specific initialization;
3. add cfg80211 operations, TX/RX paths and driver build configuration;
4. connect the complete driver to the wireless build and MAINTAINERS.
Parent build integration is last so that intermediate source states are not selectable through the wireless Kconfig.
Changes since RFC v4:
- merge the BSP and FullMAC implementation into one module; remove
aic8800_bsp/ and its private cross-module exported interface;
- consolidate driver sources under aic8800_fdrv/ and rename
the FullMAC rwnx_* source files and core driver symbols to aicwf_*;
- add D80N chip operations, SDIO IDs and U02/U02C firmware boot paths;
- remove the private generic-netlink family and private-command
implementation retained in RFC v4;
- remove the bundled regulatory database and rwnx_settings.ini parser;
use cfg80211 channel restrictions and transmit-power limits when
configuring firmware;
- remove module-parameter entry points and use internal configuration
defaults and standard cfg80211 operations;
- replace Makefile-generated CONFIG_* definitions with Kconfig symbols
and internal resource-limit definitions;
- load firmware through the standard firmware loader under aic/ and
declare the required filenames with MODULE_FIRMWARE(); - add the shared D80/D80N device tree binding and vendor prefix; and
- rebase and repartition the series for the current source layout.
Because the BSP layer has been removed and the source layout and patch boundaries have changed, RFC v4 patches do not map one-to-one to this revision. This is a new-driver series against wireless-next; the changes above describe its evolution from the earlier submissions.
Scope:
- the selectable baseline is SDIO station mode on D80 U02 and D80N;
- AP, P2P, monitor and mesh modes are not enabled by this configuration;
some associated source and disabled branches remain;
- optional per-device TX-buffer and TX-queue preallocation remain;
- the binding documents optional out-of-band wake lines; this revision uses the SDIO interrupt path and does not consume those optional wake-line properties; and
- firmware binaries and user configuration files are not part of this kernel series. The driver requests them from aic/aic8800d80/ and aic/aic8800d80n/ in the firmware search path.
Validation of the current source:
- Both AIC8800D80 and AIC8800D80N passed probe and firmware boot, module unload/reload, active/passive scanning on 2.4 and 5 GHz, open, WPA2-PSK and WPA3-SAE station connections, disconnect/reconnect, IPv4/IPv6 connectivity, suspend/resume and rfkill tests.
- TCP and UDP TX/RX throughput testing was completed on both chips.
Reported TCP TX/RX rates were 196/210 Mbit/s on 2.4 GHz and
375/445 Mbit/s on 5 GHz; UDP TX/RX rates were 218/225 Mbit/s and
422/511 Mbit/s, respectively. - Both chips passed 10 hours of sustained traffic testing. No kernel crashes, warnings, lockdep reports or firmware crashes were observed during testing.
- GCC module builds, sparse and coccicheck checks passed, with no new compiler or sparse warnings reported.
- 32-bit, allmodconfig warning-check and Clang builds succeeded in a newly created container.
AP mode and smatch were not run.
Previous submissions:
RFC v4: https://lore.kernel.org/r/[email protected]
RFC v3: https://lore.kernel.org/r/[email protected]
RFC v2: https://lore.kernel.org/r/[email protected]
RFC v1: https://lore.kernel.org/r/[email protected]
Tool assistance: OpenAI Codex assisted with the cover letter, commit descriptions and patch-series preparation.
Zhirun Liu (4):
dt-bindings: net: wireless: Add AIC8800D80 SDIO Wi-Fi
wifi: aic: Add firmware protocol and SDIO chip support
wifi: aic: Add the AIC8800D80 and D80N FullMAC driver
wifi: aic: Integrate the AIC8800 SDIO driver
.../net/wireless/aicsemi,aic8800d80-fmac.yaml | 78 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 10 + drivers/net/wireless/Kconfig | 1 + drivers/net/wireless/Makefile | 1 + drivers/net/wireless/aic/Kconfig | 16 + drivers/net/wireless/aic/Makefile | 3 + drivers/net/wireless/aic/aic8800_fdrv/Kconfig | 90 + .../net/wireless/aic/aic8800_fdrv/Makefile | 36 + .../net/wireless/aic/aic8800_fdrv/aic_bus.h | 99 + .../wireless/aic/aic8800_fdrv/aicwf_bfmer.c | 93 + .../wireless/aic/aic8800_fdrv/aicwf_bfmer.h | 100 + .../aic/aic8800_fdrv/aicwf_chip_8800d80.c | 96 + .../aic/aic8800_fdrv/aicwf_chip_8800d80n.c | 74 + .../aic/aic8800_fdrv/aicwf_chip_ops.c | 197 + .../aic/aic8800_fdrv/aicwf_chip_ops.h | 116 + .../wireless/aic/aic8800_fdrv/aicwf_cmds.c | 629 ++ .../wireless/aic/aic8800_fdrv/aicwf_cmds.h | 122 + .../aic/aic8800_fdrv/aicwf_compat_8800d80.c | 281 + .../aic/aic8800_fdrv/aicwf_compat_8800d80.h | 17 + .../aic/aic8800_fdrv/aicwf_compat_8800d80n.c | 402 ++ .../aic/aic8800_fdrv/aicwf_compat_8800d80n.h | 17 + .../wireless/aic/aic8800_fdrv/aicwf_config.h | 33 + .../wireless/aic/aic8800_fdrv/aicwf_defs.h | 657 +++ .../wireless/aic/aic8800_fdrv/aicwf_events.h | 938 +++ .../wireless/aic/aic8800_fdrv/aicwf_main.c | 5114 +++++++++++++++++ .../wireless/aic/aic8800_fdrv/aicwf_main.h | 22 + .../wireless/aic/aic8800_fdrv/aicwf_mesh.c | 33 + .../wireless/aic/aic8800_fdrv/aicwf_mesh.h | 39 + .../aic/aic8800_fdrv/aicwf_mod_params.c | 644 +++ .../aic/aic8800_fdrv/aicwf_mod_params.h | 59 + .../wireless/aic/aic8800_fdrv/aicwf_msg_rx.c | 1412 +++++ .../wireless/aic/aic8800_fdrv/aicwf_msg_rx.h | 12 + .../wireless/aic/aic8800_fdrv/aicwf_msg_tx.c | 2499 ++++++++ .../wireless/aic/aic8800_fdrv/aicwf_msg_tx.h | 201 + .../aic/aic8800_fdrv/aicwf_mu_group.c | 653 +++ .../aic/aic8800_fdrv/aicwf_mu_group.h | 163 + .../aic/aic8800_fdrv/aicwf_platform.c | 1507 +++++ .../aic/aic8800_fdrv/aicwf_platform.h | 91 + .../wireless/aic/aic8800_fdrv/aicwf_radar.c | 1969 +++++++ .../wireless/aic/aic8800_fdrv/aicwf_radar.h | 289 + .../aic/aic8800_fdrv/aicwf_resv_mem.c | 106 + .../aic/aic8800_fdrv/aicwf_resv_mem.h | 54 + .../net/wireless/aic/aic8800_fdrv/aicwf_rx.c | 2434 ++++++++ .../net/wireless/aic/aic8800_fdrv/aicwf_rx.h | 363 ++ .../aic/aic8800_fdrv/aicwf_rx_prealloc.c | 99 + .../aic/aic8800_fdrv/aicwf_rx_prealloc.h | 39 + .../wireless/aic/aic8800_fdrv/aicwf_sdio.c | 2439 ++++++++ .../wireless/aic/aic8800_fdrv/aicwf_sdio.h | 280 + .../wireless/aic/aic8800_fdrv/aicwf_strs.c | 267 + .../wireless/aic/aic8800_fdrv/aicwf_strs.h | 31 + .../net/wireless/aic/aic8800_fdrv/aicwf_tx.c | 1469 +++++ .../net/wireless/aic/aic8800_fdrv/aicwf_tx.h | 165 + .../net/wireless/aic/aic8800_fdrv/aicwf_txq.c | 1368 +++++ .../net/wireless/aic/aic8800_fdrv/aicwf_txq.h | 353 ++ .../aic/aic8800_fdrv/aicwf_txq_prealloc.c | 55 + .../aic/aic8800_fdrv/aicwf_txq_prealloc.h | 31 + .../wireless/aic/aic8800_fdrv/aicwf_txrxif.c | 666 +++ .../wireless/aic/aic8800_fdrv/aicwf_txrxif.h | 161 + .../wireless/aic/aic8800_fdrv/aicwf_utils.c | 32 + .../wireless/aic/aic8800_fdrv/aicwf_utils.h | 61 + .../net/wireless/aic/aic8800_fdrv/hal_desc.h | 359 ++ .../wireless/aic/aic8800_fdrv/ipc_shared.h | 767 +++ .../net/wireless/aic/aic8800_fdrv/lmac_mac.h | 437 ++ .../net/wireless/aic/aic8800_fdrv/lmac_msg.h | 3092 ++++++++++ .../wireless/aic/aic8800_fdrv/lmac_types.h | 21 + .../net/wireless/aic/aic8800_fdrv/sdio_host.c | 136 + .../net/wireless/aic/aic8800_fdrv/sdio_host.h | 43 + 68 files changed, 34143 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml create mode 100644 drivers/net/wireless/aic/Kconfig create mode 100644 drivers/net/wireless/aic/Makefile create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/Kconfig create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/Makefile create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aic_bus.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_bfmer.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_bfmer.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_8800d80.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_8800d80n.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_ops.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_ops.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_cmds.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_cmds.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80n.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80n.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_config.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_defs.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_events.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mesh.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mesh.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mod_params.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mod_params.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_tx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_tx.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mu_group.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mu_group.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_platform.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_platform.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_radar.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_radar.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx_prealloc.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx_prealloc.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_sdio.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_sdio.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_strs.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_strs.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_tx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_tx.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq_prealloc.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq_prealloc.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txrxif.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txrxif.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_utils.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_utils.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/hal_desc.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/ipc_shared.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/lmac_mac.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/lmac_msg.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/lmac_types.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/sdio_host.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/sdio_host.h
base-commit: b8e5b0ae8ff47240366d38e5d12c65f878724316
PATCH v5 1/4 dt-bindings: net: wireless: Add AIC8800D80 SDIO Wi-Fi
From: Zhirun Liu <[email protected]>
Document the SDIO function used by AIC8800D80 and AIC8800D80N Wi-Fi and register the aicsemi vendor prefix.
Describe the shared compatible, function number and optional host-wakeup interrupt and device-wakeup GPIO. Chip selection uses the SDIO vendor and device IDs. Power supplies and enable sequencing are described on the MMC host through vmmc-supply and mmc-pwrseq.
Include an example for an SDIO function with both wake-up lines.
--- .../net/wireless/aicsemi,aic8800d80-fmac.yaml | 78 +++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + 2 files changed, 80 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml new file +78 -0
@@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/wireless/aicsemi,aic8800d80-fmac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: AICSemi AIC8800D80 and AIC8800D80N SDIO Wi-Fi + +maintainers: + - Zhirun Liu <[email protected]> + - Dijia Xu <[email protected]> + - Chunqiu Liu <[email protected]> + +description: + The AIC8800D80 and AIC8800D80N are Wi-Fi and Bluetooth combo chips. + Wi-Fi is attached over SDIO and the chip variant is identified through + the SDIO vendor and device IDs. Both chips use the aicsemi,aic8800d80-fmac + compatible and the same device tree properties defined here. + The node describes SDIO function 1 and its optional out-of-band wake-up + lines, and is a child of the MMC host controller node. The chip supply + and enable line are described on the MMC host controller through + vmmc-supply and mmc-pwrseq. + +allOf: + - $ref: ieee80211.yaml# + +properties: + compatible: + const: aicsemi,aic8800d80-fmac + + reg: + description: SDIO function number of the Wi-Fi function + const: 1 + + interrupts: + maxItems: 1 + description: + Interrupt connected to the WIFI_WAKE_HOST pin of the chip, raised by + the chip when it has data for a sleeping host and used to wake up the + host from system suspend. + + interrupt-names: + items: + - const: host-wakeup + + device-wakeup-gpios: + maxItems: 1 + description: + GPIO connected to the HOST_WAKE_WIFI pin of the chip, asserted while + the host needs the chip awake. + +required: + - compatible + - reg + +dependencies: + interrupt-names: [ interrupts ] + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + + mmc { + #address-cells = <1>; + #size-cells = <0>; + + wifi@1 { + compatible = "aicsemi,aic8800d80-fmac"; + reg = <1>; + interrupt-parent = <&gpio1>; + interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "host-wakeup"; + device-wakeup-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>; + }; + };
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -76,6 +76,8 @@ patternProperties: description: Aeroflex Gaisler AB "^aesop,.*": description: AESOP Embedded Forum + "^aicsemi,.*": + description: AIC Semiconductor Co., Ltd. "^airoha,.*": description: Airoha "^al,.*":
[email protected]
AI reviewRe: [PATCH wireless-next v5 1/4] dt-bindings: net: wireless: Add AIC8800D80 SDIO Wi-Fi
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] dt-bindings: net: wireless: duplicate GPIO pin in aic8800d80 example --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] dt-bindings: net: wireless: duplicate GPIO pin in aic8800d80 example
--
commit b667af697cde7fb1ec4d5589a84fc742a4bcc924
Author: Zhirun Liu <[email protected]>
dt-bindings: net: wireless: Add AIC8800D80 SDIO Wi-Fi
This commit adds the Device Tree binding schema for the AICSemi AIC8800D80 and AIC8800D80N SDIO Wi-Fi function and registers the aicsemi vendor prefix.
Quoted 6 lines
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml new file +0
-0@@ -0,0 +1,78 @@
[ ... ]
Quoted 8 lines
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml new file +8
-0+examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + + mmc { + #address-cells = <1>; + #size-cells = <0>;
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml line 78
Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml new file +10
-0+ + wifi@1 { + compatible = "aicsemi,aic8800d80-fmac"; + reg = <1>; + interrupt-parent = <&gpio1>; + interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "host-wakeup"; + device-wakeup-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>; + }; + };
[Severity: Low]
Should interrupts and device-wakeup-gpios use two different pins on gpio1 in this example? Here the WIFI_WAKE_HOST input interrupt and the HOST_WAKE_WIFI output GPIO are both assigned to pin 18 on gpio1.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH wireless-next v5 1/4] dt-bindings: net: wireless: Add AIC8800D80 SDIO Wi-Fi
In reply to Yanli YangQuoted 21 lines · Yanli Yang
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml new file +21
-0+description: + The AIC8800D80 and AIC8800D80N are Wi-Fi and Bluetooth combo chips. + Wi-Fi is attached over SDIO and the chip variant is identified through + the SDIO vendor and device IDs. Both chips use the aicsemi,aic8800d80-fmac + compatible and the same device tree properties defined here. + The node describes SDIO function 1 and its optional out-of-band wake-up + lines, and is a child of the MMC host controller node. The chip supply + and enable line are described on the MMC host controller through + vmmc-supply and mmc-pwrseq. + +allOf: + - $ref: ieee80211.yaml# + +properties: + compatible: + const: aicsemi,aic8800d80-fmac + + reg: + description: SDIO function number of the Wi-Fi function + const: 1 +
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml line 44
Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml new file +10
-0+ interrupts: + maxItems: 1 + description: + Interrupt connected to the WIFI_WAKE_HOST pin of the chip, raised by + the chip when it has data for a sleeping host and used to wake up the + host from system suspend. + + interrupt-names: + items: + - const: host-wakeup
Jusr wakeup
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml line 49
Quoted 6 lines
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml new file +5
-0+ + device-wakeup-gpios: + maxItems: 1 + description: + GPIO connected to the HOST_WAKE_WIFI pin of the chip, asserted while
Looks LLM hallucinated since same pin has multiple names.
Best regards,
Krzysztof
Re: [PATCH wireless-next v5 1/4] dt-bindings: net: wireless: Add AIC8800D80 SDIO Wi-Fi
In reply to Yanli YangQuoted 6 lines · Yanli Yang
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml new file +6
-0+description: + The AIC8800D80 and AIC8800D80N are Wi-Fi and Bluetooth combo chips. + Wi-Fi is attached over SDIO and the chip variant is identified through + the SDIO vendor and device IDs. Both chips use the aicsemi,aic8800d80-fmac + compatible and the same device tree properties defined here. + The node describes SDIO function 1 and its optional out-of-band wake-up
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml line 29
Quoted 10 lines
Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml new file +10
-0+ lines, and is a child of the MMC host controller node. The chip supply + and enable line are described on the MMC host controller through + vmmc-supply and mmc-pwrseq. + +allOf: + - $ref: ieee80211.yaml# + +properties: + compatible: + const: aicsemi,aic8800d80-fmac
Nothing binds to it, no user. At least I could not find one. Can you point me? See also submitting patches in DT for explanation of rules.
Best regards,
Krzysztof
PATCH v5 2/4 wifi: aic: Add firmware protocol and SDIO chip support
In reply to Yanli YangFrom: Zhirun Liu <[email protected]>
Add the firmware message definitions, command manager and SDIO transport for the AIC8800D80 U02 and AIC8800D80N FullMAC Wi-Fi devices.
Keep firmware download, transport setup and chip operations in the FullMAC driver. Select the chip implementation from the SDIO IDs and provide separate D80 and D80N firmware boot sequences. D80N U02 and U02C use chip-initialization, RF-calibration, ROM-patch and patch-table images. Load firmware and user configuration with request_firmware() from the aic/aic8800d80/ and aic/aic8800d80n/ directories.
Add SDIO interrupt handling, transmit aggregation, firmware event dispatch and suspend/resume operations. Keep command and transport state with the device rather than exporting a separate BSP interface.
The build configuration and remaining FullMAC implementation follow in the next patch; the parent wireless build is connected only after all driver sources are present.
--- .../net/wireless/aic/aic8800_fdrv/aic_bus.h | 99 + .../wireless/aic/aic8800_fdrv/aicwf_bfmer.h | 100 + .../aic/aic8800_fdrv/aicwf_chip_8800d80.c | 96 + .../aic/aic8800_fdrv/aicwf_chip_8800d80n.c | 74 + .../aic/aic8800_fdrv/aicwf_chip_ops.c | 197 ++ .../aic/aic8800_fdrv/aicwf_chip_ops.h | 116 + .../wireless/aic/aic8800_fdrv/aicwf_cmds.c | 629 ++++ .../wireless/aic/aic8800_fdrv/aicwf_cmds.h | 122 + .../aic/aic8800_fdrv/aicwf_compat_8800d80.c | 281 ++ .../aic/aic8800_fdrv/aicwf_compat_8800d80.h | 17 + .../aic/aic8800_fdrv/aicwf_compat_8800d80n.c | 402 +++ .../aic/aic8800_fdrv/aicwf_compat_8800d80n.h | 17 + .../wireless/aic/aic8800_fdrv/aicwf_config.h | 33 + .../wireless/aic/aic8800_fdrv/aicwf_defs.h | 657 ++++ .../wireless/aic/aic8800_fdrv/aicwf_events.h | 938 +++++ .../wireless/aic/aic8800_fdrv/aicwf_main.h | 22 + .../wireless/aic/aic8800_fdrv/aicwf_mesh.h | 39 + .../aic/aic8800_fdrv/aicwf_mod_params.h | 59 + .../wireless/aic/aic8800_fdrv/aicwf_msg_rx.c | 1412 ++++++++ .../wireless/aic/aic8800_fdrv/aicwf_msg_rx.h | 12 + .../wireless/aic/aic8800_fdrv/aicwf_msg_tx.c | 2499 +++++++++++++ .../wireless/aic/aic8800_fdrv/aicwf_msg_tx.h | 201 ++ .../aic/aic8800_fdrv/aicwf_mu_group.h | 163 + .../aic/aic8800_fdrv/aicwf_platform.c | 1507 ++++++++ .../aic/aic8800_fdrv/aicwf_platform.h | 91 + .../wireless/aic/aic8800_fdrv/aicwf_radar.h | 289 ++ .../aic/aic8800_fdrv/aicwf_resv_mem.h | 54 + .../net/wireless/aic/aic8800_fdrv/aicwf_rx.h | 363 ++ .../aic/aic8800_fdrv/aicwf_rx_prealloc.h | 39 + .../wireless/aic/aic8800_fdrv/aicwf_sdio.c | 2439 +++++++++++++ .../wireless/aic/aic8800_fdrv/aicwf_sdio.h | 280 ++ .../wireless/aic/aic8800_fdrv/aicwf_strs.c | 267 ++ .../wireless/aic/aic8800_fdrv/aicwf_strs.h | 31 + .../net/wireless/aic/aic8800_fdrv/aicwf_tx.h | 165 + .../net/wireless/aic/aic8800_fdrv/aicwf_txq.h | 353 ++ .../aic/aic8800_fdrv/aicwf_txq_prealloc.h | 31 + .../wireless/aic/aic8800_fdrv/aicwf_txrxif.c | 666 ++++ .../wireless/aic/aic8800_fdrv/aicwf_txrxif.h | 161 + .../wireless/aic/aic8800_fdrv/aicwf_utils.c | 32 + .../wireless/aic/aic8800_fdrv/aicwf_utils.h | 61 + .../net/wireless/aic/aic8800_fdrv/hal_desc.h | 359 ++ .../wireless/aic/aic8800_fdrv/ipc_shared.h | 767 ++++ .../net/wireless/aic/aic8800_fdrv/lmac_mac.h | 437 +++ .../net/wireless/aic/aic8800_fdrv/lmac_msg.h | 3092 +++++++++++++++++ .../wireless/aic/aic8800_fdrv/lmac_types.h | 21 + .../net/wireless/aic/aic8800_fdrv/sdio_host.c | 136 + .../net/wireless/aic/aic8800_fdrv/sdio_host.h | 43 + 47 files changed, 19869 insertions(+) create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aic_bus.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_bfmer.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_8800d80.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_8800d80n.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_ops.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_ops.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_cmds.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_cmds.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80n.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80n.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_config.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_defs.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_events.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mesh.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mod_params.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_tx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_tx.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mu_group.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_platform.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_platform.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_radar.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx_prealloc.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_sdio.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_sdio.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_strs.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_strs.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_tx.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq_prealloc.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txrxif.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txrxif.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_utils.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_utils.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/hal_desc.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/ipc_shared.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/lmac_mac.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/lmac_msg.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/lmac_types.h create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/sdio_host.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/sdio_host.h
drivers/net/wireless/aic/aic8800_fdrv/aic_bus.h new file +99 -0
@@ -0,0 +1,99 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2024 AIC semiconductor. +* +* @file aic_bus.h +* @brief Common bus abstraction layer for AIC8800 series. +* +* This header defines the bus-level operations that abstract the +* underlying transport (currently SDIO) from the upper driver layers. +* The design follows the pattern used by silabs/wfx and broadcom/b43. +* +* Key principles: +* - struct aicwf_bus_ops provides the bus primitives the upper layers +* need: start/stop and data/message transmission. +* - Upper-layer code accesses the bus only through the ops table and +* inline wrappers defined here. It MUST NOT dereference the +* bus-private structure (aic_sdio_dev etc.) directly. +* - When a new transport (e.g. USB) is added, only the bus_ops +* implementation needs to change; upper layers are unaffected. +*/ + +#ifndef _AIC_BUS_H_ +#define _AIC_BUS_H_ + +#include <linux/device.h> +#include <linux/skbuff.h> +#include <linux/types.h> + +/* Bus operational state */ +enum aicwf_bus_state {BUS_DOWN_ST ,BUS_UP_ST }; + +struct aicwf_bus { +struct aic_sdio_dev *sdiodev; +struct device *dev; +const struct aicwf_bus_ops *ops; +enum aicwf_bus_state state; +u8 *cmd_buf; +struct completion bustx_trgg; +struct completion busrx_trgg; +struct completion busirq_trgg;// new oob feature +struct task_struct *bustx_thread; +struct task_struct *busrx_thread; +struct task_struct *busirq_thread;// new oob feature +}; + +/* ================================================================ +* Bus-level operation vectors +* +* Every transport provides one instance of this struct. The +* bus-private device pointer is carried inside struct aicwf_bus so +* that ops callbacks can retrieve it via bus->sdiodev. +* ================================================================ +*/ + +struct aicwf_bus_ops { +/* ----- Lifecycle ----- */ +int (*start)(struct device *dev); +void (*stop)(struct device *dev); + +/* ----- Data / message transmission ----- */ +int (*txdata)(struct device *dev,struct sk_buff *skb); +int (*txmsg)(struct device *dev,u8 *msg,uint len); +}; + +/* ================================================================ +* Inline wrappers – upper layers call these instead of touching +* the transport internals. +* ================================================================ +*/ + +static inline int aicwf_bus_start (struct aicwf_bus *bus) +{ +return bus->ops->start (bus->dev); +} + +static inline void aicwf_bus_stop (struct aicwf_bus *bus) +{ + bus->ops->stop (bus->dev); +} + +static inline int aicwf_bus_txdata (struct aicwf_bus *bus,struct sk_buff *skb) +{ +return bus->ops->txdata (bus->dev, skb); +} + +static inline int aicwf_bus_txmsg (struct aicwf_bus *bus,u8 *msg,uint len) +{ +return bus->ops->txmsg (bus->dev, msg, len); +} + +/* ================================================================ +* Bus-level init / deinit (shared across transports) +* ================================================================ +*/ + +int aicwf_bus_init (uint bus_hdrlen,struct device *dev); +void aicwf_bus_deinit (struct device *dev); + +#endif /* _AIC_BUS_H_ */
drivers/net/wireless/aic/aic8800_fdrv/aicwf_bfmer.h new file +100 -0
100 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_8800d80.c new file +96 -0
96 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_8800d80n.c new file +74 -0
74 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_ops.c new file +197 -0
197 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_chip_ops.h new file +116 -0
116 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_cmds.c new file +629 -0
629 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_cmds.h new file +122 -0
122 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80.c new file +281 -0
281 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2020 AIC semiconductor. +*/ + +#ifndef _AICWF_COMPAT_8800D80_H_ +#define _AICWF_COMPAT_8800D80_H_ +#include "aicwf_main.h" +#include "aicwf_msg_tx.h" +#include <linux/types.h> + +int aicwf_set_rf_config_8800d80 (struct aicwf_hw *aicwf_hw, +struct mm_set_rf_calib_cfm *cfm); +int aicwf_plat_userconfig_load_8800d80 (struct aicwf_hw *aicwf_hw); +int aicwf_fw_download_8800d80 (struct aicwf_hw *aicwf_hw); + +#endif
drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80n.c new file +402 -0
402 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_compat_8800d80n.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2020 AIC semiconductor. +*/ + +#ifndef _AICWF_COMPAT_8800D80N_H_ +#define _AICWF_COMPAT_8800D80N_H_ +#include "aicwf_main.h" +#include "aicwf_msg_tx.h" +#include <linux/types.h> + +int aicwf_set_rf_config_8800d80n (struct aicwf_hw *aicwf_hw, +struct mm_set_rf_calib_cfm *cfm); +int aicwf_plat_userconfig_load_8800d80n (struct aicwf_hw *aicwf_hw); +int aicwf_fw_download_8800d80n (struct aicwf_hw *aicwf_hw); + +#endif
drivers/net/wireless/aic/aic8800_fdrv/aicwf_config.h new file +33 -0
@@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2020 AIC semiconductor. +* +* Driver configuration and firmware resource limits. +*/ + +#ifndef _AICWF_CONFIG_H_ +#define _AICWF_CONFIG_H_ + +#ifdef CONFIG_AICWF_MUMIMO_TX +#define NX_USER_MAX 2 +#else +#define NX_USER_MAX 1 +#endif + +#define NX_VIRT_DEV_MAX 4 + +#define NX_REMOTE_STA_MAX_FOR_OLD_IC 10 +#define NX_REMOTE_STA_MAX 32 + +#define NX_MU_GROUP_MAX 62 +#define NX_TXDESC_CNT 64 +#define NX_TX_MAX_RATES 4 +#define NX_CHAN_CTXT_CNT 3 + +#ifdef CONFIG_AICWF_BCMC +#define NX_TXQ_CNT 5 +#else +#define NX_TXQ_CNT 4 +#endif + +#endif /* _AICWF_CONFIG_H_ */
drivers/net/wireless/aic/aic8800_fdrv/aicwf_defs.h new file +657 -0
657 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_events.h new file +938 -0
160 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.h new file +22 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/aic/aic8800_fdrv/aicwf_mesh.h new file +39 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/aic/aic8800_fdrv/aicwf_mod_params.h new file +59 -0
59 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c new file +1412 -0
1,412 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.h new file +12 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_tx.c new file +2499 -0
2,499 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_tx.h new file +201 -0
201 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_mu_group.h new file +163 -0
163 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_platform.c new file +1507 -0
1,507 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_platform.h new file +91 -0
91 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_radar.h new file +289 -0
289 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +54 -0
54 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx.h new file +363 -0
363 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx_prealloc.h new file +39 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/aic/aic8800_fdrv/aicwf_sdio.c new file +2439 -0
2,439 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_sdio.h new file +280 -0
280 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_strs.c new file +267 -0
267 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_strs.h new file +31 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/aic/aic8800_fdrv/aicwf_tx.h new file +165 -0
165 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq.h new file +353 -0
353 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq_prealloc.h new file +31 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/aic/aic8800_fdrv/aicwf_txrxif.c new file +666 -0
666 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_txrxif.h new file +161 -0
161 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_utils.c new file +32 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/aic/aic8800_fdrv/aicwf_utils.h new file +61 -0
61 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/hal_desc.h new file +359 -0
359 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/ipc_shared.h new file +767 -0
767 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/lmac_mac.h new file +437 -0
437 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/lmac_msg.h new file +3092 -0
3,092 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/lmac_types.h new file +21 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/aic/aic8800_fdrv/sdio_host.c new file +136 -0
136 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/sdio_host.h new file +43 -0
43 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH wireless-next v5 2/4] wifi: aic: Add firmware protocol and SDIO chip support
Quoted 68 lines · Yanli Yang
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c new file +68
-0+/*************************************************************************** +* Messages from SM task +**************************************************************************/ +#ifdef CONFIG_AICWF_FULLMAC +static inline int aicwf_rx_sm_connect_ind (struct aicwf_hw *aicwf_hw, +struct aicwf_cmd *cmd, +struct ipc_e2a_msg *msg) +{ +struct sm_connect_ind *ind = (struct sm_connect_ind *)msg->param; +struct aicwf_vif *aicwf_vif = aicwf_hw->vif_table[ind->vif_idx]; +struct net_device *dev = aicwf_vif->ndev; +const u8 *req_ie, *rsp_ie; +const struct element *extcap; +struct ieee80211_channel *chan; +const u8 *ht_ie =NULL ; +const u8 *vht_ie =NULL ; + +/* Retrieve IE addresses and lengths */ + req_ie = (const u8 *)ind->assoc_ie_buf; + rsp_ie = req_ie + ind->assoc_req_ie_len; + +// Fill-in the AP information +dev_dbg (aicwf_hw->dev,"ind->status_code:%d\n" , + ind->status_code); + +if (ind->status_code ==0 ) { +struct aicwf_sta *sta = &aicwf_hw->sta_table[ind->ap_idx]; +u8 txq_status; +struct cfg80211_chan_def chandef; + + sta->valid = true; + sta->sta_idx = ind->ap_idx; + sta->ch_idx = ind->ch_idx; + sta->vif_idx = ind->vif_idx; + sta->vlan_idx = sta->vif_idx; + sta->qos = ind->qos; + sta->acm = ind->acm; + sta->ps.active = false; + sta->aid = ind->aid; + sta->band = ind->band;// ind->chan.band; + sta->width = ind->width;// ind->chan.type; + sta->center_freq = ind->center_freq;// ind->chan.prim20_freq; + sta->center_freq1 = ind->center_freq1;// ind->chan.center1_freq; + sta->center_freq2 = ind->center_freq2;// ind->chan.center2_freq; + aicwf_vif->sta.ap = sta; +// ind->chan.prim20_freq); + chan =ieee80211_get_channel (aicwf_hw->wiphy, ind->center_freq); +cfg80211_chandef_create (&chandef, chan,NL80211_CHAN_NO_HT ); +if (!aicwf_hw->mod_params->ht_on) + chandef.width =NL80211_CHAN_WIDTH_20_NOHT ; +else + chandef.width = chnl2bw[ind->width];//[ind->chan.type]; + chandef.center_freq1 = ind->center_freq1;// ind->chan.center1_freq; + chandef.center_freq2 = ind->center_freq2;// ind->chan.center2_freq; +aicwf_chanctx_link (aicwf_vif, ind->ch_idx, &chandef); +memcpy (sta->mac_addr, ind->bssid.array,ETH_ALEN ); +if (ind->ch_idx == aicwf_hw->cur_chanctx) + txq_status =0 ; +else + txq_status =AICWF_TXQ_STOP_CHAN ; +memcpy (sta->ac_param, ind->ac_param,sizeof (sta->ac_param)); +aicwf_txq_sta_init (aicwf_hw, sta, txq_status); +aicwf_txq_tdls_vif_init (aicwf_vif); +aicwf_mu_group_sta_init (sta,NULL ); +/* Look for TDLS Channel Switch Prohibited flag in the Extended +* Capability Information Element +*/ + extcap = cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, rsp_ie,
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c line 782
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c new file +10
-0+ ind->assoc_rsp_ie_len); +if (extcap && extcap->datalen >=5 ) { + aicwf_vif->tdls_chsw_prohibited = + extcap->data[4 ] &WLAN_EXT_CAPA5_TDLS_CH_SW_PROHIBITED ; + } + +if (aicwf_vif->wep_enabled) + aicwf_vif->wep_auth_err = false; + +#ifdef CONFIG_AICWF_BFMER
Heh? What is this?
Quoted 37 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c new file +37
-0+/* If Beamformer feature is activated, check if features can be used +* with the new peer device +*/ +if (aicwf_hw->mod_params->bfmer) { +const u8 *vht_capa_ie; +const struct ieee80211_vht_cap *vht_cap; + +do { +/* Look for VHT Capability Information Element */ + vht_capa_ie =cfg80211_find_ie (WLAN_EID_VHT_CAPABILITY , rsp_ie, + ind->assoc_rsp_ie_len); + +/* Stop here if peer device does not support VHT */ +if (!vht_capa_ie) +break ; + + vht_cap = (const struct ieee80211_vht_cap *)(vht_capa_ie +2 ); + +/* Send MM_BFMER_ENABLE_REQ message if needed */ +aicwf_send_bfmer_enable (aicwf_hw, sta, vht_cap); + }while (0 ); + } +#endif //(CONFIG_AICWF_BFMER) + + ht_ie =cfg80211_find_ie (WLAN_EID_HT_CAPABILITY , rsp_ie, + ind->assoc_rsp_ie_len); +if (ht_ie) + aicwf_vif->sta.ap->ht = true; + vht_ie =cfg80211_find_ie (WLAN_EID_VHT_CAPABILITY , rsp_ie, + ind->assoc_rsp_ie_len); +if (vht_ie) + aicwf_vif->sta.ap->vht = true; + +#ifdef CONFIG_AICWF_MON_DATA +// If there are 1 sta and 1 monitor interface active at the same time +// then monitor interface channel context is always the same as the STA +// interface. This doesn't work with 2 STA interfaces but we don't want
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c line 829
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c new file +10
-0+// to support it. +if (aicwf_hw->monitor_vif !=AICWF_INVALID_VIF ) { +struct aicwf_vif *aicwf_mon_vif = + aicwf_hw->vif_table[aicwf_hw->monitor_vif]; +aicwf_chanctx_unlink (aicwf_mon_vif); +aicwf_chanctx_link (aicwf_mon_vif, ind->ch_idx,NULL ); + } +#endif +// atomic_set(&aicwf_vif->drv_conn_state, +// (int)AICWF_DRV_STATUS_CONNECTED);
What?
This is junk. You send us dead code.
...
Quoted 15 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_tx.c new file +15
-0+int aicwf_send_tdls_peer_traffic_ind_req (struct aicwf_hw *aicwf_hw, +struct aicwf_vif *aicwf_vif) +{ +struct tdls_peer_traffic_ind_req *tdls_peer_traffic_ind_req; + +if (!aicwf_vif->sta.tdls_sta) +return -ENOLINK ; + +/* Build the TDLS_PEER_TRAFFIC_IND_REQ message */ + tdls_peer_traffic_ind_req = +aicwf_msg_zalloc (aicwf_hw,TDLS_PEER_TRAFFIC_IND_REQ ,TASK_TDLS ,DRV_TASK_ID , +sizeof (struct tdls_peer_traffic_ind_req )); + +if (!tdls_peer_traffic_ind_req) +return -ENOMEM ;
...
Quoted 63 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_radar.h new file +31
-0+static inline void aicwf_radar_start_cac (struct aicwf_radar *radar, +u32 cac_time_ms,struct aicwf_vif *vif) +{ +} + +static inline void aicwf_radar_cancel_cac (struct aicwf_radar *radar) +{ +} + +static inline void +aicwf_radar_detection_enable_on_cur_channel (struct aicwf_hw *aicwf_hw) +{ +} + +static inline int aicwf_radar_dump_pattern_detector (char *buf,size_t len, +struct aicwf_radar *radar, +u8 chain) +{ +return 0 ; +} + +static inline int aicwf_radar_dump_radar_detected (char *buf,size_t len, +struct aicwf_radar *radar, +u8 chain) +{ +return 0 ; +} + +#endif /* CONFIG_AICWF_RADAR */ + +#endif // _AICWF_RADAR_H_ drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +26
-0@@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2020 AIC semiconductor. +*/ + +#ifndef _AICWF_RESV_MEM_H_ +#define _AICWF_RESV_MEM_H_ + +#include <linux/types.h> + +struct sk_buff ; + +enum aicwf_resv_mem_id { +AIC_RESV_MEM_TXDATA , +AIC_RESV_MEM_NUM , +}; + +/** +* struct aicwf_resv_mem_entry - one reserved buffer +* @used: Whether the buffer is currently handed out +* @skb: The reserved buffer, %NULL until it could be allocated +*/ +struct aicwf_resv_mem_entry { +bool used; +struct sk_buff *skb; +};
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h line 36
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +10
-0+ +/** +* struct aicwf_resv_mem - buffers reserved for the lifetime of a device +* @entry: One entry per &enum aicwf_resv_mem_id +*/ +struct aicwf_resv_mem { +struct aicwf_resv_mem_entry entry[AIC_RESV_MEM_NUM ]; +}; + +#ifdef CONFIG_RESV_MEM_SUPPORT
What the hell is this?
What are you sending to the lists? Windows code? 10 year old fork of kernel? What is the point of such code?
Quoted 6 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +6
-0+void aicwf_resv_mem_init (struct aicwf_resv_mem *pool); +void aicwf_resv_mem_deinit (struct aicwf_resv_mem *pool); +struct sk_buff *aicwf_resv_mem_alloc_skb (struct aicwf_resv_mem *pool, +unsigned int length, +enum aicwf_resv_mem_id id); +void aicwf_resv_mem_kfree_skb(struct aicwf_resv_mem *pool, struct sk_buff *skb,
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h line 52
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +10
-0+ enum aicwf_resv_mem_id id); +#else +static inline void aicwf_resv_mem_init (struct aicwf_resv_mem *pool) +{ +} + +static inline void aicwf_resv_mem_deinit (struct aicwf_resv_mem *pool) +{ +} +#endif
...
+
Quoted 45 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +45
-0+int aicwf_sdio_flow_ctrl (struct aic_sdio_dev *sdiodev) +{ +int ret =-1 ; +u8 fc_reg =0 ; +u32 count =0 ; + +while (true) { + ret = +aicwf_sdio_readb (sdiodev, sdiodev->sdio_reg.flow_ctrl_reg, &fc_reg); +if (ret) +return -1 ; + +if (sdiodev->chip_hw->need_flowctrl_mask) + fc_reg &=SDIOWIFI_FLOWCTRL_MASK_REG ; + +if (fc_reg >DATA_FLOW_CTRL_THRESH ) { + ret = fc_reg; +if (ret >AICWF_SDIO_TX_AGGR_MAX ) + ret =AICWF_SDIO_TX_AGGR_MAX ; +return ret; + } +if (count >=FLOW_CTRL_RETRY_COUNT ) { + ret = -fc_reg; +break ; + } + count++; +if (count <30 ) +usleep_range (50 ,50 ); +else if (count <40 ) +usleep_range (2000 ,2500 ); +else +usleep_range (10000 ,12000 ); + } + +return ret; +} + +int aicwf_sdio_send_pkt (struct aic_sdio_dev *sdiodev,u8 *buf,uint count) +{ +int ret =0 ; + +if (!sdiodev->func) { +dev_warn (sdiodev->dev,"null sdio func\n" ); +return 0 ; + }
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +10
-0+ +sdio_claim_host (sdiodev->func); + ret = +sdio_writesb (sdiodev->func, sdiodev->sdio_reg.wr_fifo_addr, buf, count); +sdio_release_host (sdiodev->func); + +return ret; +} + +#ifdef CONFIG_PREALLOC_RX_SKB
What is this?
Quoted 23 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +23
-0+int aicwf_sdio_recv_pkt (struct aic_sdio_dev *sdiodev,struct rx_buff *rxbuff, +u32 size) +{ +int ret; + +if (!rxbuff->data || !size || size >AICWF_RXBUFF_SIZE ) +return -EINVAL ; +if (!sdiodev->func) { +dev_warn (sdiodev->dev,"null sdio func\n" ); +return -ENODEV ; + } + +sdio_claim_host (sdiodev->func); + ret =sdio_readsb (sdiodev->func, rxbuff->data, + sdiodev->sdio_reg.rd_fifo_addr, size); +sdio_release_host (sdiodev->func); + +if (ret <0 ) +return ret; + rxbuff->len = size; + +return ret; +}
...
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +10
-0+static int aicwf_sdio_suspend (struct device *dev) +{ +int ret =0 ; +struct aicwf_bus *bus_if =dev_get_drvdata (dev); +struct aic_sdio_dev *sdiodev = bus_if->sdiodev; +mmc_pm_flag_t sdio_flags; +struct aicwf_vif *aicwf_vif, *tmp; +#ifdef CONFIG_AIC8800_NO_WAKE_COUNT +int cnt =0 ; +#endif
no, that's some bogus downstream code. Your driver must not have ifdefs in general. Variables declarations depending on ifdef is... not close to kernel at all.
Quoted 13 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +13
-0+int sus_abort =0 ; + +/* Check host PM support before changing network or chip state. */ + sdio_flags =sdio_get_host_pm_caps (sdiodev->func); +if (!(sdio_flags &MMC_PM_KEEP_POWER )) +return -EINVAL ; + ret =sdio_set_host_pm_flags (sdiodev->func,MMC_PM_KEEP_POWER ); +if (ret) +return ret; + +list_for_each_entry_safe (aicwf_vif, tmp, &sdiodev->aicwf_hw->vifs, list) { +if (aicwf_vif->ndev) +netif_device_detach (aicwf_vif->ndev);
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +10
-0+ } + +if (sdiodev->aicwf_hw->testmode ==1 ) +dev_err (dev,"sleep cmd is not supported in RF test mode\n" ); +#ifdef CONFIG_AIC8800_NO_WAKE_COUNT //move to when set supend is received + else + aicwf_send_me_set_lp_level(sdiodev->aicwf_hw, 1, 0); //dynamic switch +#endif + +#if (defined(CONFIG_AIC8800_AUTO_POWERSAVE ) && defined(CONFIG_AIC8800_SDIO_PWRCTRL ))
You need to stop inventing stuff.
Where is AIC8800_SDIO_PWRCTRL defined?
where are any of these bogus configs defined?
Quoted 84 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +84
-0+aicwf_sdio_pwr_stctl (sdiodev,SDIO_ACTIVE_ST ); +if (sdiodev->chip_hw->auto_ps_support) { +dev_dbg (dev,"auto_ps enter\n" ); + ret =aicwf_sdio_writeb (sdiodev, sdiodev->sdio_reg.wakeup_reg,0x8 ); +if (ret) +dev_err (dev,"sdio enter auto_ps fail\n" ); + } +#endif + +#ifdef CONFIG_AIC8800_NO_WAKE_COUNT +while (&sdiodev->aicwf_hw->scan_request && aicwf_hw->scanning) { +/* move to when set supend is received, the theory does not enforce this condition, +* and the code is retained for now +*/ +dev_dbg (dev,"wait scan_cfm\n" ); +if (cnt ==0 ) { +aicwf_send_scanu_cancel_req (sdiodev->aicwf_hw,NULL ); +continue ; + } +msleep (20 ); + cnt +=1 ; +if (cnt >=40 ) +break ; + } +#endif + +#ifdef CONFIG_AIC8800_TEMP_CONTROL +timer_delete_sync (&sdiodev->tp_ctrl.tp_ctrl_timer); +cancel_work_sync (&sdiodev->tp_ctrl.tp_ctrl_work); +#endif + +atomic_set (&sdiodev->suspending,1 ); +/* Publish the suspend gate before checking outstanding activity. */ +smp_mb__after_atomic (); +if (!wait_event_timeout (sdiodev->activity_waitq, +atomic_read (&sdiodev->activity_count) ==0 , +msecs_to_jiffies (600 ))) + sus_abort =1 ; +if (sus_abort) { +atomic_set (&sdiodev->suspending,0 ); +#ifdef CONFIG_AIC8800_TEMP_CONTROL +mod_timer (&sdiodev->tp_ctrl.tp_ctrl_timer, + jiffies +msecs_to_jiffies (TEMP_GET_INTERVAL )); +#endif +dev_dbg (dev,"ws active dont suspend\n" ); + +#if defined(CONFIG_AIC8800_AUTO_POWERSAVE ) +aicwf_sdio_pwr_stctl (sdiodev,SDIO_ACTIVE_ST ); +if (sdiodev->chip_hw->auto_ps_support) { +dev_dbg (dev,"auto_ps abort\n" ); + ret =aicwf_sdio_writeb (sdiodev, sdiodev->sdio_reg.wakeup_reg,0x8 ); +if (ret) +dev_err (dev,"sdio exit auto_ps fail\n" ); + } +#elif defined(CONFIG_AIC8800_NO_WAKE_COUNT ) +if (sdiodev->aicwf_hw->testmode ==0 ) +aicwf_send_me_set_lp_level (sdiodev->aicwf_hw,0 ,1 );//dynamic switch +#endif +list_for_each_entry_safe (aicwf_vif, tmp, &sdiodev->aicwf_hw->vifs, list) { +if (aicwf_vif->ndev) { +dev_dbg (dev,"suspend restore\n" ); +netif_device_attach (aicwf_vif->ndev); + } + } +return -EBUSY ; + } + +#ifdef CONFIG_AIC8800_TEMP_CONTROL +timer_delete_sync (&sdiodev->tp_ctrl.netif_timer); +cancel_work_sync (&sdiodev->tp_ctrl.netif_work); +#endif + +#ifndef CONFIG_AIC8800_AUTO_POWERSAVE +while (sdiodev->state ==SDIO_ACTIVE_ST ) { +if (down_interruptible (&sdiodev->tx_priv->txctl_sema)) +continue ; +#if defined(CONFIG_AIC8800_SDIO_PWRCTRL ) +aicwf_sdio_pwr_stctl (sdiodev,SDIO_SLEEP_ST ); +#endif +up (&sdiodev->tx_priv->txctl_sema); +break ; + } +#else +#if defined(CONFIG_AIC8800_SDIO_PWRCTRL )
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +8
-0+aicwf_sdio_pwr_stctl (sdiodev,SDIO_SLEEP_ST ); +#endif +#endif + +atomic_set (&sdiodev->is_bus_suspend,1 ); + +return 0 ; +}
+
Quoted 8 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +8
-0+/* +* TYPE and STRUCT DEFINITIONS +**************************************************************************************** +*/ + +// IRQs from app to emb +/// Interrupts bits used for the TX descriptors of the AC queues +#ifdef CONFIG_AICWF_MUMIMO_TX
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.h new file +10
-0+/// Interrupts bits used +#if NX_USER_MAX >3 +#define IPC_IRQ_A2E_USER_MSK 0xF +#elif NX_USER_MAX >2 +#define IPC_IRQ_A2E_USER_MSK 0x7 +#else +#define IPC_IRQ_A2E_USER_MSK 0x3 +#endif + +/// Offset of the interrupts for AC0
What sort of comment style is this? Windows? Doxygen? Certainly not kernel style.
This is like 30k lines of unreviewable downstream junk. Last time you send clearly undocumented ABI, now you send downstream build options.
Go back to the drawing board and clean up all this from such downstream code.
Best regards,
Krzysztof
PATCH v5 3/4 wifi: aic: Add the AIC8800D80 and D80N FullMAC driver
In reply to Yanli YangFrom: Zhirun Liu <[email protected]>
Add the cfg80211 interface and TX/RX data paths for AIC8800D80 U02 and AIC8800D80N SDIO Wi-Fi. Expose station operation on the 2.4 GHz and 5 GHz bands through cfg80211/nl80211, with scanning, connection management, key configuration and station statistics.
Implement transmit queues, receive reordering and packet delivery, and register firmware-derived capabilities with cfg80211. Propagate the cfg80211 channel restrictions and power limits to the firmware through the regulatory notifier.
Add the AIC Kconfig and Makefiles and build a single aic8800_fdrv module. Keep the initial selectable configuration restricted to station mode. Retain the existing non-station source behind disabled configuration branches, together with the optional allocation helpers.
This patch depends on the firmware and transport sources in patch 2. The next patch connects the complete driver to the wireless build.
--- drivers/net/wireless/aic/Kconfig | 16 + drivers/net/wireless/aic/Makefile | 3 + drivers/net/wireless/aic/aic8800_fdrv/Kconfig | 90 + .../net/wireless/aic/aic8800_fdrv/Makefile | 36 + .../wireless/aic/aic8800_fdrv/aicwf_bfmer.c | 93 + .../wireless/aic/aic8800_fdrv/aicwf_main.c | 5114 +++++++++++++++++ .../wireless/aic/aic8800_fdrv/aicwf_mesh.c | 33 + .../aic/aic8800_fdrv/aicwf_mod_params.c | 644 +++ .../aic/aic8800_fdrv/aicwf_mu_group.c | 653 +++ .../wireless/aic/aic8800_fdrv/aicwf_radar.c | 1969 +++++++ .../aic/aic8800_fdrv/aicwf_resv_mem.c | 106 + .../net/wireless/aic/aic8800_fdrv/aicwf_rx.c | 2434 ++++++++ .../aic/aic8800_fdrv/aicwf_rx_prealloc.c | 99 + .../net/wireless/aic/aic8800_fdrv/aicwf_tx.c | 1469 +++++ .../net/wireless/aic/aic8800_fdrv/aicwf_txq.c | 1368 +++++ .../aic/aic8800_fdrv/aicwf_txq_prealloc.c | 55 + 16 files changed, 14182 insertions(+) create mode 100644 drivers/net/wireless/aic/Kconfig create mode 100644 drivers/net/wireless/aic/Makefile create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/Kconfig create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/Makefile create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_bfmer.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mesh.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mod_params.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mu_group.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_radar.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx_prealloc.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_tx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq_prealloc.c
drivers/net/wireless/aic/Kconfig new file +16 -0
@@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config WLAN_VENDOR_AIC + bool "AIC devices" + default y + help + Say Y to expose the AIC8800D80 U02 / AIC8800D80N SDIO Wi-Fi driver. + The first upstreaming target is a narrow D80/D80N SDIO station + configuration; legacy transport, Bluetooth, Android, test and + manufacturing build switches are intentionally not exposed. + +if WLAN_VENDOR_AIC + +source "drivers/net/wireless/aic/aic8800_fdrv/Kconfig" + +endif # WLAN_VENDOR_AIC
drivers/net/wireless/aic/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_AIC8800_WLAN_SUPPORT) += aic8800_fdrv/
drivers/net/wireless/aic/aic8800_fdrv/Kconfig new file +90 -0
90 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/Makefile new file +36 -0
@@ -0,0 +1,36 @@ +# SPDX-License-Identifier: GPL-2.0 + + +obj-$(CONFIG_AIC8800_WLAN_SUPPORT) += aic8800_fdrv.o + +aic8800_fdrv-y := \ + aicwf_msg_tx.o \ + aicwf_msg_rx.o \ + aicwf_utils.o \ + aicwf_cmds.o \ + aicwf_strs.o \ + aicwf_rx.o \ + aicwf_tx.o \ + aicwf_txq.o \ + aicwf_main.o \ + aicwf_mod_params.o \ + aicwf_platform.o \ + aicwf_chip_8800d80.o \ + aicwf_chip_8800d80n.o \ + aicwf_chip_ops.o \ + aicwf_compat_8800d80.o \ + aicwf_compat_8800d80n.o + +aic8800_fdrv-$(CONFIG_AIC8800_SDIO_SUPPORT) += \ + sdio_host.o \ + aicwf_txrxif.o \ + aicwf_sdio.o \ + aicwf_rx_prealloc.o + +aic8800_fdrv-$(CONFIG_AIC8800_NONSTA_SUPPORT) += aicwf_mesh.o +aic8800_fdrv-$(CONFIG_RESV_MEM_SUPPORT) += aicwf_resv_mem.o +aic8800_fdrv-$(CONFIG_PREALLOC_TXQ) += aicwf_txq_prealloc.o + +ccflags-y += -I$(srctree) +ccflags-y += -I$(src) +ccflags-y += -DAIC_TRACE_INCLUDE_PATH=$(src)
drivers/net/wireless/aic/aic8800_fdrv/aicwf_bfmer.c new file +93 -0
93 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.c new file +5114 -0
2,762 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_mesh.c new file +33 -0
Lines of this file are not shown. View the raw message.
drivers/net/wireless/aic/aic8800_fdrv/aicwf_mod_params.c new file +644 -0
644 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_mu_group.c new file +653 -0
653 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_radar.c new file +1969 -0
1,969 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.c new file +106 -0
106 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx.c new file +2434 -0
2,434 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx_prealloc.c new file +99 -0
99 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_tx.c new file +1469 -0
1,469 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq.c new file +1368 -0
1,368 lines not on this page · raw message
drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq_prealloc.c new file +55 -0
55 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH wireless-next v5 3/4] wifi: aic: Add the AIC8800D80 and D80N FullMAC driver
Quoted 118 lines · Yanli Yang
From: Zhirun Liu <[email protected]>
Add the cfg80211 interface and TX/RX data paths for AIC8800D80 U02 and AIC8800D80N SDIO Wi-Fi. Expose station operation on the 2.4 GHz and 5 GHz bands through cfg80211/nl80211, with scanning, connection management, key configuration and station statistics.
Implement transmit queues, receive reordering and packet delivery, and register firmware-derived capabilities with cfg80211. Propagate the cfg80211 channel restrictions and power limits to the firmware through the regulatory notifier.
Add the AIC
Kconfigand Makefiles and build a singleaic8800_fdrvmodule. Keep the initial selectable configuration restricted to station mode. Retain the existing non-station source behind disabled configuration branches, together with the optional allocation helpers.This patch depends on the firmware and transport sources in patch 2. The next patch connects the complete driver to the wireless build.
Signed-off-by Chunqiu Liu <[email protected]>Signed-off-by Zhirun Liu <[email protected]>Signed-off-by Yanli Yang <[email protected]>--- drivers/net/wireless/aic/Kconfig | 16 + drivers/net/wireless/aic/Makefile | 3 + drivers/net/wireless/aic/aic8800_fdrv/Kconfig | 90 + .../net/wireless/aic/aic8800_fdrv/Makefile | 36 + .../wireless/aic/aic8800_fdrv/aicwf_bfmer.c | 93 + .../wireless/aic/aic8800_fdrv/aicwf_main.c | 5114 +++++++++++++++++ .../wireless/aic/aic8800_fdrv/aicwf_mesh.c | 33 + .../aic/aic8800_fdrv/aicwf_mod_params.c | 644 +++ .../aic/aic8800_fdrv/aicwf_mu_group.c | 653 +++ .../wireless/aic/aic8800_fdrv/aicwf_radar.c | 1969 +++++++ .../aic/aic8800_fdrv/aicwf_resv_mem.c | 106 + .../net/wireless/aic/aic8800_fdrv/aicwf_rx.c | 2434 ++++++++ .../aic/aic8800_fdrv/aicwf_rx_prealloc.c | 99 + .../net/wireless/aic/aic8800_fdrv/aicwf_tx.c | 1469 +++++ .../net/wireless/aic/aic8800_fdrv/aicwf_txq.c | 1368 +++++ .../aic/aic8800_fdrv/aicwf_txq_prealloc.c | 55 + 16 files changed, 14182 insertions(+) create mode 100644 drivers/net/wireless/aic/Kconfig create mode 100644 drivers/net/wireless/aic/Makefile create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/Kconfig create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/Makefile create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_bfmer.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mesh.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mod_params.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_mu_group.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_radar.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_resv_mem.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx_prealloc.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_tx.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq.c create mode 100644 drivers/net/wireless/aic/aic8800_fdrv/aicwf_txq_prealloc.cdrivers/net/wireless/aic/Kconfig new file +16
-0@@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config WLAN_VENDOR_AIC + bool "AIC devices" + default y + help + Say Y to expose the AIC8800D80 U02 / AIC8800D80N SDIO Wi-Fi driver. + The first upstreaming target is a narrow D80/D80N SDIO station + configuration; legacy transport, Bluetooth, Android, test and + manufacturing build switches are intentionally not exposed. + +if WLAN_VENDOR_AIC + +source "drivers/net/wireless/aic/aic8800_fdrv/Kconfig" + +endif # WLAN_VENDOR_AICdrivers/net/wireless/aic/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_AIC8800_WLAN_SUPPORT) += aic8800_fdrv/drivers/net/wireless/aic/aic8800_fdrv/Kconfig new file +23
-0@@ -0,0 +1,90 @@ +# SPDX-License-Identifier: GPL-2.0-only + +menuconfig AIC8800_WLAN_SUPPORT + tristate "AIC8800D80 U02 / AIC8800D80N SDIO station support" + depends on MMC + depends on CFG80211 + select CRYPTO_LIB_MD5 + help + Enable the AIC8800D80 U02 and AIC8800D80N (D80N, D80LN, D40N, + D40LN) FullMAC Wi-Fi driver for the first upstreaming baseline. + This build is restricted to the SDIO station path and uses + cfg80211/nl80211 for normal Wi-Fi operation. The driver also + downloads and starts the chip firmware. + + Firmware files are loaded from the aic/aic8800d80/ and + aic/aic8800d80n/ subdirectories of the kernel firmware search + path for AIC8800D80 and AIC8800D80N, respectively. + + If unsure, say N. + +if AIC8800_WLAN_SUPPORT + +config AIC8800_SDIO_SUPPORT
drivers/net/wireless/aic/aic8800_fdrv/Kconfig line 33
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/Kconfig new file +10
-0+ def_bool y + help + Build the shared SDIO transport for AIC8800D80 and AIC8800D80N. + +config AIC8800_SDIO_PWRCTRL + def_bool y + depends on AIC8800_SDIO_SUPPORT + help + Enable SDIO active/sleep transitions and the inactivity timer used + by the driver. This is a required feature of the AIC8800D80 and
Drop. Don't add your downstream config features.
drivers/net/wireless/aic/aic8800_fdrv/Kconfig line 43
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/Kconfig new file +10
-0+ AIC8800D80N SDIO configurations, independent of system suspend support. + +config AIC8800_AUTO_POWERSAVE + def_bool y + depends on AIC8800_SDIO_PWRCTRL + help + Low-power configuration within the chip + +config AIC8800_USE_5G + def_bool y
Why build option would be NOT to use 5 Ghz? Like, if I go to different building with different WiFi I rebuild the kernel?
What?
Upstream kernel is MULTIPLATFORM.
drivers/net/wireless/aic/aic8800_fdrv/Kconfig line 48
Quoted 5 lines
drivers/net/wireless/aic/aic8800_fdrv/Kconfig new file +5
-0+ help + Enable the 5 GHz band. The AIC8800D80 is a dual-band device; + keep this on for the upstream station baseline. + +config RESV_MEM_SUPPORT
Why are you inventing more config symbols?
Quoted 30 lines
drivers/net/wireless/aic/aic8800_fdrv/Kconfig new file +30
-0+ bool "Reserve the SDIO TX aggregation buffer per device" + depends on AIC8800_SDIO_SUPPORT + help + Allocate the SDIO TX aggregation buffer as soon as the device is + probed and keep it until the device is removed, instead of + allocating it when the SDIO bus is brought up. + + If unsure, say N. + +config PREALLOC_TXQ + bool "Preallocate the TX queue array" + help + Allocate the TX queue array separately and keep it until the + device is removed, instead of embedding it in the wiphy private + data. + + If unsure, say N. + +config AICWF_FULLMAC + def_bool y + +# Preserve the enabled features of the SDIO station baseline. +config AIC8800_RX_REORDER + def_bool y + +config AIC8800_ARP_OFFLOAD + def_bool y + +config AIC8800_RX_NETIF_RECV_SKB + def_bool y
drivers/net/wireless/aic/aic8800_fdrv/Kconfig line 88
Quoted 10 lines
drivers/net/wireless/aic/aic8800_fdrv/Kconfig new file +10
-0+ +config AIC8800_STA_ONLY + def_bool y + help + Limit the initial upstream driver to station mode. The AP, P2P, + monitor and mesh implementations remain in the source tree + so they can be enabled when those modes are ready for upstream. + +config AIC8800_NONSTA_SUPPORT + def_bool y if !AIC8800_STA_ONLY
Almost nothing above makes sense.
Best regards,
Krzysztof
PATCH v5 4/4 wifi: aic: Integrate the AIC8800 SDIO driver
In reply to Yanli YangFrom: Zhirun Liu <[email protected]>
Connect the AIC vendor directory to the wireless Kconfig and Makefile so the complete AIC8800D80 and AIC8800D80N FullMAC driver can be selected.
Add the driver maintainers, reviewers and linux-wireless mailing list to MAINTAINERS. Keep the parent build integration last so that intermediate patches do not expose an incomplete driver configuration.
--- MAINTAINERS | 10 ++++++++++ drivers/net/wireless/Kconfig | 1 + drivers/net/wireless/Makefile | 1 + 3 files changed, 12 insertions(+)
MAINTAINERS +10 -0
@@ -746,6 +746,16 @@ L: [email protected] S: Maintained F: drivers/scsi/aic7xxx/ +AIC8800 WIRELESS DRIVER +M: Zhirun Liu <[email protected]> +M: Dijia Xu <[email protected]> +M: Chunqiu Liu <[email protected]> +R: Liheng Wei <[email protected]> +R: Yanli Yang <[email protected]> +L: [email protected] +S: Maintained +F: drivers/net/wireless/aic/ + AIMSLAB FM RADIO RECEIVER DRIVER M: Hans Verkuil <[email protected]> L: [email protected]
drivers/net/wireless/Kconfig +1 -0
@@ -19,6 +19,7 @@ menuconfig WLAN if WLAN source "drivers/net/wireless/admtek/Kconfig" +source "drivers/net/wireless/aic/Kconfig" source "drivers/net/wireless/ath/Kconfig" source "drivers/net/wireless/atmel/Kconfig" source "drivers/net/wireless/broadcom/Kconfig"
drivers/net/wireless/Makefile +1 -0
@@ -4,6 +4,7 @@ # obj-$(CONFIG_WLAN_VENDOR_ADMTEK) += admtek/ +obj-$(CONFIG_WLAN_VENDOR_AIC) += aic/ obj-$(CONFIG_WLAN_VENDOR_ATH) += ath/ obj-$(CONFIG_WLAN_VENDOR_ATMEL) += atmel/ obj-$(CONFIG_WLAN_VENDOR_BROADCOM) += broadcom/
[email protected]
AI reviewRe: [PATCH wireless-next v5 4/4] wifi: aic: Integrate the AIC8800 SDIO driver
Thank you for your contribution! Sashiko AI review found 10 potential issues to consider: - [High] wifi: aic: stuck drv_conn_state in connect and NULL sta.ap in disconnect - [High] wifi: aic…
Thank you for your contribution! Sashiko AI review found 10 potential issues to consider:
- [High] wifi: aic: stuck drv_conn_state in connect and NULL sta.ap in disconnect
- [High] wifi: aic: uninitialized cfm and OOB access in station info and survey
- [High] wifi: aic: wrong spinlock unlock, atomic sleep, and leaks in RX reorder
- [High] wifi: aic: off-by-one flow control check and stuck cmd_txstate in aicwf_sdio_tx_msg()
- [High] wifi: aic: missing credit update and bounds check in aicwf_txq_credit_update()
- [High] wifi: aic: unlocked aicwf_txdatacfm() call from aicwf_sdio_host_tx_cfm_handler()
- [Medium] wifi: aic: 32-bit BIT() used on 64-bit avail_idx_map in aicwf_main.c
- [Medium] wifi: aic: wrong array index for ofst_2g4_ofdm_lowrate_chan_10_13
- [Medium] wifi: aic: uninitialized HE radiotap and 40MHz VHT overflow in aicwf_rx_add_rtap_hdr()
- [Low] wifi: aic: missing devicetree binding file entry in MAINTAINERS --
commit e2756605b7e0074b675225d5cc53b5d095cd0e8e
Author: Zhirun Liu <[email protected]>
wifi: aic: Integrate the AIC8800 SDIO driver
This commit connects the AIC wireless vendor directory to the wireless Kconfig and Makefile and adds a MAINTAINERS entry for the AIC8800 driver.
Quoted 7 lines
MAINTAINERS +0
-0@@ -746,6 +746,16 @@ L: [email protected] S: Maintained F: drivers/scsi/aic7xxx/
MAINTAINERS L: [email protected] · line 757
Quoted 10 lines
MAINTAINERS +9
-0+AIC8800 WIRELESS DRIVER +M: Zhirun Liu <[email protected]> +M: Dijia Xu <[email protected]> +M: Chunqiu Liu <[email protected]> +R: Liheng Wei <[email protected]> +R: Yanli Yang <[email protected]> +L: [email protected] +S: Maintained +F: drivers/net/wireless/aic/
[Severity: Low]
Earlier in the series, commit "dt-bindings: net: wireless: Add AIC8800D80 SDIO Wi-Fi" adds Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml. Should that binding file also be listed under F: here?
[ ... ]
drivers/net/wireless/Makefile line 10
Quoted 12 lines
drivers/net/wireless/Makefile +1
-0@@ -4,6 +4,7 @@ # obj-$(CONFIG_WLAN_VENDOR_ADMTEK) += admtek/ +obj-$(CONFIG_WLAN_VENDOR_AIC) += aic/ obj-$(CONFIG_WLAN_VENDOR_ATH) += ath/ obj-$(CONFIG_WLAN_VENDOR_ATMEL) += atmel/ obj-$(CONFIG_WLAN_VENDOR_BROADCOM) += broadcom/
[Severity: High]
In the driver enabled here, can aicwf_cfg80211_connect() leave aicwf_vif->drv_conn_state stuck in AICWF_DRV_STATUS_CONNECTING or AICWF_DRV_STATUS_ROAMING, and can aicwf_rx_sm_disconnect_ind() dereference a NULL aicwf_vif->sta.ap?
drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.c:aicwf_cfg80211_connect() {
if ((int)atomic_read(&aicwf_vif->drv_conn_state) == (int)AICWF_DRV_STATUS_DISCONNECTING ||
(int)atomic_read(&aicwf_vif->drv_conn_state) == (int)AICWF_DRV_STATUS_CONNECTING) {
dev_err(&wiphy->dev, "driver is disconnecting or connecting ,return it\n");
return 0;
}
if (aicwf_vif->sta.is_roam)
aicwf_set_conn_state(&aicwf_vif->drv_conn_state, (int)AICWF_DRV_STATUS_ROAMING);
else
aicwf_set_conn_state(&aicwf_vif->drv_conn_state, (int)AICWF_DRV_STATUS_CONNECTING);
...
error = aicwf_send_sm_connect_req(aicwf_hw, aicwf_vif, sme, &sm_connect_cfm);
if (error)
return error;
}If the SAE check, aicwf_send_sm_connect_req(), or sm_connect_cfm.status fails synchronously, drv_conn_state is never reset. Once stuck in AICWF_DRV_STATUS_CONNECTING, later scans in aicwf_scan() fail with -EBUSY and later aicwf_cfg80211_connect() calls return 0 without starting a connection.
Conversely, if aicwf_cfg80211_disconnect() is called while drv_conn_state is AICWF_DRV_STATUS_CONNECTING (before aicwf_rx_sm_connect_ind() assigns aicwf_vif->sta.ap), aicwf_rx_sm_disconnect_ind() unconditionally passes aicwf_vif->sta.ap to aicwf_txq_sta_deinit() and clears aicwf_vif->sta.ap->valid, causing a NULL pointer dereference:
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c:aicwf_rx_sm_disconnect_ind() {
...
aicwf_txq_sta_deinit(aicwf_hw, aicwf_vif->sta.ap);
aicwf_txq_tdls_vif_deinit(aicwf_vif);
aicwf_vif->sta.ap->valid = false;
aicwf_vif->sta.ap = NULL;
...
}[Severity: High]
Can aicwf_fill_station_info() and aicwf_rx_channel_survey_ind() access uninitialized stack memory and out-of-bounds array elements?
drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.c:aicwf_fill_station_info() {
...
union aicwf_rate_ctrl_info *rate_info;
struct mm_get_sta_info_cfm cfm;
aicwf_send_get_sta_info_req(vif->aicwf_hw, sta->sta_idx, &cfm);
sinfo->tx_failed = cfm.txfailed;
rate_info = (union aicwf_rate_ctrl_info *)&cfm.rate_info;
...
switch (rate_info->format_mod_tx) {
case FORMATMOD_NON_HT:
case FORMATMOD_NON_HT_DUP_OFDM:
sinfo->txrate.flags = 0;
sinfo->txrate.legacy = tx_legrates_lut_rate[rate_info->mcs_index_tx];
break;
...
}If aicwf_send_get_sta_info_req() fails, cfm is read uninitialized from the stack, and the 7-bit rate_info->mcs_index_tx field indexes the 12-element tx_legrates_lut_rate[] array without a bounds check.
In addition, aicwf_rx_channel_survey_ind() checks idx > ARRAY_SIZE(aicwf_hw->survey) instead of >=, allowing an out-of-bounds write to aicwf_hw->survey[ARRAY_SIZE(aicwf_hw->survey)]:
drivers/net/wireless/aic/aic8800_fdrv/aicwf_msg_rx.c:aicwf_rx_channel_survey_ind() {
...
if (idx > ARRAY_SIZE(aicwf_hw->survey))
return 0;
aicwf_survey = &aicwf_hw->survey[idx];
...
}[Severity: Medium]
Does using BIT() instead of BIT_ULL() on aicwf_hw->avail_idx_map break on 32-bit architectures?
drivers/net/wireless/aic/aic8800_fdrv/aicwf_main.c:aicwf_cfg80211_init() {
...
for (i = 0; i < NX_VIRT_DEV_MAX + NX_REMOTE_STA_MAX; i++)
aicwf_hw->avail_idx_map |= BIT(i);
...
}avail_idx_map is a u64 holding NX_VIRT_DEV_MAX + NX_REMOTE_STA_MAX (36) bits. On 32-bit architectures, BIT(i) overflows a 32-bit unsigned long for i >= 32, and aicwf_hw->avail_idx_map &= ~BIT(vif_idx) in aicwf_interface_add() and aicwf_virtual_interface_add() zero-extends the 32-bit mask and clears the upper bits of avail_idx_map.
[Severity: Medium]
Does parsing "ofst_2g4_ofdm_lowrate_chan_10_13" in aicwf_plat_nvram_set_value_group() and aicwf_plat_nvram_set_value_v3() write to the wrong element of pwrofst2x_tbl_2g4?
drivers/net/wireless/aic/aic8800_fdrv/aicwf_platform.c:aicwf_plat_nvram_set_value_group() {
...
} else if (!strcmp(command, "ofst_2g4_ofdm_lowrate_chan_1_4")) {
uc->txpwr_ofst2x.pwrofst2x_tbl_2g4[2][0] = aicwf_atoi(value);
} else if (!strcmp(command, "ofst_2g4_ofdm_lowrate_chan_5_9")) {
uc->txpwr_ofst2x.pwrofst2x_tbl_2g4[2][1] = aicwf_atoi(value);
} else if (!strcmp(command, "ofst_2g4_ofdm_lowrate_chan_10_13")) {
uc->txpwr_ofst2x.pwrofst2x_tbl_2g4[2][0] = aicwf_atoi(value);
...
}Both functions write to pwrofst2x_tbl_2g4[2][0] instead of pwrofst2x_tbl_2g4[2][2], overwriting the channel 1-4 offset and leaving channels 10-13 unconfigured.
[Severity: High]
Does the RX reorder code in aicwf_rx.c and aicwf_msg_rx.c unlock the wrong spinlock, sleep in atomic context, and leak recv_msdu frames?
drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx.c:reord_process_unit() {
...
spin_unlock_bh(&rx_priv->stas_reord_lock);
if (!preorder_ctrl->enable) {
spin_lock_bh(&preorder_ctrl->reord_list_lock);
preorder_ctrl->ind_sn = pframe->seq_num;
reord_single_frame_ind(rx_priv, pframe);
preorder_ctrl->ind_sn = (preorder_ctrl->ind_sn + 1) % 4096;
spin_unlock_bh(&rx_priv->stas_reord_lock);
return 0;
}
...
}When !preorder_ctrl->enable, reord_process_unit() locks preorder_ctrl->reord_list_lock but unlocks rx_priv->stas_reord_lock a second time, leaving reord_list_lock held and deadlocking the next acquisition. Earlier in reord_process_unit(), the unsupported iftype and !reord_info error returns free skb without returning pframe to rx_priv->rxframes_freequeue via reord_rxframe_free(), exhausting the 250-entry pool.
In reord_flush_tid(), reord_single_frame_ind() is called under spin_lock_irqsave(&preorder_ctrl->reord_list_lock, flags), but reord_single_frame_ind() calls spin_unlock_bh(), local_bh_enable(), and arpoffload_proc() -> handle_dhcp_ack() -> aicwf_send_arpoffload_en_req(), which allocates with GFP_KERNEL and waits for firmware command completion.
Finally, reord_deinit_sta() calls cancel_work_sync(&preorder_ctrl->reord_timer_work) while callers such as aicwf_cfg80211_del_station(), apm_staloss_work_process(), and aicwf_rx_deinit() hold spin_lock_bh(&rx_priv->stas_reord_lock), whereas aicwf_rx_sm_disconnect_ind() has stas_reord_lock commented out when walking and removing from rx_priv->stas_reord_list.
[Severity: Medium]
Can aicwf_rx_add_rtap_hdr() overflow the radiotap buffer on 40 MHz VHT frames and copy uninitialized stack data on HE SU frames?
drivers/net/wireless/aic/aic8800_fdrv/aicwf_rx.c:aicwf_rx_add_rtap_hdr() {
...
// bandwidth
if (rxvect->ch_bw == PHY_CHNL_BW_40)
*pos++ = 1;
if (rxvect->ch_bw == PHY_CHNL_BW_80)
*pos++ = 4;
else if ((rxvect->ch_bw == PHY_CHNL_BW_160) &&
phy_info->phy_center2_freq)
*pos++ = 0; // 80P80
else if (rxvect->ch_bw == PHY_CHNL_BW_160)
*pos++ = 11;
else // 20 MHz
*pos++ = 0;
...
if (rxvect->format_mod == FORMATMOD_HE_SU) {
struct ieee80211_radiotap_he he;
...
}Because the second if is missing an else, a PHY_CHNL_BW_40 VHT frame writes both *pos++ = 1 and the final else's *pos++ = 0, advancing pos by 2 bytes instead of 1 and writing 1 byte past rtap_len into the frame payload. In the FORMATMOD_HE_SU block, struct ieee80211_radiotap_he he is not zero-initialized on the stack before |= updates to data3, data5, and data6 (and with data4 never touched) before copying he into the skb.
[Severity: High]
In aicwf_sdio_tx_msg(), does the flow-control check reject transfers when len == buffer_cnt * BUFFER_SIZE and leave cmd_txstate stuck at true?
drivers/net/wireless/aic/aic8800_fdrv/aicwf_sdio.c:aicwf_sdio_tx_msg() {
...
if (sdiodev->chip_hw->use_flowctrl_msg) {
buffer_cnt = aicwf_sdio_flow_ctrl_msg(sdiodev);
while ((buffer_cnt <= 0 ||
(buffer_cnt > 0 && len > (buffer_cnt * BUFFER_SIZE))) &&
retry < 10) {
retry++;
buffer_cnt = aicwf_sdio_flow_ctrl_msg(sdiodev);
dev_dbg(sdiodev->dev, "buffer_cnt = %d\n", buffer_cnt);
}
}
down(&sdiodev->tx_priv->cmd_txsema);
if (sdiodev->chip_hw->use_flowctrl_msg) {
if (buffer_cnt > 0 && len < (buffer_cnt * BUFFER_SIZE)) {
err = aicwf_sdio_send_pkt(sdiodev, payload, len);
if (err)
dev_err(sdiodev->dev, "aicwf_sdio_send_pkt fail%d\n", err);
} else {
dev_err(sdiodev->dev, "tx msg fc retry fail:%d, %d\n", buffer_cnt, len);
up(&sdiodev->tx_priv->cmd_txsema);
return -1;
}
}
...
sdiodev->tx_priv->cmd_txstate = false;
}The retry loop stops waiting when len == buffer_cnt * BUFFER_SIZE (for example, a 1536-byte firmware write command when buffer_cnt is 1), but the send condition requires len < (buffer_cnt * BUFFER_SIZE). When they are equal, the function takes the else branch and returns -1 without clearing sdiodev->tx_priv->cmd_txstate, causing aicwf_sdio_tx_process() to repeatedly resend the command buffer.
[Severity: High]
Does aicwf_txq_credit_update() forget to add update to txq->credits, leaving stopped TX queues permanently stalled?
drivers/net/wireless/aic/aic8800_fdrv/aicwf_tx.c:aicwf_txq_credit_update() {
struct aicwf_sta *sta = &aicwf_hw->sta_table[sta_idx];
struct aicwf_txq *txq;
txq = aicwf_txq_sta_get(sta, tid, aicwf_hw);
spin_lock_bh(&aicwf_hw->tx_lock);
if (txq->idx != TXQ_INACTIVE) {
#ifdef AIC8800_CREATE_TRACE_POINTS
trace_credit_update(txq, update);
#endif
if (txq->credits <= 0)
aicwf_txq_stop(txq, AICWF_TXQ_STOP_FULL);
else
aicwf_txq_start(txq, AICWF_TXQ_STOP_FULL);
}
spin_unlock_bh(&aicwf_hw->tx_lock);
}txq->credits is never updated with update before checking txq->credits <= 0, so any queue that reaches 0 credits and stops with AICWF_TXQ_STOP_FULL will never be restarted by ME_TX_CREDITS_UPDATE_IND. In addition, neither aicwf_rx_me_tx_credits_update_ind() nor aicwf_txq_credit_update() bounds-checks sta_idx or tid before indexing aicwf_hw->sta_table[sta_idx] and calling aicwf_txq_sta_get().
[Severity: High]
Does calling aicwf_txdatacfm() from aicwf_sdio_host_tx_cfm_handler() without aicwf_hw->tx_lock race with the TX path?
sdio_busrx_thread TX / netdev contextaicwf_process_rxframes() aicwf_start_xmit() / aicwf_hwq_process_all()
aicwf_sdio_host_tx_cfm_handler() spin_lock_bh(&aicwf_hw->tx_lock)
aicwf_txdatacfm() aicwf_txq_queue_skb() / aicwf_hwq_process()
aicwf_txq_confirm_any() /* mutates txq->sk_list, hwq->list,
aicwf_tx_retry() txq->status, and credits */
aicwf_txq_add_to_hw_list() spin_unlock_bh(&aicwf_hw->tx_lock)
<-- unlocked list and credit mutationaicwf_txdatacfm() and its helpers (aicwf_txq_confirm_any(), aicwf_tx_retry(), and aicwf_txq_add_to_hw_list()) require aicwf_hw->tx_lock to serialize access to txq->sk_list, hwq->list, txq->status, and queue credits, but aicwf_sdio_host_tx_cfm_handler() invokes aicwf_txdatacfm() without acquiring aicwf_hw->tx_lock.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
Re: [PATCH wireless-next v5 4/4] wifi: aic: Integrate the AIC8800 SDIO driver
In reply to Yanli YangQuoted 23 lines · Yanli Yang
From: Zhirun Liu <[email protected]>
Connect the AIC vendor directory to the wireless
KconfigandMakefileso the complete AIC8800D80 and AIC8800D80N FullMAC driver can be selected.Add the driver maintainers, reviewers and linux-wireless mailing list to
MAINTAINERS. Keep the parent build integration last so that intermediate patches do not expose an incomplete driver configuration.Signed-off-by Chunqiu Liu <[email protected]>Signed-off-by Zhirun Liu <[email protected]>Signed-off-by Yanli Yang <[email protected]>--- MAINTAINERS | 10 ++++++++++ drivers/net/wireless/Kconfig | 1 + drivers/net/wireless/Makefile | 1 + 3 files changed, 12 insertions(+)MAINTAINERS +0
-0
MAINTAINERS L: [email protected] · line 754
Quoted 9 lines
MAINTAINERS +6
-0@@ -746,6 +746,16 @@ L: [email protected] S: Maintained F: drivers/scsi/aic7xxx/ +AIC8800 WIRELESS DRIVER +M: Zhirun Liu <[email protected]> +M: Dijia Xu <[email protected]> +M: Chunqiu Liu <[email protected]> +R: Liheng Wei <[email protected]> +R: Yanli Yang <[email protected]>
So all these five people will be providing reviews, right? Just don't add random managers names?
MAINTAINERS L: [email protected] · line 757
Quoted 3 lines
MAINTAINERS +3
-0+L: [email protected] +S: Maintained +F: drivers/net/wireless/aic/
Bindings as well
Quoted 21 lines
MAINTAINERS +1
-0+ AIMSLAB FM RADIO RECEIVER DRIVER M: Hans Verkuil <[email protected]> L: [email protected]drivers/net/wireless/Kconfig +1
-0@@ -19,6 +19,7 @@ menuconfig WLAN if WLAN source "drivers/net/wireless/admtek/Kconfig" +source "drivers/net/wireless/aic/Kconfig" source "drivers/net/wireless/ath/Kconfig" source "drivers/net/wireless/atmel/Kconfig" source "drivers/net/wireless/broadcom/Kconfig"drivers/net/wireless/Makefile +0
-0
drivers/net/wireless/Makefile line 7
Quoted 4 lines
drivers/net/wireless/Makefile +1
-0@@ -4,6 +4,7 @@ # obj-$(CONFIG_WLAN_VENDOR_ADMTEK) += admtek/ +obj-$(CONFIG_WLAN_VENDOR_AIC) += aic/
Why this cannot be previous patch? Why Makefile entry has to be a separate commit?
Quoted 3 lines
drivers/net/wireless/Makefile +0
-0obj-$(CONFIG_WLAN_VENDOR_ATH) += ath/ obj-$(CONFIG_WLAN_VENDOR_ATMEL) += atmel/ obj-$(CONFIG_WLAN_VENDOR_BROADCOM) += broadcom/
Re: [PATCH wireless-next v5 4/4] wifi: aic: Integrate the AIC8800 SDIO driver
Thanks for the review.
Quoted 2 lines
So all these five people will be providing reviews, right? Just don't add random managers names?
Yes, all five people listed here are technical engineers who will actively review patches and maintain this driver. No non-technical managers are added.
Quoted 1 line
Bindings as well
I will add the binding to the MAINTAINERS entry:
F: Documentation/devicetree/bindings/net/wireless/aicsemi,aic8800d80-fmac.yaml
Quoted 2 lines
Why this cannot be previous patch? Why
Makefileentry has to be a separate commit?
Agreed. The intention was to keep the driver unselectable until all sources were present, but folding this patch into patch 3 achieves the same result. Patch 3 already adds the remaining implementation and the driver-local Kconfig and Makefiles.
I will fold this patch, including the MAINTAINERS entry, into patch 3 in v6 and update the cover letter accordingly.
Best regards,
Yanli
Quoted 81 lines
From: "Krzysztof Kozlowski"<[email protected]>
Date: Mon, Nov 16, 2026, 19:10
Subject: Re: [PATCH wireless-next v5 4/4] wifi: aic: Integrate the AIC8800 SDIO driver
To: "Yanli Yang"<[email protected]>
Cc: <[email protected]>, "Johannes Berg"<[email protected]>, "Rob Herring"<[email protected]>, "Krzysztof Kozlowski"<[email protected]>, "Conor Dooley"<[email protected]>, <[email protected]>, <[email protected]>, "Zhirun Liu"<[email protected]>, "Dijia Xu"<[email protected]>, "Chunqiu Liu"<[email protected]>, "Liheng Wei"<[email protected]>Quoted 26 lines · Yanli Yang
From: Zhirun Liu <[email protected]>
Connect the AIC vendor directory to the wirelessKconfigandMakefileso the complete AIC8800D80 and AIC8800D80N FullMAC driver can be selected.
Add the driver maintainers, reviewers and linux-wireless mailing list toMAINTAINERS. Keep the parent build integration last so that intermediate patches do not expose an incomplete driver configuration.Signed-off-by Chunqiu Liu <[email protected]>Signed-off-by Zhirun Liu <[email protected]>Signed-off-by Yanli Yang <[email protected]>---
MAINTAINERS | 10 ++++++++++
drivers/net/wireless/Kconfig | 1 +
drivers/net/wireless/Makefile | 1 +3 files changed, 12 insertions(+)MAINTAINERS +0
-0@@ -746,6 +746,16 @@ L: [email protected]S: Maintained
F: drivers/scsi/aic7xxx/MAINTAINERS L: [email protected] · line 754
Quoted 6 lines
MAINTAINERS +6
-0+AIC8800 WIRELESS DRIVER +M: Zhirun Liu <[email protected]> +M: Dijia Xu <[email protected]> +M: Chunqiu Liu <[email protected]> +R: Liheng Wei <[email protected]> +R: Yanli Yang <[email protected]>
So all these five people will be providing reviews, right? Just don't add random managers names?MAINTAINERS L: [email protected] · line 757
Quoted 3 lines
MAINTAINERS +3
-0+L: [email protected] +S: Maintained +F: drivers/net/wireless/aic/
Bindings as wellQuoted 22 lines
+
AIMSLAB FM RADIO RECEIVER DRIVER
M: Hans Verkuil <[email protected]>
L: [email protected]drivers/net/wireless/Kconfig +0
-0@@ -19,6 +19,7 @@ menuconfig WLANif WLAN
source "drivers/net/wireless/admtek/Kconfig"
+source "drivers/net/wireless/aic/Kconfig"
source "drivers/net/wireless/ath/Kconfig"
source "drivers/net/wireless/atmel/Kconfig"
source "drivers/net/wireless/broadcom/Kconfig"drivers/net/wireless/Makefile +0
-0@@ -4,6 +4,7 @@ #Quoted 3 lines
obj-$(CONFIG_WLAN_VENDOR_ADMTEK) += admtek/
+obj-$(CONFIG_WLAN_VENDOR_AIC) += aic/
Why this cannot be previous patch? WhyMakefileentry has to be a separate commit?Quoted 3 lines
obj-$(CONFIG_WLAN_VENDOR_ATH) += ath/
obj-$(CONFIG_WLAN_VENDOR_ATMEL) += atmel/
obj-$(CONFIG_WLAN_VENDOR_BROADCOM) += broadcom/
Hi,
while getting monitor mode working on an AIC8800D80 USB dongle with the out-of-tree driver this series is based on, I hit a bug in the monitor RX status handling that also appears in aic8800_fdrv/rwnx_rx.c as added by 3/4 of this series. Reporting it before it lands seems cheaper than fixing it afterwards.
In rwnx_rxdataind_aicwf():
if(hw_rxhdr->is_monitor_vif)
status = RX_STAT_MONITOR;
if(hw_rxhdr->flags_upload)
status |= RX_STAT_FORWARD;
...
if (status & RX_STAT_MONITOR) {
...
if (status == RX_STAT_MONITOR) {
...
} else {
skb->data = (void *)hw_rxhdr;
wiphy_err(aicwf_hw->wiphy,
"RX status %d is invalid when MON_DATA is disabled\n",
status);
goto check_len_update;
}The outer test is a bit test, the inner one is an equality test. A monitor frame that also carries flags_upload therefore ends up with RX_STAT_MONITOR | RX_STAT_FORWARD, fails the equality test, and is dropped with the "RX status ... is invalid when MON_DATA is disabled" message - even though it is a perfectly valid monitor frame and MON_DATA has nothing to do with delivering it. With CONFIG_RWNX_MON_DATA=n (the default in the vendor tree) monitor mode then comes up and silently captures nothing.
In the out-of-tree USB tree the same equality test is worse: that else arm only has a body under #ifdef CONFIG_RWNX_MON_DATA, so skb_monitor is still NULL when it is dereferenced a few lines later and the RX thread oopses:
rwnx_fw_assert_ind: ASSERT (pd != NULL) at rxl_payload_transfer_usb:628 pc : rwnx_rxdataind_aicwf+0x2a0/0x1dc0 [aic8800_fdrv] Code: ... (a94c0001) /* ldp x1, x0, [x0, #192], x0 = NULL */
followed by a firmware assert and a USB reset.
Making the monitor status win over the forward bit fixes both: a monitor frame always carries exactly RX_STAT_MONITOR, which is what the rest of the block already assumes.
- if(hw_rxhdr->is_monitor_vif) - status = RX_STAT_MONITOR; - if(hw_rxhdr->flags_upload) status |= RX_STAT_FORWARD; + + if(hw_rxhdr->is_monitor_vif) + status = RX_STAT_MONITOR;
(A guard before the dereference is worth having anyway, since skb_copy_expand() can return NULL there too.)
Tested on the out-of-tree tree: Raspberry Pi 5, kernel 6.18.39, AIC8800D80 USB (368b:8d88), firmware "la Dec 05 2025 19:45:42 - g586bc1e8". Before the change, monitor mode delivered zero frames on every channel. After it, tcpdump shows beacons with signal levels on both channels tested (three nearby APs, -45dBm on ch1 and -50/-64dBm on ch6).
I have not tested the SDIO variant, so I cannot say whether its firmware ever hits that else arm in practice - if MON_DATA is always enabled there the drop may be unreachable. The equality test still looks wrong either way, and the vendor-tree crash shows what happens when it is reachable.
The same finding, with the vendor-tree crash details, is on the radxa
tracker: https://github.com/radxa-pkg/aic8800/issues/39
Happy to send a proper patch against the series if you would prefer that to a bug report.
Thanks,