src/cyw43_ctrl: Implement roaming configuration#146
src/cyw43_ctrl: Implement roaming configuration#146mitchellcairns wants to merge 1 commit intogeorgerobotics:mainfrom
Conversation
Add ctrl and ll functions to configure and query WiFi roaming behavior on the STA. Why? Until now, this has been enabled by default with no option to configure/alter the behavior. If a device drops below the trigger threshold for RSSI, it would drop packets due to activating roam. interface: - cyw43_ll_wifi_set_roam_enabled / cyw43_wifi_set_roam_enabled Control the roam_off iovar to enable or disable roaming entirely. - cyw43_ll_wifi_set_roam_params / cyw43_wifi_set_roam_params Set the RSSI trigger threshold, candidate delta, and scan period. - cyw43_ll_wifi_get_roam_params / cyw43_wifi_get_roam_params Read back current roam parameters. All output pointers are nullable.
|
Kindly requesting review from @dpgeorge |
|
Thanks for the contribution. Note that it is already possible to configure these roaming parameters -- if you know the correct IOCTL codes. You can use There are many, many IOCTLs and I don't think it scales to add them all as both LL functions (in Instead, look how uint8_t buf[36];
cyw43_ioctl(&cyw, CYW43_IOCTL_GET_SSID, 36, buf, itf);Or how What I would suggest is:
We need to remember that this code executes in an embedded environment and needs to have a small footprint. |
|
Thanks for the feedback I can definitely restructure this so that there is one base function, and wrapper static functions to avoid consuming binary space unless it's actually used. While we're on the topic of roaming, I do think that there should be a consideration to have roaming disabled as the default configuration parameter. I can confirm that doing so entirely resolves the issues here: I understand the concern that there are hundreds of IOCTLS, but I'm not asking to configure all of them, these are critical to get performance under control and resolve those specific types of issues. The current driver offers no visibility that this is an issue whatsoever, and it seems that Infineon doesn't like to share this information. Consider it an improvement to the average developer experience |
Yes, I tend to agree. For consumer applications (laptops, mobile phones) enabling roaming makes sense, but for microcontroller applications (what this driver aims for) it might indeed be better to prioritise sticking with the one AP. But that could be quite a big breaking change for some users who (implicitly, maybe without realising) rely on this feature. In that case we could tune
I fully support adding these new ioctls. I was thinking the use could be something like this (eg in MicroPython), schematically: struct command_table[] = {
"trigger_dbm", CYW43_IOCTL_TRIGGER_DBM,
"candidate_delta_db", CYW43_IOCTL_CANDIDATE_DELTA_DB,
"scan_interval_ms", CYW43_IOCTL_SCAN_INTERVAL_MS,
"other_option", CYW43_IOCTL_OTHER_OPTION,
...
};
set_param(const char *name, int value) {
int ioctl = lookup_name_in(name, command_table);
if (ioctl == -1) {
return EINVAL;
}
return cyw43_ioctl_set_u32(&cyw43, ioctl, value);
}In that case all it needs is the CYW43_IOCL_xxx defined, and helper functions to get/set ioctl. Also documentation 😄 Of course, we can also add |
Add ctrl and ll functions to configure and query WiFi roaming behavior on the STA.
Why? Until now, this has been enabled by default with no option to configure/alter the behavior. If a device drops below the trigger threshold for RSSI, it would drop packets due to activating roam.
interface:
cyw43_ll_wifi_set_roam_enabled / cyw43_wifi_set_roam_enabled
Control the roam_off iovar to enable or disable roaming entirely.
cyw43_ll_wifi_set_roam_params / cyw43_wifi_set_roam_params
Set the RSSI trigger threshold, candidate delta, and scan period.
cyw43_ll_wifi_get_roam_params / cyw43_wifi_get_roam_params
Read back current roam parameters. All output pointers are nullable.