RDKBWIFI-278: CACR add multi-STA support and received subdoc from UWM#1222
Open
sundram0711 wants to merge 1 commit into
Open
RDKBWIFI-278: CACR add multi-STA support and received subdoc from UWM#1222sundram0711 wants to merge 1 commit into
sundram0711 wants to merge 1 commit into
Conversation
sundram0711
commented
Jun 23, 2026
Contributor
- Refactored implementation to support multiple STA entries per message (spec compliant)
- Changed the struct to json format to carry cacr information from UWM to OneWifi.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the EasyMesh Client Association Control Request (CACR) handling to accept a JSON sub-document from UWM and to apply the request to multiple STAs per message, rather than a single STA.
Changes:
- Switched CACR payload handling from a binary struct (
client_assoc_ctrl_req_t) to a JSON subdoc parser (parse_client_assoc_ctrl_json()). - Added multi-STA processing loop for
StaMacListand per-STA ACL timer scheduling/cancellation tracking. - Extended
kick_details_tto carry a scheduler timer ID for cancel support.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| source/core/wifi_ctrl.h | Extends kick_details_t with a timer_id field to track scheduled ACL removal timers. |
| source/apps/em/wifi_em.c | Implements JSON parsing for CACR, multi-STA handling, and pending timer tracking/cancellation. |
| include/wifi_base.h | Removes the old binary CACR request struct (client_assoc_ctrl_req_t) now replaced by JSON payloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
June 23, 2026 09:28
c4a31aa to
4a907f6
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
source/apps/em/wifi_em.c:3290
- The error
cleanup:path only freeskick_details, but whenkick_details->kick_listhas been allocated (e.g.,strdup()succeeded) this leaks memory. Freekick_details->kick_listfirst (it is safe tofree(NULL)).
cleanup:
if (kick_details) {
free(kick_details);
}
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
June 24, 2026 11:52
4a907f6 to
a7f6696
Compare
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
June 24, 2026 12:00
a7f6696 to
436d6a1
Compare
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
June 25, 2026 20:09
436d6a1 to
02c6fcf
Compare
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
June 25, 2026 20:59
02c6fcf to
8bc17f3
Compare
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
June 25, 2026 21:13
8bc17f3 to
fb7a95e
Compare
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
June 26, 2026 06:00
fb7a95e to
9ec193e
Compare
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
June 26, 2026 09:45
9ec193e to
5d0ebd0
Compare
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
June 30, 2026 19:05
5d0ebd0 to
1f17f6f
Compare
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
July 1, 2026 05:39
1f17f6f to
8514563
Compare
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
July 1, 2026 06:37
8514563 to
68bb3bb
Compare
- Refactored implementation to support multiple STA entries per message (spec compliant) - Changed the struct to json format to carry cacr information from UWM to OneWifi. Signed-off-by: Sundram Patel <sundram.p@tataelxsi.co.in>
sundram0711
force-pushed
the
easymesh-refactor_client_assoc_multiSTA_new
branch
from
July 9, 2026 11:35
68bb3bb to
eb22b83
Compare
Comment on lines
+3516
to
+3533
| kick_details_t *existing = find_remove_and_cancel_pending_block(vap_index, sta_mac_list[i]); | ||
|
|
||
| if (existing) { | ||
| wifi_util_dbg_print(WIFI_CTRL,"%s:%d STA %s already blocked, extending timer\n", | ||
| __func__, __LINE__, sta_mac_list[i]); | ||
|
|
||
| /* Extend the existing timer in-place to avoid multiple timers sharing the same arg. */ | ||
| struct timespec now; | ||
| clock_gettime(CLOCK_MONOTONIC, &now); | ||
|
|
||
| if (existing->timer_id <= 0 || | ||
| scheduler_update_timer_task_interval(ctrl->sched, existing->timer_id, validity_period * 1000) != RETURN_OK || | ||
| scheduler_update_timeout(ctrl->sched, existing->timer_id, now) != RETURN_OK) { | ||
| /* Keep the original timer so the block will still expire. */ | ||
| (void)add_pending_block(existing); | ||
| ret = bus_error_general; | ||
| goto cleanup; | ||
| } |
Comment on lines
+3643
to
+3674
| kick_details_t *pending = find_remove_and_cancel_pending_block(vap_index, sta_mac_list[i]); | ||
|
|
||
| #ifdef NL80211_ACL | ||
| //if sta already block then removed it from acl list | ||
| success = (wifi_hal_delApAclDevice(vap_index, sta_mac_str) == RETURN_OK); | ||
| //if sta already block then removed it from acl list | ||
| success = (wifi_hal_delApAclDevice(vap_index, sta_mac_list[i]) == RETURN_OK); | ||
| #else | ||
| success = (wifi_delApAclDevice(vap_index, sta_mac_str) == RETURN_OK); | ||
| success = (wifi_delApAclDevice(vap_index, sta_mac_list[i]) == RETURN_OK); | ||
| #endif | ||
| if (!success) { | ||
| wifi_util_error_print(WIFI_CTRL, "%s:%d Failed to delete ACL device on vap %d\n", | ||
| __func__, __LINE__, vap_index); | ||
| if (pending && add_pending_block(pending) != RETURN_OK) { | ||
| wifi_util_error_print(WIFI_CTRL, "%s:%d Failed to add pending\n", __func__, __LINE__); | ||
| } | ||
| ret = bus_error_general; | ||
| goto cleanup; | ||
| } | ||
| } | ||
|
|
||
| if (pending) { | ||
| if (pending->timer_id >= 0 && scheduler_cancel_timer_task(ctrl->sched, pending->timer_id) == RETURN_OK) { | ||
| /* scheduler_cancel_timer_task() does not free the task arg; free kick_details explicitly. */ | ||
| char *kick_list = pending->kick_list; | ||
| pending->kick_list = NULL; | ||
| if (scheduler_free_timer_task_arg(ctrl->sched, pending->timer_id) != RETURN_OK) { | ||
| /* Fallback: timer is cancelled so the arg will not be dereferenced. */ | ||
| free(pending); | ||
| } | ||
| free(kick_list); | ||
| pending = NULL; | ||
| } | ||
| acl_block_end(vap_index); | ||
| } |
Comment on lines
+3860
to
+3888
| // Cancel and free any pending block timers/entries before destroying the mutex | ||
| pthread_mutex_lock(&pending_blocks_lock); | ||
| pending_block_node_t *node = pending_blocks_head; | ||
| pending_blocks_head = NULL; | ||
| pthread_mutex_unlock(&pending_blocks_lock); | ||
|
|
||
| while (node) { | ||
| pending_block_node_t *next = node->next; | ||
| if (node->kick_details) { | ||
| if (node->kick_details->timer_id > 0) { | ||
| scheduler_cancel_timer_task(ctrl->sched, node->kick_details->timer_id); | ||
| } | ||
|
|
||
| #ifdef NL80211_ACL | ||
| wifi_hal_delApAclDevice(node->kick_details->vap_index, node->kick_details->kick_list); | ||
| #else | ||
| wifi_delApAclDevice(node->kick_details->vap_index, node->kick_details->kick_list); | ||
| #endif | ||
| acl_block_end(node->kick_details->vap_index); | ||
|
|
||
| free(node->kick_details->kick_list); | ||
| free(node->kick_details); | ||
| } | ||
| free(node); | ||
| node = next; | ||
| } | ||
|
|
||
| pthread_mutex_destroy(&pending_blocks_lock); | ||
| pthread_mutex_destroy(&g_vap_acl_lock); |
Comment on lines
+3303
to
+3308
| if (d->cancelled_by_unblock) { | ||
| remove_pending_block(d); | ||
| free(d->kick_list); | ||
| free(d); | ||
| return 0; | ||
| } |
Contributor
|
@sundram0711 please address recent copilot comments. If they are not applicable comment why. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.