Commit Graph
103 Commits
Author SHA1 Message Date
MastaG 2c4ab4b421 fix: support Linux 7.3 cfg80211 API
7.3 lands the last part of a two-commit series that converts several
cfg80211_ops cookie parameters from driver-invented output values to
values cfg80211 pre-assigns and passes in as input, and renames
probe_client to probe_peer. Building against 7.3 fails with 5 errors:

  - cfg80211_probe_status() gained an MLO link_id parameter between cookie
    and acked (kernel commit 010e955c203e). This driver has no MLO
    support; -1 is the documented value for non-MLO.
  - cfg80211_ops::probe_client was renamed to probe_peer (4ab9b637b94a).
  - cfg80211_ops::mgmt_tx, ::remain_on_channel and ::probe_peer all
    changed their cookie parameter from u64 * to u64 (914781c72813):
    cfg80211 now pre-assigns the cookie before calling the driver instead
    of the driver inventing one and returning it through the pointer.

The cookie change is more than a type fix. This driver invents its
mgmt_tx/remain_on_channel/probe_peer cookies from a skb pointer, an
internal roc_cookie_cnt counter, and an internal probe_id counter
respectively, and separately re-derives "the same" value later when
reporting completion. Once cfg80211 assigns the cookie itself, the
completion report must echo back the value cfg80211 gave the driver.

Two of the three ops are thin wrappers around a lower-level helper that
is also called from a purely-internal path with no cfg80211-assigned
cookie to honor: rwnx_start_mgmt_xmit() is reused by TDLS, and
rwnx_cfg80211_remain_on_channel_() starts the internal RoC from inside
mgmt_tx. Each of those helpers gets a bool (use_given_cookie / the
existing mgmt_roc_flag) so the internal callers keep inventing a cookie
exactly as before on every kernel, while the cfg80211 op wrappers honor
the pre-assigned value on 7.3+ and thread it through to the completion
report. probe_peer has no helper and no internal caller; the op stores
the cookie itself.

  - rwnx_start_mgmt_xmit() gains use_given_cookie; the resulting cookie is
    stored in a new rwnx_sw_txhdr::cookie and echoed back via
    cfg80211_mgmt_tx_status(). Because sw_txhdr comes from a kmem_cache
    and is never zeroed, every one of the five allocation sites
    initialises the field -- to the skb pointer, which is exactly what the
    completion path reported before the field existed -- so the
    TXU_CNTRL_MGMT filter on the reporting side is not what keeps it safe.
  - rwnx_cfg80211_remain_on_channel_()'s mgmt_roc_flag also selects the
    cookie source, stored in a new rwnx_roc_elem::cookie that the
    rwnx_msg_rx.c completion handlers read.
  - rwnx_cfg80211_probe_client() stores the given cookie in a new
    apm_probe_sta::cookie field for the async probe-status work.

Every gate this adds uses AICWF_CFG80211_VERSION_CODE, so an OpenWrt
backports build selects these paths from the wireless stack's version
rather than the kernel's, matching the existing 7.2 gates.

On kernels before 7.3 the compiled behaviour is identical to main with
two exceptions, both requested in review and both changing only the
order of a store relative to a queue/send: *cookie for probe_client is
taken from probe_id before queue_work() rather than after it, and the
RoC cookie is read from roc_cookie_cnt once, before rwnx_send_roc(),
rather than after it returns. In each case the value differs from
main's only if the worker/RX path has already completed and bumped the
counter in between -- a window in which main returns N+1 while having
already reported N to cfg80211. The reported and returned values now
agree by construction.

v2, addressing review:
  - RoC: the cookie is decided and stored in roc_elem before the element
    is published and rwnx_send_roc() is called, so an early channel-switch
    indication cannot report an uninitialised cookie.
  - probe_peer: the cookie is stored before queue_work(), so a worker
    running immediately on another CPU reports the right one.
  - Monitor injection: intended to initialise sw_txhdr->cookie in
    rwnx_start_monitor_if_xmit(), but the store landed in
    rwnx_start_xmit() instead, where it is never read. Fixed in v5.
  - Pre-3.14: use_given_cookie is part of that signature too and both
    old-signature callers pass false.
  - Rebased onto the OpenWrt backport-version change.

