Skip to content

LTE-2853 DFS NOP fix for multi-radio platforms#1258

Open
poornakumar-pk wants to merge 4 commits into
rdkcentral:mainfrom
poornakumar-pk:nopstarted-main
Open

LTE-2853 DFS NOP fix for multi-radio platforms#1258
poornakumar-pk wants to merge 4 commits into
rdkcentral:mainfrom
poornakumar-pk:nopstarted-main

Conversation

@poornakumar-pk

Copy link
Copy Markdown
Contributor

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

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
Copilot AI review requested due to automatic review settings July 13, 2026 08:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 radarDetected entries per-radio.
  • Updated update_db_radar_detected() to take a radio_index parameter 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_FINISHED for 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 doing pos + 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 \0 terminator.
    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.

Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c Outdated
Comment thread source/core/wifi_ctrl_queue_handlers.c
@mateuszCieslak-GL

Copy link
Copy Markdown
Contributor

@poornakumar-pk

  1. please address copilot comments
  2. please reference original PR from which you've done a cherrypick in the description
  3. please trigger a verification builds from gerrit with this change and post link to it here.

Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c Outdated
Comment thread source/core/wifi_ctrl_queue_handlers.c Outdated
Comment thread source/core/wifi_ctrl_queue_handlers.c Outdated
Comment thread source/core/wifi_ctrl_queue_handlers.c
…undant checks, size radarDetected buffer to 256

Signed-off-by: poornakumar-pk <poornakumar_mezhiselvam@comcast.com>
Copilot AI review requested due to automatic review settings July 15, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Copilot AI review requested due to automatic review settings July 15, 2026 11:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_temp buffer is hardcoded to 256 bytes. If the underlying radio_params->radarDetected size differs, this can silently truncate (or be unnecessarily large). Using sizeof(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';

Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
…, 256B radarDetected buffers, NULL guard)

Signed-off-by: poornakumar-pk <poornakumar_mezhiselvam@comcast.com>
Copilot AI review requested due to automatic review settings July 15, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.

Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants