Skip to content

Commit e8567d7

Browse files
author
Juha Heiskanen
committed
MAC neighbour remove and add trace simplify.
Change-Id: I3162e511d72ed8d8830c9619bd0a11782dafaeef
1 parent 8bb4ab5 commit e8567d7

File tree

8 files changed

+19
-18
lines changed

8 files changed

+19
-18
lines changed

source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan_bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ static void lowpan_neighbor_entry_remove_notify(mac_neighbor_table_entry_t *entr
16051605
protocol_6lowpan_release_short_link_address_from_neighcache(cur_interface, entry_ptr->mac16);
16061606
protocol_6lowpan_release_long_link_address_from_neighcache(cur_interface, entry_ptr->mac64);
16071607
}
1608-
mac_helper_devicetable_remove(cur_interface->mac_api, entry_ptr->index);
1608+
mac_helper_devicetable_remove(cur_interface->mac_api, entry_ptr->index, entry_ptr->mac64);
16091609
//Removes ETX neighbor
16101610
etx_neighbor_remove(cur_interface->id, entry_ptr->index);
16111611
//Remove MLE frame counter info

source/6LoWPAN/MAC/mac_helper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ int8_t mac_helper_link_frame_counter_set(int8_t interface_id, uint32_t seq_ptr)
866866
return 0;
867867
}
868868