v3:
  - rwnx_main.h gated the probe_client prototype on LINUX_VERSION_CODE
    while rwnx_main.c gated the definition on AICWF_CFG80211_VERSION_CODE.
    Identical on a native build, but a backports build with the two
    decoupled would see a u64 * prototype against a u64 definition.
  - rwnx_cfg80211_remain_on_channel() no longer duplicates the whole call
    to the shared helper just to change one argument; only the cookie
    pointer is selected by version.

v4:
  - rwnx_cfg80211_remain_on_channel_() no longer writes *cookie before
    rwnx_send_roc(). The cookie is snapshotted into a local, roc_elem
    keeps its early assignment, and *cookie is written where it was
    before this patch: inside the error == 0 branch.

v5:
  - The monitor-injection initialisation is now where it was always
    meant to be: rwnx_start_monitor_if_xmit(), between the skb
    assignment and raw_frame = 1, ungated, since that path runs on every
    kernel with CONFIG_RWNX_MON_XMIT. The value is (unsigned long)skb_mgmt,
    which is what rwnx_txdatacfm() reported for these frames before.
  - The remaining allocation sites that did not set the field --
    intf_tx() and rwnx_probersp_work() -- now do, so all five do.
  - The internal RoC's block-local cookie in rwnx_cfg80211_mgmt_tx() is
    renamed roc_cookie: on 7.3 it had come to shadow a same-typed
    parameter with a different meaning.
  - Comment fixes: the rwnx_start_mgmt_xmit() kerneldoc documents
    use_given_cookie; the probe_peer comment states the 7.3 contract; the
    two #endif trailers that close chains now opening on the 7.3 gate say
    so; the unused rx_addr is explained on the 7.3 arm as well.
  - Rebased onto main (set_monitor_channel on 6.12 stable).

Verified against real linux-cachyos-bc250 (7.2.6) and linux-cachyos-rc-bc250
(7.3-rc4) headers with LLVM=1, the way DKMS builds them, asserting on exit
code and module count:

  upstream main @ 7.2.6   rc=0, 3 modules, 13 warnings
  upstream main @ 7.3-rc4 rc=2 - the errors this patch fixes
  this branch   @ 7.2.6   rc=0, 3 modules, 13 warnings
  this branch   @ 7.3-rc4 rc=0, 3 modules, 13 warnings
  warning sets on 7.2.6: identical, and none names a function this
  patch touches.

The backports configuration is not something I can build here, so the
header/definition agreement in v3 rests on both sites using the same
macro rather than on a test.
2026-09-24 12:34:45 +02:00
MinQ 3e9a02549b Merge pull request #97 from lucaskawatoko/fix/main-monitor-channel-6.12.101
fix: handle set_monitor_channel dev parameter on 6.12 stable
2026-09-24 13:24:00 +08:00
Lucas Kawatoko 264f29db21 fix: handle set_monitor_channel dev parameter on 6.12 stable
cfg80211_ops.set_monitor_channel() gained a "struct net_device *dev"
parameter in mainline 6.13, and the change was backported to the 6.12
stable series starting with 6.12.101. Debian 13 ships 6.12.107, so the
existing ">= 6.13.0" guards select the old prototype there and the build
fails with -Wincompatible-pointer-types:

  rwnx_main.c: error: initialization of
    'int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *)'
    from incompatible pointer type
    'int (*)(struct wiphy *, struct cfg80211_chan_def *)'
    [-Wincompatible-pointer-types]

This is the failure reported in #96 for Debian 13 trixie.

Introduce AICWF_CFG80211_SET_MONITOR_CHANNEL_HAS_DEV in rwnx_compat.h,
defined at AICWF_CFG80211_VERSION_CODE >= 6.12.101, and gate the nine
set_monitor_channel call sites on it instead of comparing against 6.13.0.
The threshold covers both the 6.12 backport and mainline 6.13, while
kernels 6.11 and earlier 6.12.x keep the old prototype. The check now
lives in one place and follows the existing AICWF_CFG80211_VERSION_CODE
convention, so OpenWrt builds can override it with CFG80211_VERSION.

The MODULE_IMPORT_NS guard at rwnx_main.c that also checks 6.13.0 is
unrelated and is left untouched.

