Skip to content

Commit 710da57

Browse files
committed
RDKB-58244: SMApp update based on status of the Mesh.Enable and HCM
Reason for change: SMApp continues to run when Mesh is disabled. Test Procedure: 1. Disable getv Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.Mesh.Enable and Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MeshWifiOptimization.Mode 2. Check if SM_APP is still running. Risks: Low Priority: P2 Signed-off-by: Maksym Holovatyi <[email protected]>
1 parent b826b47 commit 710da57

File tree

6 files changed

+51
-2
lines changed

6 files changed

+51
-2
lines changed

include/wifi_events.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ typedef enum {
183183
wifi_event_monitor_get_radio_temperature,
184184
wifi_event_monitor_set_subscribe,
185185
wifi_event_monitor_action_frame,
186+
wifi_event_type_sm_app_enable,
186187
wifi_event_monitor_max,
187188

188189
// Tunnel

source/apps/sm/wifi_sm.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ typedef struct {
4343
unsigned int req_stats_vap_mask;
4444
} client_assoc_stats_t;
4545

46+
static int sm_stats_to_monitor_set(wifi_app_t *app, bool enable);
47+
4648
client_assoc_stats_t client_assoc_stats[MAX_NUM_RADIOS];
4749

4850
int sm_survey_type_conversion(wifi_neighborScanMode_t *halw_scan_type, survey_type_t *app_stat_type, unsigned int conv_type)
@@ -556,7 +558,7 @@ int handle_sm_command_event(wifi_app_t *app, wifi_event_t *event)
556558
wifi_mgr_t *g_wifi_mgr = get_wifimgr_obj();
557559
stats_config_t *cur_stats_cfg = NULL;
558560
hash_map_t *cur_app_stats_cfg_map = app->data.u.sm_data.sm_stats_config_map;
559-
bool off_scan_rfc = g_wifi_mgr->rfc_dml_parameters.wifi_offchannelscan_sm_rfc;
561+
bool *sm_app_enable, off_scan_rfc = g_wifi_mgr->rfc_dml_parameters.wifi_offchannelscan_sm_rfc;
560562

561563
wifi_util_dbg_print(WIFI_SM, "inside %s:%d off_scan_rfc:%d\n",__func__, __LINE__,off_scan_rfc);
562564
if (event->sub_type == wifi_event_type_wifi_offchannelscan_sm_rfc )
@@ -584,6 +586,18 @@ int handle_sm_command_event(wifi_app_t *app, wifi_event_t *event)
584586
}
585587
}
586588
}
589+
else if (event->sub_type == wifi_event_type_sm_app_enable)
590+
{
591+
sm_app_enable = event->u.core_data.msg;
592+
if (sm_app_enable)
593+
{
594+
sm_stats_to_monitor_set(app, *sm_app_enable);
595+
}
596+
else
597+
{
598+
wifi_util_error_print(WIFI_SM, "inside %s:%d sub_type: wifi_event_type_sm_app_enable sm_app_enable=NULL\n",__func__, __LINE__);
599+
}
600+
}
587601
return RETURN_OK;
588602
}
589603

@@ -771,7 +785,7 @@ int sm_event(wifi_app_t *app, wifi_event_t *event)
771785
monitor_event_sm(app, event);
772786
break;
773787
case wifi_event_type_command:
774-
handle_sm_command_event(app,event);
788+
handle_sm_command_event(app, event);
775789
break;
776790
default:
777791
break;

