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 6 commits intordkcentral:developfrom
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
|
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. |
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.
| 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; | ||
| } | ||
| } | ||
| else if (isVapMeshBackhaul(vap_index)) { | ||
| vap->u.bss_info.security.mode = wifi_security_mode_wpa3_personal; | ||
| vap->u.bss_info.security.wpa3_transition_disable = false; | ||
| vap->u.bss_info.security.mfp = wifi_mfp_cfg_optional; | ||
| vap->u.bss_info.security.u.key.type = wifi_security_key_type_psk_sae; | ||
| } |
| 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); | ||
| } |
| @@ -1280,6 +1350,36 @@ int vap_svc_mesh_ext_start(vap_svc_t *svc, unsigned int radio_index, wifi_vap_in | |||
| return -1; | |||
| } | |||
|
|
|||
| #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; | |||
| } | |||
| 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", |
| /* Find the mesh extender service for this VAP using the existing API */ | ||
| ext_svc = get_svc_by_vap_index(ctrl, vap_index); | ||
| if (ext_svc != NULL && ext_svc->type == vap_svc_type_mesh_ext) { | ||
| /* Found the service - call the WPS credentials handler */ | ||
| wifi_util_info_print(WIFI_CTRL, "%s:%d: Calling vap_svc_mesh_ext_wps_credentials_received " | ||
| "for vap_index %d\n", __func__, __LINE__, vap_index); | ||
| vap_svc_mesh_ext_wps_credentials_received(ext_svc, vap_index); | ||
| } else { |
| /* 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; | ||
| } |
| #include "stdlib.h" | ||
| #include <sys/time.h> | ||
| #include <string.h> | ||
| #include <unistd.h> |
No description provided.