Verified with clean builds against linux-headers 5.15.0-191,
6.1.0-53, 6.8.0-139, 6.11.0-8 and 6.12.107+deb13.
2026-09-21 23:06:15 -03:00
Shen Mintao 27af5add83 fix: support OpenWrt cfg80211 backport versions
Allow CFG80211_VERSION to select wireless API signatures independently of the target kernel. Keep native kernel builds on their existing version checks.

Also guard the WEXT-only label and replace overlapping firmware path formatting with bounded appends so OpenWrt builds pass with Werror.

Validated all three modules against OpenWrt Linux 6.12.94 with backports 6.18.26, plus native 6.11, 6.17 and 7.2 headers. Refs #94.
2026-09-17 13:55:56 +08:00
Shen Mintao 9594c5c99a fix: sync upstream SUN60IW2P1 USB transfer settings
Disable CONFIG_USB_ALIGN_DATA and enable CONFIG_USB_NO_TRANS_DMA_MAP
when CONFIG_ARCH_SUN60IW2P1 is set, following the upstream USB controller
workaround. Preserve the current defaults on other platforms.

Source: radxa-pkg/aic8800 commit 33f19ba,
fix-usbc1-controller-wifi-rate-of-sun60iw2p1.patch.

Validation: GNU make resolves the expected settings for both platform
branches; Linux 6.14, 6.17 and 7.2 module builds succeeded. No SUN60IW2P1
hardware was available for runtime validation.
2026-09-10 11:26:07 +08:00
Shen Mintao 31b726adbd fix: correct TDLS discovery response length on Linux 7.1+
Linux 7.1 moved action_code outside tdls_discover_resp. Reserve both
category and action_code bytes before the response body so appending an
IE does not overwrite the capability field.

Sync the USB hunk from radxa-pkg/aic8800 commit
bd01abe95bc83c4708dd1d117e27424ee41cc747.

