Commit Graph

63117 Commits

Author SHA1 Message Date
Sean Khan
dbce3160cf ath11k_nss: Remove 902-wifi-mac80211-Fix-memory-corruption-during-mesh-beac
We are not targeting 32-bit systems, so this patch is not needed and is
just unnecessary code.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 17:10:41 -05:00
Sean Khan
323025844f ath11k_nss: fix null chanctx warning for NSS dynamic VLAN
Patch is updated to match closer to QSDK's implementation for
ath11k/12k. The null chanctx warning is likely due to the way NSS is
managing the interface. This patch (for now) is a workaround to prevent
the BUG_ON() from triggering for dynamic VLANs.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 17:10:41 -05:00
Sean Khan
0da9714059 ath11k_nss: revert parts of NSS patches to align with upstream
These changes revert parts of QCom's NSS patches to bring it closer to upstream Linux.

* The structure of `hal_wbm_release_ring` is restored
* `changed` in ath11k_mac_op_nss_bss_info_changed() is set back to u64
* `ath11k_mac_op_update_vif_offload()` returns void as in mainline.
* Reverted `ath10k_update_vif_offload()` to return void.

Ideally the original patches would be updated to avoid introducing these changes in the first place
but since there are a number of patches in the series, they too will need to be updated.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 17:10:41 -05:00
Sean Khan
512e6b6d88 docs: update notes to show MX4300 being fully merged
Mark the `24.10-nss-mx4300` branch as deprecated since MX4300 support has been backported upstream.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 17:05:53 -05:00
Sean Khan
88428d6832 docs: update branch links, add note about merged MX4300
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:08 -05:00
Sean Khan
236d9d4183 ath11k_nss: Fix Broadcast Issues After GTK Key Exchange
Patch resolves issues where certain brodcast frames like ARP or mDNS are
not reliably transmitted after GTK key exchange.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:08 -05:00
Sean Khan
01277800ab ath11k_nss: Refresh patches for backports 6.12.6
Rebased against upstream commit 87033
mac80211: improve single-wiphy multi-radio support

Signed-off-by: Sean Khan <datapronix@protonmail.com>

ath11k_nss: Refresh patches against rebase 53eab61

Author:     Felix Fietkau <nbd@nbd.name>
AuthorDate: Mon Nov 18 11:21:02 2024 +0100
Commit:     Felix Fietkau <nbd@nbd.name>
CommitDate: Mon Nov 18 11:44:44 2024 +0100

    mac80211: backport some upstream fixes

    Fix various issues, including potential crashes

    Signed-off-by: Felix Fietkau <nbd@nbd.name>

Signed-off-by: Sean Khan <datapronix@protonmail.com>

ath11k_nss: Fix patches for backports 6.12.6

Signed-off-by: Sean Khan <datapronix@protonmail.com>

ath11k_nss: Refresh patches for backports 6.12.6

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:08 -05:00
Sean Khan
c812027c57 ath11k_nss: nss_diag: check for opkg/apk
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:08 -05:00
Sean Khan
480c29cac7 nss-setup: switch to using apk package manager
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:08 -05:00
Sean Khan
9df099eeb5 ath11k_nss: Fix null pointer dereference in BSS transition handling
There is a null pointer bug caused by inconsistent handling of the
`ath11k_base` structure. Previously, functions accessing
`ar->ab` internally, assumed it was always valid. If `ar->ab` was
not properly initialized, this led to null pointer dereferences.

This patch resolves the issue by:
- Explicitly passing `struct ath11k_base *ab` to functions that
  require it, instead of relying on `ar->ab`.
- Replacing all instances of `ar->ab` with `ab` for direct access.

Patch by: Sebastian Gottschall <s.gottschall@dd-wrt.com>

Signed-off-by: Sean Khan <datapronix@protonmail.com>
(cherry picked from commit 1f6f55f9c737ece5e3d8156bbe280f84ea4bd480)
2025-02-28 16:38:07 -05:00
Bruno Martins
b4cd031d2a nss-setup: Detail advanced setup with trunk ports 2025-02-28 16:38:07 -05:00
Sean Khan
bcbd42c162 nss-setup: fix network in wifi + formatting
- fix issue #15: minor config mistake in the new nss setup vlan readme guide
- fix formatting of primary subsection displaying too large.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:07 -05:00
Sean Khan
584002f58a ath11k_nss: Refactor nss_diag interface display
Change "GRO FRAG" to "Interface" to account for additional information
of other interface features (i.e. tx-checksumming)

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:07 -05:00
Sean Khan
4120e2247c nss-setup: update wifi configs for WPA3
* 802.11 k/v/r now fully works in sae-mixed mode. So we can now switch
  from psk2 (WPA2) to WPA2/WPA3 mixed mode.
* Clean up uncessary configs
* Remove WDS example as it's not applicable in this example

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:07 -05:00
Sean Khan
ca2585237a nss-setup: Initial README for examples
Initial README for the example scripts/configs. Right now it's only for
VLAN setup.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:07 -05:00
Sean Khan
669c652666 ath11k_nss: replace rcu_read_unlock with spin_unlock
Mistakenly edited the patch by hand thinking I had incorrectly imported
it from @BS.

Original patch was throwing
```
peer.c:572:1: error: label at end of compound statement is a C23 extension
```

Moved spin_unlocks into exit as that's what it would have been doing
anyways.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:06 -05:00
Sean Khan
2d55c32844 qualcommax: set non-ct ath10k as default
The firmware for 'ct' does not support ethernet frames, which is
required for partial offload with mac80211

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:06 -05:00
Sean Khan
7cc9b76fd2 ath10k-ct: fix incompatible pointer type
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:06 -05:00
Sean Khan
4026801976 ath11k_nss: Improve NSS event callback handling
Improve NSS event callback ihandling for better clarity and type safety

This patch modifies ath11k_nss_wifili_event_receive to take a context parameter
, enhancing code clarity by explicitly passing the ath11k_base.

A wrapper function, ath11k_nss_wifili_ext_callback_wrapper, retrieves
the ath11k_base from the net_device's private data, ensuring correct
context handling.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:06 -05:00
Sean Khan
80487edd18 ath11k_nss: add disable_mesh_chksum_ath11k.hotplug
Rather than pollute `qca-nss-ecm` with logic specific to ath11k, move
into its own hotplug script managed by mac80211. Also enforce
`qca-nss-ecm` dependency.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:06 -05:00
AgustinLorenzo
354b49e7ac ath10k-ct: bump patch for 6.7 to 6.10 2025-02-28 16:38:06 -05:00
Sean Khan
a1a9644211 nss-setup: reorg seed file with additional instructions and clarifications
- Added detailed build instructions for new users,
  including the use of `scripts/env` for reproducible builds.
- Updated comments to provide context for each config setting and package.
- Clarified steps for selecting target devices and running make commands.
- Included notes on SSL preferences, performance optimizations, and optional packages.
- Removed redundant or unnecessary package entries for improved readability.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:05 -05:00
Sean Khan
72ddc7a110 nss-setup: explicitly require nss-ecm
Although qca-nss-ecm isn't explicitly depended on by other
nss packages, it is still required for proper offloading.
There are also a few init and hotplug scripts needed
to mitigate issues (like disabling rx-gro-list)

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:05 -05:00
Sean Khan
61e68abaea nss-setup: clean up mesh base and sat config
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:05 -05:00
Sean Khan
555f5043a6 nss-setup: Include example for setting up VLANs
For NSS setups, you CANNOT enable option for vlan filtering.
This is done internally by NSS (via `kmod-qca-nss-drv-vlan-mgr`).

Check if you have it enabled by running the following command:
`uci show network | grep vlan_filtering`

If it's enabled, you might see:
`network.@device[0].vlan_filtering='1'`

Disable it by running the following commands:
```sh
uci del network.@device[0].vlan_filtering
uci commit network
service network restart
```
Or reboot the device

You also cannot use tagging in the typical way, as the NSS does not support it.
That means your config must not anything like:

```
  list ports 'lan1:u*'
  list ports 'lan2:t'
  list ports 'lan3:t'
```

To set up VLANs you must:

1.) Set them up on specific ports
2.) Bridge them into interfaces (they can be left unmanaged)
3.) Create firewall rules

Check `nss-setup/example/04-vlans` for more examples

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:05 -05:00
Sean Khan
51c949e0bc nss-setup: Optimize mesh node/sat configs
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:05 -05:00
Sean Khan
fd725269fa nss-setup: Reorg and make uci-defaults pluggable
1.) Clarify what radio_5g_high, and radio_5g_low mean
2.) Make txpower configurable
3.) Don't hardcode radio names in the generated config, but allow
    specifiying them as variables.
4.) Set `cell_density` to 0 (don't enforce rates, let driver choose)
5.) Remove `pmk_r1_push` as `ft_psk_generate_local` already deals with
    generating key locally
