LTE-2853 DFS NOP fix for multi-radio platforms#1258
Open
poornakumar-pk wants to merge 4 commits into
Open
Conversation
Reason for change: ensure NOP state clears on the correct 5GHz radio by using the detected radio_index instead of hardcoding RADIO_INDEX_DFS. Test Procedure: verify radar event handling and NOP_FINISHED in pcap/logs. Risks: Medium Priority: P2 Signed-off-by: poornakumar_mezhiselvam@comcast.com
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses multi-radio DFS behavior by removing the hardcoded DFS radio index and ensuring DFS NOP state is started/cleared on the correct 5GHz radio based on the detected radioIndex.
Changes:
- Reworked DFS NOP start handling to iterate over all 5GHz radios and process pending
radarDetectedentries per-radio. - Updated
update_db_radar_detected()to take aradio_indexparameter and updated call sites to pass the correct index. - Updated DFS NOP finish handling to locate the radio that owns the finishing channel before emitting
NOP_FINISHEDfor that radio.
Comments suppressed due to low confidence (1)
source/core/wifi_ctrl_queue_handlers.c:3328
update_db_radar_detected()removes an entry by doingpos + len + 1, which assumes the entry is always followed by a;. When the entry is the last token (e.g. "A;B" removing B), this reads past the string terminator and can overread/produce undefined behavior. Consider deleting either the preceding or trailing delimiter depending on position, and memmove from a pointer that never goes beyond the\0terminator.
char *pos_ch_radar_time = strstr(radio_params->radarDetected, radar_detected_ch_time);
size_t len_ch_radar_time = strlen(radar_detected_ch_time);
if( strlen(radio_params->radarDetected) == len_ch_radar_time ){
strncpy(radio_params->radarDetected, " ", sizeof(radio_params->radarDetected));
wifi_util_info_print(WIFI_CTRL,"%s:%d radarDetected:%s. \n",__FUNCTION__, __LINE__, radio_params->radarDetected);
return RETURN_OK;
}
if(pos_ch_radar_time) {
pthread_mutex_lock(&g_wifidb->data_cache_lock);
memmove(radio_params->radarDetected, pos_ch_radar_time + len_ch_radar_time + 1, strlen(radio_params->radarDetected) + 1);
pthread_mutex_unlock(&g_wifidb->data_cache_lock);
}
wifi_util_info_print(WIFI_CTRL,"%s: radarDetected:%s. \n",__FUNCTION__, radio_params->radarDetected);
if(strlen(radio_params->radarDetected) == 0) {
strncpy(radio_params->radarDetected, " ", sizeof(radio_params->radarDetected));
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
mateuszCieslak-GL
previously requested changes
Jul 13, 2026
…undant checks, size radarDetected buffer to 256 Signed-off-by: poornakumar-pk <poornakumar_mezhiselvam@comcast.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
source/core/wifi_ctrl_queue_handlers.c:3678
- The local
radarDetected_tempbuffer is hardcoded to 256 bytes. If the underlyingradio_params->radarDetectedsize differs, this can silently truncate (or be unnecessarily large). Usingsizeof(radio_params->radarDetected)keeps these buffers aligned with the actual field size and avoids future drift.
char radarDetected_temp[256];
unsigned int ch_temp;
strncpy(radarDetected_temp, radio_params->radarDetected, sizeof(radarDetected_temp));
radarDetected_temp[sizeof(radarDetected_temp) - 1] = '\0';
…, 256B radarDetected buffers, NULL guard) Signed-off-by: poornakumar-pk <poornakumar_mezhiselvam@comcast.com>
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.
Reason for change: ensure NOP state clears on the correct 5GHz radio by using the detected radio_index instead of hardcoding RADIO_INDEX_DFS.
Test Procedure: verify radar event handling and NOP_FINISHED in logs.
Risks: Medium
Priority: P2
Signed-off-by: poornakumar_mezhiselvam@comcast.com