Reset all stats from wisun_tasklet.c

pull/14439/head
Debdeep Saha 2021-03-18 17:13:54 +05:30 committed by Debdeep Saha
parent 11caebcc04
commit e686f6849b
6 changed files with 3 additions and 62 deletions

View File

@ -626,16 +626,12 @@ int wisun_tasklet_statistics_start(void)
int wisun_tasklet_statistics_reset(void)
{
if (!wisun_tasklet_data_ptr || wisun_tasklet_data_ptr->network_interface_id < 0 || !mac_api) {
if (!statistics) {
return -1;
}
if (ns_sw_mac_statistics_reset(mac_api) < 0) {
return -1;
}
if (ws_statistics_reset(wisun_tasklet_data_ptr->network_interface_id) < 0) {
return -1;
}
memset(&statistics->mac_statistics, 0, sizeof(mac_statistics_t));
memset(&statistics->ws_statistics, 0, sizeof(ws_statistics_t));
return 0;
}

View File

@ -89,13 +89,6 @@ extern struct fhss_api *ns_sw_mac_get_fhss_api(struct mac_api_s *mac_api);
*/
extern int ns_sw_mac_statistics_start(struct mac_api_s *mac_api, struct mac_statistics_s *mac_statistics);
/**
* @brief Reset all statistics from software MAC.
* @param mac_api MAC instance.
* @return 0 on success, -1 on fail.
*/
extern int ns_sw_mac_statistics_reset(struct mac_api_s *mac_api);
/**
* @brief Start collecting statistics from PHY driver.
* @param mac_api MAC instance.

View File

@ -727,16 +727,6 @@ int ws_statistics_start(
int8_t interface_id,
ws_statistics_t *stats_ptr);
/**
* Reset Wi-SUN statistics.
*
* \param interface_id Network interface ID.
*
* \return 0 Success.
* \return <0 Failure.
*/
int ws_statistics_reset(int8_t interface_id);
/**
* Stop collecting Wi-SUN statistics.
*

View File

@ -434,12 +434,6 @@ int ws_statistics_start(int8_t interface_id, ws_statistics_t *stats_ptr)
return -1;
}
int ws_statistics_reset(int8_t interface_id)
{
(void) interface_id;
return -1;
}
int ws_statistics_stop(int8_t interface_id)
{
(void) interface_id;

View File

@ -49,21 +49,6 @@ int ws_statistics_stop(int8_t interface_id)
return 0;
}
int ws_statistics_reset(int8_t interface_id)
{
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
if (!cur || !ws_info(cur)) {
return -1;
}
if (cur->ws_info->stored_stats_ptr == NULL) {
/* Wi-SUN statistics is not started */
return 0;
}
cur->ws_info->stored_stats_ptr->asynch_rx_count = 0;
cur->ws_info->stored_stats_ptr->asynch_tx_count = 0;
return 0;
}
void ws_stats_update(protocol_interface_info_entry_t *cur, ws_stats_type_t type, uint32_t update_val)
{
if (!cur || !ws_info(cur)) {

View File

@ -255,23 +255,6 @@ int ns_sw_mac_statistics_start(struct mac_api_s *mac_api, struct mac_statistics_
return 0;
}
int ns_sw_mac_statistics_reset(struct mac_api_s *mac_api)
{
if (!mac_api) {
return -1;
}
protocol_interface_rf_mac_setup_s *mac_setup = get_sw_mac_ptr_by_mac_api(mac_api);
if (!mac_setup) {
return -1;
}
if (mac_setup->mac_statistics == NULL) {
/* MAC statics is not started */
return 0;
}
memset(mac_setup->mac_statistics, 0, sizeof(struct mac_statistics_s));
return 0;
}
static int8_t ns_sw_mac_initialize(mac_api_t *api, mcps_data_confirm *mcps_data_conf_cb,
mcps_data_indication *mcps_data_ind_cb, mcps_purge_confirm *mcps_purge_conf_cb,
mlme_confirm *mlme_conf_callback, mlme_indication *mlme_ind_callback, int8_t parent_id)