Skip to content

Commit d9976cf

Browse files
author
Jarkko Paso
committed
Merge branch 'master' into release_internal
* master: (35 commits) RPL parent update handle update Fixed Ifdown / UP sequence and and discovery state set own hop to 0xff. Fixed dwell time, clock drift and timing accuracy values Wi-sun BBR Slaac Ula support fix Modified advertisiement trickle handling to remove congestion Added storing of all MAC frame counters to NVM MAC ACK handler update: Added adaptation layer TX queue size statistic MAC update: MAC security update: Added skipping of fragment length to EAP-TLS protocol and other improvements Wi-sun Discovery update: DHCPv6 Client and Server update Corrected skipping of other elements than KDEs on EAPOL key frames Removed RPL version number increment. RPL parent select update Corrected setting of test GTK on supplicant Do not balck list neighbour if link fail to ARO. Wi-sun RPL candidate accept update fixed bbr for ULA prefix to real prefix change ...
2 parents f598339 + 0a6fb58 commit d9976cf

File tree

80 files changed

+2604
-864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2604
-864
lines changed

nanostack/mlme.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ typedef enum {
264264
macAutoRequestKeyIndex = 0x7b, /*<The index of the key used for automatic data*/
265265
macDefaultKeySource = 0x7c, /*<Default key source*/
266266
//NON standard extension
267+
macDeviceDescriptionPanIDUpdate = 0xf7, /*<Thread pending link update case this will update device descrioton list pan-id to new one*/
267268
macTXPower = 0xf8, /*<TX output power*/
268269
macCCAThreshold = 0xf9, /*<CCA threshold*/
269270
macMultiCSMAParameters = 0xfa, /*<Multi CSMA parameters*/

nanostack/nwk_stats_api.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ typedef struct nwk_stats_t {
7070
/* ETX */
7171
uint16_t etx_1st_parent; /**< Primary parent ETX. */
7272
uint16_t etx_2nd_parent; /**< Secondary parent ETX. */
73-
73+
/* MAC */
74+
uint16_t adapt_layer_tx_queue_size; /**< Adaptation layer direct TX queue size. */
75+
uint16_t adapt_layer_tx_queue_peak; /**< Adaptation layer direct TX queue size peak. */
7476
} nwk_stats_t;
7577

7678
/**

nanostack/ws_management_api.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ extern "C" {
7979
#define NETWORK_SIZE_SMALL 0x01
8080
#define NETWORK_SIZE_MEDIUM 0x08
8181
#define NETWORK_SIZE_LARGE 0x10
82+
#define NETWORK_SIZE_CERTIFICATE 0xFF
8283

8384

8485
/** Temporary API change flag. this will be removed when new version of API is implemented on applications
@@ -246,9 +247,10 @@ int ws_management_fhss_timing_configure(
246247
* Change the default configuration for Wi-SUN FHSS operation.
247248
* if application defined is used the behaviour is undefined
248249
*
250+
*
249251
* \param interface_id Network interface ID.
250252
* \param channel_function Unicast channel function.
251-
* \param fixed_channel Used channel when channel function is fixed channel. If 0xFFFF, randomly chosen channel is used.
253+
* \param fixed_channel Used channel when channel function is fixed channel.
252254
* \param dwell_interval Used dwell interval when channel function is TR51 or DH1.
253255
*
254256
* \return 0, Init OK.
@@ -266,9 +268,10 @@ int ws_management_fhss_unicast_channel_function_configure(
266268
* Change the default configuration for Wi-SUN FHSS operation.
267269
* if application defined is used the behaviour is undefined
268270
*
271+
*
269272
* \param interface_id Network interface ID.
270273
* \param channel_function Broadcast channel function.
271-
* \param fixed_channel Used channel when channel function is fixed channel. If 0xFFFF, randomly chosen channel is used.
274+
* \param fixed_channel Used channel when channel function is fixed channel.
272275
* \param dwell_interval Broadcast channel dwell interval.
273276
* \param broadcast_interval Broadcast interval.
274277
*

source/6LoWPAN/MAC/mac_helper.c

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -834,20 +834,41 @@ int8_t mac_helper_link_frame_counter_read(int8_t interface_id, uint32_t *seq_ptr
834834
{
835835
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
836836

837+
if (!cur || !cur->mac_api || !seq_ptr) {
838+
return -1;
839+
}
840+
841+
return mac_helper_key_link_frame_counter_read(interface_id, seq_ptr, cur->mac_parameters->mac_default_key_attribute_id);
842+
}
843+
844+
int8_t mac_helper_link_frame_counter_set(int8_t interface_id, uint32_t seq_ptr)
845+
{
846+
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
847+
848+
if (!cur || !cur->mac_api) {
849+
return -1;
850+
}
851+
852+
return mac_helper_key_link_frame_counter_set(interface_id, seq_ptr, cur->mac_parameters->mac_default_key_attribute_id);
853+
}
854+
855+
int8_t mac_helper_key_link_frame_counter_read(int8_t interface_id, uint32_t *seq_ptr, uint8_t descriptor)
856+
{
857+
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
858+
837859
if (!cur || !cur->mac_api || !seq_ptr) {
838860
return -1;
839861
}
840862
mlme_get_t get_req;
841863
get_req.attr = macFrameCounter;
842-
get_req.attr_index = cur->mac_parameters->mac_default_key_attribute_id;
864+
get_req.attr_index = descriptor;
843865
cur->mac_api->mlme_req(cur->mac_api, MLME_GET, &get_req);
844866
*seq_ptr = cur->mac_parameters->security_frame_counter;
845867

846868
return 0;
847869
}
848870

849-
850-
int8_t mac_helper_link_frame_counter_set(int8_t interface_id, uint32_t seq_ptr)
871+
int8_t mac_helper_key_link_frame_counter_set(int8_t interface_id, uint32_t seq_ptr, uint8_t descriptor)
851872
{
852873
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
853874

@@ -856,7 +877,7 @@ int8_t mac_helper_link_frame_counter_set(int8_t interface_id, uint32_t seq_ptr)
856877
}
857878
mlme_set_t set_req;
858879
set_req.attr = macFrameCounter;
859-
set_req.attr_index = cur->mac_parameters->mac_default_key_attribute_id;
880+
set_req.attr_index = descriptor;
860881
set_req.value_pointer = &seq_ptr;
861882
set_req.value_size = 4;
862883
cur->mac_api->mlme_req(cur->mac_api, MLME_SET, &set_req);
@@ -929,3 +950,20 @@ int8_t mac_helper_mac_mlme_max_retry_set(int8_t interface_id, uint8_t mac_retry_
929950

930951
return 0;
931952
}
953+
954+
955+
int8_t mac_helper_mac_device_description_pan_id_update(int8_t interface_id, uint16_t pan_id)
956+
{
957+
protocol_interface_info_entry_t *cur;
958+
cur = protocol_stack_interface_info_get_by_id(interface_id);
959+
if (!cur || !cur->mac_api) {
960+
return -1;
961+
}
962+
mlme_set_t set_req;
963+
set_req.attr = macDeviceDescriptionPanIDUpdate;
964+
set_req.attr_index = 0;
965+
set_req.value_pointer = &pan_id;
966+
set_req.value_size = sizeof(pan_id);
967+
cur->mac_api->mlme_req(cur->mac_api, MLME_SET, &set_req);
968+
return 0;
969+
}

source/6LoWPAN/MAC/mac_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,17 @@ 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+
int8_t mac_helper_key_link_frame_counter_read(int8_t interface_id, uint32_t *seq_ptr, uint8_t descriptor);
119+
120+
int8_t mac_helper_key_link_frame_counter_set(int8_t interface_id, uint32_t seq_ptr, uint8_t descriptor);
121+
118122
void mac_helper_devicetable_remove(struct mac_api_s *mac_api, uint8_t attribute_index, uint8_t *mac64);
119123

120124
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);
121125

122126
void mac_helper_devicetable_set(const mlme_device_descriptor_t *device_dec, struct protocol_interface_info_entry *cur, uint8_t attribute_index, uint8_t keyID, bool force_set);
123127
int8_t mac_helper_mac_mlme_max_retry_set(int8_t interface_id, uint8_t mac_retry_set);
124128

129+
int8_t mac_helper_mac_device_description_pan_id_update(int8_t interface_id, uint16_t pan_id);
130+
125131
#endif // MAC_HELPER_H

source/6LoWPAN/Thread/thread_bootstrap.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ int thread_link_configuration_activate(protocol_interface_info_entry_t *cur, lin
755755
return -1;
756756
}
757757

758+
mac_helper_mac_device_description_pan_id_update(cur->id, linkConfiguration->panId);
759+
758760
thread_configuration_thread_activate(cur, linkConfiguration);
759761
thread_configuration_security_activate(cur, linkConfiguration);
760762
thread_configuration_6lowpan_activate(cur);
@@ -899,7 +901,7 @@ void thread_interface_init(protocol_interface_info_entry_t *cur)
899901
{
900902
thread_discovery_reset(cur->id);
901903
thread_routing_set_mesh_callbacks(cur);
902-
dhcp_client_init(cur->id);
904+
dhcp_client_init(cur->id, DHCPV6_DUID_HARDWARE_EUI64_TYPE);
903905
dhcp_client_configure(cur->id, false, false, false);
904906
thread_management_client_init(cur->id);
905907
thread_bootstrap_address_registration_init();
@@ -2886,7 +2888,7 @@ void thread_bootstrap_network_prefixes_process(protocol_interface_info_entry_t *
28862888
thread_addr_write_mesh_local_16(addr, curBorderRouter->routerID, cur->thread_info);
28872889
/* Do not allow multiple DHCP solicits from one prefix => delete previous */
28882890
dhcp_client_global_address_delete(cur->id, NULL, curPrefix->servicesPrefix);
2889-
if (dhcp_client_get_global_address(cur->id, addr, curPrefix->servicesPrefix, cur->mac, DHCPV6_DUID_HARDWARE_EUI64_TYPE, thread_dhcp_client_gua_error_cb) == 0) {
2891+
if (dhcp_client_get_global_address(cur->id, addr, curPrefix->servicesPrefix, thread_dhcp_client_gua_error_cb) == 0) {
28902892
tr_debug("GP Address Requested");
28912893
}
28922894
}

source/6LoWPAN/Thread/thread_mle_message_handler.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static void thread_parse_annoucement(protocol_interface_info_entry_t *cur, mle_m
514514
channel_page = ptr[0];
515515
channel = common_read_16_bit(&ptr[1]);
516516

517-
if (linkConfiguration->timestamp == timestamp) {
517+
if (linkConfiguration && linkConfiguration->timestamp == timestamp) {
518518
// We received same timestamp
519519
tr_debug("Same timestamp");
520520
return;
@@ -527,7 +527,7 @@ static void thread_parse_annoucement(protocol_interface_info_entry_t *cur, mle_m
527527
}
528528

529529

530-
if (linkConfiguration->timestamp > timestamp) {
530+
if (linkConfiguration && linkConfiguration->timestamp > timestamp) {
531531
// We received older time stamp we just announce back to originator channel
532532
thread_bootstrap_announce_send(cur, linkConfiguration->channel_page, linkConfiguration->rfChannel, linkConfiguration->panId, linkConfiguration->timestamp, channel);
533533
return;

source/6LoWPAN/adaptation_interface.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ typedef struct {
9292
fragmenter_tx_entry_t active_unicast_tx_buf; //Current active direct unicast tx process
9393
fragmenter_tx_entry_t active_broadcast_tx_buf; //Current active direct broadcast tx process
9494
buffer_list_t directTxQueue; //Waiting free tx process
95+
uint16_t directTxQueue_size;
9596
uint16_t indirect_big_packet_threshold;
9697
uint16_t max_indirect_big_packets_total;
9798
uint16_t max_indirect_small_packets_per_child;
@@ -216,6 +217,8 @@ static void lowpan_adaptation_tx_queue_write(fragmenter_interface_t *interface_p
216217
} else {
217218
ns_list_add_to_end(&interface_ptr->directTxQueue, buf);
218219
}
220+
interface_ptr->directTxQueue_size++;
221+
protocol_stats_update(STATS_AL_TX_QUEUE_SIZE, interface_ptr->directTxQueue_size);
219222
}
220223

221224
static buffer_t *lowpan_adaptation_tx_queue_read(fragmenter_interface_t *interface_ptr, protocol_interface_info_entry_t *cur)
@@ -231,6 +234,8 @@ static buffer_t *lowpan_adaptation_tx_queue_read(fragmenter_interface_t *interfa
231234
} else if ((buf->link_specific.ieee802_15_4.requestAck && !interface_ptr->active_unicast_tx_buf.buf)
232235
|| (!buf->link_specific.ieee802_15_4.requestAck && !interface_ptr->active_broadcast_tx_buf.buf)) {
233236
ns_list_remove(&interface_ptr->directTxQueue, buf);
237+
interface_ptr->directTxQueue_size--;
238+
protocol_stats_update(STATS_AL_TX_QUEUE_SIZE, interface_ptr->directTxQueue_size);
234239
return buf;
235240
}
236241
}

0 commit comments

Comments
 (0)