source/core/wifi_ctrl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ extern "C" {
9090

9191
#define WIFI_WEBCONFIG_KICK_MAC "Device.WiFi.KickAssocDevices"
9292
#define BUS_WIFI_WPS_PIN_START "Device.WiFi.WPS.Start"
93+
#define BUS_SM_APP_ENABLE "Device.X_RDK_MeshAgent.SM_APP.Enable"
9394

9495
#define ETH_BH_STATUS "Device.X_RDK_MeshAgent.EthernetBhaulUplink.Status"
9596

@@ -242,6 +243,7 @@ typedef struct wifi_ctrl {
242243
bool frame_802_11_injector_subscribed;
243244
bool factory_reset;
244245
bool marker_list_config_subscribed;
246+
bool sm_app_enable_subscribed;
245247
bool eth_bh_status_subscribed;
246248
wifiapi_t wifiapi;
247249
wifi_rfc_dml_parameters_t rfc_params;

source/core/wifi_ctrl_queue_handlers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3183,6 +3183,7 @@ void handle_command_event(wifi_ctrl_t *ctrl, void *data, unsigned int len,
31833183
case wifi_event_type_start_inst_msmt:
31843184
case wifi_event_type_stop_inst_msmt:
31853185
case wifi_event_type_xfinity_rrm:
3186+
case wifi_event_type_sm_app_enable:
31863187
// not handle here
31873188
break;
31883189
default:

source/core/wifi_ctrl_rbus_handlers.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,23 @@ static void frame_802_11_injector_Handler(char *event_name, raw_data_t *p_data)
13091309
}
13101310
}
13111311

1312+
static void sm_app_enable_Handler(char *event_name, raw_data_t *p_data)
1313+
{
1314+
bool sm_app_enable;
1315+
1316+
wifi_util_dbg_print(WIFI_CTRL, "%s:%d Recvd Event\n", __func__, __LINE__);
1317+
1318+
if((strcmp(event_name, BUS_SM_APP_ENABLE) != 0) || (p_data->data_type != bus_data_type_boolean)) {
1319+
wifi_util_error_print(WIFI_CTRL,"%s:%d Invalid event received,%s:%x\n", __func__, __LINE__, event_name, p_data->data_type);
1320+
return;
1321+
}
1322+
1323+
sm_app_enable = p_data->raw_data.b;
1324+
1325+
push_event_to_ctrl_queue(&sm_app_enable, sizeof(sm_app_enable), wifi_event_type_command,
1326+
wifi_event_type_sm_app_enable, NULL);
1327+
}
1328+
13121329
static void wps_test_event_receive_handler(char *event_name, raw_data_t *p_data)
13131330
{
13141331
uint32_t vap_index = 0;
@@ -1601,6 +1618,19 @@ void bus_subscribe_events(wifi_ctrl_t *ctrl)
16011618
}
16021619
}
16031620

1621+
if (ctrl->sm_app_enable_subscribed == false) {
1622+
if (bus_desc->bus_event_subs_fn(&ctrl->handle, BUS_SM_APP_ENABLE, sm_app_enable_Handler, NULL,
1623+
0) != bus_error_success) {
1624+
// wifi_util_dbg_print(WIFI_CTRL, "%s:%d bus: bus event:%s subscribe failed\n",
1625+
// __FUNCTION__,
1626+
// __LINE__, BUS_SM_APP_ENABLE);
1627+
} else {
1628+
ctrl->sm_app_enable_subscribed = true;
1629+
wifi_util_info_print(WIFI_CTRL, "%s:%d bus: bus event:%s subscribe success\n",
1630+
__FUNCTION__, __LINE__, BUS_SM_APP_ENABLE);
1631+
}
1632+
}
1633+
16041634
#if defined(RDKB_EXTENDER_ENABLED)
16051635
if (ctrl->eth_bh_status_subscribed == false) {
16061636
if (bus_desc->bus_event_subs_fn(&ctrl->handle, ETH_BH_STATUS, eth_bh_status_handler, NULL,

source/core/wifi_events.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ const char *wifi_event_subtype_to_string(wifi_event_subtype_t type)
147147
DOC2S(wifi_event_type_xfinity_rrm)
148148
DOC2S(wifi_event_type_collect_stats)
149149
DOC2S(wifi_event_type_send_action_frame)
150+
DOC2S(wifi_event_type_sm_app_enable)
150151
DOC2S(wifi_event_command_max)
151152
DOC2S(wifi_event_monitor_diagnostics)
152153
DOC2S(wifi_event_monitor_connect)

0 commit comments

Comments
 (0)