Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/rdkcentral/OneWifi into …
Browse files Browse the repository at this point in the history
…feature/add-vendor-specific-ie-methods
  • Loading branch information
bcarlson-dev committed Dec 17, 2024
2 parents 36016ea + a629737 commit 0f925aa
Show file tree
Hide file tree
Showing 31 changed files with 1,662 additions and 108 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
install/
*.o
*.so
.vscode/
1 change: 1 addition & 0 deletions build/linux/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ WEBCONFIG_SOURCES = $(ONE_WIFI_HOME)/source/webconfig/wifi_decoder.c \
$(ONE_WIFI_HOME)/source/webconfig/wifi_webconfig_assocdevice_stats.c \
$(ONE_WIFI_HOME)/source/webconfig/wifi_webconfig_radio_temperature.c \
$(ONE_WIFI_HOME)/source/webconfig/wifi_webconfig_radiodiag_stats.c \
$(ONE_WIFI_HOME)/source/webconfig/wifi_webconfig_multivap.c \
$(ONE_WIFI_HOME)/source/utils/wifi_util.c \

HEBUS_SOURCES = $(wildcard $(ONE_WIFI_HOME)/source/platform/linux/he_bus/src/*.c) \
Expand Down
4 changes: 2 additions & 2 deletions config/TR181-WiFi-USGv2.XML
Original file line number Diff line number Diff line change
Expand Up @@ -2871,13 +2871,13 @@ INSTMSMT_PH2 -->
<writable>true</writable>
</parameter>
<parameter>
<name>TimeInMs</name>
<name>TcmWaitTime</name>
<type>int</type>
<syntax>int</syntax>
<writable>true</writable>
</parameter>
<parameter>
<name>MinMgmtFrames</name>
<name>TcmMinMgmtFrames</name>
<type>int</type>
<syntax>int</syntax>
<writable>true</writable>
Expand Down
48 changes: 30 additions & 18 deletions config/subdoc_schemas_1_4/xfinity_subdoc_schema
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@
"BasicDataTransmitRates": "12",
"OperationalDataTransmitRates": "12,24,36,48,54",
"SupportedDataTransmitRates": "12,24,36,48,54",
"MinimumAdvertisedMCS": "3",
"TimeInMs": 150,
"MinMgmtFrames": 3,
"MinimumAdvertisedMCS": "3"
},
"TcmPreAssociationDeny": {
"TcmWaitTime": 150,
"TcmMinMgmtFrames": 3,
"TcmExpWeightage": "0.6",
"TcmGradientThreshold": "0.18"
},
Expand Down Expand Up @@ -148,9 +150,11 @@
"BasicDataTransmitRates": "12",
"OperationalDataTransmitRates": "12,24,36,48,54",
"SupportedDataTransmitRates": "12,24,36,48,54",
"MinimumAdvertisedMCS": "3",
"TimeInMs": 150,
"MinMgmtFrames": 3,
"MinimumAdvertisedMCS": "3"
},
"TcmPreAssociationDeny": {
"TcmWaitTime": 150,
"TcmMinMgmtFrames": 3,
"TcmExpWeightage": "0.6",
"TcmGradientThreshold": "0.18"
},
Expand Down Expand Up @@ -247,9 +251,11 @@
"BasicDataTransmitRates": "12",
"OperationalDataTransmitRates": "12,24,36,48,54",
"SupportedDataTransmitRates": "12,24,36,48,54",
"MinimumAdvertisedMCS": "3",
"TimeInMs": 150,
"MinMgmtFrames": 3,
"MinimumAdvertisedMCS": "3"
},
"TcmPreAssociationDeny": {
"TcmWaitTime": 150,
"TcmMinMgmtFrames": 3,
"TcmExpWeightage": "0.6",
"TcmGradientThreshold": "0.18"
},
Expand Down Expand Up @@ -348,9 +354,11 @@
"BasicDataTransmitRates": "12",
"OperationalDataTransmitRates": "12,24,36,48,54",
"SupportedDataTransmitRates": "12,24,36,48,54",
"MinimumAdvertisedMCS": "3",
"TimeInMs": 150,
"MinMgmtFrames": 3,
"MinimumAdvertisedMCS": "3"
},
"TcmPreAssociationDeny": {
"TcmWaitTime": 150,
"TcmMinMgmtFrames": 3,
"TcmExpWeightage": "0.6",
"TcmGradientThreshold": "0.18"
},
Expand Down Expand Up @@ -450,9 +458,11 @@
"OperationalDataTransmitRates": "12,24,36,48,54",
"SupportedDataTransmitRates": "12,24,36,48,54",
"MinimumAdvertisedMCS": "3",
"6GOpInfoMinRate": "",
"TimeInMs": 150,
"MinMgmtFrames": 3,
"6GOpInfoMinRate": ""
},
"TcmPreAssociationDeny": {
"TcmWaitTime": 150,
"TcmMinMgmtFrames": 3,
"TcmExpWeightage": "0.6",
"TcmGradientThreshold": "0.18"
},
Expand Down Expand Up @@ -552,9 +562,11 @@
"OperationalDataTransmitRates": "12,24,36,48,54",
"SupportedDataTransmitRates": "12,24,36,48,54",
"MinimumAdvertisedMCS": "3",
"6GOpInfoMinRate": "",
"TimeInMs": 150,
"MinMgmtFrames": 3,
"6GOpInfoMinRate": ""
},
"TcmPreAssociationDeny": {
"TcmWaitTime": 150,
"TcmMinMgmtFrames": 3,
"TcmExpWeightage": "0.6",
"TcmGradientThreshold": "0.18"
},
Expand Down
6 changes: 3 additions & 3 deletions include/webconfig_external_proto_easymesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ extern "C"
{
#endif

#include "em_base.h"

typedef unsigned int (*ext_proto_get_num_radio_t)(void *data_model);
typedef void (*ext_proto_set_num_radio_t)(void *data_model, unsigned int num_radio);
typedef unsigned int (*ext_proto_get_num_op_class_t)(void *data_model);
Expand All @@ -43,6 +41,7 @@ typedef em_sta_info_t * (*ext_proto_get_first_sta_info_t)(void *data_model, em_t
typedef em_sta_info_t * (*ext_proto_get_next_sta_info_t)(void *data_model, em_sta_info_t *sta_info, em_target_sta_map_t target);
typedef em_sta_info_t * (*ext_proto_get_sta_info_t)(void *data_model, mac_address_t sta, bssid_t bssid, mac_address_t ruid, em_target_sta_map_t target);
typedef void (*ext_proto_put_sta_info_t)(void *data_model, em_sta_info_t *sta_info, em_target_sta_map_t target);
typedef em_bss_info_t * (*ext_proto_em_get_bss_info_with_mac_t)(void *data_model, mac_address_t mac);

typedef struct {
void *data_model; /* agent data model dm_easy_mesh_t */
Expand All @@ -65,6 +64,7 @@ typedef struct {
ext_proto_get_next_sta_info_t get_next_sta_info;
ext_proto_get_sta_info_t get_sta_info;
ext_proto_put_sta_info_t put_sta_info;
ext_proto_em_get_bss_info_with_mac_t get_bss_info_with_mac;
} webconfig_external_easymesh_t;

void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *data_model, void *m2ctrl_vapconfig,
Expand All @@ -75,7 +75,7 @@ void webconfig_proto_easymesh_init(webconfig_external_easymesh_t *proto, void *d
ext_proto_em_get_radio_info_t get_radio, ext_proto_em_get_ieee_1905_security_info_t get_sec,
ext_proto_em_get_bss_info_t get_bss, ext_proto_em_get_op_class_info_t get_op_class,
ext_proto_get_first_sta_info_t get_first_sta, ext_proto_get_next_sta_info_t get_next_sta,
ext_proto_get_sta_info_t get_sta, ext_proto_put_sta_info_t put_sta);
ext_proto_get_sta_info_t get_sta, ext_proto_put_sta_info_t put_sta, ext_proto_em_get_bss_info_with_mac_t get_bss_info_with_mac);

#ifdef __cplusplus
}
Expand Down
10 changes: 10 additions & 0 deletions include/wifi_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ extern "C" {
#define WIFI_ACCESSPOINT_RM_VENDOR_IE "Device.WiFi.AccessPoint.{i}.RemoveVendorSpecificIE"

#define WIFI_ACCESSPOINT_RADIUS_CONNECTED_ENDPOINT "Device.WiFi.AccessPoint.{i}.Security.ConnectedRadiusEndpoint"
#define WIFI_ACCESSPOINT_RAWFRAME_MGMT_ACTION_TX "Device.WiFi.AccessPoint.{i}.RawFrame.Mgmt.Action.Tx"
#define WIFI_ACCESSPOINT_RAWFRAME_MGMT_ACTION_RX "Device.WiFi.AccessPoint.{i}.RawFrame.Mgmt.Action.Rx"
#define WIFI_CSI_TABLE "Device.WiFi.X_RDK_CSI.{i}."
#define WIFI_CSI_DATA "Device.WiFi.X_RDK_CSI.{i}.data"
#define WIFI_CSI_CLIENTMACLIST "Device.WiFi.X_RDK_CSI.{i}.ClientMaclist"
Expand Down Expand Up @@ -266,6 +268,14 @@ typedef enum {
whix_app_event_type_max
} whix_app_event_type_t;

typedef struct {
unsigned int ap_index;
mac_addr_t dest_addr;
unsigned int frequency;
unsigned int frame_len;
uint8_t frame_data[0];
} __attribute__((packed)) action_frame_params_t;

typedef struct {
unsigned int radio_index;
unsigned int vap_index;
Expand Down
2 changes: 2 additions & 0 deletions include/wifi_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ typedef enum {
wifi_event_type_xfinity_rrm,
wifi_event_type_collect_stats,
wifi_event_type_tcm_rfc,
wifi_event_type_send_action_frame,
wifi_event_command_max,


Expand Down Expand Up @@ -183,6 +184,7 @@ typedef enum {
wifi_event_monitor_get_radiodiag_stats,
wifi_event_monitor_get_radio_temperature,
wifi_event_monitor_set_subscribe,
wifi_event_monitor_action_frame,
wifi_event_monitor_max,

// Tunnel
Expand Down
22 changes: 22 additions & 0 deletions include/wifi_webconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ typedef enum {
webconfig_subdoc_type_assocdev_stats,
webconfig_subdoc_type_radiodiag_stats,
webconfig_subdoc_type_radio_temperature,
webconfig_subdoc_type_vap_24G,
webconfig_subdoc_type_vap_5G,
webconfig_subdoc_type_vap_6G,
webconfig_subdoc_type_radio_24G,
webconfig_subdoc_type_radio_5G,
webconfig_subdoc_type_radio_6G,
webconfig_subdoc_type_max
} webconfig_subdoc_type_t;

Expand Down Expand Up @@ -578,6 +584,22 @@ webconfig_error_t decode_radio_temperature_stats_subdoc(webconfig_t *confi
webconfig_error_t encode_radio_temperature_stats_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t translate_to_radio_temperature_stats_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t translate_from_radio_temperature_stats_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);

// Vap_24G, Vap_5G and Vap_6G
webconfig_error_t init_multivap_subdoc(webconfig_subdoc_t *doc);
webconfig_error_t access_check_multivap_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t decode_multivap_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t encode_multivap_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t translate_to_multivap_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t translate_from_multivap_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);

// Per Radio Config for 2.4G, 5G and 6G
webconfig_error_t init_single_radio_subdoc(webconfig_subdoc_t *doc);
webconfig_error_t access_check_single_radio_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t decode_single_radio_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t encode_single_radio_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t translate_to_single_radio_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
webconfig_error_t translate_from_single_radio_subdoc(webconfig_t *config, webconfig_subdoc_data_t *data);
#ifdef __cplusplus
}
#endif
Expand Down
22 changes: 17 additions & 5 deletions source/apps/analytics/wifi_analytics.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@

const char *subdoc_type_to_string(webconfig_subdoc_type_t type)
{
#define DOC2S(x) case x: return #x;
#define DOC2S(x) \
case x: \
return #x;
switch (type) {
DOC2S(webconfig_subdoc_type_private)
DOC2S(webconfig_subdoc_type_null)
Expand All @@ -45,7 +47,6 @@ const char *subdoc_type_to_string(webconfig_subdoc_type_t type)
DOC2S(webconfig_subdoc_type_mesh)
DOC2S(webconfig_subdoc_type_mesh_backhaul)
DOC2S(webconfig_subdoc_type_mesh_sta)
DOC2S(webconfig_subdoc_type_mesh_backhaul_sta)
DOC2S(webconfig_subdoc_type_lnf)
DOC2S(webconfig_subdoc_type_dml)
DOC2S(webconfig_subdoc_type_associated_clients)
Expand All @@ -56,11 +57,22 @@ const char *subdoc_type_to_string(webconfig_subdoc_type_t type)
DOC2S(webconfig_subdoc_type_harvester)
DOC2S(webconfig_subdoc_type_wifi_config)
DOC2S(webconfig_subdoc_type_csi)
DOC2S(webconfig_subdoc_type_stats_config)
DOC2S(webconfig_subdoc_type_steering_config)
DOC2S(webconfig_subdoc_type_steering_clients)
DOC2S(webconfig_subdoc_type_vif_neighbors)
DOC2S(webconfig_subdoc_type_mesh_backhaul_sta)
DOC2S(webconfig_subdoc_type_levl)
DOC2S(webconfig_subdoc_type_cac)
default:
wifi_util_error_print(WIFI_APPS,"%s:%d: event not handle[%d]\r\n",__func__, __LINE__, type);
break;
DOC2S(webconfig_subdoc_type_radio_stats)
DOC2S(webconfig_subdoc_type_neighbor_stats)
DOC2S(webconfig_subdoc_type_assocdev_stats)
DOC2S(webconfig_subdoc_type_radiodiag_stats)
DOC2S(webconfig_subdoc_type_radio_temperature)
default:
wifi_util_error_print(WIFI_APPS, "%s:%d: event not handle[%d]\r\n", __func__, __LINE__,
type);
break;
}

return "unknown subdoc";
Expand Down
3 changes: 1 addition & 2 deletions source/apps/blaster/wifi_blaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,10 +1625,9 @@ static void process_request(active_msmt_t *cfg)

if (ctrl->network_mode == rdk_dev_mode_type_ext) {
active_msmt_report_all_steps(cfg, msg, status);
mgr->ctrl.webconfig_state |= ctrl_webconfig_state_blaster_cfg_complete_rsp_pending;
}

active_msmt_log_message(BLASTER_DEBUG_LOG, "%s:%d %s\n" ,__FUNCTION__, __LINE__, msg);
mgr->ctrl.webconfig_state |= ctrl_webconfig_state_blaster_cfg_complete_rsp_pending;

pthread_mutex_unlock(&g_active_msmt->lock);
return;
Expand Down
11 changes: 6 additions & 5 deletions source/apps/sm/sm_neighbor_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ static sm_neighbor_t* neighbor_get_or_alloc(sm_neighbor_cache_t *cache, sm_neigh
return neighbor;
}


static int neighbor_convert_hal_to_sample(unsigned int radio_index, wifi_neighbor_ap2_t *hal, dpp_neighbor_record_list_t *result)
static int neighbor_convert_hal_to_sample(unsigned int radio_index, wifi_neighbor_ap2_t *hal,
dpp_neighbor_record_list_t *result, survey_type_t survey_type)
{
CHECK_NULL(hal);
CHECK_NULL(result);
Expand All @@ -137,12 +137,13 @@ static int neighbor_convert_hal_to_sample(unsigned int radio_index, wifi_neighbo
entry->lastseen = time(NULL); /* TODO: get the time of the scan ? */
entry->chanwidth = str_to_dpp_chan_width(hal->ap_OperatingChannelBandwidth);

wifi_util_dbg_print(WIFI_SM, "%s:%d: Fetched neighbor sample on %s channel %u SSID %s\n", __func__, __LINE__, radio_index_to_radio_type_str(radio_index), hal->ap_Channel, hal->ap_SSID);
wifi_util_dbg_print(WIFI_SM, "%s:%d: Fetched neighbor %s sample on %s channel %u SSID %s\n",
__func__, __LINE__, survey_type_to_str(survey_type),
radio_index_to_radio_type_str(radio_index), hal->ap_Channel, hal->ap_SSID);

return RETURN_OK;
}


static int neighbor_sample_add(sm_neighbor_cache_t *cache, survey_type_t survey_type,
unsigned int radio_index, wifi_neighbor_ap2_t *stats)
{
Expand Down Expand Up @@ -178,7 +179,7 @@ static int neighbor_sample_add(sm_neighbor_cache_t *cache, survey_type_t survey_
goto exit_err;
}

rc = neighbor_convert_hal_to_sample(radio_index, stats, sample);
rc = neighbor_convert_hal_to_sample(radio_index, stats, sample, survey_type);
if (rc != RETURN_OK) {
wifi_util_error_print(WIFI_SM, "%s:%d: failed to convert hal to sample\n", __func__, __LINE__);
goto exit_err;
Expand Down
16 changes: 11 additions & 5 deletions source/apps/sm/wifi_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,17 @@ int neighbor_response(wifi_provider_response_t *provider_response)

neighbor_ap = (wifi_neighbor_ap2_t *)provider_response->stat_pointer;

wifi_util_dbg_print(WIFI_SM,"%s:%d: radio_index : %d stats_array_size : %d\r\n",__func__, __LINE__, radio_index, provider_response->stat_array_size);

for (count = 0; count < provider_response->stat_array_size; count++) {
wifi_util_dbg_print(WIFI_SM,"%s:%d: count : %d ap_SSID : %s\r\n",__func__, __LINE__, count, neighbor_ap[count].ap_SSID);
sm_neighbor_sample_store(radio_index, survey_type, &neighbor_ap[count]);
wifi_util_dbg_print(WIFI_SM, "%s:%d: radio_index : %d stats_array_size : %d\r\n", __func__,
__LINE__, radio_index, provider_response->stat_array_size);
if (provider_response->stat_array_size == 0) {
wifi_util_dbg_print(WIFI_SM, "%s:%d: No neighbor APs found in %s on %s\r\n", __func__,
__LINE__, survey_type_to_str(survey_type), radio_index_to_radio_type_str(radio_index));
} else {
for (count = 0; count < provider_response->stat_array_size; count++) {
wifi_util_dbg_print(WIFI_SM, "%s:%d: count : %d ap_SSID : %s\r\n", __func__, __LINE__,
count, neighbor_ap[count].ap_SSID);
sm_neighbor_sample_store(radio_index, survey_type, &neighbor_ap[count]);
}
}
return RETURN_OK;
}
Expand Down
Loading

0 comments on commit 0f925aa

Please sign in to comment.