869-
void mac_helper_devicetable_remove(mac_api_t *mac_api, uint8_t attribute_index)
869+
void mac_helper_devicetable_remove(mac_api_t *mac_api, uint8_t attribute_index, uint8_t *mac64)
870870
{
871871
if (!mac_api) {
872872
return;
@@ -880,7 +880,7 @@ void mac_helper_devicetable_remove(mac_api_t *mac_api, uint8_t attribute_index)
880880
set_req.attr_index = attribute_index;
881881
set_req.value_pointer = (void *)&device_desc;
882882
set_req.value_size = sizeof(mlme_device_descriptor_t);
883-
tr_debug("unRegister Device");
883+
tr_debug("Unregister Device %u, mac64: %s", attribute_index, trace_array(mac64, 8));
884884
mac_api->mlme_req(mac_api, MLME_SET, &set_req);
885885
}
886886

@@ -910,7 +910,7 @@ void mac_helper_devicetable_set(const mlme_device_descriptor_t *device_desc, pro
910910
set_req.attr_index = attribute_index;
911911
set_req.value_pointer = (void *)device_desc;
912912
set_req.value_size = sizeof(mlme_device_descriptor_t);
913-
tr_debug("Register Device");
913+
tr_debug("Register Device %u, mac16 %x mac64: %s, %"PRIu32, attribute_index, device_desc->ShortAddress, trace_array(device_desc->ExtAddress, 8), device_desc->FrameCounter);
914914
cur->mac_api->mlme_req(cur->mac_api, MLME_SET, &set_req);
915915
}
916916

source/6LoWPAN/MAC/mac_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ int8_t mac_helper_link_frame_counter_read(int8_t interface_id, uint32_t *seq_ptr
115115

116116
int8_t mac_helper_link_frame_counter_set(int8_t interface_id, uint32_t seq_ptr);
117117

118-
void mac_helper_devicetable_remove(struct mac_api_s *mac_api, uint8_t attribute_index);
118+
void mac_helper_devicetable_remove(struct mac_api_s *mac_api, uint8_t attribute_index, uint8_t *mac64);
119119

120120
void mac_helper_device_description_write(struct protocol_interface_info_entry *cur, mlme_device_descriptor_t *device_desc, uint8_t *mac64, uint16_t mac16, uint32_t frame_counter, bool exempt);
121121

source/6LoWPAN/Thread/thread_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,7 @@ void thread_reset_neighbour_info(protocol_interface_info_entry_t *cur, mac_neigh
20152015
thread_routing_remove_link(cur, neighbour->mac16);
20162016
thread_router_bootstrap_reset_child_info(cur, neighbour);
20172017
protocol_6lowpan_release_long_link_address_from_neighcache(cur, neighbour->mac64);
2018-
mac_helper_devicetable_remove(cur->mac_api, neighbour->index);
2018+
mac_helper_devicetable_remove(cur->mac_api, neighbour->index, neighbour->mac64);
20192019
thread_neighbor_class_entry_remove(&cur->thread_info->neighbor_class, neighbour->index);
20202020
}
20212021

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ mac_neighbor_table_entry_t *ws_bootstrap_mac_neighbor_add(struct protocol_interf
123123
return neighbor;
124124
}
125125

126-
static void ws_bootstrap_neighbor_delete(struct protocol_interface_info_entry *interface, uint8_t attribute_index)
126+
static void ws_bootstrap_neighbor_delete(struct protocol_interface_info_entry *interface, mac_neighbor_table_entry_t *entry_ptr)
127127
{
128-
mac_helper_devicetable_remove(interface->mac_api, attribute_index);
129-
etx_neighbor_remove(interface->id, attribute_index);
130-
ws_neighbor_class_entry_remove(&interface->ws_info->neighbor_storage, attribute_index);
128+
mac_helper_devicetable_remove(interface->mac_api, entry_ptr->index, entry_ptr->mac64);
129+
etx_neighbor_remove(interface->id, entry_ptr->index);
130+
ws_neighbor_class_entry_remove(&interface->ws_info->neighbor_storage, entry_ptr->index);
131131
}
132132

133133
static void ws_bootstrap_neighbor_list_clean(struct protocol_interface_info_entry *interface)
@@ -1394,7 +1394,7 @@ static void ws_neighbor_entry_remove_notify(mac_neighbor_table_entry_t *entry_pt
13941394
//NUD Process Clear Here
13951395
ws_nud_entry_remove(cur, entry_ptr);
13961396

1397-
ws_bootstrap_neighbor_delete(cur, entry_ptr->index);
1397+
ws_bootstrap_neighbor_delete(cur, entry_ptr);
13981398
}
13991399

14001400
static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr, void *user_data)

source/MAC/IEEE802_15_4/mac_security_mib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static void mac_sec_mib_key_device_description_remove_from_list(mlme_key_descrip
126126
*prev = *cur;
127127
} else if (cur->DeviceDescriptorHandle == device_descriptor_handle) {
128128
removed_entry = true;
129-
tr_debug("Remove user %u from key", device_descriptor_handle);
129+
//tr_debug("Remove user %u from key", device_descriptor_handle);
130130
}
131131
prev = cur;
132132
cur++;
@@ -244,10 +244,10 @@ int8_t mac_sec_mib_device_description_set(uint8_t atribute_index, mlme_device_de
244244
if (memcmp(device_ptr->ExtAddress, device_descriptor->ExtAddress, 8)) {
245245
//Remove last handles key user's
246246
mac_sec_mib_device_description_remove(rf_mac_setup, atribute_index);
247-
tr_debug("Over write %u, mac16 %x mac64: %s, %"PRIu32, atribute_index, device_ptr->ShortAddress, trace_array(device_ptr->ExtAddress, 8), device_ptr->FrameCounter);
247+
//tr_debug("Over write %u, mac16 %x mac64: %s, %"PRIu32, atribute_index, device_ptr->ShortAddress, trace_array(device_ptr->ExtAddress, 8), device_ptr->FrameCounter);
248248
}
249249

250-
tr_debug("Set %u, mac16 %x mac64: %s, %"PRIu32, atribute_index, device_descriptor->ShortAddress, trace_array(device_descriptor->ExtAddress, 8), device_descriptor->FrameCounter);
250+
//tr_debug("Set %u, mac16 %x mac64: %s, %"PRIu32, atribute_index, device_descriptor->ShortAddress, trace_array(device_descriptor->ExtAddress, 8), device_descriptor->FrameCounter);
251251

252252
*device_ptr = *device_descriptor;
253253
return 0;
@@ -485,7 +485,7 @@ void mac_sec_mib_device_description_blacklist(protocol_interface_rf_mac_setup_s
485485
for (uint8_t i = 0; i < rf_mac_setup->key_description_table_size; i++) {
486486
descriptor = mac_sec_mib_key_device_description_discover_from_list(&rf_mac_setup->key_description_table[i], device_handle);
487487
if (descriptor) {
488-
tr_debug("Black listed device %u lookup%s", device_handle, trace_array(rf_mac_setup->key_description_table[i].Key, 16));
488+
tr_debug("Black listed device %u", device_handle);
489489
descriptor->Blacklisted = true;
490490
}
491491

test/nanostack/unittest/6lp_mac/mac_helper/test_mac_helper.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,11 @@ bool test_mac_helper_devicetable_remove()
839839
{
840840
mac_api_t api;
841841
api.mlme_req = &mlme_req;
842+
uint8_t mac64[8];
842843

843-
mac_helper_devicetable_remove(NULL, 0);
844+
mac_helper_devicetable_remove(NULL, 0, mac64);
844845

845-
mac_helper_devicetable_remove(&api, 0);
846+
mac_helper_devicetable_remove(&api, 0, mac64);
846847
return true;
847848
}
848849

test/nanostack/unittest/stub/mac_helper_stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ int8_t mac_helper_security_pairwisekey_set(protocol_interface_info_entry_t *inte
239239
return mac_helper_stub.int8_value;
240240
}
241241

242-
void mac_helper_devicetable_remove(struct mac_api_s *mac_api, uint8_t attribute_index)
242+
void mac_helper_devicetable_remove(struct mac_api_s *mac_api, uint8_t attribute_index, uint8_t *mac64)
243243
{
244244

245245
}

0 commit comments

Comments
 (0)