Skip to content

Commit

Permalink
MAC, RPL and ETX trace clean.
Browse files Browse the repository at this point in the history
Change-Id: I4bdf63e277b2301bf779483b116b63e2f65f4d91
  • Loading branch information
Juha Heiskanen committed Jul 4, 2019
1 parent eaf8907 commit da5d2c7
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 49 deletions.
1 change: 0 additions & 1 deletion source/MAC/IEEE802_15_4/mac_indirect_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ uint8_t mac_indirect_data_req_handle(mac_pre_parsed_frame_t *buf, protocol_inter

/* If the Ack we sent for the Data Request didn't have frame pending set, we shouldn't transmit - child may have slept */
if (!buf->ack_pendinfg_status) {
//tr_debug("Drop by pending");
if (mac_ptr->indirect_pd_data_request_queue) {
tr_error("Wrongly dropped");
}
Expand Down
14 changes: 0 additions & 14 deletions source/MAC/IEEE802_15_4/mac_mcps_sap.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ void mcps_sap_data_req_handler_ext(protocol_interface_rf_mac_setup_s *rf_mac_set

if (!rf_mac_setup->macUpState || rf_mac_setup->scan_active) {
status = MLME_TRX_OFF;
tr_debug("Drop MAC tx packet when mac disabled");
goto verify_status;
}

Expand Down Expand Up @@ -616,11 +615,6 @@ static uint8_t mac_data_interface_decrypt_packet(mac_pre_parsed_frame_t *b, mlme
ccm_ptr.data_ptr = (mcps_mac_payload_pointer_get(b) + openPayloadLength);
ccm_ptr.data_len = b->mac_payload_length - openPayloadLength;
if (ccm_process_run(&ccm_ptr) != 0) {
tr_warning("MIC Fail adata %s", trace_array(ccm_ptr.adata_ptr, ccm_ptr.adata_len));
tr_warning("Nonce %s", trace_array(ccm_ptr.exp_nonce, 13));
if (openPayloadLength) {
tr_warning("%s", tr_array(ccm_ptr.data_ptr, ccm_ptr.data_len));
}
return MLME_SECURITY_FAIL;
}

Expand Down Expand Up @@ -662,7 +656,6 @@ static void mcps_comm_status_indication_generate(uint8_t status, mac_pre_parsed_
static int8_t mac_data_interface_host_accept_data(mcps_data_ind_t *data_ind, protocol_interface_rf_mac_setup_s *rf_mac_setup)
{
if ((data_ind->DstAddrMode == MAC_ADDR_MODE_16_BIT) && (data_ind->DstAddr[0] == 0xff && data_ind->DstAddr[1] == 0xff)) {
tr_debug("Drop Multicast packet");
return -1;
}

Expand Down Expand Up @@ -723,7 +716,6 @@ static int8_t mac_data_sap_rx_handler(mac_pre_parsed_frame_t *buf, protocol_inte
}

if (!mac_payload_information_elements_parse(buf)) {
tr_debug("Drop by Paylod IE");
goto DROP_PACKET;
}
data_ind->msduLength = buf->mac_payload_length;
Expand All @@ -741,7 +733,6 @@ static int8_t mac_data_sap_rx_handler(mac_pre_parsed_frame_t *buf, protocol_inte

if (buf->fcf_dsn.frameVersion == MAC_FRAME_VERSION_2015) {
if (!rf_mac_setup->mac_extension_enabled) {
tr_debug("No Ext reg");
goto DROP_PACKET;
}
mcps_data_ie_list_t ie_list;
Expand Down Expand Up @@ -903,7 +894,6 @@ static void mac_data_interface_parse_beacon(mac_pre_parsed_frame_t *buf, protoco
}

if (!mac_payload_information_elements_parse(buf)) {
tr_debug("Drop by Paylod IE");
return;
}

Expand All @@ -924,7 +914,6 @@ static void mac_data_interface_parse_beacon(mac_pre_parsed_frame_t *buf, protoco
if (len < gts_field_length) {
return;
}
// gts_info = ptr;
len -= gts_field_length;
ptr += gts_field_length;
}
Expand Down Expand Up @@ -979,7 +968,6 @@ static void mac_data_interface_frame_handler(mac_pre_parsed_frame_t *buf)
{
protocol_interface_rf_mac_setup_s *rf_mac_setup = buf->mac_class_ptr;
if (!rf_mac_setup) {
tr_debug("Drop by no mac class");
mcps_sap_pre_parsed_frame_buffer_free(buf);
return;
}
Expand Down Expand Up @@ -1084,13 +1072,11 @@ static int8_t mac_ack_sap_rx_handler(mac_pre_parsed_frame_t *buf, protocol_inter
if (buf->fcf_dsn.securityEnabled) {
uint8_t status = mac_data_interface_decrypt_packet(buf, &key);
if (status != MLME_SUCCESS) {
tr_debug("ACK Decrypt fail");
return -1;
}
}

if (buf->mac_payload_length && !mac_payload_information_elements_parse(buf)) {
tr_debug("Drop ACK by Paylod IE");
return -1;
}

Expand Down
11 changes: 0 additions & 11 deletions source/MAC/IEEE802_15_4/mac_mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ uint8_t mac_mlme_beacon_req_tx(protocol_interface_rf_mac_setup_s *rf_ptr)
buf->fcf_dsn.DstPanPresents = true;
buf->fcf_dsn.SrcPanPresents = false;

tr_debug("BEA REQ tx");
mcps_sap_pd_req_queue_write(rf_ptr, buf);
return 1;
}
Expand Down Expand Up @@ -843,7 +842,6 @@ static void mlme_scan_operation(protocol_interface_rf_mac_setup_s *rf_mac_setup)
channel = mlme_scan_analyze_next_channel(&rf_mac_setup->mac_channel_list, true);
if (channel > 0xff || rf_mac_setup->mac_mlme_scan_resp->ResultListSize == MLME_MAC_RES_SIZE_MAX) {
resp->status = MLME_SUCCESS;
tr_debug("Scan Complete..Halt MAC");
platform_enter_critical();
mac_mlme_mac_radio_disabled(rf_mac_setup);
if (resp->ResultListSize == 0 && rf_mac_setup->scan_type == MAC_ACTIVE_SCAN) {
Expand All @@ -855,7 +853,6 @@ static void mlme_scan_operation(protocol_interface_rf_mac_setup_s *rf_mac_setup)
platform_exit_critical();
//Scan Confirmation
mac_generic_event_trig(MAC_MLME_SCAN_CONFIRM_HANDLER, rf_mac_setup, false);
tr_debug("Trig confirm");
rf_mac_setup->scan_active = false;
} else {
mac_mlme_scan_init((uint8_t) channel, rf_mac_setup);
Expand Down Expand Up @@ -987,20 +984,17 @@ static void mac_mlme_free_scan_temporary_data(protocol_interface_rf_mac_setup_s
rf_mac_setup->scan_active = false;
if (rf_mac_setup->mac_mlme_scan_resp) {
mlme_scan_conf_t *r = rf_mac_setup->mac_mlme_scan_resp;
tr_debug("%02x", r->ResultListSize);
if (r->ED_values) {
ns_dyn_mem_free(r->ED_values);
r->ED_values = NULL;
}
uint8_t i = 0;
while (i < r->ResultListSize) {
if (r->PAN_values[i]) {
tr_debug("Free PAN result");
ns_dyn_mem_free(r->PAN_values[i]);
}
i++;
}
tr_debug("Free Response");
ns_dyn_mem_free(rf_mac_setup->mac_mlme_scan_resp);
rf_mac_setup->mac_mlme_scan_resp = NULL;
}
Expand Down Expand Up @@ -1399,11 +1393,6 @@ static void mac_mlme_start_confirm_handler(protocol_interface_rf_mac_setup_s *rf

static void mac_mlme_scan_confirm_handler(protocol_interface_rf_mac_setup_s *rf_ptr, const mlme_scan_conf_t *conf)
{
if (conf->ScanType == MAC_ACTIVE_SCAN) {
tr_debug("Active Scan Result");
} else if (conf->ScanType == MAC_ED_SCAN_TYPE) {
tr_debug("ED Scan Result");
}
if (rf_ptr->tun_extension_rf_driver) {
virtual_data_req_t scan_conf;
uint8_t buf_temp[2];
Expand Down
4 changes: 0 additions & 4 deletions source/RPL/rpl_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,6 @@ static void rpl_control_dao_trigger_request(rpl_instance_t *instance, rpl_dodag_
static buffer_t *rpl_control_dio_handler(protocol_interface_info_entry_t *cur, rpl_domain_t *domain, buffer_t *buf)
{
if (!rpl_control_options_well_formed_in_buffer(buf, 24)) {
tr_error("DIO format");
malformed:
protocol_stats_update(STATS_RPL_MALFORMED_MESSAGE, 1);
return buffer_free(buf);
Expand Down Expand Up @@ -1268,7 +1267,6 @@ void rpl_control_transmit_dio(rpl_domain_t *domain, protocol_interface_info_entr
static buffer_t *rpl_control_dis_handler(protocol_interface_info_entry_t *cur, rpl_domain_t *domain, buffer_t *buf, bool multicast)
{
if (!rpl_control_options_well_formed_in_buffer(buf, 2)) {
tr_error("DIS format");
protocol_stats_update(STATS_RPL_MALFORMED_MESSAGE, 1);
return buffer_free(buf);
}
Expand Down Expand Up @@ -1396,7 +1394,6 @@ static buffer_t *rpl_control_dao_ack_handler(protocol_interface_info_entry_t *cu

if (buffer_data_length(buf) < 4) {
format_error:
tr_error("DAO-ACK format");
protocol_stats_update(STATS_RPL_MALFORMED_MESSAGE, 1);
return buffer_free(buf);
}
Expand Down Expand Up @@ -1480,7 +1477,6 @@ static buffer_t *rpl_control_dao_handler(protocol_interface_info_entry_t *cur, r
{
if (buffer_data_length(buf) < 4) {
format_error:
tr_error("DAO format");
protocol_stats_update(STATS_RPL_MALFORMED_MESSAGE, 1);
return buffer_free(buf);
}
Expand Down
2 changes: 1 addition & 1 deletion source/RPL/rpl_downward.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ void rpl_instance_dao_trigger(rpl_instance_t *instance, uint16_t delay)
}
if (instance->delay_dao_timer == 0 || instance->delay_dao_timer > delay) {
instance->delay_dao_timer = delay;
tr_debug("DAO trigger %" PRIu16, delay);
//tr_debug("DAO trigger %" PRIu16, delay);
}
}

Expand Down
15 changes: 2 additions & 13 deletions source/Service_Libs/etx/etx.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static bool etx_update_possible(etx_sample_storage_t *storage, etx_storage_t *en
}
}

tr_debug("ETX update possible %u attempts, %u rx ack", storage->attempts_count, storage->received_acks);
//tr_debug("ETX update possible %u attempts, %u rx ack", storage->attempts_count, storage->received_acks);

return true;

Expand Down Expand Up @@ -318,9 +318,6 @@ uint16_t etx_read(int8_t interface_id, addrtype_t addr_type, const uint8_t *addr
}
attribute_index = mac_neighbor->index;


//tr_debug("Etx Read from atribute %u", attribute_index);

etx_storage_t *entry = etx_storage_entry_get(interface_id, attribute_index);

if (!entry) {
Expand All @@ -330,8 +327,6 @@ uint16_t etx_read(int8_t interface_id, addrtype_t addr_type, const uint8_t *addr
uint16_t etx = etx_current_calc(entry->etx, entry->accumulated_failures);
etx >>= 4;

//tr_debug("Etx value %u", etx);

return etx;
}

Expand Down Expand Up @@ -632,7 +627,6 @@ void etx_max_update_set(uint16_t etx_max_update)
etx_storage_t *etx_storage_entry_get(int8_t interface_id, uint8_t attribute_index)
{
if (etx_info.interface_id != interface_id || !etx_info.etx_storage_list || attribute_index >= etx_info.ext_storage_list_size) {
//tr_debug("Unknow ID or un initilized ETX %u", attribute_index);
return NULL;
}

Expand Down Expand Up @@ -804,12 +798,7 @@ void etx_cache_timer(int8_t interface_id, uint16_t seconds_update)
}

protocol_interface_info_entry_t *interface = protocol_stack_interface_info_get_by_id(interface_id);
if (!interface) {
return;
}


if (!mac_neighbor_info(interface)) {
if (!interface || !mac_neighbor_info(interface)) {
return;
}

Expand Down
5 changes: 0 additions & 5 deletions source/Service_Libs/mac_neighbor_table/mac_neighbor_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "Core/include/ns_address_internal.h"
#include "platform/topo_trace.h"

#define TRACE_GROUP "mnei"

mac_neighbor_table_t *mac_neighbor_table_create(uint8_t table_size, neighbor_entry_remove_notify *remove_cb, neighbor_entry_nud_notify *nud_cb, void *user_indentifier)
{
mac_neighbor_table_t *table_class = ns_dyn_mem_alloc(sizeof(mac_neighbor_table_t) + sizeof(mac_neighbor_table_entry_t) * table_size);
Expand Down Expand Up @@ -111,11 +109,9 @@ void mac_neighbor_table_neighbor_timeout_update(mac_neighbor_table_t *table_clas
if (table_class->user_nud_notify_cb(cur, table_class->table_user_identifier)) {
table_class->active_nud_process++;
cur->nud_active = true;
//tr_debug("Nud started index %u : %"PRIu32" time ", cur->index, cur->lifetime);
}

} else {
tr_debug("Node index %u time out ", cur->index);
neighbor_table_class_remove_entry(table_class, cur);
}
}
Expand Down Expand Up @@ -176,7 +172,6 @@ void mac_neighbor_table_neighbor_refresh(mac_neighbor_table_t *table_class, mac_
neighbor_entry->lifetime = life_time;
neighbor_entry->link_lifetime = life_time;
if (neighbor_entry->nud_active) {
//tr_debug("Node index NUD response %u : %"PRIu32" time ", neighbor_entry->index, neighbor_entry->lifetime);
neighbor_entry->nud_active = false;
table_class->active_nud_process--;
}
Expand Down

0 comments on commit da5d2c7

Please sign in to comment.