Skip to content

RDKBWIFI-388: Add support for onboarding extender using WPS mechanism in RDK-B#1102

Open
bsomanath wants to merge 14 commits into
rdkcentral:developfrom
bsomanath:develop
Open

RDKBWIFI-388: Add support for onboarding extender using WPS mechanism in RDK-B#1102
bsomanath wants to merge 14 commits into
rdkcentral:developfrom
bsomanath:develop

Conversation

@bsomanath
Copy link
Copy Markdown

@bsomanath bsomanath commented Apr 30, 2026

I have read the CLA Document and I hereby sign the CLA

Copilot AI review requested due to automatic review settings April 30, 2026 03:51
@bsomanath bsomanath requested a review from a team as a code owner April 30, 2026 03:51
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds RDK-B mesh extender onboarding via WPS by enabling WPS configuration on STA/mesh VAPs and wiring a STA-side WPS success path into the mesh extender connection state machine.

Changes:

  • Allow WPS parameter get/set for STA mesh VAPs when UWM_EXT_WPS_SUPPORT is enabled (TR-181 + DM callbacks).
  • Track whether backhaul credentials are “valid” in DB defaults and trigger a WPS onboarding state in the mesh extender service when they are missing.
  • Register and handle a WPS STA event callback; add new mesh extender connection states to react to received WPS credentials.

Reviewed changes

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

Show a summary per file
File Description
source/platform/common/data_model/wifi_dml_cb.c Relaxes WPS configuration restrictions for STA mesh VAPs under UWM_EXT_WPS_SUPPORT.
source/dml/tr_181/ml/cosa_wifi_dml.c Adjusts WPS validation flow to allow STA/mesh interfaces to proceed under UWM_EXT_WPS_SUPPORT.
source/db/wifi_db.c Initializes valid_bh_credentials for STA configs based on default SSID/key presence.
source/core/wifi_ctrl.c Registers a new WPS STA callback and calls into mesh extender service on success.
source/core/services/vap_svc_private.c Tweaks security mode for WPS-enabled private VAPs and copies mesh backhaul creds into Multi-AP backhaul fields.
source/core/services/vap_svc_mesh_ext.c Adds new connection states and logic to drive WPS STA onboarding and reinit supplicant after credentials arrive.
source/core/services/vap_svc.h Extends the connection state enum and exposes a mesh-ext WPS-credentials handler.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/core/services/vap_svc_private.c Outdated
Comment thread source/core/services/vap_svc_mesh_ext.c
Comment thread source/core/services/vap_svc_mesh_ext.c
Comment thread source/core/services/vap_svc_mesh_ext.c
Comment thread source/core/wifi_ctrl.c
Comment thread source/core/wifi_ctrl.c
Comment thread source/core/services/vap_svc_private.c Outdated
removed unused unistd.h usage

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 7, 2026 13:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 5 comments.

Comment thread source/core/wifi_ctrl.c
Comment thread source/core/services/vap_svc_mesh_ext.c
Comment thread source/core/services/vap_svc_private.c
Comment thread source/core/services/vap_svc_private.c Outdated
Comment thread source/platform/common/data_model/wifi_dml_cb.c
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 11:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread source/core/wifi_ctrl.c
Comment on lines +1394 to +1401
wifi_util_info_print(WIFI_CTRL, "%s:%d: WPS STA event callback: vap_index=%d, event=%d\n",
__func__, __LINE__, vap_index, event);

