src/cyw43_ctrl: Add roaming and interference-mitigation config via ioctl helpers#151
src/cyw43_ctrl: Add roaming and interference-mitigation config via ioctl helpers#151mitchellcairns wants to merge 1 commit into
Conversation
fc0a4f8 to
bbb3303
Compare
…ctl helpers Expose the roaming and interference-mitigation ioctls needed to tune link stability, implemented entirely in terms of cyw43_ioctl() rather than adding dedicated low-level (cyw43_ll_*) functions for each setting, per maintainer feedback on PR georgerobotics#146. Only the two generic u32 helpers cost binary space; the feature-specific wrappers are static inline and the named-iovar helpers are the only additional functions. Roaming is enabled by default with no way to configure it. When a STA's RSSI drops below the (hidden) roam trigger the firmware starts background roam scans, which causes dropped packets and severe throughput degradation on a point-to-point link (see georgerobotics#111 and raspberrypi/pico-sdk#2835). Add public helpers: - cyw43_ioctl_set_u32(self, cmd, val, iface) - cyw43_ioctl_get_u32(self, cmd, *out_val, iface) Wrap cyw43_ioctl() for the common case of a 4-byte ioctl value. Argument order matches cyw43_ioctl() (iface last). Add CYW43_IOCTL_xxx constants, encoded as (WLC_cmd << 1) | is_set to match the existing CYW43_IOCTL_ defines: - GET/SET_ROAM_TRIGGER, GET/SET_ROAM_DELTA, GET/SET_ROAM_SCAN_PERIOD - GET/SET_INTERFERENCE_MODE Add the configuration API: - cyw43_wifi_set_roam_params() / cyw43_wifi_get_roam_params() static inline, built on the u32 ioctl helpers. - cyw43_wifi_set_interference_mode() / cyw43_wifi_get_interference_mode() static inline, built on the u32 ioctl helpers, with CYW43_IFMODE_* mode constants. - cyw43_wifi_set_roam_enabled() / cyw43_wifi_get_roam_enabled() toggle/read the "roam_off" iovar via WLC_SET_VAR / WLC_GET_VAR. The default roaming behaviour is left unchanged.
bbb3303 to
d4f2a36
Compare
|
Have you done much testing with this? I'm wondering what values for the roaming and interference mode you've found make a difference? |
In my configurations I've disabled both roaming/interference as the roaming mode only serves to cause data rate issues. The default value is rather aggressive. In my other testing, using some debug logging to track the signal level in dBm, the roaming value set aligns with what is set using the helpers. Note that this change does not alter the default configuration set, it only exposes these helpers so that developers can utilize them with built in, documented options. |
|
Had this exact issue on a RC car + controller pair — 2 Pico2W (RP2350), Can confirm For anyone using pico-sdk: |
Follow-up to the discussion on #146. This reworks the WiFi roaming (and
interference-mitigation) configuration to be implemented entirely in terms of
cyw43_ioctl(), per @dpgeorge's feedback, instead of adding dedicatedlow-level
cyw43_ll_*functions for each setting.The goal is to expose the handful of roaming/interference ioctls that are
critical for tuning link stability, while keeping the embedded footprint
minimal: only two small generic helpers cost binary space; everything
feature-specific is
static inline(or a tiny iovar wrapper) and is onlyinstantiated when actually used.
Background / motivation
Roaming is enabled by default with no way to configure it. When a STA's RSSI
drops below the (hidden) roam trigger, the firmware starts background roam
scans, which causes dropped packets and severe throughput degradation on a
point-to-point link. See:
Disabling roaming (or tuning the trigger/delta/scan-period) fully resolves
these issues, but until now there was no API and no visibility
that this was even the cause.
Implemented
New generic helpers (the only functions that add code size):
cyw43_ioctl_set_u32(self, cmd, val, iface)cyw43_ioctl_get_u32(self, cmd, *out_val, iface)Thin wrappers around
cyw43_ioctl()for the common case of a 4-byte ioctlvalue. Argument order matches
cyw43_ioctl()(ifacelast).New
CYW43_IOCTL_xxxconstants (encoded as(WLC_cmd << 1) | is_set, matchingthe existing
CYW43_IOCTL_*defines):GET/SET_ROAM_TRIGGER,GET/SET_ROAM_DELTA,GET/SET_ROAM_SCAN_PERIODGET/SET_INTERFERENCE_MODE