RDKBWIFI-388: Add support for onboarding extender using WPS mechanism in RDK-B#1102
RDKBWIFI-388: Add support for onboarding extender using WPS mechanism in RDK-B#1102bsomanath wants to merge 14 commits into
Conversation
… in RDK-B Signed-off-by: Somanath Bulusu <bsomanath@plume.com>
… in RDK-B RDKBWIFI-388: Add support for onboarding extender using WPS mechanism in RDK-B
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
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_SUPPORTis 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.
removed unused unistd.h usage Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| 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; |
| 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", |
| @@ -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); | |||
|
|
|||
| #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 |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
recheck |
|
I have read the CLA Document and I hereby sign the CLA |
recheck |
|
"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 |
There was a problem hiding this comment.
Add to every #endif comment what if is it related to.
| #endif | |
| #endif /* UWM_EXT_WPS_SUPPORT */ |
| } | ||
|
|
||
| #ifdef UWM_EXT_WPS_SUPPORT | ||
| if(radio_params != NULL && is_radio_band_5G(radio_params->band)) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
| 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; |
…onal on 2.4G & 5G and disabling MLO Signed-off-by: Somanath Bulusu <bsomanath@plume.com>
| * @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; | ||
| } |
| 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", |
| #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); | ||
| } |
Core 1386
I have read the CLA Document and I hereby sign the CLA