Validation: Linux 6.14, 6.17 and 7.2 module builds succeeded. A focused
frame construction check detects the original one-byte overwrite and
passes with this change. Hardware TDLS operation remains untested.
2026-09-10 11:26:07 +08:00
MinQ 2895da26d8 Merge pull request #87 from heydemoura/fix/bazzite-spec-linux-7.2
fix: build the Bazzite package on Linux 7.2
2026-08-24 14:02:26 +08:00
heydemoura dd74ae66f7 fix: build the Bazzite package on Linux 7.2
The spec still pins 13baa9b, which predates 40379fe ("fix: support Linux
7.2 cfg80211 API"), so on Bazzite 44 (kernel 7.2) rpmbuild fails in
%build with an implicit declaration of the removed strncpy() and an
incompatible pointer type for cfg80211_ops::remain_on_channel, whose
prototype gained a trailing rx_addr argument.

Pin the current main branch instead and reset Release for the new
snapshot. Verified by building the package against kernel
7.2.0-ogc4.1.fc44.x86_64.
2026-08-21 08:29:43 -03:00
Shen Mintao e93a7d2b6b docs: document Pandora mode switching 2026-08-17 01:20:50 +08:00
Shen Mintao 30505069fa fix: use two-stage Pandora mode switch 2026-08-17 01:20:44 +08:00
MinQ 3006aae254 Merge pull request #85 from YaQia/main
feat: add USB ID for TP-Link AX900 (2357:014e)
2026-08-11 17:42:55 +08:00
Shen Mintao b26fef2910 fix: scope TP-Link AX900 match to Wi-Fi interface 2026-08-11 17:40:58 +08:00
YaQia 8f0b982ec9 feat: add USB ID for TP-Link AX900 (2357:014e)
This adapter uses the AIC8800D80 chipset and was previously not
matched by the fdrv probe. Add vendor/product IDs so the driver
binds and both Wi-Fi and Bluetooth (via standard btusb) work.

Tested on Linux 7.1.6 with TP-Link AX900 TL-XDN7000H.
2026-08-11 16:59:29 +08:00
Shen Mintao 5e990a5468 feat: add mode switch rule for AIC8800DE 2026-08-09 17:03:02 +08:00
Shen Mintao 9747ee3110 feat: support AIC8800DE USB variant 2026-08-09 17:03:00 +08:00
Shen Mintao 40379fee97 fix: support Linux 7.2 cfg80211 API 2026-08-08 12:18:17 +08:00
Shen Mintao c096067ef3 fix: avoid USB reboot hang after suspend 2026-08-08 12:17:51 +08:00
Shen Mintao 8e0135c948 fix: respect caller build parallelism 2026-08-08 12:17:01 +08:00
Shen Mintao 81b8b3335e feat: enable monitor packet injection
Build the existing monitor transmit path by default. Validate the radiotap header before parsing it and align the transmit prototype with netdev_tx_t.

Hardware-tested-by: jkroepke (GitHub)
2026-08-07 16:15:23 +08:00
Shen Mintao 531d16c4d6 fix: prevent monitor RX null dereference
Do not send monitor frames through the normal data path when simultaneous monitor/data support is disabled. Handle monitor skb allocation failures without dereferencing NULL or dropping the original combined-mode frame.

Fixes #83
2026-08-07 16:12:28 +08:00
Shen Mintao 40f00e69af fix: support ARM32 ZLP kprobe arguments
Read the first kernel argument from ARM_r0 on 32-bit ARM, where regs_get_kernel_argument() is unavailable.

Fixes #82
2026-08-06 16:24:58 +08:00
MinQ a1f8d3bcb6 Merge pull request #78 from ccyuen1/main
fix Bazzite build and install errors
2026-07-29 09:34:58 +08:00
ccyuen1 43ca679bea fix: increment the Release value
increment the Release value for previous commit
2026-07-29 00:23:40 +08:00
ccyuen1 80afe144d1 fix Bazzite build and install errors
- Disable automatic creation of debuginfo packages to fix issue #77.
- Require usb_modeswitch as package dependency instead of file dependency to fix issue #77.
2026-07-29 00:10:00 +08:00
Shen Mintao 13488f30dc docs: finalize two-branch maintenance model 2026-07-25 19:42:12 +08:00
MinQ 050844d924 Merge pull request #73 from shenmintao/test/unified-wifi-bt-zlp
feat: unify Wi-Fi Bluetooth and ZLP support
2026-07-25 19:25:06 +08:00
Shen Mintao eb3aad9e8d fix: clarify integrated Bluetooth diagnostics 2026-07-25 19:15:07 +08:00
Shen Mintao e53523ba48 merge: sync Bluetooth retirement notice from main
# Conflicts:
#	README.md
2026-07-25 16:06:11 +08:00
Shen Mintao 0d7a07e8aa docs: announce Bluetooth branch retirement 2026-07-25 16:04:38 +08:00
Shen Mintao 800a7b93ba fix: refresh Bazzite package for unified ZLP branch 2026-07-25 15:52:29 +08:00
Shen Mintao 13baa9b0b1 feat: unify Bluetooth support and add ZLP quirk 2026-07-25 15:49:53 +08:00
Shen Mintao 6550131e18 test: add standalone btusb ZLP quirk module 2026-07-25 15:40:59 +08:00
Shen Mintao 268c4f7122 fix: refresh Bazzite package for unified branch 2026-07-25 15:38:56 +08:00
Shen Mintao c83ae8b4e6 test: unify Wi-Fi and Bluetooth installation 2026-07-25 15:38:47 +08:00
Shen Mintao 4b31d02392 docs: explain hardware branch selection 2026-07-25 15:29:46 +08:00
Shen Mintao 388a0192c7 fix: refresh Bazzite package for main branch
Pin the Wi-Fi package to the current main code commit, ship both maintained modules and all firmware variants, and remove obsolete Bluetooth packaging.
2026-07-14 17:38:28 +08:00
Shen Mintao d10bc52903 fix: improve dependency installation diagnostics
Install mode-switch dependencies, support a69c:572f, avoid redundant generic headers when a usable kernel build tree exists, and discover DKMS logs dynamically. Addresses installer portions of #28, #55, #65, #66, and #68.
2026-07-14 17:18:27 +08:00
Shen Mintao 3f9916b6ff fix: retry DKMS install when existing modules block install 2026-06-25 19:55:41 +08:00
Shen Mintao c5e635bf4c fix: handle Volumio and early firmware loading 2026-06-25 19:48:22 +08:00
Shen Mintao f97281254a fix: write radiotap HE fields without struct copy 2026-06-25 19:38:56 +08:00
Shen Mintao 46f420f8f6 fix: avoid fortify warning in patch info unpack 2026-06-25 19:33:01 +08:00
Shen Mintao 8bf93919e7 fix: support newer kernel cfg80211 APIs 2026-06-25 19:26:34 +08:00
Shen MintaoandClaude Opus 4.7 a5db07c4d4 fix: install all firmware variants and usb_modeswitch config
Follow-up to d66e5cb which shipped fw/aic8800{,D80N,D80X2,DLN} but
forgot to update install.sh — so users still got only aic8800D80
firmware installed and the "Pandora" mode-switch config was missing.

install_firmware:
- Loop over all fw/aic8800* variants instead of hard-coding aic8800D80
- Install usb_modeswitch/1111_1111 to /etc/usb_modeswitch.d/1111:1111

verify_installation: count installed firmware variants instead of
checking for the single aic8800D80 directory.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 14:06:08 +08:00
Shen MintaoandClaude Opus 4.7 d66e5cb859 feat: update to SDK v5.0 with comprehensive kernel and device support
Sync WiFi driver, firmware, and DKMS configuration from the bluetooth
branch (which itself is radxa USB driver_fw + Linux 6.16/6.17/6.19
kernel compat). aic_btusb and Bluetooth-specific install.sh logic
are intentionally excluded from main.

Driver updates:
- Add Linux kernel 6.12-6.19 compatibility support
- Add Linux 6.16 timer_container_of and wakelock API support
- Add Debian 6.1.0-26 backport support
- Add USB device ID 368b:8d81 support
- Add AIC8800DW device support
- Add TP-Link Archer TX1U Nano support (USB_VENDOR_ID_TENDA_V2:0x0110)
- Add TENDA series device support (U2, U11, U11 PRO)
- Add AIC8800FC_CUS1-6 series support
- Add AIC8800M80_CUS0-8 series support
- Add UGREEN AIC8800D80 adapter support
- Add Mercury (TP-Link OEM) support
- Allow 1 or 3 USB interfaces (BT-disabled SKUs report 1)

New compat modules:
- aicwf_compat_8800d80n.{c,h}
- aicwf_compat_8800dln.{c,h}

Firmware:
- New: fw/aic8800/, fw/aic8800D80N/, fw/aic8800D80X2/, fw/aic8800DLN/
- Updated: fw/aic8800D80/, fw/aic8800DC/

install.sh:
- Loop over all fw/aic8800* variants instead of hard-coding aic8800D80
- Install usb_modeswitch/1111_1111 config for "Pandora" clone adapter
- Verify firmware install by counting variants

dkms.conf: pass KDIR explicitly to make for cross-kernel builds.

Excluded from this commit (BT-only, kept on bluetooth branch):
- drivers/aic8800/aic_btusb/
- modprobe/aic8800-bt.conf
- diagnose_bt.sh
- install.sh btusb auto-load / hciconfig / bluez status checks

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 14:02:08 +08:00
MinQ 9a3b01eead Merge pull request #51 from toor11/add-usb-id-368b-8d84
Add USB ID 368b:8d84 (AIC 8800D80 variant)
2026-05-20 09:42:46 +08:00
toor11 0bcec3069e Add USB ID 368b:8d84 (AIC 8800D80 variant)
Device 368b:8d84 is an AIC 8800D80 variant not included in the USB
device table. Add it as AIC8800M80_CUS0 alongside the other M80 CUS
variants; it maps to PRODUCT_ID_AIC8800D81 like its siblings.

Tested on kernel 6.19.8-arch1 with a physical dongle (Bus 001 Device
005: ID 368b:8d84 AICSemi AIC 8800D80).
2026-05-11 20:14:30 +02:00
MinQ f8df5e741e Merge pull request #45 from Nurmukhamed/main
fixed README.md after requests of telegram users.
2026-04-28 15:27:01 +08:00
Nurmukhamed Artykaly d1b60ff10d fixed README.md after requests of telegram users. 2026-04-11 20:06:20 +05:00
MinQ 05710dff05 Merge pull request #42 from l27001/main
fix: map riscv64 to riscv for kernel ARCH
2026-03-31 09:22:31 +08:00
Vladislav Tatyanin ed0e373a0d fix: map riscv64 to riscv for kernel ARCH 2026-03-30 14:57:59 +04:00