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.
Comment on lines
+3257
to
+3267
| /* un-block; cancel any pending timer for this STA */ | ||
| /* Look for and cancel any pending block timer for this STA */ | ||
| kick_details_t *pending = find_and_remove_pending_block(vap_index, sta_mac_list[i]); | ||
| if (pending) { | ||
| wifi_util_dbg_print(WIFI_CTRL, "%s:%d Cancelling pending block timer for STA %s on vap %d\n", | ||
| __func__, __LINE__, sta_mac_list[i], vap_index); | ||
| if (scheduler_cancel_timer_task(ctrl->sched, pending->timer_id) != 0) { | ||
| wifi_util_error_print(WIFI_CTRL, "%s:%d Failed to cancel timer %d for STA %s on vap %d\n", | ||
| __func__, __LINE__, pending->timer_id, sta_mac_list[i], vap_index); | ||
| } | ||
| } |
- 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>
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);
}
Comment on lines
+3014
to
+3018
| if (ether_aton_r(bssid_obj->valuestring, (struct ether_addr *)bssid) == NULL) { | ||
| wifi_util_error_print(WIFI_CTRL, "%s:%d Failed to parse BSSID: %s\n", __func__, __LINE__, bssid_obj->valuestring); | ||
| cJSON_Delete(root); | ||
| return bus_error_invalid_input; | ||
| } |
Comment on lines
+2924
to
+2948
| // Helper function to remove a pending block by pointer (when timer fires) | ||
| static void remove_pending_block(kick_details_t *kick_details) | ||
| { | ||
| pthread_mutex_lock(&pending_blocks_lock); | ||
|
|
||
| pending_block_node_t *current = pending_blocks_head; | ||
| pending_block_node_t *prev = NULL; | ||
|
|
||
| while (current) { | ||
| if (current->kick_details == kick_details) { | ||
| // Found a match, remove from list | ||
| if (prev) { | ||
| prev->next = current->next; | ||
| } else { | ||
| pending_blocks_head = current->next; | ||
| } | ||
| free(current); | ||
| pthread_mutex_unlock(&pending_blocks_lock); | ||
| return; | ||
| } | ||
| prev = current; | ||
| current = current->next; | ||
| } | ||
| pthread_mutex_unlock(&pending_blocks_lock); | ||
| } |
Comment on lines
2956
to
2960
| kick_details_t *d = (kick_details_t *)arg; | ||
| wifi_util_dbg_print(WIFI_CTRL, "%s:%d Callback Del ACL, vap_index:%d, MAC: %s\n", | ||
| __func__, __LINE__, d->vap_index, | ||
| d->kick_list ? d->kick_list : "NULL"); | ||
|
|
Comment on lines
+3259
to
+3269
| /* un-block; cancel any pending timer for this STA */ | ||
| /* Look for and cancel any pending block timer for this STA */ | ||
| kick_details_t *pending = find_and_remove_pending_block(vap_index, sta_mac_list[i]); | ||
| if (pending) { | ||
| wifi_util_dbg_print(WIFI_CTRL, "%s:%d Cancelling pending block timer for STA %s on vap %d\n", | ||
| __func__, __LINE__, sta_mac_list[i], vap_index); | ||
| if (scheduler_cancel_timer_task(ctrl->sched, pending->timer_id) != 0) { | ||
| wifi_util_error_print(WIFI_CTRL, "%s:%d Failed to cancel timer %d for STA %s on vap %d\n", | ||
| __func__, __LINE__, pending->timer_id, sta_mac_list[i], vap_index); | ||
| } | ||
| } |
Comment on lines
+3450
to
+3452
| // Destroy pending blocks list mutex | ||
| pthread_mutex_destroy(&pending_blocks_lock); | ||
|
|
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.