6.) Reduce `mesh_max_peer_links` and lower ttl

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:05 -05:00
Sean Khan
5ddcd91a17 ath10k: change 'peer unmap' warning to debug
It's just log spam. It doesn't affect usage.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:04 -05:00
Sean Khan
db06cdd1f5 ath11k_nss: consistently use ath11k_sta_to_arsta
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:04 -05:00
Sean Khan
f78a7d6e35 ath11k_nss: Refresh patches for backports 6.11.2
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:04 -05:00
Sean Khan
3b40600123 ath11k_nss: only show peer ast warning if NSS is off
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:04 -05:00
Sean Khan
c7855bed69 ath11k_nss: Enhance nss_diag to properly list ifaces
Also optimized to use more native functions

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:04 -05:00
Sean Khan
3c2ddb1d25 ath11k_nss: Add diagnostic gathering utility
This is meant to ease debugging when asking for support. Just run the
command "nss_diag" and include in your issues/forum posts.

Example of output
```
     MODEL: Linksys MX5300
   OPENWRT: r27645+154-f9a0485c99
IPQ BRANCH: qualcommax-6.x-nss-mx4300-6.11
IPQ COMMIT: 04c2d8a2db
  IPQ DATE: 2024-10-04
    NSS FW: NSS.HK.11.4.0.5-6-R
  MAC80211: v6.11.2-0-g7aa21fec187b
 ATH11K FW: WLAN.HK.2.9.0.1-01977-QCAHKSWPL_SILICONZ-1
  GRO FRAG: wan         : off
            br-lan      : off
            lan1        : off
            lan2        : off
            lan3        : off
            lan4        : off
            phy0-mesh0  : off
            phy1-ap0    : off
            phy2-ap0    : off

  NSS PKGS: kmod-qca-nss-cfi-cryptoapi - 6.6.54.12.5.2022.12.15~5cd07ce-r3
            kmod-qca-nss-crypto - 6.6.54.12.5.2022.12.15~3c5a574-r3
            kmod-qca-nss-dp - 6.6.54.2024.04.16~5bf8b91e-r1
            kmod-qca-nss-drv - 6.6.54.11.4.0.5.2021.09.13~53e5863-r14
            kmod-qca-nss-drv-bridge-mgr - 6.6.54.11.4.0.5.2021.08.17~c4049d1-r7
            kmod-qca-nss-drv-igs - 6.6.54.11.4.0.5.2021.08.17~c4049d1-r7
            kmod-qca-nss-drv-qdisc - 6.6.54.11.4.0.5.2021.08.17~c4049d1-r7
            kmod-qca-nss-drv-vlan-mgr - 6.6.54.11.4.0.5.2021.08.17~c4049d1-r7
            kmod-qca-nss-drv-wifi-meshmgr - 6.6.54.11.4.0.5.2021.08.17~c4049d1-r7
            kmod-qca-nss-ecm - 6.6.54.12.5.5.2024.09.02~bd5057b-r2
            nss-eip-firmware - 2.5.7-r3
            nss-firmware-default - 2024.08.04~794fe373-r1
            nss-firmware-ipq8074 - 2024.08.04~794fe373-r1
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
(cherry picked from commit a58914b4f788f6b5ee70ddad0a1f5c4e464a5629)
2025-02-28 16:38:04 -05:00
Sean Khan
d225c500cb ath11k_nss: Possible workaround to 0 wifi stats
Signed-off-by: Sean Khan <datapronix@protonmail.com>
(cherry picked from commit 0056ba46ffe980c88ab4d250eb4799cb0a632de7)
2025-02-28 16:38:03 -05:00
Sean Khan
c0c56930a0 ath11k_nss: Delete 999-783-001-wifi-ath11k-Fix-BCCA-counter-for-EMA.patch
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:03 -05:00
Sean Khan
1c59993344 ath11k_nss: 6.11.2: fix 999-783-001-wifi-ath11k-Fix-BCCA-counter-for-EMA.patch
Signed-off-by: Sean Khan <datapronix@protonmail.com>

ath11k_nss: 6.11.2 refresh 999-783-001-wifi-ath11k-Fix-BCCA-counter-for-EMA.patch

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:03 -05:00
Sean Khan
f232fcf2a7 ath11k_nss: 6.11.2: fix 235-003-ath11k-add-AP_VLAN-vif-support-for-WDS-offload-in-NSS-offload.patch
Signed-off-by: Sean Khan <datapronix@protonmail.com>

ath11k_nss: 6.11.2 refresh 235-003-ath11k-add-AP_VLAN-vif-support-for-WDS-offload-in-NSS-offload.patch

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:03 -05:00
Sean Khan
7b9edac6ed nss-setup: Make sure user selects their own target
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:03 -05:00
Sean Khan
734446d726 nss-setup: change default optimization to '-O2'
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:03 -05:00
Sean Khan
e24d72bb59 feeds: fix disable nss feed from being packaged
Fix typo in feeds name

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:02 -05:00
Sean Khan
218de5053d nss-setup: Add additional notes
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:02 -05:00
Sean Khan
6c177c575e nss-setup: fix led configs not generating
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:02 -05:00
Sean Khan
777ce17d3f nss-setup: Refactor and add options for setting up nodes to use DHCP
* Refactor and clean up script and add more helpful docs.
* If a device's MAC doesn't match or isn't specified the following will
  be configured:
  1.) lan network will use DHCP ("lan_proto=dhcp") to retrieve an IP
  2.) device name will be "mx4300-xxxx", where "xxxx" represents the
      last 4 characters of the device MAC address found on the bottom of
      sticker.
* When in bridge mode, devices can be setup to use static or dhcp for their lan interface.
  This is specified with option "lan_proto=dhcp" under each devices's
  config, or if no suffix is specified, it is assumed the IP needs to be
  optained.
* Add fallback mgmt IP address 10.1.1.1 that can be used in case mesh
  fails to come up and hardwire connection is required. Make sure to set
  a static IP for your computer in the 10.1.1.x subnet in order to
  connect.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:02 -05:00
Sean Khan
7917995dd1 nss-setup: Add example NSS configs/scripts
Included starter config seed NSS offloading for MX4300. Although it can
be used by any compatible ipq807x NSS setup.

There is also an example 'uci-defaults' script that you can use to build
a single image for multiple nodes.

Although the script includes options to set low/high band for mesh backhaul.
Only the high-band works for offloading.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:02 -05:00
Sean Khan
9634424d8d docs: Update README for NSS specific info
Signed-off-by: Sean Khan <datapronix@protonmail.com>

docs: Add donation links

Not obligatory at all. Just adding for folks who appreciate my work, and
wanting to contribute. :)
2025-02-28 16:38:02 -05:00
Sean Khan
5d7acf2ac6 Revert "ath11k_nss: Revert patch for 512M + 2KB RX header"
This reverts commit 08db8048d06b9a3e45bbcb7ab49463a21c769dc7.
2025-02-28 16:38:01 -05:00
Sean Khan
8b0a21b1ca ath11k_nss: fix WDS instability by disabling NAWDS mode
This patch replaces the problematic NAWDS stateless mode with standard
WDS in the ath11k driver. NAWDS has shown incompatibility with WDS AP
and STA modes in ath11k, leading to issues like MAC address
duplication and unstable connections. By switching to standard WDS,
this patch aims to resolve these issues.

It also enables WDS backhaul in NSS for better handling of backhaul links.

Testing is still ongoing, but early results indicate improved
stability and fewer connection problems in affected environments

Authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:01 -05:00
Sean Khan
df1215fb60 ath11k_nss: mac80211: fix NULL pointer access, Klocwork issue
Currently we are dereferencing dev pointer without a NULL
check.

Fix this issue by adding a NULL check.

Patch-dependency: none
Patch-work: none
Fixes: 4b7afb52c8e2 (mac80211: reorganize code to remove a forward declaration)
Note: ath.git commit id is mentioned in the Fixes tag

Signed-off-by: Monika Korada <quic_koramoni@quicinc.com>

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:01 -05:00
Sean Khan
e506100cce ath11k_nss: remove call trace while rebooting AP
When a station idles for a long time, hostapd will try to send
a QoS Null frame to the station as "poll". NL80211_CMD_PROBE_CLIENT
is used for this purpose.
And the skb will be added to ack_status_frame - waiting for a
completion via ieee80211_report_ack_skb().

But when the peer was already removed before the tx_complete arrives,
the peer will be missing. And when using dev_kfree_skb_any (instead
of going through mac80211), the entry will stay inside
ack_status_frames thus not clean up related information in its
internal data structures. This IDR will therefore run full after
8K request were generated for such clients.
At this point, the access point <M-[>48;55;187;1760;2992will then just stall and not allow
any new clients because idr_alloc() for ack_status_frame will fail.

ieee80211_free_txskb() on the other hand will (when required) call
ieee80211_report_ack_skb() and make sure that (when required) remove
the entry from the ack_status_frame and clean up related
information in its internal data structures.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:01 -05:00
Sean Khan
7a9bd40934 ath11k_nss: Consolidate Allow-fast-rx-by-bypassing-stats-update
This original patch: 237-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch
was split into two patches:

237-001-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch
237-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch

Merge them back together to avoid confusion

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 16:38:01 -05:00