/* Only handle WPS_EV_SUCCESS (value 2) */
if (event != 2) {
wifi_util_dbg_print(WIFI_CTRL, "%s:%d: Ignoring non-success WPS event %d\n",
__func__, __LINE__, event);
return;
Comment on lines +1245 to +1270
unsigned int vap_index = 0;
unsigned char num_of_radios = getNumberRadios();
unsigned char radio_index = 0;
wifi_vap_info_map_t *vap_map = NULL;

// Find the STA VAP index
for (radio_index = 0; radio_index < num_of_radios; radio_index++) {
vap_map = (wifi_vap_info_map_t *)get_wifidb_vap_map(radio_index);
if (vap_map == NULL) {
continue;
}
unsigned int j;
for (j = 0; j < vap_map->num_vaps; j++) {
if (vap_svc_is_mesh_ext(vap_map->vap_array[j].vap_index) == true &&
vap_map->vap_array[j].vap_mode == wifi_vap_mode_sta) {
vap_index = vap_map->vap_array[j].vap_index;
break;
}
}
if (vap_index != 0) {
break;
}
}

if (vap_index != 0) {
wifi_util_info_print(WIFI_CTRL, "%s:%d: Deinitializing and reinitializing wpa_supplicant for vap_index %d\n",
Comment on lines 1353 to 1400
@@ -1295,6 +1395,7 @@ int vap_svc_mesh_ext_start(vap_svc_t *svc, unsigned int radio_index, wifi_vap_in
memset(ext, 0, sizeof(vap_svc_ext_t));

ext_set_conn_state(ext, connection_state_disconnected_scan_list_none, __func__, __LINE__);

schedule_connect_sm(svc);

Comment on lines +4728 to +4734
#if !defined(UWM_EXT_WPS_SUPPORT)
if (isVapSTAMesh(pcfg->vap_index)) {
wifi_util_info_print(WIFI_DMCLI, "%s:%d %s does not support configuration\n", __func__,
__LINE__, pcfg->vap_name);
return true;
}
#endif
@bsomanath
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@bsomanath
Copy link
Copy Markdown
Author

recheck

@bsomanath
Copy link
Copy Markdown
Author

Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.

I have read the CLA Document and I hereby sign the CLA

You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

recheck

@bsomanath
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@bsomanath
Copy link
Copy Markdown
Author

Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.

I have read the CLA Document and I hereby sign the CLA

You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

recheck

@bsomanath
Copy link
Copy Markdown
Author

"I have read the CLA Document and I hereby sign the CLA"

connection_state_set_wps_sta_mode_started,
connection_state_set_wps_sta_mode,
connection_state_set_wps_sta_mode_completed,
#endif
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.

Add to every #endif comment what if is it related to.

Suggested change
#endif
#endif /* UWM_EXT_WPS_SUPPORT */

}

#ifdef UWM_EXT_WPS_SUPPORT
if(radio_params != NULL && is_radio_band_5G(radio_params->band)) {
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.

Why is it important that radio was 5G?

/* Just set the connection state to set_wps_sta_mode_completed */
if (ext->conn_state == connection_state_set_wps_sta_mode ||
ext->conn_state == connection_state_set_wps_sta_mode_started ||
ext->conn_state == connection_state_disconnected_scan_list_none) {
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.

Suggested change
ext->conn_state == connection_state_disconnected_scan_list_none) {
ext->conn_state == connection_state_disconnected_scan_list_none) {

if (convert_radio_index_to_freq_band(wifi_prop, radio_index, &band) == RETURN_OK) {
if (isVapPrivate(vap_index) && map->vap_array[i].u.bss_info.wps.enable) {
if (band != WIFI_FREQUENCY_6_BAND) {
vap->u.bss_info.security.mode = wifi_security_mode_wpa2_personal;
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.

Why enforcing WPA2?

Copilot AI review requested due to automatic review settings May 20, 2026 07:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 7 out of 7 changed files in this pull request and generated 5 comments.

Comment thread source/core/wifi_ctrl.c
Comment on lines +1386 to +1402
* @param event WPS event (2 = WPS_EV_SUCCESS)
* @return None
*/
static void wps_sta_event_callback(unsigned int vap_index, unsigned int event)
{
wifi_ctrl_t *ctrl = get_wifictrl_obj();
vap_svc_t *ext_svc = NULL;

wifi_util_info_print(WIFI_CTRL, "%s:%d: WPS STA event callback: vap_index=%d, event=%d\n",
__func__, __LINE__, vap_index, event);

/* Only handle WPS_EV_SUCCESS (value 2) */
if (event != 2) {
wifi_util_dbg_print(WIFI_CTRL, "%s:%d: Ignoring non-success WPS event %d\n",
__func__, __LINE__, event);
return;
}
Comment on lines +1246 to +1271
unsigned int vap_index = 0;
unsigned char num_of_radios = getNumberRadios();
unsigned char radio_index = 0;
wifi_vap_info_map_t *vap_map = NULL;

// Find the STA VAP index
for (radio_index = 0; radio_index < num_of_radios; radio_index++) {
vap_map = (wifi_vap_info_map_t *)get_wifidb_vap_map(radio_index);
if (vap_map == NULL) {
continue;
}
unsigned int j;
for (j = 0; j < vap_map->num_vaps; j++) {
if (vap_svc_is_mesh_ext(vap_map->vap_array[j].vap_index) == true &&
vap_map->vap_array[j].vap_mode == wifi_vap_mode_sta) {
vap_index = vap_map->vap_array[j].vap_index;
break;
}
}
if (vap_index != 0) {
break;
}
}

if (vap_index != 0) {
wifi_util_info_print(WIFI_CTRL, "%s:%d: Deinitializing and reinitializing wpa_supplicant for vap_index %d\n",
Comment on lines +1354 to +1380
#ifdef UWM_EXT_WPS_SUPPORT
if(radio_params != NULL && is_radio_band_5G(radio_params->band)) {
vap_map = (wifi_vap_info_map_t *)get_wifidb_vap_map(radio_index);
if (vap_map != NULL)
{
for (j = 0; j < vap_map->num_vaps; j++)
{
wifi_util_info_print(WIFI_CTRL, "%s:%d Vap_name: %s Mesh status: %d vap_mode: %d valid_bh: %d\n", __FUNCTION__, __LINE__,
vap_map->vap_array[j].vap_name, vap_svc_is_mesh_ext(vap_map->vap_array[j].vap_index), vap_map->vap_array[j].vap_mode,
vap_map->vap_array[j].u.sta_info.valid_bh_credentials);
if (vap_svc_is_mesh_ext(vap_map->vap_array[j].vap_index) == true &&
vap_map->vap_array[j].vap_mode == wifi_vap_mode_sta &&
vap_map->vap_array[j].u.sta_info.valid_bh_credentials == FALSE)
{
wps_onboard_status = 1;
vap_index = vap_map->vap_array[j].vap_index;
wifi_util_info_print(WIFI_CTRL, "%s:%d WPS Onboarding required for vap_index: %d\n", __FUNCTION__, __LINE__, vap_index);
break;
}
}
}
if (wps_onboard_status) {
ext_set_conn_state(ext, connection_state_set_wps_sta_mode_started, __func__, __LINE__);
wifi_util_info_print(WIFI_CTRL, "%s:%d: WPS onboarding required - valid_bh_credentials not set for STA vap_index %d\n",
__FUNCTION__, __LINE__, vap_index);
schedule_connect_sm(svc);
}
Comment thread source/core/services/vap_svc_private.c
Comment thread source/dml/tr_181/ml/cosa_wifi_dml.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