Skip to content

Commit 02e9af5

Browse files
author
Arto Kinnunen
committed
Squashed 'features/nanostack/sal-stack-nanostack/' changes from 9b3e144..fb7413b
fb7413b Merge branch 'release_internal' into release_external a9f6e88 Merge branch 'master' into release_internal c536960 DHCPv6 Server feature update 01e7e82 Merge pull request ARMmbed#2314 from ARMmbed/update_from_mbedos c906c43 Fixed typo: 'lenght' in ns_crc.h 2bd0558 Wi-sun border router DHCPv6 server address alocation update 63e4680 Allow buffer_dyn to handle more data (ARMmbed#2311) 9b82abf Copy IE unicast channel function from WS info instead of FHSS configu… (ARMmbed#2310) 18247d5 Wi-sun RPL memory soft and hard limit update c8560db Updated RPL default memory sof and hard limit to 2/4 from 1/2. 05aa54c Update MPL parameters to follow Specification f728d55 Support for handle CRC error which will automatically change a channel. 6b6f535 Corrected EUI-64 address bit flip on supplicant 015f3fe Corrected bitfield definition 7717ef8 Improved initial EAPOL-key send stop logic on supplicant 4185734 Improved EAPOL key update retry logic 8bda176 Wi-sun boot fix 6283dfd DIO advertisment fix 1acec7c Aro Registation and Dao update 6cde17a Iotthd 3963 2 (ARMmbed#2301) b9187da Randomize fixed channel when making new parent selection 34d0339 Wi-sun address registartion update 5b30559 Allow unicast TX to overlap with MC (ARMmbed#2298) d40b1c7 MAC: Updated calling FHSS TX done (ARMmbed#2295) aeb93a1 Add support for bbr configuration that removes default route from DIO 9b941af Use default UC channel function in discovery, fixed BC schedule (ARMmbed#2284) d65fcc6 Fix Wi-SUN network name comparison (ARMmbed#2294) f085132 Made parent set size configuraple in RPL fd11ffa Added HAVE_WS flag to FHSS api (ARMmbed#2296) 4f27500 Implemented optimal packet size test api (ARMmbed#2292) 87ee16a Call channel change after filtered out packet d196ffc Refactor Wi-SUN BBR stop function 35970d7 Revert "Disabled temporarily tx slot check for testing purposes (ARMmbed#2287)" (ARMmbed#2289) 8cc0ff5 Disabled temporarily tx slot check for testing purposes (ARMmbed#2287) e306dc5 Removed extra ";" 5642a4f Free TX failed list when FHSS deleted (ARMmbed#2285) 9fcf718 Updated FHSS optimal packet length to 300 bytes (ARMmbed#2282) 427743f ETX and Source route validation update 7b6bcca Added TX/RX bytes in PHY statistics (ARMmbed#2281) a043f8d Wi-sun FHSS Management update 2ff90e6 Configure TXRX slot length using given datarate (ARMmbed#2275) a126cb7 ETX sampling rule update d5cf8d5 Clean ARMC6/GCC compiler warnings (ARMmbed#2278) 807632d DHCP server freed next free allocated id fd6ce04 Thread Child ml16 update clear old address queue's and registered address. 99e6efa Neighbour remove operation update 5cd094c Corrected GTK update initial EAPOL-key trickle timer 7606ee8 Wi-sun NS Aro registration blacklisting update e3e5a00 Timed parent selection timer trigger update 7144121 RPL DIO Multicast message update 588f202 Wi-Sun RPL bootstrap update 20289f6 Added periodic RPL version number increase d8dd18d Added ignoring of incoming security messages and improved EAP-TLS startup 7350634 Corrected initial EAPOL-key trickle retries ac33518 Wi-sun ETX and proping update 11c486f Implemented unregistering FHSS from MAC. FHSS deleted in ifdown call. (ARMmbed#2266) eabca17 Wi-Sun Border router DHCPV server SLAAC mode enabled by default. 1d6ce9c DHCPv6 Server feature update 46aa460 Fixed unit test's. c65292e Mac enhanced ACK pending update 11a1e1d Store TX start channel and black list if TX failed (ARMmbed#2261) 0494606 Adapatation layer unicast list entry free update 4481e86 Updated trace level to info. c9e3d8e Interface down update 1f77ad6 Updated trace levels (ARMmbed#2258) 1d82fd5 Wi-sun BBR route update fix 33c48eb Removed NUD messages from registered children ec2ea92 Added RX and TX active times in PHY statistics (ARMmbed#2255) 49686cc Wi-sun certification test setup update 1090430 Trickle API update and Wi-SUN config sol state timeout update 38df576 Wi-sun advertisment consistent update 81740b8 Wi-sun bootstarp update nad balck list trace level update 6919ba1 Wi-sun New key index activate. 0aead93 Wi-sun Probe functionality revert operation 4ff02f9 Stop sending normal ACK if neighbour is Unknown. c387fda NS Probe limiter accept only 2 probe at 16 seconds period. a58c71b Trace level updates (ARMmbed#2247) 6867dd7 Suplicant EAP-TLS timeout is not incremented from retries 1f1c2a2 Test purpose change. 1b99fe1 Added ETX to rpl_possible_better_candidate 3441594 RPL parent candidate list update 96ffe92 Adaptation layer to support multiple simultaneous unicast transmissions (ARMmbed#2243) 45f8519 On stop (ifdown) stores frame counters regardless of threshold 5c2fc55 Corrected frame counter handling on re-discovery 9307416 Added check to prevent installing new GTK to used index using GKH 385ae14 WS bootstrap: print MAC address 2b1dfb9 Slaac address can be recreated after root stop 74ff3cc Merge branch 'release_internal' into release_external 66bfd98 Fixed trace printing warnings. 21d9c24 DHCP server address allocated pointer init fix. e659a01 Fixed compile warning for may uninitialized usage. cee8502 Fixed trace printing warnings. bc9f07b DHCP server address allocated pointer init fix. e3fddad Fixed compile warning for may uninitialized usage. bf909d2 Modified bbr restart mechanism when dodagid was lost git-subtree-dir: features/nanostack/sal-stack-nanostack git-subtree-split: fb7413b
1 parent 0b6ccc5 commit 02e9af5

