@@ -436,7 +436,7 @@ unsigned int dfs_fallback_channel(wifi_platform_property_t *wifi_prop, wifi_freq
436436 return channel ;
437437}
438438
439- int start_radios (rdk_dev_mode_type_t mode )
439+ int start_radios (rdk_dev_mode_type_t mode , unsigned int radio_index )
440440{
441441 wifi_radio_operationParam_t * wifi_radio_oper_param = NULL ;
442442 int ret = RETURN_OK ;
@@ -460,6 +460,10 @@ int start_radios(rdk_dev_mode_type_t mode)
460460 }
461461
462462 for (index = 0 ; index < num_of_radios ; index ++ ) {
463+ if (radio_index != WIFI_ALL_RADIO_INDICES && radio_index != index ) {
464+ continue ;
465+ }
466+
463467 wifi_radio_oper_param = (wifi_radio_operationParam_t * )get_wifidb_radio_map (index );
464468 if (wifi_radio_oper_param == NULL ) {
465469 wifi_util_error_print (WIFI_CTRL ,"%s:wrong index for radio map: %d\n" ,__FUNCTION__ , index );
@@ -750,17 +754,17 @@ int bus_get_active_gw_parameter(const char *name, unsigned int *ret_val)
750754 return RETURN_OK ;
751755}
752756
753- void start_extender_vaps (void )
757+ void start_extender_vaps (unsigned int radio_index )
754758{
755759 wifi_ctrl_t * ctrl ;
756760 vap_svc_t * ext_svc ;
757761
758762 ctrl = (wifi_ctrl_t * )get_wifictrl_obj ();
759763 ext_svc = get_svc_by_type (ctrl , vap_svc_type_mesh_ext );
760- ext_svc -> start_fn (ext_svc , WIFI_ALL_RADIO_INDICES , NULL );
764+ ext_svc -> start_fn (ext_svc , radio_index , NULL );
761765}
762766
763- void start_gateway_vaps ()
767+ void start_gateway_vaps (unsigned int radio_index )
764768{
765769 vap_svc_t * priv_svc , * pub_svc , * mesh_gw_svc ;
766770 unsigned int value ;
@@ -772,20 +776,20 @@ void start_gateway_vaps()
772776 mesh_gw_svc = get_svc_by_type (ctrl , vap_svc_type_mesh_gw );
773777
774778 // start private
775- priv_svc -> start_fn (priv_svc , WIFI_ALL_RADIO_INDICES , NULL );
779+ priv_svc -> start_fn (priv_svc , radio_index , NULL );
776780
777781 // start mesh gateway if mesh is enabled
778782 value = get_wifi_mesh_vap_enable_status ();
779783 if (value == true) {
780- mesh_gw_svc -> start_fn (mesh_gw_svc , WIFI_ALL_RADIO_INDICES , NULL );
784+ mesh_gw_svc -> start_fn (mesh_gw_svc , radio_index , NULL );
781785 }
782786
783787 value = false;
784788 // start public if tunnel is up
785789 bus_get_vap_init_parameter (WIFI_DEVICE_TUNNEL_STATUS , & value );
786790 if (value == true) {
787791 set_wifi_public_vap_enable_status ();
788- pub_svc -> start_fn (pub_svc , WIFI_ALL_RADIO_INDICES , NULL );
792+ pub_svc -> start_fn (pub_svc , radio_index , NULL );
789793 }
790794
791795 value = false;
@@ -797,11 +801,11 @@ void start_gateway_vaps()
797801
798802 if (is_sta_enabled () == true) {
799803 wifi_util_info_print (WIFI_CTRL , "%s:%d start mesh sta\n" ,__func__ , __LINE__ );
800- start_extender_vaps ();
804+ start_extender_vaps (radio_index );
801805 }
802806}
803807
804- void stop_gateway_vaps ()
808+ void stop_gateway_vaps (unsigned int radio_index )
805809{
806810 vap_svc_t * priv_svc , * pub_svc , * mesh_gw_svc ;
807811 wifi_ctrl_t * ctrl ;
@@ -812,19 +816,19 @@ void stop_gateway_vaps()
812816 pub_svc = get_svc_by_type (ctrl , vap_svc_type_public );
813817 mesh_gw_svc = get_svc_by_type (ctrl , vap_svc_type_mesh_gw );
814818
815- priv_svc -> stop_fn (priv_svc , WIFI_ALL_RADIO_INDICES , NULL );
816- pub_svc -> stop_fn (pub_svc , WIFI_ALL_RADIO_INDICES , NULL );
817- mesh_gw_svc -> stop_fn (mesh_gw_svc , WIFI_ALL_RADIO_INDICES , NULL );
819+ priv_svc -> stop_fn (priv_svc , radio_index , NULL );
820+ pub_svc -> stop_fn (pub_svc , radio_index , NULL );
821+ mesh_gw_svc -> stop_fn (mesh_gw_svc , radio_index , NULL );
818822}
819823
820- void stop_extender_vaps (void )
824+ void stop_extender_vaps (unsigned int radio_index )
821825{
822826 wifi_ctrl_t * ctrl ;
823827 vap_svc_t * ext_svc ;
824828
825829 ctrl = (wifi_ctrl_t * )get_wifictrl_obj ();
826830 ext_svc = get_svc_by_type (ctrl , vap_svc_type_mesh_ext );
827- ext_svc -> stop_fn (ext_svc , WIFI_ALL_RADIO_INDICES , NULL );
831+ ext_svc -> stop_fn (ext_svc , radio_index , NULL );
828832}
829833
830834int start_wifi_services (void )
@@ -835,8 +839,10 @@ int start_wifi_services(void)
835839
836840 if (ctrl -> network_mode == rdk_dev_mode_type_gw ) {
837841 wifi_util_info_print (WIFI_CTRL , "%s:%d start gw vaps\n" ,__func__ , __LINE__ );
838- start_radios (rdk_dev_mode_type_gw );
839- start_gateway_vaps ();
842+ for (unsigned int radio_index = 0 ; radio_index < getNumberRadios (); radio_index ++ ) {
843+ start_radios (rdk_dev_mode_type_gw , radio_index );
844+ start_gateway_vaps (radio_index );
845+ }
840846 captive_portal_check ();
841847#if !defined(NEWPLATFORM_PORT ) && !defined(_SR213_PRODUCT_REQ_ ) && \
842848 (defined(_XB10_PRODUCT_REQ_ ) || defined(_SCER11BEL_PRODUCT_REQ_ ) || defined(_SCXF11BFL_PRODUCT_REQ_ ))
@@ -846,21 +852,27 @@ int start_wifi_services(void)
846852#endif
847853
848854 } else if (ctrl -> network_mode == rdk_dev_mode_type_ext ) {
849- start_radios (rdk_dev_mode_type_ext );
850- if (is_sta_enabled ()) {
851- wifi_util_info_print (WIFI_CTRL , "%s:%d start mesh sta\n" ,__func__ , __LINE__ );
852- start_extender_vaps ();
853- } else {
854- wifi_util_info_print (WIFI_CTRL , "%s:%d mesh sta disabled\n" ,__func__ , __LINE__ );
855+ for (unsigned int radio_index = 0 ; radio_index < getNumberRadios (); radio_index ++ ) {
856+ start_radios (rdk_dev_mode_type_ext , radio_index );
857+ if (is_sta_enabled ()) {
858+ wifi_util_info_print (WIFI_CTRL , "%s:%d start mesh sta\n" , __func__ , __LINE__ );
859+ start_extender_vaps (radio_index );
860+ } else {
861+ wifi_util_info_print (WIFI_CTRL , "%s:%d mesh sta disabled\n" , __func__ , __LINE__ );
862+ }
855863 }
856864 } else if (ctrl -> network_mode == rdk_dev_mode_type_em_node ) {
857865 wifi_util_info_print (WIFI_CTRL , "%s:%d start em_mode\n" ,__func__ , __LINE__ );
858- start_radios (rdk_dev_mode_type_gw );
859- start_extender_vaps ();
866+ for (unsigned int radio_index = 0 ; radio_index < getNumberRadios (); radio_index ++ ) {
867+ start_radios (rdk_dev_mode_type_gw , radio_index );
868+ start_extender_vaps (radio_index );
869+ }
860870 } else if (ctrl -> network_mode == rdk_dev_mode_type_em_colocated_node ) {
861871 wifi_util_info_print (WIFI_CTRL , "%s:%d start em_colocated mode\n" ,__func__ , __LINE__ );
862- start_radios (rdk_dev_mode_type_gw );
863- start_gateway_vaps ();
872+ for (unsigned int radio_index = 0 ; radio_index < getNumberRadios (); radio_index ++ ) {
873+ start_radios (rdk_dev_mode_type_gw , radio_index );
874+ start_gateway_vaps (radio_index );
875+ }
864876 }
865877
866878 return RETURN_OK ;
0 commit comments