File tree

95 files changed

+2324
-827
lines changed

Some content is hidden

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

95 files changed

+2324
-827
lines changed

nanostack/fhss_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,10 @@ typedef void fhss_data_tx_done(const fhss_api_t *api, bool waiting_ack, bool tx_
122122
* @param api FHSS instance.
123123
* @param handle Handle of the data request.
124124
* @param frame_type Frame type of packet (Frames types are defined by FHSS api).
125+
* @param channel Channel wanted to black list temporarily.
125126
* @return true if frame has to be queued for retransmission, false otherwise.
126127
*/
127-
typedef bool fhss_data_tx_fail(const fhss_api_t *api, uint8_t handle, int frame_type);
128+
typedef bool fhss_data_tx_fail(const fhss_api_t *api, uint8_t handle, int frame_type, uint8_t channel);
128129

129130
/**
130131
* @brief Change synchronization state.

nanostack/fhss_test_api.h

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright (c) 2020, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/**
19+
* \file fhss_test_api.h
20+
* \brief
21+
*/
22+
23+
#ifndef FHSS_TEST_API_H
24+
#define FHSS_TEST_API_H
25+
26+
27+
#ifdef __cplusplus
28+
extern "C" {
29+
#endif
30+
31+
/**
32+
* \brief Set optimal packet length
33+
*
34+
* \param fhss_api FHSS instance.
35+
* \param packet_length Optimal packet length
36+
*
37+
* \return 0 Success
38+
* \return -1 Failure
39+
*/
40+
int8_t fhss_set_optimal_packet_length(const fhss_api_t *fhss_api, uint16_t packet_length);
41+
42+
#ifdef __cplusplus
43+
}
44+
#endif
45+
46+
#endif // FHSS_TEST_API_H

nanostack/platform/arm_hal_phy.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ typedef enum {
161161
CHANNEL_PAGE_5 = 5, ///< Page 5
162162
CHANNEL_PAGE_6 = 6, ///< Page 6
163163
CHANNEL_PAGE_9 = 9, ///< Page 9
164-
CHANNEL_PAGE_10 = 10 ///< Page 10
164+
CHANNEL_PAGE_10 = 10, ///< Page 10
165+
CHANNEL_PAGE_UNDEFINED ///< Undefined
165166
} channel_page_e;
166167

167168
/** Modulation index */
@@ -192,6 +193,10 @@ typedef struct phy_rf_statistics_s {
192193
uint32_t crc_fails; ///< CRC failures
193194
uint32_t tx_timeouts; ///< transmission timeouts
194195
uint32_t rx_timeouts; ///< reception timeouts
196+
uint64_t tx_active_time; ///< transmission active time
197+
uint64_t rx_active_time; ///< reception active time
198+
uint32_t tx_bytes; ///< transmitted bytes
199+
uint32_t rx_bytes; ///< received bytes
195200
} phy_rf_statistics_s;
196201

197202
/** Virtual data request */

nanostack/sw_mac.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ extern int8_t ns_sw_mac_virtual_client_unregister(struct mac_api_s *api);
6767
*/
6868
extern int ns_sw_mac_fhss_register(struct mac_api_s *mac_api, struct fhss_api *fhss_api);
6969

70+
/**
71+
* @brief Unregister FHSS API instance from given software MAC instance.
72+
* @param mac_api MAC instance.
73+
* @return 0 on success, -1 on fail.
74+
*/
75+
extern int ns_sw_mac_fhss_unregister(struct mac_api_s *mac_api);
76+
7077
/**
7178
* @brief Request registered FHSS API instance from software MAC instance.
7279
* @param mac_api MAC instance.

nanostack/ws_bbr_api.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,10 @@ int ws_bbr_start(int8_t interface_id, int8_t backbone_interface_id);
4848
/**
4949
* Border router configuration options
5050
*/
51-
#define BBR_ULA_C 0x0001 /**< Static ULA prefix created automatically */
52-
#define BBR_GUA_ROUTE 0x0002 /**< More specific route is added for GUA prefix */
53-
#define BBR_BB_WAIT 0x0004 /**< Wait backbone availability before starting Wi-SUN network */
54-
55-
/*Deprecated configuration values */
56-
#define BBR_GUA_C 0x0000 /**< Routable prefix is learned from the backbone */
57-
#define BBR_GUA_SLAAC 0x0000 /**< Use SLAAC addressing in routable prefix */
58-
#define BBR_GUA_WAIT 0x0000 /**< Wait backbone availability before startingRPL dodag */
51+
#define BBR_ULA_C 0x0001 /**< Static ULA prefix created automatically */
52+
#define BBR_GUA_ROUTE 0x0002 /**< More specific route is added for GUA prefix */
53+
#define BBR_BB_WAIT 0x0004 /**< Wait backbone availability before starting Wi-SUN network */
54+
#define BBR_DEFAULT_ROUTE 0x0008 /**< Add default route parameter to DIO */
5955

6056
/**
6157
* Configure border router features.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,8 @@ static int8_t arm_6lowpan_bootstrap_down(protocol_interface_info_entry_t *cur)
13791379
}
13801380
cur->if_lowpan_security_params->mle_security_frame_counter = mle_service_security_get_frame_counter(cur->id);
13811381
mle_service_interface_receiver_handler_update(cur->id, mle_6lowpan_message_handler);
1382+
// Reset MAC for safe upper layer memory free
1383+
protocol_mac_reset(cur);
13821384
return nwk_6lowpan_down(cur);
13831385
}
13841386
#ifdef HAVE_6LOWPAN_ND
@@ -1593,7 +1595,7 @@ static void lowpan_neighbor_entry_remove_notify(mac_neighbor_table_entry_t *entr
15931595
{
15941596

15951597
protocol_interface_info_entry_t *cur_interface = user_data;
1596-
lowpan_adaptation_remove_free_indirect_table(cur_interface, entry_ptr);
1598+
lowpan_adaptation_neigh_remove_free_tx_tables(cur_interface, entry_ptr);
15971599
// Sleepy host
15981600
if (cur_interface->lowpan_info & INTERFACE_NWK_CONF_MAC_RX_OFF_IDLE) {
15991601
mac_data_poll_protocol_poll_mode_decrement(cur_interface);

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@
7272
#include "6LoWPAN/Fragmentation/cipv6_fragmenter.h"
7373
#include "libNET/src/net_load_balance_internal.h"
7474

75+
void protocol_mac_reset(protocol_interface_info_entry_t *cur)
76+
{
77+
if (cur->mac_api) {
78+
mlme_reset_t reset;
79+
reset.SetDefaultPIB = true;
80+
cur->mac_api->mlme_req(cur->mac_api, MLME_RESET, &reset);
81+
}
82+
}
83+
7584

7685

7786
static int8_t set_6lowpan_nwk_down(protocol_interface_info_entry_t *cur)
@@ -96,15 +105,11 @@ static int8_t set_6lowpan_nwk_down(protocol_interface_info_entry_t *cur)
96105
}
97106

98107
if (cur->interface_mode == INTERFACE_UP) {
99-
if (cur->mac_api) {
100-
mlme_reset_t reset;
101-
reset.SetDefaultPIB = true;
102-
cur->mac_parameters->pan_id = 0xffff;
103-
cur->mac_parameters->SecurityEnabled = false;
104-
cur->mac_parameters->security_frame_counter = 0;
105-
cur->mac_parameters->mac_security_level = 0;
106-
cur->mac_api->mlme_req(cur->mac_api, MLME_RESET, &reset);
107-
}
108+
cur->mac_parameters->pan_id = 0xffff;
109+
cur->mac_parameters->SecurityEnabled = false;
110+
cur->mac_parameters->security_frame_counter = 0;
111+
cur->mac_parameters->mac_security_level = 0;
112+
protocol_mac_reset(cur);
108113
cur->interface_mode = INTERFACE_IDLE;
109114
net_load_balance_internal_state_activate(cur, false);
110115
}

source/6LoWPAN/Bootstraps/protocol_6lowpan_interface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ extern int8_t nwk_6lowpan_up(struct protocol_interface_info_entry *cur);
3131
*/
3232
extern int8_t nwk_6lowpan_down(struct protocol_interface_info_entry *cur);
3333

34+
extern void protocol_mac_reset(struct protocol_interface_info_entry *cur);
35+
3436

3537
#endif /* PROTOCOL_6LOWPAN_INTERFACE_H_ */

source/6LoWPAN/MAC/mac_helper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,7 @@ int8_t mac_helper_key_link_frame_counter_set(int8_t interface_id, uint32_t seq_p
887887

888888
void mac_helper_devicetable_remove(mac_api_t *mac_api, uint8_t attribute_index, uint8_t *mac64)
889889
{
890+
(void) mac64;
890891
if (!mac_api) {
891892
return;
892893
}

source/6LoWPAN/MAC/mac_response_handler.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ void mcps_data_indication_handler(const mac_api_t *api, const mcps_data_ind_t *d
120120
void mcps_purge_confirm_handler(const mac_api_t *api, mcps_purge_conf_t *data)
121121
{
122122
(void)api;
123+
(void)data;
123124
tr_info("MCPS Data Purge confirm status %u, for handle %u", data->status, data->msduHandle);
124125
}
125126

0 commit comments

Comments
 (0)