diff --git a/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAT86RF215.cpp b/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAT86RF215.cpp index 414fb4db64c..149395490ea 100644 --- a/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAT86RF215.cpp +++ b/components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAT86RF215.cpp @@ -30,9 +30,24 @@ #include #include "Timeout.h" #include "SPI.h" +#include "platform/mbed_version.h" #define TRACE_GROUP "AtRF" +#if (MBED_VERSION > MBED_ENCODE_VERSION(6, 0, 0)) +/* Mbed OS 6.0 introduces support for chrono time management */ +using namespace std::chrono_literals; +#define ATMEL_RF_TIME_65MS 65ms +#define ATMEL_RF_TIME_1US 1us +#define ATMEL_RF_ATTACH(timer_ref, signal_ref, timeout_ref) timer_ref.attach(signal_ref, timeout_ref) +#define ATMEL_RF_DRIVER_CHRONO_SUPPORTED +#else +#define ATMEL_RF_TIME_65MS 65000 +#define ATMEL_RF_TIME_1US 1 + +#define ATMEL_RF_ATTACH(timer_ref, signal_ref, timeout_ref) timer_ref.attach_us(signal_ref, timeout_ref) +#endif + #define RF_MTU_15_4_2011 127 #define RF_MTU_15_4G_2012 2047 @@ -196,7 +211,11 @@ static Se2435Pins *se2435_pa_pins = NULL; static uint32_t rf_get_timestamp(void) { +#ifdef ATMEL_RF_DRIVER_CHRONO_SUPPORTED + return (uint32_t)rf->tx_timer.elapsed_time().count(); +#else return (uint32_t)rf->tx_timer.read_us(); +#endif } static void rf_lock(void) @@ -485,7 +504,7 @@ static void rf_init_registers(rf_modules_e module) // Set low frequency offset bit rf_write_bbc_register_field(BBC_OFDMC, module, LFO, 0); // Configure using bandwidth option - rf_configure_by_ofdm_bandwidth_option(4, 300000, module); + rf_configure_by_ofdm_bandwidth_option(phy_current_config.ofdm_option, phy_current_config.datarate, module); // Set Gain control settings rf_write_rf_register_field(RF_AGCC, module, AVGS, AVGS_8_SAMPLES); rf_write_rf_register_field(RF_AGCC, module, AGCI, 0); @@ -564,17 +583,21 @@ static int8_t rf_start_csma_ca(uint8_t *data_ptr, uint16_t data_length, uint8_t mac_tx_handle = tx_handle; if (tx_time) { +#ifdef ATMEL_RF_DRIVER_CHRONO_SUPPORTED + std::chrono::microseconds backoff_time(tx_time - rf_get_timestamp()); +#else uint32_t backoff_time = tx_time - rf_get_timestamp(); +#endif // Max. time to TX can be 65ms, otherwise time has passed already -> send immediately - if (backoff_time <= 65000) { - rf->cca_timer.attach_us(rf_csma_ca_timer_signal, backoff_time); + if (backoff_time <= ATMEL_RF_TIME_65MS) { + ATMEL_RF_ATTACH(rf->cca_timer, rf_csma_ca_timer_signal, backoff_time); TEST_CSMA_STARTED rf_unlock(); return 0; } } // Short timeout to start CCA immediately. - rf->cca_timer.attach_us(rf_csma_ca_timer_signal, 1); + ATMEL_RF_ATTACH(rf->cca_timer, rf_csma_ca_timer_signal, ATMEL_RF_TIME_1US); TEST_CSMA_STARTED rf_unlock(); return 0; @@ -607,12 +630,16 @@ static void rf_handle_cca_ed_done(void) if (cca_prepare_status == PHY_RESTART_CSMA) { device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_OK, 0, 0); if (tx_time) { +#ifdef ATMEL_RF_DRIVER_CHRONO_SUPPORTED + std::chrono::microseconds backoff_time(tx_time - rf_get_timestamp()); +#else uint32_t backoff_time = tx_time - rf_get_timestamp(); +#endif // Max. time to TX can be 65ms, otherwise time has passed already -> send immediately - if (backoff_time > 65000) { - backoff_time = 1; + if (backoff_time > ATMEL_RF_TIME_65MS) { + backoff_time = ATMEL_RF_TIME_1US; } - rf->cca_timer.attach_us(rf_csma_ca_timer_signal, backoff_time); + ATMEL_RF_ATTACH(rf->cca_timer, rf_csma_ca_timer_signal, backoff_time); TEST_CSMA_STARTED } return; @@ -994,7 +1021,11 @@ static uint32_t rf_backup_timer_start(uint16_t bytes, uint32_t time_us) time_us = (uint32_t)(8000000 / phy_current_config.datarate) * bytes + PACKET_PROCESSING_TIME; } // Using cal_timer as backup timer +#ifdef ATMEL_RF_DRIVER_CHRONO_SUPPORTED + rf->cal_timer.attach(rf_backup_timer_signal, std::chrono::microseconds(time_us)); +#else rf->cal_timer.attach_us(rf_backup_timer_signal, time_us); +#endif return (rf_get_timestamp() + time_us); } diff --git a/features/frameworks/mbed-trace/mbed-trace/mbed_trace.h b/features/frameworks/mbed-trace/mbed-trace/mbed_trace.h index c0cef6a888b..02196e39cc1 100644 --- a/features/frameworks/mbed-trace/mbed-trace/mbed_trace.h +++ b/features/frameworks/mbed-trace/mbed-trace/mbed_trace.h @@ -69,7 +69,12 @@ extern "C" { #define MBED_CONF_MBED_TRACE_ENABLE 0 #endif -#ifndef MBED_CONF_MBED_TRACE_FEA_IPV6 +#ifndef MBED_CONF_NANOSTACK_LIBSERVICE_PRESENT +/* if libservice presence is not configured, enable it by default */ +#define MBED_CONF_NANOSTACK_LIBSERVICE_PRESENT 1 +#endif + +#if !defined(MBED_CONF_MBED_TRACE_FEA_IPV6) && MBED_CONF_NANOSTACK_LIBSERVICE_PRESENT #define MBED_CONF_MBED_TRACE_FEA_IPV6 1 #endif diff --git a/features/frameworks/mbed-trace/source/mbed_trace.c b/features/frameworks/mbed-trace/source/mbed_trace.c index f90e0ea5d9b..eba23ef2c77 100644 --- a/features/frameworks/mbed-trace/source/mbed_trace.c +++ b/features/frameworks/mbed-trace/source/mbed_trace.c @@ -21,7 +21,7 @@ #undef MBED_CONF_MBED_TRACE_ENABLE #endif #define MBED_CONF_MBED_TRACE_ENABLE 1 -#ifndef MBED_CONF_MBED_TRACE_FEA_IPV6 +#if !defined(MBED_CONF_MBED_TRACE_FEA_IPV6) && MBED_CONF_NANOSTACK_LIBSERVICE_PRESENT #define MBED_CONF_MBED_TRACE_FEA_IPV6 1 #endif diff --git a/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/main.cpp b/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/main.cpp index 602aa1faac1..1d4177e2178 100644 --- a/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/main.cpp +++ b/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/main.cpp @@ -1,5 +1,18 @@ /* * Copyright (c) 2015 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "CppUTest/CommandLineTestRunner.h" diff --git a/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/nsnvmhelpertest.cpp b/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/nsnvmhelpertest.cpp index 32c3fc8384c..df42b125bfa 100644 --- a/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/nsnvmhelpertest.cpp +++ b/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/nsnvmhelpertest.cpp @@ -1,5 +1,18 @@ /* * Copyright (c) 2016 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "CppUTest/TestHarness.h" #include "test_ns_nvm_helper.h" diff --git a/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/test_ns_nvm_helper.c b/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/test_ns_nvm_helper.c index 10b41c87d0f..a83eb877237 100644 --- a/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/test_ns_nvm_helper.c +++ b/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/test_ns_nvm_helper.c @@ -1,5 +1,18 @@ /* * Copyright (c) 2016 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include diff --git a/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/test_ns_nvm_helper.h b/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/test_ns_nvm_helper.h index 0d0af911e1a..408a33f2d4a 100644 --- a/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/test_ns_nvm_helper.h +++ b/features/frameworks/nanostack-libservice/test/libService/unittest/nsnvmhelper/test_ns_nvm_helper.h @@ -1,5 +1,18 @@ /* * Copyright (c) 2016 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef TEST_NS_NVM_HELPER_H #define TEST_NS_NVM_HELPER_H diff --git a/features/nanostack/sal-stack-nanostack-eventloop/source/event.c b/features/nanostack/sal-stack-nanostack-eventloop/source/event.c index 5e03328a834..1741f6b8f67 100644 --- a/features/nanostack/sal-stack-nanostack-eventloop/source/event.c +++ b/features/nanostack/sal-stack-nanostack-eventloop/source/event.c @@ -198,7 +198,9 @@ void event_core_free_push(arm_event_storage_t *free) timer_sys_event_free(free); break; case ARM_LIB_EVENT_USER: + // *INDENT-OFF* // No need set state to UNQUEUED - we forget about it. + // *INDENT-ON* default: break; } diff --git a/features/nanostack/sal-stack-nanostack/Doxyfile b/features/nanostack/sal-stack-nanostack/Doxyfile index 71d397e99a8..9205be3d1ba 100644 --- a/features/nanostack/sal-stack-nanostack/Doxyfile +++ b/features/nanostack/sal-stack-nanostack/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.8 +# Doxyfile 1.8.17 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -17,11 +17,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -46,10 +46,10 @@ PROJECT_NUMBER = PROJECT_BRIEF = "ARM 6LoWPAN/Thread/IPv6 Stack." -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. PROJECT_LOGO = @@ -60,7 +60,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where @@ -76,7 +76,7 @@ CREATE_SUBDIRS = NO # U+3044. # The default value is: NO. -# ALLOW_UNICODE_NAMES = NO +ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this @@ -93,14 +93,22 @@ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -135,7 +143,7 @@ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -179,6 +187,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -205,9 +223,9 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -226,7 +244,12 @@ TAB_SIZE = 4 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) ALIASES = @@ -264,19 +287,28 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is +# Fortran), use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. @@ -285,7 +317,7 @@ EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -293,10 +325,19 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES @@ -318,7 +359,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -336,13 +377,20 @@ SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent @@ -401,7 +449,7 @@ LOOKUP_CACHE_SIZE = 0 # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -411,35 +459,41 @@ LOOKUP_CACHE_SIZE = 0 EXTRACT_ALL = NO -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local methods, +# This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -464,21 +518,21 @@ HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -492,21 +546,28 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also +# names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# (including Cygwin) ands Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -534,14 +595,14 @@ INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -586,27 +647,25 @@ SORT_BY_SCOPE_NAME = NO STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -631,8 +690,8 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -677,7 +736,7 @@ LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -696,7 +755,7 @@ CITE_BIB_FILES = QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -704,7 +763,7 @@ QUIET = NO WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -721,12 +780,19 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = NO +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -750,15 +816,16 @@ WARN_LOGFILE = # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = nanostack doxygen +INPUT = nanostack \ + doxygen # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -766,12 +833,19 @@ INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f, *.for, *.tcl, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = @@ -857,6 +931,10 @@ IMAGE_PATH = # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -866,11 +944,15 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -918,7 +1000,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -930,7 +1012,7 @@ REFERENCED_BY_RELATION = NO REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -950,12 +1032,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -977,6 +1059,35 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1007,7 +1118,7 @@ IGNORE_PREFIX = # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -1073,10 +1184,10 @@ HTML_STYLESHEET = # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. +# standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra stylesheet files is of importance (e.g. the last -# stylesheet in the list overrules the setting of the previous ones in the +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1093,9 +1204,9 @@ HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to +# will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1124,12 +1235,24 @@ HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1153,13 +1276,13 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1198,7 +1321,7 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output @@ -1221,28 +1344,28 @@ GENERATE_HTMLHELP = NO CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1274,7 +1397,7 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1282,7 +1405,7 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1291,7 +1414,7 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1299,7 +1422,7 @@ QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1307,7 +1430,7 @@ QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = @@ -1356,7 +1479,7 @@ DISABLE_INDEX = NO # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1384,7 +1507,7 @@ ENUM_VALUES_PER_LINE = 4 TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1400,7 +1523,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1411,9 +1534,15 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1439,8 +1568,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest @@ -1482,7 +1611,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1499,9 +1628,9 @@ SERVER_BASED_SEARCH = NO # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1512,9 +1641,9 @@ EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1550,7 +1679,7 @@ EXTRA_SEARCH_MAPPINGS = # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO @@ -1566,22 +1695,36 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1599,9 +1742,12 @@ COMPACT_LATEX = NO PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. To get the times font for -# instance you can specify -# EXTRA_PACKAGES=times +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1616,9 +1762,9 @@ EXTRA_PACKAGES = # Note: Only use a user-defined header if you know what you are doing! The # following commands have a special meaning inside the header: $title, # $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empy string, -# for the replacement values of the other commands the user is refered to -# HTML_HEADER. +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = @@ -1634,6 +1780,17 @@ LATEX_HEADER = LATEX_FOOTER = +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or @@ -1652,7 +1809,7 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES to get a +# the PDF file directly from the LaTeX files. Set this option to YES, to get a # higher quality PDF documentation. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1687,17 +1844,33 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. @@ -1712,7 +1885,7 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1732,9 +1905,9 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. @@ -1743,17 +1916,27 @@ RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for # classes and files. # The default value is: NO. @@ -1782,7 +1965,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -# MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -1797,7 +1980,7 @@ MAN_LINKS = NO # Configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. @@ -1811,7 +1994,7 @@ GENERATE_XML = NO XML_OUTPUT = xml -# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. @@ -1820,11 +2003,18 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. @@ -1838,23 +2028,23 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES doxygen will include the +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the # program listings (including syntax highlighting and cross-referencing # information) to the DOCBOOK output. Note that enabling this will significantly # increase the size of the DOCBOOK output. # The default value is: NO. # This tag requires that the tag GENERATE_DOCBOOK is set to YES. -# DOCBOOK_PROGRAMLISTING = NO +DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen -# Definitions (see http://autogen.sf.net) file that captures the structure of -# the code including all documentation. Note that this feature is still -# experimental and incomplete at the moment. +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -1863,7 +2053,7 @@ GENERATE_AUTOGEN_DEF = NO # Configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. @@ -1871,7 +2061,7 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. @@ -1879,9 +2069,9 @@ GENERATE_PERLMOD = NO PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO the +# understand what is going on. On the other hand, if this tag is set to NO, the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. @@ -1901,14 +2091,14 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1924,7 +2114,7 @@ MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -2000,37 +2190,32 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -2039,15 +2224,6 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -2055,7 +2231,7 @@ MSCGEN_PATH = DIA_PATH = -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2066,7 +2242,7 @@ HIDE_UNDOC_RELATIONS = YES # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO -# The default value is: NO. +# The default value is: YES. HAVE_DOT = NO @@ -2128,7 +2304,7 @@ COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -2180,7 +2356,8 @@ INCLUDED_BY_GRAPH = YES # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2191,7 +2368,8 @@ CALL_GRAPH = NO # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2214,11 +2392,17 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, jpg, gif and svg. +# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd, +# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo, +# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2266,10 +2450,18 @@ DIAFILE_DIRS = # PlantUML is not used or called during a preprocessing step. Doxygen will # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -# This tag requires that the tag HAVE_DOT is set to YES. -# Disabled for Nanostack -#PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = + +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes @@ -2307,7 +2499,7 @@ MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -2324,7 +2516,7 @@ DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. diff --git a/features/nanostack/sal-stack-nanostack/nanostack/fhss_config.h b/features/nanostack/sal-stack-nanostack/nanostack/fhss_config.h index 5c55965733f..545cb98cda8 100644 --- a/features/nanostack/sal-stack-nanostack/nanostack/fhss_config.h +++ b/features/nanostack/sal-stack-nanostack/nanostack/fhss_config.h @@ -132,6 +132,9 @@ typedef struct fhss_ws_configuration { /** Wi-SUN specific unicast channel mask */ uint32_t unicast_channel_mask[8]; + /** Channel mask size */ + uint16_t channel_mask_size; + /** Vendor defined channel function. */ fhss_vendor_defined_cf *vendor_defined_cf; diff --git a/features/nanostack/sal-stack-nanostack/nanostack/mac_api.h b/features/nanostack/sal-stack-nanostack/nanostack/mac_api.h index a972554b92b..8e545987eab 100644 --- a/features/nanostack/sal-stack-nanostack/nanostack/mac_api.h +++ b/features/nanostack/sal-stack-nanostack/nanostack/mac_api.h @@ -78,7 +78,7 @@ typedef enum { } mlme_primitive; /** - * \struct mac_description_storage_size_t + * \struct mac_description_storage_size_s * \brief Container for MAC storage sizes. */ typedef struct mac_description_storage_size_s { @@ -305,7 +305,7 @@ struct mac_api_s { }; /** - * \struct mac_statistics_t + * \struct mac_statistics_s * \brief MAC statistics structure. */ typedef struct mac_statistics_s { diff --git a/features/nanostack/sal-stack-nanostack/nanostack/net_interface.h b/features/nanostack/sal-stack-nanostack/nanostack/net_interface.h index 89905eeb162..89c942ccb11 100644 --- a/features/nanostack/sal-stack-nanostack/nanostack/net_interface.h +++ b/features/nanostack/sal-stack-nanostack/nanostack/net_interface.h @@ -103,7 +103,7 @@ typedef enum arm_library_event_type_e { #define SOCKET_BIND_DONE SOCKET_CONNECT_DONE /**< Backward compatibility */ #define SOCKET_BIND_FAIL SOCKET_CONNECT_FAIL /**< Backward compatibility */ #define SOCKET_BIND_AUTH_FAIL SOCKET_CONNECT_AUTH_FAIL /**< Backward compatibility */ -/* @} */ +/** @} */ /** Network security levels. */ typedef enum net_security_t { @@ -1228,3 +1228,4 @@ extern const cca_threshold_table_s *arm_nwk_get_cca_threshold_table(int8_t inter } #endif #endif /* NET_INTERFACE_H_ */ + diff --git a/features/nanostack/sal-stack-nanostack/nanostack/net_nvm_api.h b/features/nanostack/sal-stack-nanostack/nanostack/net_nvm_api.h index 646f41cff9c..e790f63a87f 100644 --- a/features/nanostack/sal-stack-nanostack/nanostack/net_nvm_api.h +++ b/features/nanostack/sal-stack-nanostack/nanostack/net_nvm_api.h @@ -89,7 +89,7 @@ typedef enum pana_client_nvm_update_process_t { } pana_client_nvm_update_process_t; /*! - * \struct wpan_nvm_params_t + * \struct wpan_nvm_params * \brief Network nvm parameters. */ typedef struct wpan_nvm_params { diff --git a/features/nanostack/sal-stack-nanostack/nanostack/net_polling_api.h b/features/nanostack/sal-stack-nanostack/nanostack/net_polling_api.h index 1b575e6d863..de22f7db7d5 100644 --- a/features/nanostack/sal-stack-nanostack/nanostack/net_polling_api.h +++ b/features/nanostack/sal-stack-nanostack/nanostack/net_polling_api.h @@ -52,7 +52,7 @@ extern "C" { #endif /*! - * \enum net_host_mode_t + * \enum net_host_mode * \brief Sleepy host states. */ typedef enum net_host_mode { diff --git a/features/nanostack/sal-stack-nanostack/nanostack/ns_mdns_api.h b/features/nanostack/sal-stack-nanostack/nanostack/ns_mdns_api.h index 2cec738c3e6..7a92fb2c36f 100644 --- a/features/nanostack/sal-stack-nanostack/nanostack/ns_mdns_api.h +++ b/features/nanostack/sal-stack-nanostack/nanostack/ns_mdns_api.h @@ -36,7 +36,7 @@ typedef struct ns_mdns *ns_mdns_t; /**< Instance */ typedef struct ns_mdns_service *ns_mdns_service_t; /**< Service instance */ /*! - * \struct ns_mdns_service_param_t + * \struct ns_mdns_service_param * \brief Structure for mDNS service parameters */ typedef struct ns_mdns_service_param { diff --git a/features/nanostack/sal-stack-nanostack/nanostack/platform/arm_hal_aes.h b/features/nanostack/sal-stack-nanostack/nanostack/platform/arm_hal_aes.h index 891e03931bc..e64c12050ed 100644 --- a/features/nanostack/sal-stack-nanostack/nanostack/platform/arm_hal_aes.h +++ b/features/nanostack/sal-stack-nanostack/nanostack/platform/arm_hal_aes.h @@ -48,6 +48,7 @@ extern "C" { #define ARM_AES_MBEDTLS_CONTEXT_MIN 1 /**interface_id, full_gc ? LOWPAN_MEM_LIMIT_REMOVE_MAX : LOWPAN_MEM_LIMIT_REMOVE_NORMAL); + } +} + +int8_t lowpan_adaptation_free_low_priority_packets(int8_t interface_id, uint32_t requested_amount) +{ + fragmenter_interface_t *interface_ptr = lowpan_adaptation_interface_discover(interface_id); + + if (!interface_ptr) { + return -1; + } + uint32_t adaptation_memory = 0; + uint16_t adaptation_packets = 0; + uint32_t memory_freed = 0; + uint16_t packets_freed = 0; + + ns_list_foreach(buffer_t, entry, &interface_ptr->directTxQueue) { + adaptation_memory += sizeof(buffer_t) + entry->size; + adaptation_packets++; + } + + if (interface_ptr->directTxQueue_size < LOWPAN_MEM_LIMIT_MIN_QUEUE) { + // Minimum reserved for operations + return 0; + } + if (adaptation_memory < LOWPAN_MEM_LIMIT_MIN_MEMORY) { + // Minimum reserved for operations + return 0; + } + if (adaptation_memory - requested_amount < LOWPAN_MEM_LIMIT_MIN_MEMORY) { + // only reduse to minimum + requested_amount = adaptation_memory - LOWPAN_MEM_LIMIT_MIN_MEMORY; + } + + //Only remove last entries from TX queue with low priority + ns_list_foreach_reverse_safe(buffer_t, entry, &interface_ptr->directTxQueue) { + if (entry->priority == QOS_NORMAL) { + memory_freed += sizeof(buffer_t) + entry->size; + packets_freed++; + ns_list_remove(&interface_ptr->directTxQueue, entry); + interface_ptr->directTxQueue_size--; + lowpan_adaptation_tx_queue_level_update(interface_ptr); + socket_tx_buffer_event_and_free(entry, SOCKET_TX_FAIL); + } + if (memory_freed > requested_amount) { + // Enough memory freed + break; + } + } + tr_info("Adaptation Free low priority packets memory: %" PRIi32 " queue: %d deallocated %" PRIi32 " bytes, %d packets, %" PRIi32 " requested", adaptation_memory, adaptation_packets, memory_freed, packets_freed, requested_amount); + return 0; +} static fragmenter_tx_entry_t *lowpan_indirect_entry_allocate(uint16_t fragment_buffer_size) { @@ -1562,7 +1628,6 @@ int8_t lowpan_adaptation_free_messages_from_queues_by_address(struct protocol_in return 0; } - int8_t lowpan_adaptation_indirect_queue_params_set(struct protocol_interface_info_entry *cur, uint16_t indirect_big_packet_threshold, uint16_t max_indirect_big_packets_total, uint16_t max_indirect_small_packets_per_child) { fragmenter_interface_t *interface_ptr = lowpan_adaptation_interface_discover(cur->id); diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/lowpan_adaptation_interface.h b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/lowpan_adaptation_interface.h index 307dd9917be..13401df1f0f 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/lowpan_adaptation_interface.h +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/lowpan_adaptation_interface.h @@ -36,8 +36,13 @@ int8_t lowpan_adaptation_interface_reset(int8_t interface_id); int8_t lowpan_adaptation_interface_mpx_register(int8_t interface_id, struct mpx_api_s *mpx_api, uint16_t mpx_user_id); +void lowpan_adaptation_free_heap(bool full_gc); + +int8_t lowpan_adaptation_free_low_priority_packets(int8_t interface_id, uint32_t requested_amount); + + /** - * \brief call this before normatl TX. This function prepare buffer link spesific metadata and verify packet destination + * \brief call this before normal TX. This function prepare buffer link specific metadata and verify packet destination */ struct buffer *lowpan_adaptation_data_process_tx_preprocess(struct protocol_interface_info_entry *cur, struct buffer *buf); diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bbr_api.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bbr_api.c index 990d6969db1..75a1178bfc6 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bbr_api.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bbr_api.c @@ -176,12 +176,12 @@ static void ws_bbr_rpl_version_timer_start(protocol_interface_info_entry_t *cur, //stable version for RPL so slow timer update is ok cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME; } else { - if (cur->ws_info->cfg->gen.network_size <= NETWORK_SIZE_SMALL) { - // handles also NETWORK_SIZE_CERTIFICATE + if (ws_cfg_network_config_get(cur) <= CONFIG_SMALL) { + // Also handles CONFIG_CERTIFICATE cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME_RESTART_SMALL; - } else if (cur->ws_info->cfg->gen.network_size <= NETWORK_SIZE_MEDIUM) { + } else if (ws_cfg_network_config_get(cur) <= CONFIG_MEDIUM) { cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME_RESTART_MEDIUM; - } else if (cur->ws_info->cfg->gen.network_size <= NETWORK_SIZE_LARGE) { + } else if (ws_cfg_network_config_get(cur) <= CONFIG_LARGE) { cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME_RESTART_LARGE; } else { cur->ws_info->rpl_version_timer = RPL_VERSION_LIFETIME_RESTART_EXTRA_LARGE; diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap.c index 8fc1120d138..03a646d8543 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap.c @@ -116,6 +116,9 @@ static parent_info_t *ws_bootstrap_candidate_parent_get(struct protocol_interfac static void ws_bootstrap_candidate_parent_sort(struct protocol_interface_info_entry *cur, parent_info_t *new_entry); static void ws_bootstrap_packet_congestion_init(protocol_interface_info_entry_t *cur); +static void ws_bootstrap_asynch_trickle_stop(protocol_interface_info_entry_t *cur); +static void ws_bootstrap_advertise_start(protocol_interface_info_entry_t *cur); + typedef enum { WS_PARENT_SOFT_SYNCH = 0, /**< let FHSS make decision if synchronization is needed*/ WS_PARENT_HARD_SYNCH, /**< Synch FHSS with latest synch information*/ @@ -624,8 +627,9 @@ static uint8_t ws_generate_exluded_channel_list_from_active_channels(ws_excluded static void ws_fhss_configure_channel_masks(protocol_interface_info_entry_t *cur, fhss_ws_configuration_t *fhss_configuration) { - ws_generate_channel_list(fhss_configuration->channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain, cur->ws_info->hopping_schdule.operating_class); - ws_generate_channel_list(fhss_configuration->unicast_channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain, cur->ws_info->hopping_schdule.operating_class); + fhss_configuration->channel_mask_size = cur->ws_info->hopping_schdule.number_of_channels; + ws_generate_channel_list(fhss_configuration->channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain, cur->ws_info->hopping_schdule.operating_class, cur->ws_info->hopping_schdule.channel_plan_id); + ws_generate_channel_list(fhss_configuration->unicast_channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain, cur->ws_info->hopping_schdule.operating_class, cur->ws_info->hopping_schdule.channel_plan_id); // using bitwise AND operation for user set channel mask to remove channels not allowed in this device for (uint8_t n = 0; n < 8; n++) { fhss_configuration->unicast_channel_mask[n] &= cur->ws_info->cfg->fhss.fhss_channel_mask[n]; @@ -1082,6 +1086,32 @@ static int8_t ws_bootstrap_up(protocol_interface_info_entry_t *cur) return ret_val; } +void ws_bootstrap_disconnect(protocol_interface_info_entry_t *cur, ws_bootsrap_event_type_e event_type) +{ + if (cur->nwk_bootstrap_state == ER_RPL_NETWORK_LEAVING) { + //Already moved to leaving state. + return; + } + + if (cur->rpl_domain && cur->nwk_bootstrap_state == ER_BOOTSRAP_DONE) { + //Stop Asych Timer + ws_bootstrap_asynch_trickle_stop(cur); + tr_debug("Start Network soft leaving"); + if (event_type == WS_FAST_DISCONNECT) { + rpl_control_instant_poison(cur, cur->rpl_domain); + cur->bootsrap_state_machine_cnt = 80; //Give 8 seconds time to send Poison + } else { + rpl_control_poison(cur->rpl_domain, 1); + cur->bootsrap_state_machine_cnt = 6000; //Give 10 minutes time for poison if RPL is not report + } + + } else { + ws_bootstrap_event_discovery_start(cur); + } + cur->nwk_bootstrap_state = ER_RPL_NETWORK_LEAVING; +} + + static void ws_bootstrap_asynch_trickle_stop(protocol_interface_info_entry_t *cur) { cur->ws_info->trickle_pas_running = false; @@ -1550,10 +1580,10 @@ static void ws_bootstrap_pan_advertisement_solicit_analyse(struct protocol_inter */ trickle_consistent_heard(&cur->ws_info->trickle_pan_advertisement_solicit); /* - * Optimized PAN discovery to select faster the parent if we hear solicit from someone else + * Optimized PAN discovery to select the parent faster if we hear solicit from someone else */ - if (ws_bootstrap_state_discovery(cur) && cur->ws_info->cfg->gen.network_size <= NETWORK_SIZE_MEDIUM && + if (ws_bootstrap_state_discovery(cur) && ws_cfg_network_config_get(cur) <= CONFIG_MEDIUM && cur->bootsrap_state_machine_cnt > cur->ws_info->trickle_params_pan_discovery.Imin * 2) { cur->bootsrap_state_machine_cnt = cur->ws_info->trickle_params_pan_discovery.Imin + randLIB_get_random_in_range(0, cur->ws_info->trickle_params_pan_discovery.Imin); @@ -1634,7 +1664,7 @@ static void ws_bootstrap_pan_config_analyse(struct protocol_interface_info_entry tr_debug("NEW Brodcast Schedule %u...BR rebooted", ws_bs_ie.broadcast_schedule_identifier); cur->ws_info->ws_bsi_block.block_time = cur->ws_info->cfg->timing.pan_timeout; cur->ws_info->ws_bsi_block.old_bsi = cur->ws_info->hopping_schdule.fhss_bsi; - ws_bootstrap_event_discovery_start(cur); + ws_bootstrap_event_disconnect(cur, WS_NORMAL_DISCONNECT); } return; } @@ -2044,7 +2074,7 @@ static void ws_neighbor_entry_remove_notify(mac_neighbor_table_entry_t *entry_pt static uint32_t ws_probe_init_time_get(protocol_interface_info_entry_t *cur) { - if (cur->ws_info->cfg->gen.network_size <= NETWORK_SIZE_SMALL) { + if (ws_cfg_network_config_get(cur) <= CONFIG_SMALL) { return WS_SMALL_PROBE_INIT_BASE_SECONDS; } @@ -2360,7 +2390,11 @@ int ws_bootstrap_set_rf_config(protocol_interface_info_entry_t *cur, phy_rf_chan set_request.value_size = sizeof(phy_rf_channel_configuration_s); cur->mac_api->mlme_req(cur->mac_api, MLME_SET, &set_request); // Set Ack wait duration - uint16_t ack_wait_symbols = WS_ACK_WAIT_SYMBOLS + (WS_TACK_MAX_MS * (rf_configs.datarate / 1000)); + uint8_t bits_per_symbol = 1; + if (rf_configs.modulation == M_OFDM) { + bits_per_symbol = 4; + } + uint16_t ack_wait_symbols = WS_ACK_WAIT_SYMBOLS + (WS_TACK_MAX_MS * (rf_configs.datarate / 1000) / bits_per_symbol); set_request.attr = macAckWaitDuration; set_request.value_pointer = &ack_wait_symbols; set_request.value_size = sizeof(ack_wait_symbols); @@ -2397,11 +2431,29 @@ static int ws_bootstrap_set_domain_rf_config(protocol_interface_info_entry_t *cu { phy_rf_channel_configuration_s rf_configs; memset(&rf_configs, 0, sizeof(phy_rf_channel_configuration_s)); + + uint8_t phy_mode_id = cur->ws_info->hopping_schdule.phy_mode_id; + if (((phy_mode_id >= 34) && (phy_mode_id <= 38)) || + ((phy_mode_id >= 51) && (phy_mode_id <= 54)) || + ((phy_mode_id >= 68) && (phy_mode_id <= 70)) || + ((phy_mode_id >= 84) && (phy_mode_id <= 86))) { + rf_configs.modulation = M_OFDM; + rf_configs.datarate = ws_get_datarate_using_phy_mode_id(cur->ws_info->hopping_schdule.phy_mode_id); + rf_configs.ofdm_option = ws_get_ofdm_option_using_phy_mode_id(cur->ws_info->hopping_schdule.phy_mode_id); + rf_configs.ofdm_mcs = ws_get_ofdm_mcs_using_phy_mode_id(cur->ws_info->hopping_schdule.phy_mode_id); + } else { + if ((phy_mode_id >= 17) && (phy_mode_id <= 24)) { + rf_configs.fec = true; + } else { + rf_configs.fec = false; + } + rf_configs.modulation = M_2FSK; + rf_configs.datarate = ws_get_datarate_using_operating_mode(cur->ws_info->hopping_schdule.operating_mode); + rf_configs.modulation_index = ws_get_modulation_index_using_operating_mode(cur->ws_info->hopping_schdule.operating_mode); + } + rf_configs.channel_0_center_frequency = (uint32_t)cur->ws_info->hopping_schdule.ch0_freq * 100000; rf_configs.channel_spacing = ws_decode_channel_spacing(cur->ws_info->hopping_schdule.channel_spacing); - rf_configs.datarate = ws_get_datarate_using_operating_mode(cur->ws_info->hopping_schdule.operating_mode); - rf_configs.modulation_index = ws_get_modulation_index_using_operating_mode(cur->ws_info->hopping_schdule.operating_mode); - rf_configs.modulation = M_2FSK; rf_configs.number_of_channels = cur->ws_info->hopping_schdule.number_of_channels; ws_bootstrap_set_rf_config(cur, rf_configs); return 0; @@ -2531,6 +2583,15 @@ static void ws_bootstrap_rpl_callback(rpl_event_t event, void *handle) if (!cur->rpl_domain || cur->interface_mode != INTERFACE_UP) { return; } + + if (event == RPL_EVENT_POISON_FINISHED) { + //If we are waiting poison we will trig Discovery after couple seconds + if (cur->nwk_bootstrap_state == ER_RPL_NETWORK_LEAVING) { + cur->bootsrap_state_machine_cnt = 80; //Give 8 seconds time to send Poison + } + return; + } + // if waiting for RPL and if (event == RPL_EVENT_DAO_DONE) { // Trigger statemachine check @@ -2560,6 +2621,12 @@ static void ws_bootstrap_rpl_callback(rpl_event_t event, void *handle) // After successful DAO ACK connection to border router is verified cur->ws_info->pan_timeout_timer = cur->ws_info->cfg->timing.pan_timeout; + + } + + if (!cur->ws_info->trickle_pa_running || !cur->ws_info->trickle_pc_running) { + //Enable wi-sun asynch adverisment + ws_bootstrap_advertise_start(cur); } ws_set_fhss_hop(cur); @@ -2576,6 +2643,8 @@ static void ws_bootstrap_rpl_callback(rpl_event_t event, void *handle) } else if (event == RPL_EVENT_LOCAL_REPAIR_START) { tr_debug("RPL local repair start"); + //Disable Asynchs + ws_bootstrap_asynch_trickle_stop(cur); ws_nwk_event_post(cur, ARM_NWK_NWK_CONNECTION_DOWN); } else if (event == RPL_EVENT_DAO_PARENT_ADD) { @@ -2802,6 +2871,7 @@ static void ws_bootstrap_rpl_activate(protocol_interface_info_entry_t *cur) rpl_control_set_dao_retry_count(WS_MAX_DAO_RETRIES); rpl_control_set_initial_dao_ack_wait(WS_MAX_DAO_INITIAL_TIMEOUT); rpl_control_set_mrhof_parent_set_size(WS_MAX_PARENT_SET_COUNT); + rpl_control_set_force_tunnel(true); if (cur->bootsrap_mode != ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER) { rpl_control_set_memory_limits(WS_NODE_RPL_SOFT_MEM_LIMIT, WS_NODE_RPL_HARD_MEM_LIMIT); } @@ -3066,9 +3136,9 @@ static void ws_bootstrap_rpl_scan_start(protocol_interface_info_entry_t *cur) tr_debug("Start RPL learn"); // routers wait until RPL root is contacted ws_bootstrap_state_change(cur, ER_RPL_SCAN); - //For Large network and medium shuold do passive scan - if (cur->ws_info->cfg->gen.network_size > NETWORK_SIZE_SMALL) { - // Set timeout for check to 30 -60 seconds + //For Large network and medium should do passive scan + if (ws_cfg_network_config_get(cur) > CONFIG_SMALL) { + // Set timeout for check to 30 - 60 seconds cur->bootsrap_state_machine_cnt = randLIB_get_random_in_range(WS_RPL_DIS_INITIAL_TIMEOUT / 2, WS_RPL_DIS_INITIAL_TIMEOUT); } /* While in Join State 4, if a non Border Router determines it has been unable to communicate with the PAN Border @@ -3102,6 +3172,12 @@ void ws_bootstrap_event_routing_ready(protocol_interface_info_entry_t *cur) { ws_bootsrap_event_trig(WS_ROUTING_READY, cur->bootStrapId, ARM_LIB_LOW_PRIORITY_EVENT, NULL); } + +void ws_bootstrap_event_disconnect(protocol_interface_info_entry_t *cur, ws_bootsrap_event_type_e event_type) +{ + ws_bootsrap_event_trig(event_type, cur->bootStrapId, ARM_LIB_LOW_PRIORITY_EVENT, NULL); +} + void ws_bootstrap_configuration_trickle_reset(protocol_interface_info_entry_t *cur) { trickle_inconsistent_heard(&cur->ws_info->trickle_pan_config, &cur->ws_info->trickle_params_pan_discovery); @@ -3115,7 +3191,7 @@ static void ws_set_asynch_channel_list(protocol_interface_info_entry_t *cur, asy uint16_t channel_number = cur->ws_info->cfg->fhss.fhss_uc_fixed_channel; async_req->channel_list.channel_mask[0 + (channel_number / 32)] = (1 << (channel_number % 32)); } else { - ws_generate_channel_list(async_req->channel_list.channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain, cur->ws_info->hopping_schdule.operating_class); + ws_generate_channel_list(async_req->channel_list.channel_mask, cur->ws_info->hopping_schdule.number_of_channels, cur->ws_info->hopping_schdule.regulatory_domain, cur->ws_info->hopping_schdule.operating_class, cur->ws_info->hopping_schdule.channel_plan_id); } async_req->channel_list.channel_page = CHANNEL_PAGE_10; @@ -3285,6 +3361,7 @@ static int8_t ws_bootstrap_backbone_ip_addr_get(protocol_interface_info_entry_t return -1; } + static void ws_bootstrap_event_handler(arm_event_s *event) { ws_bootsrap_event_type_e event_type; @@ -3301,7 +3378,6 @@ static void ws_bootstrap_event_handler(arm_event_s *event) break; case WS_DISCOVERY_START: tr_info("Discovery start"); - protocol_mac_reset(cur); ws_llc_reset(cur); lowpan_adaptation_interface_reset(cur->id); @@ -3437,6 +3513,12 @@ static void ws_bootstrap_event_handler(arm_event_s *event) ws_bootstrap_advertise_start(cur); ws_bootstrap_state_change(cur, ER_BOOTSRAP_DONE); break; + case WS_FAST_DISCONNECT: + ws_bootstrap_disconnect(cur, WS_FAST_DISCONNECT); + break; + case WS_NORMAL_DISCONNECT: + ws_bootstrap_disconnect(cur, WS_NORMAL_DISCONNECT); + break; default: tr_err("Invalid event received"); @@ -3628,6 +3710,10 @@ void ws_bootstrap_state_machine(protocol_interface_info_entry_t *cur) // Bootstrap_done event to application nwk_bootsrap_state_update(ARM_NWK_BOOTSTRAP_READY, cur); break; + case ER_RPL_NETWORK_LEAVING: + tr_debug("WS SM:RPL Leaving ready trigger discovery"); + ws_bootstrap_event_discovery_start(cur); + break; default: tr_warn("WS SM:Invalid state %d", cur->nwk_bootstrap_state); } @@ -3713,9 +3799,10 @@ void ws_bootstrap_seconds_timer(protocol_interface_info_entry_t *cur, uint32_t s } } else { // Border router has timed out + //Clear Timeout timer cur->ws_info->pan_timeout_timer = 0; tr_warn("Border router has timed out"); - ws_bootstrap_event_discovery_start(cur); + ws_bootstrap_event_disconnect(cur, WS_FAST_DISCONNECT); } } if (cur->ws_info->aro_registration_timer) { diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap.h b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap.h index 7be0655ca3c..8d40c63eee5 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap.h +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_bootstrap.h @@ -24,7 +24,9 @@ typedef enum { WS_DISCOVERY_START, /**< discovery start*/ WS_CONFIGURATION_START, /**< configuration learn start*/ WS_OPERATION_START, /**< active operation start*/ - WS_ROUTING_READY /**< RPL routing connected to BR*/ + WS_ROUTING_READY, /**< RPL routing connected to BR*/ + WS_FAST_DISCONNECT, /**< Do fast timeout after Border router timeout*/ + WS_NORMAL_DISCONNECT /**< Border have been rebooted so Slow poison Process*/ } ws_bootsrap_event_type_e; #ifdef HAVE_WS @@ -60,6 +62,8 @@ void ws_bootstrap_event_operation_start(protocol_interface_info_entry_t *cur); void ws_bootstrap_event_routing_ready(protocol_interface_info_entry_t *cur); +void ws_bootstrap_event_disconnect(protocol_interface_info_entry_t *cur, ws_bootsrap_event_type_e event_type); + void ws_bootstrap_configuration_trickle_reset(protocol_interface_info_entry_t *cur); void ws_bootstrap_seconds_timer(protocol_interface_info_entry_t *cur, uint32_t seconds); diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_cfg_settings.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_cfg_settings.c index 8366204e52a..40e46940f30 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_cfg_settings.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_cfg_settings.c @@ -79,6 +79,32 @@ typedef union { ws_sec_prot_cfg_t sec_prot; } ws_cfgs_t; + +typedef struct cfg_devices_in_config { + uint8_t max_for_small; + uint8_t max_for_medium; + uint8_t max_for_large; + uint8_t max_for_xlarge; +} cfg_devices_in_config_t; + +/* Table for amount of devices that certain configuration should be used + * + * larger data rates allow more devices to be used with faster settings. + * + * For example with network the size of 2000 devices we use + * Xlrage configuration with 50kbs data rate. + * Large configuration with 300kbs data rate. + * and with 600kbs data rate it is possible to use medium network settings. + * + */ +const cfg_devices_in_config_t devices_by_datarate[] = { + { 1, 4, 10, 25}, // Configuration for 50 -100kbs + { 1, 8, 15, 25}, // Configuration for 150kbs - 200kbs + { 2, 15, 25, 50}, // Configuration for 300kbs + { 3, 20, 40, 100}, // Configuration for 600kbs - 2400kbs +}; + + static int8_t ws_cfg_to_get(ws_cfgs_t **cfg, ws_cfgs_t *new_cfg, ws_cfg_validate valid_cb, ws_cfgs_t *external_cfg, uint8_t *cfg_flags, uint8_t *flags); static void ws_cfg_network_size_config_set_small(ws_cfg_nw_size_t *cfg); @@ -258,13 +284,13 @@ int8_t ws_cfg_network_size_set(protocol_interface_info_entry_t *cur, ws_gen_cfg_ ws_cfg_network_size_config_set_size set_function = NULL; - if (cfg->network_size == NETWORK_SIZE_CERTIFICATE) { + if (ws_cfg_network_config_get(cur) == CONFIG_CERTIFICATE) { set_function = ws_cfg_network_size_config_set_certificate; - } else if (cfg->network_size <= NETWORK_SIZE_SMALL || cfg->network_size == NETWORK_SIZE_AUTOMATIC) { + } else if (ws_cfg_network_config_get(cur) == CONFIG_SMALL || cfg->network_size == NETWORK_SIZE_AUTOMATIC) { set_function = ws_cfg_network_size_config_set_small; - } else if (cfg->network_size <= NETWORK_SIZE_MEDIUM) { + } else if (ws_cfg_network_config_get(cur) == CONFIG_MEDIUM) { set_function = ws_cfg_network_size_config_set_medium; - } else if (cfg->network_size <= NETWORK_SIZE_LARGE) { + } else if (ws_cfg_network_config_get(cur) == CONFIG_LARGE) { set_function = ws_cfg_network_size_config_set_large; } else { set_function = ws_cfg_network_size_config_set_xlarge; @@ -360,6 +386,47 @@ int8_t ws_cfg_network_size_configure(protocol_interface_info_entry_t *cur, uint1 return CFG_SETTINGS_OK; } +cfg_network_size_type_e ws_cfg_network_config_get(protocol_interface_info_entry_t *cur) +{ + // Get size of the network Amount of devices in the network + // Get the data rate of the network + // Adjust the configuration type based on the network size and data rate + + (void)cur; + + ws_gen_cfg_t cfg; + if (ws_cfg_gen_get(&cfg, NULL) < 0) { + return CONFIG_SMALL; + } + ws_phy_cfg_t phy_cfg; + if (ws_cfg_phy_get(&phy_cfg, NULL) < 0) { + return CONFIG_SMALL; + } + + uint32_t data_rate = ws_get_datarate_using_operating_mode(phy_cfg.operating_mode); + uint8_t index; + if (data_rate < 150000) { + index = 0; + } else if (data_rate < 300000) { + index = 1; + } else if (data_rate < 600000) { + index = 2; + } else { + index = 3; + } + + if (cfg.network_size == NETWORK_SIZE_CERTIFICATE) { + return CONFIG_CERTIFICATE; + } else if (cfg.network_size <= devices_by_datarate[index].max_for_small) { + return CONFIG_SMALL; + } else if (cfg.network_size <= devices_by_datarate[index].max_for_medium) { + return CONFIG_MEDIUM; + } else if (cfg.network_size <= devices_by_datarate[index].max_for_large) { + return CONFIG_LARGE; + } + return CONFIG_XLARGE; +} + static void ws_cfg_network_size_config_set_small(ws_cfg_nw_size_t *cfg) { @@ -651,6 +718,8 @@ int8_t ws_cfg_phy_default_set(ws_phy_cfg_t *cfg) cfg->regulatory_domain = REG_DOMAIN_EU; cfg->operating_mode = OPERATING_MODE_3; cfg->operating_class = 2; + cfg->phy_mode_id = 255; + cfg->channel_plan_id = 255; return CFG_SETTINGS_OK; } @@ -671,12 +740,16 @@ int8_t ws_cfg_phy_validate(ws_phy_cfg_t *cfg, ws_phy_cfg_t *new_cfg) // Regulator domain, operating mode or class has changed if (cfg->regulatory_domain != new_cfg->regulatory_domain || cfg->operating_mode != new_cfg->operating_mode || - cfg->operating_class != new_cfg->operating_class) { + cfg->operating_class != new_cfg->operating_class || + cfg->phy_mode_id != new_cfg->phy_mode_id || + cfg->channel_plan_id != new_cfg->channel_plan_id) { ws_hopping_schedule_t hopping_schdule = { .regulatory_domain = new_cfg->regulatory_domain, .operating_mode = new_cfg->operating_mode, - .operating_class = new_cfg->operating_class + .operating_class = new_cfg->operating_class, + .phy_mode_id = new_cfg->phy_mode_id, + .channel_plan_id = new_cfg->channel_plan_id }; // Check that new settings are valid @@ -698,11 +771,31 @@ int8_t ws_cfg_phy_set(protocol_interface_info_entry_t *cur, ws_phy_cfg_t *cfg, w if (ret != CFG_SETTINGS_CHANGED) { return ret; } - // Check settings and configure interface if (cur && !(cfg_flags & CFG_FLAGS_DISABLE_VAL_SET)) { + // Set operating mode for FSK if given with PHY mode ID + if ((new_cfg->phy_mode_id == 1) || (new_cfg->phy_mode_id == 17)) { + cur->ws_info->hopping_schdule.operating_mode = OPERATING_MODE_1a; + } else if ((new_cfg->phy_mode_id == 2) || (new_cfg->phy_mode_id == 18)) { + cur->ws_info->hopping_schdule.operating_mode = OPERATING_MODE_1b; + } else if ((new_cfg->phy_mode_id == 3) || (new_cfg->phy_mode_id == 19)) { + cur->ws_info->hopping_schdule.operating_mode = OPERATING_MODE_2a; + } else if ((new_cfg->phy_mode_id == 4) || (new_cfg->phy_mode_id == 20)) { + cur->ws_info->hopping_schdule.operating_mode = OPERATING_MODE_2b; + } else if ((new_cfg->phy_mode_id == 5) || (new_cfg->phy_mode_id == 21)) { + cur->ws_info->hopping_schdule.operating_mode = OPERATING_MODE_3; + } else if ((new_cfg->phy_mode_id == 6) || (new_cfg->phy_mode_id == 22)) { + cur->ws_info->hopping_schdule.operating_mode = OPERATING_MODE_4a; + } else if ((new_cfg->phy_mode_id == 7) || (new_cfg->phy_mode_id == 23)) { + cur->ws_info->hopping_schdule.operating_mode = OPERATING_MODE_4b; + } else if ((new_cfg->phy_mode_id == 8) || (new_cfg->phy_mode_id == 24)) { + cur->ws_info->hopping_schdule.operating_mode = OPERATING_MODE_5; + } else { + cur->ws_info->hopping_schdule.operating_mode = new_cfg->operating_mode; + } + cur->ws_info->hopping_schdule.phy_mode_id = new_cfg->phy_mode_id; + cur->ws_info->hopping_schdule.channel_plan_id = new_cfg->channel_plan_id; cur->ws_info->hopping_schdule.regulatory_domain = new_cfg->regulatory_domain; - cur->ws_info->hopping_schdule.operating_mode = new_cfg->operating_mode; cur->ws_info->hopping_schdule.operating_class = new_cfg->operating_class; if (ws_common_regulatory_domain_config(cur, &cur->ws_info->hopping_schdule) < 0) { diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_cfg_settings.h b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_cfg_settings.h index 35490e33269..763d1ff56fe 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_cfg_settings.h +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_cfg_settings.h @@ -38,6 +38,8 @@ typedef struct ws_phy_cfg_s { uint8_t regulatory_domain; /**< PHY regulatory domain; default "KR" 0x09 */ uint8_t operating_class; /**< PHY operating class; default 1 */ uint8_t operating_mode; /**< PHY operating mode; default "1b" symbol rate 50, modulation index 1 */ + uint8_t phy_mode_id; /**< PHY mode ID; default 255 (not used) */ + uint8_t channel_plan_id; /**< Channel plan ID; default 255 (not used) */ } ws_phy_cfg_t; /** @@ -146,11 +148,23 @@ typedef struct ws_cfg_s { #define CFG_SETTINGS_ERROR_SEC_TIMER_CONF -17 /**< Security timers configuration error */ #define CFG_SETTINGS_ERROR_SEC_PROT_CONF -18 /**< Security protocols configuration error */ +/** Network configuration parameters sets for different network sizes*/ +typedef enum { + CONFIG_CERTIFICATE = 0, ///< Configuration used in Wi-SUN Certification + CONFIG_SMALL = 1, ///< Small networks that can utilize fast recovery + CONFIG_MEDIUM = 2, ///< Medium networks that can form quickly but require balance on load + CONFIG_LARGE = 3, ///< Large networks that needs to throttle joining and maintenance + CONFIG_XLARGE = 4 ///< Xlarge networks with very slow joining, maintenance and recovery profile +} cfg_network_size_type_e; + + int8_t ws_cfg_settings_init(void); int8_t ws_cfg_settings_default_set(void); int8_t ws_cfg_settings_interface_set(protocol_interface_info_entry_t *cur); int8_t ws_cfg_network_size_configure(protocol_interface_info_entry_t *cur, uint16_t network_size); +cfg_network_size_type_e ws_cfg_network_config_get(protocol_interface_info_entry_t *cur); + int8_t ws_cfg_network_size_get(ws_gen_cfg_t *cfg, uint8_t *flags); int8_t ws_cfg_network_size_validate(ws_gen_cfg_t *cfg, ws_gen_cfg_t *new_cfg); int8_t ws_cfg_network_size_set(protocol_interface_info_entry_t *cur, ws_gen_cfg_t *cfg, ws_gen_cfg_t *new_cfg, uint8_t *flags); diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common.c index 11532e41ad4..bf1bca224fb 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common.c @@ -53,33 +53,57 @@ uint8_t DEVICE_MIN_SENS = 174 - 93; uint16_t test_max_child_count_override = 0xffff; -int8_t ws_generate_channel_list(uint32_t *channel_mask, uint16_t number_of_channels, uint8_t regulatory_domain, uint8_t operating_class) +static int8_t ws_disable_channels_in_range(uint32_t *channel_mask, uint16_t number_of_channels, uint16_t range_start, uint16_t range_stop) { - uint32_t excluded_start_channel = 0xFFFFFFFF; - uint32_t excluded_end_channel = 0xFFFFFFFF; - - if (regulatory_domain == REG_DOMAIN_BZ) { - if (operating_class == 1) { - excluded_start_channel = 26; - excluded_end_channel = 64; - } else if (operating_class == 2) { - excluded_start_channel = 12; - excluded_end_channel = 32; - } else if (operating_class == 3) { - excluded_start_channel = 7; - excluded_end_channel = 21; + for (uint16_t i = 0; i < number_of_channels; i++) { + if (i >= range_start && i <= range_stop) { + channel_mask[0 + (i / 32)] &= ~(1 << (i % 32)); } } + return 0; +} +int8_t ws_generate_channel_list(uint32_t *channel_mask, uint16_t number_of_channels, uint8_t regulatory_domain, uint8_t operating_class, uint8_t channel_plan_id) +{ // Clear channel mask for (uint8_t i = 0; i < 8; i++) { channel_mask[i] = 0; } - - // Set channel maks outside excluded channels + // Enable all channels for (uint16_t i = 0; i < number_of_channels; i++) { - if (i < excluded_start_channel || i > excluded_end_channel) { - channel_mask[0 + (i / 32)] |= (1 << (i % 32)); + channel_mask[0 + (i / 32)] |= (1 << (i % 32)); + } + // Disable unsupported channels per regional frequency bands + if (regulatory_domain == REG_DOMAIN_NA) { + if (channel_plan_id == 1) { + ws_disable_channels_in_range(channel_mask, number_of_channels, 1, 7); + } else if (channel_plan_id == 5) { + ws_disable_channels_in_range(channel_mask, number_of_channels, 5, 7); + } + } + if (regulatory_domain == REG_DOMAIN_BZ) { + if (channel_plan_id == 255) { + if (operating_class == 1) { + ws_disable_channels_in_range(channel_mask, number_of_channels, 26, 64); + } else if (operating_class == 2) { + ws_disable_channels_in_range(channel_mask, number_of_channels, 12, 32); + } else if (operating_class == 3) { + ws_disable_channels_in_range(channel_mask, number_of_channels, 7, 21); + } + } else { + if (channel_plan_id == 1) { + ws_disable_channels_in_range(channel_mask, number_of_channels, 1, 7); + ws_disable_channels_in_range(channel_mask, number_of_channels, 64, 64); + ws_disable_channels_in_range(channel_mask, number_of_channels, 72, 103); + ws_disable_channels_in_range(channel_mask, number_of_channels, 106, 111); + } else if (channel_plan_id == 2) { + ws_disable_channels_in_range(channel_mask, number_of_channels, 24, 24); + ws_disable_channels_in_range(channel_mask, number_of_channels, 32, 47); + ws_disable_channels_in_range(channel_mask, number_of_channels, 52, 55); + } else if (channel_plan_id == 5) { + ws_disable_channels_in_range(channel_mask, number_of_channels, 5, 10); + ws_disable_channels_in_range(channel_mask, number_of_channels, 19, 23); + } } } return 0; @@ -109,6 +133,10 @@ uint32_t ws_decode_channel_spacing(uint8_t channel_spacing) return 400000; } else if (CHANNEL_SPACING_600 == channel_spacing) { return 600000; + } else if (CHANNEL_SPACING_800 == channel_spacing) { + return 800000; + } else if (CHANNEL_SPACING_1200 == channel_spacing) { + return 1200000; } return 0; } @@ -129,6 +157,60 @@ uint32_t ws_get_datarate_using_operating_mode(uint8_t operating_mode) return 0; } +uint32_t ws_get_datarate_using_phy_mode_id(uint8_t phy_mode_id) +{ + if (84 == phy_mode_id) { + return 150000; + } else if (85 == phy_mode_id) { + return 200000; + } else if ((68 == phy_mode_id) || (86 == phy_mode_id)) { + return 300000; + } else if ((34 == phy_mode_id) || (51 == phy_mode_id) || (69 == phy_mode_id)) { + return 400000; + } else if ((52 == phy_mode_id) || (70 == phy_mode_id)) { + return 600000; + } else if ((35 == phy_mode_id) || (53 == phy_mode_id)) { + return 800000; + } else if ((36 == phy_mode_id) || (54 == phy_mode_id)) { + return 1200000; + } else if (37 == phy_mode_id) { + return 1600000; + } else if (38 == phy_mode_id) { + return 2400000; + } + return 0; +} + +uint8_t ws_get_ofdm_option_using_phy_mode_id(uint8_t phy_mode_id) +{ + if ((phy_mode_id >= 34) && (phy_mode_id <= 38)) { + return OFDM_OPTION_1; + } else if ((phy_mode_id >= 51) && (phy_mode_id <= 54)) { + return OFDM_OPTION_2; + } else if ((phy_mode_id >= 68) && (phy_mode_id <= 70)) { + return OFDM_OPTION_3; + } else if ((phy_mode_id >= 84) && (phy_mode_id <= 86)) { + return OFDM_OPTION_4; + } + return 0; +} + +uint8_t ws_get_ofdm_mcs_using_phy_mode_id(uint8_t phy_mode_id) +{ + if (34 == phy_mode_id) { + return OFDM_MCS_2; + } else if ((35 == phy_mode_id) || (51 == phy_mode_id)) { + return OFDM_MCS_3; + } else if ((36 == phy_mode_id) || (52 == phy_mode_id) || (68 == phy_mode_id) || (84 == phy_mode_id)) { + return OFDM_MCS_4; + } else if ((37 == phy_mode_id) || (53 == phy_mode_id) || (69 == phy_mode_id) || (85 == phy_mode_id)) { + return OFDM_MCS_5; + } else if ((38 == phy_mode_id) || (54 == phy_mode_id) || (70 == phy_mode_id) || (86 == phy_mode_id)) { + return OFDM_MCS_6; + } + return 0; +} + phy_modulation_index_e ws_get_modulation_index_using_operating_mode(uint8_t operating_mode) { if ((OPERATING_MODE_1b == operating_mode) || (OPERATING_MODE_2b == operating_mode) || (OPERATING_MODE_4b == operating_mode)) { @@ -146,6 +228,38 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur, return -1; } + // Validate PHY mode ID + if (hopping_schdule->phy_mode_id != 255) { + uint8_t phy_mode_id = hopping_schdule->phy_mode_id; + uint8_t phy_type = phy_mode_id >> 4; + uint8_t phy_mode = phy_mode_id & 0x0f; + // Invalid PHY type + if (phy_type > 5) { + return -1; + } + // Invalid OFDM mode + if (phy_type >= 2 && phy_mode > 6) { + return -1; + } + // Skip if PHY mode is for FSK modulation + if (!phy_mode_id || ((phy_mode_id > 8) && (phy_mode_id < 17)) || phy_mode_id > 24) { + // Validate OFDM configurations + if (((phy_mode_id >= 34) && (phy_mode_id <= 38)) || + ((phy_mode_id >= 51) && (phy_mode_id <= 54)) || + ((phy_mode_id >= 68) && (phy_mode_id <= 70)) || + ((phy_mode_id >= 84) && (phy_mode_id <= 86))) { + if (ws_get_datarate_using_phy_mode_id(phy_mode_id) == 0 || + ws_get_ofdm_option_using_phy_mode_id(phy_mode_id) == 0 || + ws_get_ofdm_mcs_using_phy_mode_id(phy_mode_id) == 0) { + //Unsupported PHY mode + return -1; + } + } else { + // Invalid PHY mode ID + return -1; + } + } + } hopping_schdule->channel_plan = 0; if (hopping_schdule->regulatory_domain == REG_DOMAIN_KR) { @@ -185,30 +299,60 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur, return -1; } } else if (hopping_schdule->regulatory_domain == REG_DOMAIN_NA) { - if (hopping_schdule->operating_class == 1) { - hopping_schdule->ch0_freq = 9022; - hopping_schdule->channel_spacing = CHANNEL_SPACING_200; - } else if (hopping_schdule->operating_class == 2) { - hopping_schdule->ch0_freq = 9024; - hopping_schdule->channel_spacing = CHANNEL_SPACING_400; - } else if (hopping_schdule->operating_class == 3) { - hopping_schdule->ch0_freq = 9026; - hopping_schdule->channel_spacing = CHANNEL_SPACING_600; + if (hopping_schdule->channel_plan_id == 255) { + if (hopping_schdule->operating_class == 1) { + hopping_schdule->ch0_freq = 9022; + hopping_schdule->channel_spacing = CHANNEL_SPACING_200; + } else if (hopping_schdule->operating_class == 2) { + hopping_schdule->ch0_freq = 9024; + hopping_schdule->channel_spacing = CHANNEL_SPACING_400; + } else if (hopping_schdule->operating_class == 3) { + hopping_schdule->ch0_freq = 9026; + hopping_schdule->channel_spacing = CHANNEL_SPACING_600; + } else { + return -1; + } } else { - return -1; + if (hopping_schdule->channel_plan_id == 1) { + hopping_schdule->ch0_freq = 9022; + hopping_schdule->channel_spacing = CHANNEL_SPACING_200; + } else if (hopping_schdule->channel_plan_id == 2) { + hopping_schdule->ch0_freq = 9024; + hopping_schdule->channel_spacing = CHANNEL_SPACING_400; + } else if (hopping_schdule->channel_plan_id == 5) { + hopping_schdule->ch0_freq = 9032; + hopping_schdule->channel_spacing = CHANNEL_SPACING_1200; + } else { + return -1; + } } } else if (hopping_schdule->regulatory_domain == REG_DOMAIN_BZ) { - if (hopping_schdule->operating_class == 1) { - hopping_schdule->ch0_freq = 9022; - hopping_schdule->channel_spacing = CHANNEL_SPACING_200; - } else if (hopping_schdule->operating_class == 2) { - hopping_schdule->ch0_freq = 9024; - hopping_schdule->channel_spacing = CHANNEL_SPACING_400; - } else if (hopping_schdule->operating_class == 3) { - hopping_schdule->ch0_freq = 9026; - hopping_schdule->channel_spacing = CHANNEL_SPACING_600; + if (hopping_schdule->channel_plan_id == 255) { + if (hopping_schdule->operating_class == 1) { + hopping_schdule->ch0_freq = 9022; + hopping_schdule->channel_spacing = CHANNEL_SPACING_200; + } else if (hopping_schdule->operating_class == 2) { + hopping_schdule->ch0_freq = 9024; + hopping_schdule->channel_spacing = CHANNEL_SPACING_400; + } else if (hopping_schdule->operating_class == 3) { + hopping_schdule->ch0_freq = 9026; + hopping_schdule->channel_spacing = CHANNEL_SPACING_600; + } else { + return -1; + } } else { - return -1; + if (hopping_schdule->channel_plan_id == 1) { + hopping_schdule->ch0_freq = 9022; + hopping_schdule->channel_spacing = CHANNEL_SPACING_200; + } else if (hopping_schdule->channel_plan_id == 2) { + hopping_schdule->ch0_freq = 9024; + hopping_schdule->channel_spacing = CHANNEL_SPACING_400; + } else if (hopping_schdule->channel_plan_id == 5) { + hopping_schdule->ch0_freq = 9032; + hopping_schdule->channel_spacing = CHANNEL_SPACING_1200; + } else { + return -1; + } } } else if (hopping_schdule->regulatory_domain == REG_DOMAIN_JP) { if (hopping_schdule->operating_class == 1) { @@ -236,7 +380,7 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur, } else { return -1; } - hopping_schdule->number_of_channels = (uint8_t)ws_common_channel_number_calc(hopping_schdule->regulatory_domain, hopping_schdule->operating_class); + hopping_schdule->number_of_channels = (uint8_t)ws_common_channel_number_calc(hopping_schdule->regulatory_domain, hopping_schdule->operating_class, hopping_schdule->channel_plan_id); if (!hopping_schdule->number_of_channels) { return -1; } @@ -244,7 +388,7 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur, return 0; } -uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operating_class) +uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operating_class, uint8_t channel_plan_id) { if (regulatory_domain == REG_DOMAIN_KR) { if (operating_class == 1) { @@ -269,12 +413,22 @@ uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operat return 10; } } else if (regulatory_domain == REG_DOMAIN_NA) { - if (operating_class == 1) { - return 129; - } else if (operating_class == 2) { - return 64; - } else if (operating_class == 3) { - return 42; + if (channel_plan_id == 255) { + if (operating_class == 1) { + return 129; + } else if (operating_class == 2) { + return 64; + } else if (operating_class == 3) { + return 42; + } + } else { + if (channel_plan_id == 1) { + return 136; + } else if (channel_plan_id == 2) { + return 64; + } else if (channel_plan_id == 5) { + return 24; + } } } else if (regulatory_domain == REG_DOMAIN_JP) { if (operating_class == 1) { @@ -285,12 +439,22 @@ uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operat return 12; } } else if (regulatory_domain == REG_DOMAIN_BZ) { - if (operating_class == 1) { - return 129; - } else if (operating_class == 2) { - return 64; - } else if (operating_class == 3) { - return 42; + if (channel_plan_id == 255) { + if (operating_class == 1) { + return 129; + } else if (operating_class == 2) { + return 64; + } else if (operating_class == 3) { + return 42; + } + } else { + if (channel_plan_id == 1) { + return 136; + } else if (channel_plan_id == 2) { + return 64; + } else if (channel_plan_id == 5) { + return 24; + } } } else if (regulatory_domain == REG_DOMAIN_WW) { if (operating_class == 1) { @@ -366,10 +530,16 @@ void ws_common_neighbor_update(protocol_interface_info_entry_t *cur, const uint8 } } +void ws_common_black_list_neighbour(const uint8_t *ll_address, uint8_t nd_status) +{ + if (nd_status == ARO_FULL) { + blacklist_update(ll_address, false); + } +} + void ws_common_aro_failure(protocol_interface_info_entry_t *cur, const uint8_t *ll_address) { tr_warn("ARO registration Failure %s", trace_ipv6(ll_address)); - blacklist_update(ll_address, false); ws_bootstrap_aro_failure(cur, ll_address); } @@ -478,18 +648,13 @@ bool ws_common_negative_aro_mark(protocol_interface_info_entry_t *interface, con uint32_t ws_common_latency_estimate_get(protocol_interface_info_entry_t *cur) { uint32_t latency = 0; - uint8_t network_size = cur->ws_info->cfg->gen.network_size; - - if (network_size == NETWORK_SIZE_AUTOMATIC) { - network_size = cur->ws_info->pan_information.pan_size / 100; - } - if (network_size <= NETWORK_SIZE_SMALL) { - // handles also NETWORK_SIZE_CERTIFICATE + if (ws_cfg_network_config_get(cur) <= CONFIG_SMALL) { + // Also has the certificate settings latency = 5000; - } else if (network_size <= NETWORK_SIZE_MEDIUM) { + } else if (ws_cfg_network_config_get(cur) <= CONFIG_MEDIUM) { latency = 10000; - } else if (network_size <= NETWORK_SIZE_LARGE) { + } else if (ws_cfg_network_config_get(cur) <= CONFIG_LARGE) { latency = 20000; } else { latency = 30000; diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common.h b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common.h index f0aaf9fde03..c4f92f53816 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common.h +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common.h @@ -122,7 +122,7 @@ typedef struct ws_info_s { #ifdef HAVE_WS -int8_t ws_generate_channel_list(uint32_t *channel_mask, uint16_t number_of_channels, uint8_t regulatory_domain, uint8_t operating_class); +int8_t ws_generate_channel_list(uint32_t *channel_mask, uint16_t number_of_channels, uint8_t regulatory_domain, uint8_t operating_class, uint8_t channel_plan_id); uint16_t ws_active_channel_count(uint32_t *channel_mask, uint16_t number_of_channels); @@ -130,11 +130,17 @@ uint32_t ws_decode_channel_spacing(uint8_t channel_spacing); uint32_t ws_get_datarate_using_operating_mode(uint8_t operating_mode); +uint32_t ws_get_datarate_using_phy_mode_id(uint8_t phy_mode_id); + +uint8_t ws_get_ofdm_option_using_phy_mode_id(uint8_t phy_mode_id); + +uint8_t ws_get_ofdm_mcs_using_phy_mode_id(uint8_t phy_mode_id); + phy_modulation_index_e ws_get_modulation_index_using_operating_mode(uint8_t operating_mode); int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur, ws_hopping_schedule_t *hopping_schdule); -uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operating_class); +uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operating_class, uint8_t channel_plan_id); int8_t ws_common_allocate_and_init(protocol_interface_info_entry_t *cur); @@ -144,6 +150,8 @@ void ws_common_fast_timer(protocol_interface_info_entry_t *cur, uint16_t ticks); void ws_common_neighbor_update(protocol_interface_info_entry_t *cur, const uint8_t *ll_address); +void ws_common_black_list_neighbour(const uint8_t *ll_address, uint8_t nd_status); + void ws_common_aro_failure(protocol_interface_info_entry_t *cur, const uint8_t *ll_address); void ws_common_neighbor_remove(protocol_interface_info_entry_t *cur, const uint8_t *ll_address); @@ -170,6 +178,7 @@ uint8_t ws_common_temporary_entry_size(uint8_t mac_table_size); #define ws_info(cur) ((ws_info_t *) NULL) #define ws_common_seconds_timer(cur, seconds) #define ws_common_neighbor_update(cur, ll_address) ((void) 0) +#define ws_common_black_list_neighbour(ll_address, nd_status) ((void) 0) #define ws_common_aro_failure(cur, ll_address) #define ws_common_neighbor_remove(cur, ll_address) #define ws_common_fast_timer(cur, ticks) ((void) 0) diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common_defines.h b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common_defines.h index 7ce70d0146e..89a698b3d3c 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common_defines.h +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_common_defines.h @@ -100,6 +100,8 @@ typedef struct ws_hopping_schedule_s { uint8_t regulatory_domain; /**< PHY regulatory domain default to "KR" 0x09 */ uint8_t operating_class; /**< PHY operating class default to 1 */ uint8_t operating_mode; /**< PHY operating mode default to "1b" symbol rate 50, modulation index 1 */ + uint8_t phy_mode_id; /**< PHY mode ID, default to 255 */ + uint8_t channel_plan_id; /**< Channel plan ID, default to 255 */ uint8_t channel_plan; /**< 0: use regulatory domain values 1: application defined plan */ uint8_t uc_channel_function; /**< 0: Fixed channel, 1:TR51CF, 2: Direct Hash, 3: Vendor defined */ uint8_t bc_channel_function; /**< 0: Fixed channel, 1:TR51CF, 2: Direct Hash, 3: Vendor defined */ diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_empty_functions.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_empty_functions.c index 990c423df8d..17443e8469e 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_empty_functions.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_empty_functions.c @@ -68,6 +68,24 @@ int ws_management_network_name_validate( return -1; } +int ws_management_phy_mode_id_set( + int8_t interface_id, + uint8_t phy_mode_id) +{ + (void)interface_id; + (void)phy_mode_id; + return -1; +} + +int ws_management_channel_plan_id_set( + int8_t interface_id, + uint8_t channel_plan_id) +{ + (void)interface_id; + (void)channel_plan_id; + return -1; +} + int ws_management_regulatory_domain_set( int8_t interface_id, uint8_t regulatory_domain, diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_management_api.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_management_api.c index 10fcebf5492..bdd2aadc9a5 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_management_api.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_management_api.c @@ -156,6 +156,74 @@ int ws_management_network_name_validate( return 0; } +int ws_management_phy_mode_id_set( + int8_t interface_id, + uint8_t phy_mode_id) +{ + protocol_interface_info_entry_t *cur; + + cur = protocol_stack_interface_info_get_by_id(interface_id); + if (interface_id >= 0 && (!cur || !ws_info(cur))) { + return -1; + } + + ws_phy_cfg_t cfg; + ws_phy_cfg_t cfg_default; + if (ws_cfg_phy_get(&cfg, NULL) < 0) { + return -3; + } + + if (ws_cfg_phy_default_set(&cfg_default) < 0) { + return -3; + } + + if (phy_mode_id != 255) { + cfg.phy_mode_id = phy_mode_id; + } else { + cfg.phy_mode_id = cfg_default.phy_mode_id; + } + + if (ws_cfg_phy_set(cur, NULL, &cfg, 0) < 0) { + return -4; + } + + return 0; +} + +int ws_management_channel_plan_id_set( + int8_t interface_id, + uint8_t channel_plan_id) +{ + protocol_interface_info_entry_t *cur; + + cur = protocol_stack_interface_info_get_by_id(interface_id); + if (interface_id >= 0 && (!cur || !ws_info(cur))) { + return -1; + } + + ws_phy_cfg_t cfg; + ws_phy_cfg_t cfg_default; + if (ws_cfg_phy_get(&cfg, NULL) < 0) { + return -3; + } + + if (ws_cfg_phy_default_set(&cfg_default) < 0) { + return -3; + } + + if (channel_plan_id != 255) { + cfg.channel_plan_id = channel_plan_id; + } else { + cfg.channel_plan_id = cfg_default.channel_plan_id; + } + + if (ws_cfg_phy_set(cur, NULL, &cfg, 0) < 0) { + return -4; + } + + return 0; +} + int ws_management_regulatory_domain_set( int8_t interface_id, uint8_t regulatory_domain, diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_neighbor_class.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_neighbor_class.c index 35647c1e121..ab24bf0ed83 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_neighbor_class.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_neighbor_class.c @@ -254,7 +254,7 @@ void ws_neighbor_class_neighbor_unicast_schedule_set(ws_neighbor_class_entry_t * } else { if (ws_us->channel_plan == 0) { - ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels = ws_common_channel_number_calc(ws_us->plan.zero.regulator_domain, ws_us->plan.zero.operation_class); + ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels = ws_common_channel_number_calc(ws_us->plan.zero.regulator_domain, ws_us->plan.zero.operation_class, own_shedule->channel_plan_id); } else if (ws_us->channel_plan == 1) { ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels = ws_us->plan.one.number_of_channel; @@ -262,16 +262,16 @@ void ws_neighbor_class_neighbor_unicast_schedule_set(ws_neighbor_class_entry_t * //Handle excluded channel and generate activate channel list if (ws_us->excluded_channel_ctrl == WS_EXC_CHAN_CTRL_RANGE) { - ws_generate_channel_list(ws_neighbor->fhss_data.uc_channel_list.channel_mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels, own_shedule->regulatory_domain, own_shedule->operating_class); + ws_generate_channel_list(ws_neighbor->fhss_data.uc_channel_list.channel_mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels, own_shedule->regulatory_domain, own_shedule->operating_class, own_shedule->channel_plan_id); ws_neighbor->fhss_data.uc_channel_list.channel_count = ws_active_channel_count(ws_neighbor->fhss_data.uc_channel_list.channel_mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels); ws_neighbour_excluded_mask_by_range(&ws_neighbor->fhss_data.uc_channel_list, &ws_us->excluded_channels.range, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels); } else if (ws_us->excluded_channel_ctrl == WS_EXC_CHAN_CTRL_BITMASK) { - ws_generate_channel_list(ws_neighbor->fhss_data.uc_channel_list.channel_mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels, own_shedule->regulatory_domain, own_shedule->operating_class); + ws_generate_channel_list(ws_neighbor->fhss_data.uc_channel_list.channel_mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels, own_shedule->regulatory_domain, own_shedule->operating_class, own_shedule->channel_plan_id); ws_neighbor->fhss_data.uc_channel_list.channel_count = ws_active_channel_count(ws_neighbor->fhss_data.uc_channel_list.channel_mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels); ws_neighbour_excluded_mask_by_mask(&ws_neighbor->fhss_data.uc_channel_list, &ws_us->excluded_channels.mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels); } else if (ws_us->excluded_channel_ctrl == WS_EXC_CHAN_CTRL_NONE) { if (ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels != ws_neighbor->fhss_data.uc_channel_list.channel_count) { - ws_generate_channel_list(ws_neighbor->fhss_data.uc_channel_list.channel_mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels, own_shedule->regulatory_domain, own_shedule->operating_class); + ws_generate_channel_list(ws_neighbor->fhss_data.uc_channel_list.channel_mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels, own_shedule->regulatory_domain, own_shedule->operating_class, own_shedule->channel_plan_id); ws_neighbor->fhss_data.uc_channel_list.channel_count = ws_active_channel_count(ws_neighbor->fhss_data.uc_channel_list.channel_mask, ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels); } } diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_pae_key_storage.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_pae_key_storage.c index 7ee66a073a9..e8026364a3d 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_pae_key_storage.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_pae_key_storage.c @@ -186,6 +186,7 @@ static int8_t ws_pae_key_storage_allocate(const void *instance, uint16_t key_sto if (new_storage_array == NULL) { key_storage_array->storage_array_handle = ns_dyn_mem_alloc(key_storage_size); if (!key_storage_array->storage_array_handle) { + ns_dyn_mem_free(key_storage_array); return -1; } key_storage_array->allocated = true; diff --git a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_pae_supp.c b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_pae_supp.c index 13c1e149ec3..d3dc8a0220b 100644 --- a/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_pae_supp.c +++ b/features/nanostack/sal-stack-nanostack/source/6LoWPAN/ws/ws_pae_supp.c @@ -269,6 +269,8 @@ int8_t ws_pae_supp_border_router_addr_read(protocol_interface_info_entry_t *inte int8_t ws_pae_supp_nw_key_valid(protocol_interface_info_entry_t *interface_ptr, uint8_t *br_iid) { + (void) br_iid; + pae_supp_t *pae_supp = ws_pae_supp_get(interface_ptr); if (!pae_supp) { return -1; @@ -276,24 +278,6 @@ int8_t ws_pae_supp_nw_key_valid(protocol_interface_info_entry_t *interface_ptr, tr_info("NW key valid indication"); - // Store border router EUI-64 received on bootstrap complete - memcpy(pae_supp->comp_br_eui_64, br_iid, 8); - pae_supp->comp_br_eui_64[0] ^= 0x02; - pae_supp->comp_br_eui_64_set = true; - - // Get the EUI-64 used on 4WH handshake PTK generation - uint8_t *ptk_eui_64 = sec_prot_keys_ptk_eui_64_get(&pae_supp->entry.sec_keys); - - /* If border router EUI-64 received on bootstrap complete does not match to - EUI-64 stored with keys, delete keys */ - if (!ptk_eui_64 || memcmp(ptk_eui_64, pae_supp->comp_br_eui_64, 8) != 0) { - tr_warn("Delete keys: PTK EUI-64 %s does not match to BR EUI-64 %s", - ptk_eui_64 ? tr_array(ptk_eui_64, 8) : "", tr_array(pae_supp->comp_br_eui_64, 8)); - sec_prot_keys_pmk_delete(&pae_supp->entry.sec_keys); - sec_prot_keys_ptk_delete(&pae_supp->entry.sec_keys); - sec_prot_keys_ptk_eui_64_delete(&pae_supp->entry.sec_keys); - } - // Stored keys are valid pae_supp->nw_keys_used_cnt = 0; diff --git a/features/nanostack/sal-stack-nanostack/source/Common_Protocols/icmpv6.c b/features/nanostack/sal-stack-nanostack/source/Common_Protocols/icmpv6.c index a661f743860..ba9bb0b684e 100644 --- a/features/nanostack/sal-stack-nanostack/source/Common_Protocols/icmpv6.c +++ b/features/nanostack/sal-stack-nanostack/source/Common_Protocols/icmpv6.c @@ -357,6 +357,7 @@ static void icmpv6_na_wisun_aro_handler(protocol_interface_info_entry_t *cur_int (void)life_time; if (nd_status != ARO_SUCCESS) { + ws_common_black_list_neighbour(src_addr, nd_status); ws_common_aro_failure(cur_interface, src_addr); } } @@ -1447,7 +1448,7 @@ static void icmpv6_aro_cb(buffer_t *buf, uint8_t status) ll_address[8] ^= 2; } if (rpl_control_address_register_done(buf->interface, ll_address, status)) { - // When RPL returns true neighbor should be blacklisted + // When RPL returns true neighbor should be deleted ws_common_aro_failure(buf->interface, ll_address); } } diff --git a/features/nanostack/sal-stack-nanostack/source/Common_Protocols/tcp.c b/features/nanostack/sal-stack-nanostack/source/Common_Protocols/tcp.c index 311a0e96a75..2a0b6d498a7 100644 --- a/features/nanostack/sal-stack-nanostack/source/Common_Protocols/tcp.c +++ b/features/nanostack/sal-stack-nanostack/source/Common_Protocols/tcp.c @@ -82,7 +82,7 @@ void tcp_test_drop_reset() } #endif -#ifdef FEA_TRACE_SUPPORT +#if defined(FEA_TRACE_SUPPORT) && MBED_CONF_MBED_TRACE_ENABLE && (MBED_TRACE_MAX_LEVEL >= TRACE_LEVEL_DEBUG) static const char *trace_tcp_flags(uint16_t flags) { static char buf[9]; @@ -1223,7 +1223,9 @@ buffer_t *tcp_up(buffer_t *buf) seg_len++; } +#if defined(FEA_TRACE_SUPPORT) && MBED_CONF_MBED_TRACE_ENABLE && (MBED_TRACE_MAX_LEVEL >= TRACE_LEVEL_DEBUG) tr_debug("TCP_UP: dst_p=%d, src_p=%d, flags=%s", buf->dst_sa.port, buf->src_sa.port, trace_tcp_flags(flags)); +#endif /* clear flags that will be ignored */ flags &= ~(TCP_FLAG_CWR | TCP_FLAG_ECE | TCP_FLAG_URG); diff --git a/features/nanostack/sal-stack-nanostack/source/Core/ns_monitor.c b/features/nanostack/sal-stack-nanostack/source/Core/ns_monitor.c index 17a46eb6233..22d4c43e50f 100644 --- a/features/nanostack/sal-stack-nanostack/source/Core/ns_monitor.c +++ b/features/nanostack/sal-stack-nanostack/source/Core/ns_monitor.c @@ -34,6 +34,7 @@ #include "ipv6_stack/ipv6_routing_table.h" #include "NWK_INTERFACE/Include/protocol.h" #include "6LoWPAN/ws/ws_pae_controller.h" +#include "6LoWPAN/lowpan_adaptation_interface.h" #include "NWK_INTERFACE/Include/protocol.h" #define TRACE_GROUP "mntr" @@ -73,7 +74,8 @@ typedef void (ns_maintenance_gc_cb)(bool full_gc); */ static ns_maintenance_gc_cb *ns_maintenance_gc_functions[] = { ipv6_destination_cache_forced_gc, - ws_pae_controller_forced_gc + ws_pae_controller_forced_gc, + lowpan_adaptation_free_heap }; static void ns_monitor_heap_gc(bool full_gc) diff --git a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_defines.h b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_defines.h index 26f51cd520c..84e2612fcf2 100644 --- a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_defines.h +++ b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_defines.h @@ -26,6 +26,7 @@ struct cca_structure_s; struct buffer; struct mac_pre_build_frame; +struct mac_pre_parsed_frame_s; struct mlme_key_descriptor_s; struct arm_device_driver_list; struct fhss_api; @@ -204,6 +205,7 @@ typedef struct protocol_interface_rf_mac_setup { bool macBroadcastDisabled: 1; bool scan_active: 1; bool rf_csma_extension_supported: 1; + bool rf_pd_ack_buffer_is_in_use: 1; uint16_t mac_short_address; uint16_t pan_id; uint8_t mac64[8]; @@ -233,7 +235,9 @@ typedef struct protocol_interface_rf_mac_setup { struct mac_pre_build_frame *pd_data_request_queue_to_go; struct mac_pre_build_frame *pd_data_request_bc_queue_to_go; struct mac_pre_build_frame *active_pd_data_request; + struct mac_pre_parsed_frame_s *pd_rx_ack_buffer; /* MAC Beacon info */ + uint16_t allocated_ack_buffer_length; uint16_t max_beacon_payload_length; uint8_t *mac_beacon_payload; uint8_t mac_beacon_payload_size; @@ -253,6 +257,7 @@ typedef struct protocol_interface_rf_mac_setup { struct mac_pre_build_frame enhanced_ack_buffer; uint32_t enhanced_ack_handler_timestamp; arm_event_t mac_mcps_timer_event; + arm_event_storage_t mac_ack_event; uint16_t indirect_pending_bytes; arm_nwk_mlme_event_type_e mac_mlme_event; mac_event_t timer_mac_event; @@ -267,7 +272,7 @@ typedef struct protocol_interface_rf_mac_setup { int8_t bc_timer_id; uint32_t mlme_tick_count; uint32_t symbol_rate; - uint32_t symbol_time_us; + uint32_t symbol_time_ns; uint32_t datarate; uint8_t max_ED; uint16_t mlme_ED_counter; diff --git a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_filter.c b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_filter.c index 8903c7c8f4c..a1a3ea94721 100644 --- a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_filter.c +++ b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_filter.c @@ -29,6 +29,7 @@ #include "mac_mcps.h" #include "MAC/IEEE802_15_4/mac_mcps_sap.h" #include "MAC/IEEE802_15_4/mac_header_helper_functions.h" +#include "MAC/rf_driver_storage.h" #define TRACE_GROUP "mFil" @@ -291,7 +292,7 @@ int_fast8_t mac_filter_add_long(int8_t interface_id, uint8_t mac64[8], int16_t l return 0; } -int_fast8_t mac_filter_modify_link_quality(int8_t interface_id, mac_pre_parsed_frame_t *mac_frame) +int_fast8_t mac_filter_modify_link_quality(int8_t interface_id, struct mac_fcf_sequence_s *fcf, struct arm_pd_sap_generic_ind_s *mac_frame) { filter_instance_t *this = filter_instance_find(interface_id); filter_t *filter_ptr = NULL; @@ -300,25 +301,24 @@ int_fast8_t mac_filter_modify_link_quality(int8_t interface_id, mac_pre_parsed_f int16_t dbm_m; int16_t dbm_add; - if (!this || !mac_frame) { + if (!this) { return 0; } if (!this->enabled) { return 0; } + tr_debug_extra("mac_filter_modify_link_quality lqi %d dbm %d", mac_frame->link_quality, mac_frame->dbm); - tr_debug_extra("mac_filter_modify_link_quality lqi %d dbm %d", mac_frame->LQI, mac_frame->dbm); - - if (mac_frame->fcf_dsn.SrcAddrMode == MAC_ADDR_MODE_NONE) { + if (fcf->SrcAddrMode == MAC_ADDR_MODE_NONE) { return 0; } uint8_t srcAddress[8]; - mac_header_get_src_address(&mac_frame->fcf_dsn, mac_header_message_start_pointer(mac_frame), srcAddress); + mac_header_get_src_address(fcf, mac_frame->data_ptr, srcAddress); //Find filter for specific address - if (mac_frame->fcf_dsn.SrcAddrMode == MAC_ADDR_MODE_16_BIT) { + if (fcf->SrcAddrMode == MAC_ADDR_MODE_16_BIT) { uint16_t mac16 = common_read_16_bit(srcAddress); filter_ptr = filter_find_short(this, mac16); if (!filter_ptr && this->resolve_long_cb) { @@ -354,14 +354,14 @@ int_fast8_t mac_filter_modify_link_quality(int8_t interface_id, mac_pre_parsed_f } //calculate - int16_t lqi = ((mac_frame->LQI * lqi_m) >> 8) + lqi_add; + int16_t lqi = ((mac_frame->link_quality * lqi_m) >> 8) + lqi_add; // Saturate if (lqi > 255) { - mac_frame->LQI = 255; + mac_frame->link_quality = 255; } else if (lqi < 0) { - mac_frame->LQI = 0; + mac_frame->link_quality = 0; } else { - mac_frame->LQI = lqi; + mac_frame->link_quality = lqi; } //calculate @@ -375,14 +375,14 @@ int_fast8_t mac_filter_modify_link_quality(int8_t interface_id, mac_pre_parsed_f mac_frame->dbm = dbm; } - tr_debug_extra("mac_filter_modify_link_quality result lqi %d dbm %d", mac_frame->LQI, mac_frame->dbm); + tr_debug_extra("mac_filter_modify_link_quality result lqi %d dbm %d", mac_frame->link_quality, mac_frame->dbm); // If quality goes below treshold packet is dropped if ((dbm_m != 0x100 || dbm_add != 0) && (mac_frame->dbm < MAC_FILTER_SIGNAL_FLOOR)) { tr_debug_extra("Filter dropped packet signal too low"); return 1; } - if ((lqi_m != 0x100 || lqi_add != 0) && (mac_frame->LQI < 1)) { + if ((lqi_m != 0x100 || lqi_add != 0) && (mac_frame->link_quality < 1)) { tr_debug_extra("Filter dropped packet LQI < 1"); return 1; } diff --git a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_filter.h b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_filter.h index 784a9a884c9..2df4e901cd8 100644 --- a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_filter.h +++ b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_filter.h @@ -24,7 +24,8 @@ #ifndef MAC_FILTER_H_ #define MAC_FILTER_H_ -struct mac_pre_parsed_frame_s; +struct mac_fcf_sequence_s; +struct arm_pd_sap_generic_ind_s; /** * Modify the link quality values. @@ -41,6 +42,6 @@ struct mac_pre_parsed_frame_s; * return >0 Packet is ignored. * return 0 Packet is not dropped. */ -int_fast8_t mac_filter_modify_link_quality(int8_t interface_id, struct mac_pre_parsed_frame_s *mac_frame); +int_fast8_t mac_filter_modify_link_quality(int8_t interface_id, struct mac_fcf_sequence_s *fcf, struct arm_pd_sap_generic_ind_s *mac_frame); #endif /* MAC_FILTER_H_ */ diff --git a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mcps_sap.c b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mcps_sap.c index a47753c3a30..899813b7249 100644 --- a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mcps_sap.c +++ b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mcps_sap.c @@ -2372,6 +2372,18 @@ static mac_pre_build_frame_t *mcps_sap_pd_req_queue_read(protocol_interface_rf_m void mcps_sap_pre_parsed_frame_buffer_free(mac_pre_parsed_frame_t *buf) { + if (!buf) { + return; + } + + if (buf->mac_class_ptr && buf->fcf_dsn.frametype == FC_ACK_FRAME) { + struct protocol_interface_rf_mac_setup *rf_mac_setup = buf->mac_class_ptr; + if (rf_mac_setup->rf_pd_ack_buffer_is_in_use) { + rf_mac_setup->rf_pd_ack_buffer_is_in_use = false; + return; + } + } + ns_dyn_mem_free(buf); } @@ -2388,6 +2400,37 @@ mac_pre_parsed_frame_t *mcps_sap_pre_parsed_frame_buffer_get(const uint8_t *data return buffer; } +mac_pre_parsed_frame_t *mcps_sap_pre_parsed_ack_buffer_get(protocol_interface_rf_mac_setup_s *rf_ptr, const uint8_t *data_ptr, uint16_t frame_length) +{ + + if (rf_ptr->rf_pd_ack_buffer_is_in_use) { +#ifdef __linux__ + tr_debug("mac ACK buffer get fail: already active"); +#endif + return NULL; + } + + if (frame_length > rf_ptr->allocated_ack_buffer_length) { + //Free Current + if (rf_ptr->pd_rx_ack_buffer) { + ns_dyn_mem_free(rf_ptr->pd_rx_ack_buffer); + rf_ptr->allocated_ack_buffer_length = 0; + } + rf_ptr->pd_rx_ack_buffer = ns_dyn_mem_alloc(sizeof(mac_pre_parsed_frame_t) + frame_length); + if (!rf_ptr->pd_rx_ack_buffer) { + return NULL; + } + rf_ptr->allocated_ack_buffer_length = frame_length; + } + memset(rf_ptr->pd_rx_ack_buffer, 0, sizeof(mac_pre_parsed_frame_t) + rf_ptr->allocated_ack_buffer_length); + rf_ptr->pd_rx_ack_buffer->frameLength = frame_length; + memcpy(mac_header_message_start_pointer(rf_ptr->pd_rx_ack_buffer), data_ptr, frame_length); + //Mark active ACK buffer state + rf_ptr->rf_pd_ack_buffer_is_in_use = true; + return rf_ptr->pd_rx_ack_buffer; +} + + static void mac_set_active_event(protocol_interface_rf_mac_setup_s *rf_mac_setup, uint8_t event_type) { rf_mac_setup->active_mac_events |= (1 << event_type); @@ -2458,21 +2501,36 @@ int8_t mcps_sap_pd_confirm_failure(void *mac_ptr) return eventOS_event_send(&event); } -void mcps_sap_pd_ack(void *ack_ptr) +int8_t mcps_sap_pd_ack(struct protocol_interface_rf_mac_setup *rf_ptr, mac_pre_parsed_frame_t *buffer) { - if (mac_tasklet_event_handler < 0 || !ack_ptr) { - return; + if (mac_tasklet_event_handler < 0 || !buffer) { + return -1; + } + + if (buffer->fcf_dsn.frametype == FC_ACK_FRAME) { + arm_event_storage_t *event = &rf_ptr->mac_ack_event; + event->data.data_ptr = buffer; + event->data.event_data = 0; + event->data.event_id = 0; + event->data.event_type = MCPS_SAP_DATA_ACK_CNF_EVENT; + event->data.priority = ARM_LIB_HIGH_PRIORITY_EVENT; + event->data.sender = 0; + event->data.receiver = mac_tasklet_event_handler; + eventOS_event_send_user_allocated(event); + + return 0; } + arm_event_s event = { .receiver = mac_tasklet_event_handler, .sender = 0, .event_id = 0, - .data_ptr = ack_ptr, + .data_ptr = buffer, .event_type = MCPS_SAP_DATA_ACK_CNF_EVENT, .priority = ARM_LIB_HIGH_PRIORITY_EVENT, }; - eventOS_event_send(&event); + return eventOS_event_send(&event); } void mcps_sap_trig_tx(void *mac_ptr) @@ -2566,6 +2624,17 @@ void mac_mcps_buffer_queue_free(protocol_interface_rf_mac_setup_s *rf_mac_setup) mcps_sap_prebuild_frame_buffer_free(buffer); } } + + if (rf_mac_setup->pd_rx_ack_buffer) { + if (rf_mac_setup->rf_pd_ack_buffer_is_in_use) { + eventOS_cancel(&rf_mac_setup->mac_ack_event); + rf_mac_setup->rf_pd_ack_buffer_is_in_use = false; + } + ns_dyn_mem_free(rf_mac_setup->pd_rx_ack_buffer); + rf_mac_setup->pd_rx_ack_buffer = NULL; + rf_mac_setup->allocated_ack_buffer_length = 0; + } + } /** * Function return list start pointer diff --git a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mcps_sap.h b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mcps_sap.h index fb212e20a26..3992ae31251 100644 --- a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mcps_sap.h +++ b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mcps_sap.h @@ -36,6 +36,7 @@ struct mcps_purge_s; struct mcps_data_req_ie_list; struct channel_list_s; struct mcps_enhanced_frame_response_s; +struct mac_pre_parsed_frame_s; /** Address types */ typedef enum { @@ -100,6 +101,8 @@ void mcps_sap_pd_req_queue_write(struct protocol_interface_rf_mac_setup *rf_mac_ */ mac_pre_parsed_frame_t *mcps_sap_pre_parsed_frame_buffer_get(const uint8_t *data_ptr, uint16_t frame_length); +mac_pre_parsed_frame_t *mcps_sap_pre_parsed_ack_buffer_get(struct protocol_interface_rf_mac_setup *rf_ptr, const uint8_t *data_ptr, uint16_t frame_length); + /** * Forward Buffer for MAC MCPS SAP layer event handler */ @@ -112,7 +115,7 @@ int8_t mcps_sap_pd_confirm(void *mac_ptr); int8_t mcps_sap_pd_confirm_failure(void *mac_ptr); -void mcps_sap_pd_ack(void *ack_ptr); +int8_t mcps_sap_pd_ack(struct protocol_interface_rf_mac_setup *rf_ptr, struct mac_pre_parsed_frame_s *buffer); int8_t mac_virtual_sap_data_cb(void *identifier, struct arm_phy_sap_msg_s *message); diff --git a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mlme.c b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mlme.c index 0e6ae5ca36a..5530c6b3aec 100644 --- a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mlme.c +++ b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_mlme.c @@ -652,11 +652,11 @@ void mac_extended_mac_set(protocol_interface_rf_mac_setup_s *rf_mac_setup, const static uint32_t mac_calc_ack_wait_duration(protocol_interface_rf_mac_setup_s *rf_mac_setup, uint16_t symbols) { - uint32_t AckWaitDuration = 0; + uint32_t AckWaitDuration_us = 0; if (rf_mac_setup->rf_csma_extension_supported) { - AckWaitDuration = symbols * rf_mac_setup->symbol_time_us; + AckWaitDuration_us = (symbols * rf_mac_setup->symbol_time_ns) / 1000; } - return AckWaitDuration; + return AckWaitDuration_us; } static int8_t mac_mlme_set_ack_wait_duration(protocol_interface_rf_mac_setup_s *rf_mac_setup, const mlme_set_t *set_req) @@ -1107,8 +1107,8 @@ static int mac_mlme_set_symbol_rate(protocol_interface_rf_mac_setup_s *rf_mac_se { if (rf_mac_setup->rf_csma_extension_supported) { rf_mac_setup->dev_driver->phy_driver->extension(PHY_EXTENSION_GET_SYMBOLS_PER_SECOND, (uint8_t *) &rf_mac_setup->symbol_rate); - rf_mac_setup->symbol_time_us = 1000000 / rf_mac_setup->symbol_rate; - tr_debug("SW-MAC driver support rf extension %"PRIu32" symbol/seconds %"PRIu32" us symbol time length", rf_mac_setup->symbol_rate, rf_mac_setup->symbol_time_us); + rf_mac_setup->symbol_time_ns = 1000000000 / rf_mac_setup->symbol_rate; + tr_debug("SW-MAC driver support rf extension %"PRIu32" symbol/seconds %"PRIu32" ns symbol time length", rf_mac_setup->symbol_rate, rf_mac_setup->symbol_time_ns); return 0; } return -1; diff --git a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_pd_sap.c b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_pd_sap.c index dad7da84fd5..766901c82c0 100644 --- a/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_pd_sap.c +++ b/features/nanostack/sal-stack-nanostack/source/MAC/IEEE802_15_4/mac_pd_sap.c @@ -97,7 +97,7 @@ uint32_t mac_csma_backoff_get(protocol_interface_rf_mac_setup_s *rf_mac_setup) uint32_t backoff_in_us; //Multiple aUnitBackoffPeriod symbol time if (rf_mac_setup->rf_csma_extension_supported) { - backoff_in_us = backoff * rf_mac_setup->aUnitBackoffPeriod * rf_mac_setup->symbol_time_us; + backoff_in_us = backoff * rf_mac_setup->aUnitBackoffPeriod * (rf_mac_setup->symbol_time_ns / 1000); } else { backoff_in_us = backoff * rf_mac_setup->backoff_period_in_10us * 10; } @@ -480,6 +480,8 @@ static int8_t mac_data_interface_tx_done_cb(protocol_interface_rf_mac_setup_s *r rf_ptr->dev_driver->phy_driver->phy_tail_length, active_buf->tx_time); // When FHSS TX handle returns -1, transmission of the packet is currently not allowed -> restart CCA timer if (tx_handle_retval == -1) { + // RX channel could have changed during CSMA-CA, must update using TX done callback + rf_ptr->fhss_api->data_tx_done(rf_ptr->fhss_api, false, false, rf_ptr->active_pd_data_request->msduHandle); mac_sap_cca_fail_cb(rf_ptr, 0xffff); return PHY_TX_NOT_ALLOWED; } @@ -631,14 +633,19 @@ static int8_t mac_data_interface_tx_done_cb(protocol_interface_rf_mac_setup_s *r return 0; } - -static int8_t mac_data_interface_tx_done_by_ack_cb(protocol_interface_rf_mac_setup_s *rf_ptr, mac_pre_parsed_frame_t *buf) +static int8_t mac_data_interface_waiting_ack(protocol_interface_rf_mac_setup_s *rf_ptr, const mac_fcf_sequence_t *fcf_read) { - - if (!rf_ptr->macRfRadioTxActive || !rf_ptr->active_pd_data_request || rf_ptr->active_pd_data_request->fcf_dsn.DSN != buf->fcf_dsn.DSN) { + if (!rf_ptr->macRfRadioTxActive || !rf_ptr->active_pd_data_request || rf_ptr->active_pd_data_request->fcf_dsn.DSN != fcf_read->DSN) { return -1; } + return 0; +} + + +static int8_t mac_data_interface_tx_done_by_ack_cb(protocol_interface_rf_mac_setup_s *rf_ptr, mac_pre_parsed_frame_t *buf) +{ + timer_mac_stop(rf_ptr); if (buf->fcf_dsn.framePending) { rf_ptr->mac_tx_result = MAC_TX_DONE_PENDING; @@ -647,7 +654,9 @@ static int8_t mac_data_interface_tx_done_by_ack_cb(protocol_interface_rf_mac_set } rf_ptr->macRfRadioTxActive = false; rf_ptr->macTxProcessActive = false; - mcps_sap_pd_ack(buf); + if (mcps_sap_pd_ack(rf_ptr, buf) != 0) { + mcps_sap_pre_parsed_frame_buffer_free(buf); + } if (rf_ptr->fhss_api) { rf_ptr->fhss_api->data_tx_done(rf_ptr->fhss_api, false, true, rf_ptr->active_pd_data_request->msduHandle); @@ -891,22 +900,35 @@ static int8_t mac_pd_sap_generate_edfe_response(protocol_interface_rf_mac_setup_ static mac_pre_parsed_frame_t *mac_pd_sap_allocate_receive_buffer(protocol_interface_rf_mac_setup_s *rf_ptr, const mac_fcf_sequence_t *fcf_read, arm_pd_sap_generic_ind_t *pd_data_ind) { // Unless receiving Ack, check that system has enough space to handle the new packet - if (fcf_read->frametype != FC_ACK_FRAME) { - if (!ns_monitor_packet_allocation_allowed()) { + mac_pre_parsed_frame_t *buffer = NULL; + if (fcf_read->frametype != FC_ACK_FRAME || rf_ptr->macProminousMode) { + if (!rf_ptr->macProminousMode && !ns_monitor_packet_allocation_allowed()) { // stack can not handle new packets for routing #ifdef __linux__ tr_debug("Packet ingress drop buffer allocation"); #endif return NULL; } - } - mac_pre_parsed_frame_t *buffer = mcps_sap_pre_parsed_frame_buffer_get(pd_data_ind->data_ptr, pd_data_ind->data_len); - if (!buffer) { + + buffer = mcps_sap_pre_parsed_frame_buffer_get(pd_data_ind->data_ptr, pd_data_ind->data_len); + if (!buffer) { +#ifdef __linux__ + tr_debug("macPD buffer allocate fail %u", pd_data_ind->data_len); +#endif + return NULL; + } + } else { + //Allocate ACK buffer + buffer = mcps_sap_pre_parsed_ack_buffer_get(rf_ptr, pd_data_ind->data_ptr, pd_data_ind->data_len); + if (!buffer) { #ifdef __linux__ - tr_debug("macPD buffer allocate fail %u", pd_data_ind->data_len); + tr_debug("macPD ACK buffer allocate fail %u", pd_data_ind->data_len); #endif - return NULL; + return NULL; + + } } + //Copy Pre Parsed values buffer->fcf_dsn = *fcf_read; buffer->timestamp = mac_pd_sap_get_phy_rx_time(rf_ptr); @@ -1012,11 +1034,20 @@ int8_t mac_pd_sap_data_cb(void *identifier, arm_phy_sap_msg_t *message) mac_fcf_sequence_t fcf_read; const uint8_t *ptr = mac_header_parse_fcf_dsn(&fcf_read, pd_data_ind->data_ptr); - buffer = mac_pd_sap_allocate_receive_buffer(rf_ptr, &fcf_read, pd_data_ind); - if (buffer && mac_filter_modify_link_quality(rf_ptr->mac_interface_id, buffer) == 1) { + // No need to send Ack - Check if RX channel needs to be updated + if (fcf_read.ackRequested == false) { + if (rf_ptr->fhss_api) { + rf_ptr->fhss_api->data_tx_done(rf_ptr->fhss_api, false, false, 0); + } + } + + //Modify link quality + if (mac_filter_modify_link_quality(rf_ptr->mac_interface_id, &fcf_read, pd_data_ind) == 1) { goto ERROR_HANDLER; } + if (!rf_ptr->macProminousMode) { + //Pre validate things before allocate buffer if (mac_pd_sap_validate_fcf(rf_ptr, &fcf_read, pd_data_ind)) { goto ERROR_HANDLER; } @@ -1024,12 +1055,26 @@ int8_t mac_pd_sap_data_cb(void *identifier, arm_phy_sap_msg_t *message) pd_data_ind->data_len = 0; // Do not update RX drop in that case goto ERROR_HANDLER; } + //Ack can be send even buffer allocate fail if (mac_pd_sap_generate_ack(rf_ptr, &fcf_read, pd_data_ind)) { #ifdef __linux__ tr_debug("Drop a Data by ignored ACK generation"); #endif goto ERROR_HANDLER; } + if (fcf_read.frametype == FC_ACK_FRAME && mac_data_interface_waiting_ack(rf_ptr, &fcf_read)) { +#ifdef __linux__ + tr_debug("Drop a ACK not a proper DSN"); +#endif + goto ERROR_HANDLER; + } + + } + //Allocate Buffer + buffer = mac_pd_sap_allocate_receive_buffer(rf_ptr, &fcf_read, pd_data_ind); + + if (!rf_ptr->macProminousMode) { + if (buffer) { if (mac_pd_sap_parse_length_fields(buffer, pd_data_ind, ptr)) { goto ERROR_HANDLER; @@ -1098,7 +1143,7 @@ int8_t mac_pd_sap_data_cb(void *identifier, arm_phy_sap_msg_t *message) //Mark session closed rf_ptr->mac_edfe_info->state = MAC_EDFE_FRAME_IDLE; rf_ptr->mac_edfe_tx_active = false; - if (mac_data_interface_tx_done_by_ack_cb(rf_ptr, buffer)) { + if (mac_data_interface_waiting_ack(rf_ptr, &buffer->fcf_dsn) || mac_data_interface_tx_done_by_ack_cb(rf_ptr, buffer)) { mcps_sap_pre_parsed_frame_buffer_free(buffer); } return 0; diff --git a/features/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/Include/protocol.h b/features/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/Include/protocol.h index a9f26329db1..81d44631dae 100644 --- a/features/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/Include/protocol.h +++ b/features/nanostack/sal-stack-nanostack/source/NWK_INTERFACE/Include/protocol.h @@ -124,6 +124,7 @@ typedef enum icmp_state { ER_BOOTSTRAP_NEW_FRAGMENT_START, ER_WAIT_RESTART, ER_RPL_LOCAL_REPAIR, + ER_RPL_NETWORK_LEAVING, } icmp_state_t; typedef enum { diff --git a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_control.c b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_control.c index 29ddcdd48e5..af80b13f78a 100644 --- a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_control.c +++ b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_control.c @@ -55,6 +55,7 @@ #include "RPL/rpl_downward.h" #include "RPL/rpl_policy.h" #include "RPL/rpl_control.h" +#include "6LoWPAN/ws/ws_common.h" #define TRACE_GROUP "rplc" @@ -204,6 +205,12 @@ void rpl_control_set_mrhof_parent_set_size(uint16_t parent_set_size) rpl_policy_set_mrhof_parent_set_size(parent_set_size); } +/* True Force RPL to use IPv6 tunneling when it send and forward data to Border router direction, This feature is disabled by default */ +void rpl_control_set_force_tunnel(bool requested) +{ + rpl_policy_force_tunnel_set(requested); +} + /* Send address registration to either specified address, or to non-registered address */ void rpl_control_register_address(protocol_interface_info_entry_t *interface, const uint8_t addr[16]) { @@ -399,6 +406,7 @@ static void rpl_control_etx_change_callback(int8_t nwk_id, uint16_t previous_et if (!cur || !cur->rpl_domain) { return; } + (void) attribute_index; // ETX is "better" if now lower, or previous was "unknown" and new isn't infinite bool better = current_etx < previous_etx || (previous_etx == 0 && current_etx != 0xffff); @@ -879,6 +887,11 @@ static void rpl_control_process_prefix_options(protocol_interface_info_entry_t * uint32_t preferred = common_read_32_bit(ptr + 8); const uint8_t *prefix = ptr + 16; + if (ws_info(cur)) { + //For Wi-SUN Interoperability force length to 64 + prefix_len = 64; + } + if (rpl_upward_accept_prefix_update(dodag, neighbour, pref_parent)) { /* Store prefixes for possible forwarding */ @@ -1169,6 +1182,23 @@ static buffer_t *rpl_control_dio_handler(protocol_interface_info_entry_t *cur, r goto invalid_parent; } + /* RFC 6550 8.3: A DIO from a sender with lesser DAGRank that causes no + * changes to the recipient's parent set, preferred parent, or Rank SHOULD + * be considered consistent with respect to the Trickle timer. + * + * Now, if we don't run parent selection immediately, how do we know if it's + * consistent or not? Compromise is to treat all lower ranked DIOs as + * consistent, and reset (and hold) the consistent counter to 0 if any of + * the above change. This actually seems better than the RFC 6550 rule, as + * it guarantees we will transmit if those change. The rule as stated + * would mean a large number of parent messages would stop us advertising + * a Rank change. + */ + if (version == rpl_instance_current_dodag_version(instance) && + (rpl_rank_compare(dodag, rank, rpl_instance_current_rank(instance)) & RPL_CMP_LESS)) { + rpl_instance_consistent_rx(instance); + } + /* Now we create the neighbour, if we don't already have a record */ if (!neighbour) { @@ -1208,23 +1238,6 @@ static buffer_t *rpl_control_dio_handler(protocol_interface_info_entry_t *cur, r rpl_dodag_set_leaf(dodag, true); } - /* RFC 6550 8.3: A DIO from a sender with lesser DAGRank that causes no - * changes to the recipient's parent set, preferred parent, or Rank SHOULD - * be considered consistent with respect to the Trickle timer. - * - * Now, if we don't run parent selection immediately, how do we know if it's - * consistent or not? Compromise is to treat all lower ranked DIOs as - * consistent, and reset (and hold) the consistent counter to 0 if any of - * the above change. This actually seems better than the RFC 6550 rule, as - * it guarantees we will transmit if those change. The rule as stated - * would mean a large number of parent messages would stop us advertising - * a Rank change. - */ - if (version == rpl_instance_current_dodag_version(instance) && - (rpl_rank_compare(dodag, rank, rpl_instance_current_rank(instance)) & RPL_CMP_LESS)) { - rpl_instance_consistent_rx(instance); - } - rpl_instance_neighbours_changed(instance, dodag); return buffer_free(buf); diff --git a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_control.h b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_control.h index 5b9f6c26cf9..e1525eee81c 100644 --- a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_control.h +++ b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_control.h @@ -36,6 +36,7 @@ typedef enum rpl_event { RPL_EVENT_LOCAL_REPAIR_START, /* RPL start scanning new parent by multicast DIS user can disable beacon request responser here*/ RPL_EVENT_LOCAL_REPAIR_NO_MORE_DIS, /* RPL not sending DIS anymore user can report bootstrap error */ RPL_EVENT_DAO_PARENT_ADD, /* RPL indicate that DAO downward Parent has been added */ + RPL_EVENT_POISON_FINISHED, /* RPL have finished Dodag Poison proces */ } rpl_event_t; typedef void rpl_domain_callback_t(rpl_event_t event, void *handle); @@ -176,6 +177,7 @@ bool rpl_control_find_worst_neighbor(struct protocol_interface_info_entry *inter /* Parent link confirmation API extension */ void rpl_control_request_parent_link_confirmation(bool requested); +void rpl_control_set_force_tunnel(bool requested); void rpl_control_set_dio_multicast_min_config_advertisment_count(uint8_t min_count); void rpl_control_set_address_registration_timeout(uint16_t timeout_in_minutes); void rpl_control_set_dao_retry_count(uint8_t count); @@ -200,6 +202,7 @@ const rpl_dodag_conf_t *rpl_control_get_dodag_config(const struct rpl_instance * const uint8_t *rpl_control_preferred_parent_addr(const struct rpl_instance *instance, bool global); uint16_t rpl_control_current_rank(const struct rpl_instance *instance); uint8_t rpl_policy_mrhof_parent_set_size_get(const rpl_domain_t *domain); +void rpl_control_instant_poison(struct protocol_interface_info_entry *cur, rpl_domain_t *domain); #else /* HAVE_RPL */ @@ -211,6 +214,7 @@ uint8_t rpl_policy_mrhof_parent_set_size_get(const rpl_domain_t *domain); #define rpl_control_address_register_done(interface, ll_addr, status) (false) #define rpl_policy_mrhof_parent_set_size_get(domain) (0) #define rpl_control_set_mrhof_parent_set_size(parent_set_size) +#define rpl_control_instant_poison(cur, domain) ((void) 0) #endif /* HAVE_RPL */ #endif /* RPL_CONTROL_H_ */ diff --git a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_data.c b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_data.c index 236b6a5431e..c718f34c43d 100644 --- a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_data.c +++ b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_data.c @@ -334,8 +334,24 @@ static buffer_t *rpl_data_exthdr_provider_hbh_2(buffer_t *buf, rpl_instance_t *i bool destination_in_instance = false; uint16_t ext_size = 0; - if (addr_ipv6_equal(route_info->next_hop_addr, buf->dst_sa.address) || - addr_ipv6_equal(buf->dst_sa.address, dodag->id)) { + + // Limit creation of multi-hop RPL packets + // Previous code created multi-hop RPL packets as much as possible, + // sending direct to border router in particular. + // This has caused WiSUN interop problems, so limit this. + // a) When creating a basic packet, have a policy option that prevents + // direct RPL header insertion, forcing tunnelling. This means + // we never put a RPL header on the innermost packet. Option is + // off by default, except for WiSUN, as it increases packet size + // when talking to the border router (eg DAOs). + // b) When putting a packet into a tunnel, set the tunnel exit to the + // next hop always, rather than having a special case for exiting + // at the border router. This is probably a net benefit to packet + // size because of the LL addresses used on the outer header, so + // this is an unconditional change. Exception remains for local + // DODAGs, where the destination address must be the DODAGID. + if (addr_ipv6_equal(route_info->next_hop_addr, buf->dst_sa.address) || (!rpl_policy_force_tunnel() && + addr_ipv6_equal(buf->dst_sa.address, dodag->id))) { destination_in_instance = true; if (buf->rpl_option) { @@ -409,10 +425,12 @@ static buffer_t *rpl_data_exthdr_provider_hbh_2(buffer_t *buf, rpl_instance_t *i rpl_data_locate_info(buf, &opt, NULL); if (!opt) { *result = IPV6_EXTHDR_MODIFY_TUNNEL; - // Tunnel to next hop in general case, but if going to DODAGID, - // it can tunnel all the way (and it HAS to if it is a local - // DODAG). - if (!addr_ipv6_equal(buf->dst_sa.address, dodag->id)) { + // Tunnel to next hop always, even if we could tunnel all + // the way to DODAG root (this may be better for + // packet compression, and it was found to be necessary for + // Wi-SUN interoperability). Except for local DODAGs the + // destination must be the DODAGID, so retain that in dst_sa. + if (!rpl_instance_id_is_local(instance->id)) { memcpy(buf->dst_sa.address, route_info->next_hop_addr, 16); } buf->src_sa.addr_type = ADDR_NONE; // force auto-selection @@ -427,18 +445,20 @@ static buffer_t *rpl_data_exthdr_provider_hbh_2(buffer_t *buf, rpl_instance_t *i * strictly less for Down packets and strictly greater for Up. */ sender_rank = common_read_16_bit(opt + 4); - rpl_cmp_t cmp = rpl_rank_compare_dagrank_rank(dodag, sender_rank, instance->current_rank); - rpl_cmp_t expected_cmp = (opt[2] & RPL_OPT_DOWN) ? RPL_CMP_LESS : RPL_CMP_GREATER; - if (cmp != expected_cmp) { - /* Set the Rank-Error bit; if already set, drop */ - if (opt[2] & RPL_OPT_RANK_ERROR) { - protocol_stats_update(STATS_RPL_ROUTELOOP, 1); - tr_info("Forwarding inconsistency R"); - rpl_instance_inconsistency(instance); - *result = -1; - return buf; - } else { - opt[2] |= RPL_OPT_RANK_ERROR; + if (sender_rank != 0) { + rpl_cmp_t cmp = rpl_rank_compare_dagrank_rank(dodag, sender_rank, instance->current_rank); + rpl_cmp_t expected_cmp = (opt[2] & RPL_OPT_DOWN) ? RPL_CMP_LESS : RPL_CMP_GREATER; + if (cmp != expected_cmp) { + /* Set the Rank-Error bit; if already set, drop */ + if (opt[2] & RPL_OPT_RANK_ERROR) { + protocol_stats_update(STATS_RPL_ROUTELOOP, 1); + tr_info("Forwarding inconsistency R"); + rpl_instance_inconsistency(instance); + *result = -1; + return buf; + } else { + opt[2] |= RPL_OPT_RANK_ERROR; + } } } } diff --git a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_downward.c b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_downward.c index 6bbd5f02a58..4b7fe15dd26 100644 --- a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_downward.c +++ b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_downward.c @@ -885,9 +885,24 @@ void rpl_instance_send_dao_update(rpl_instance_t *instance) instance->requested_dao_ack = need_ack; instance->dao_in_transit = true; if (instance->dao_attempt < 16) { - uint32_t t = (uint32_t) rpl_policy_initial_dao_ack_wait(instance->domain, mop) << instance->dao_attempt; - t = randLIB_randomise_base(t, 0x4000, 0xC000); - instance->dao_retry_timer = t <= 0xffff ? t : 0xffff; + + uint32_t delay = rpl_policy_initial_dao_ack_wait(instance->domain, mop); + if (delay < dodag->dio_timer_params.Imin) { + //Use Imin Based on delay if it is longer than cache retry + delay = dodag->dio_timer_params.Imin; + } + //Multiply Delay by attempt + delay = delay << instance->dao_attempt; + + if (delay > 5400) { + //MAX base 540 seconds (9min) + delay = 5400; + } + + // 0.5 - 1.5 *t randomized base delay + delay = randLIB_randomise_base(delay, 0x4000, 0xC000); + + instance->dao_retry_timer = delay; } else { instance->dao_retry_timer = 0xffff; } diff --git a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_policy.c b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_policy.c index 5e6b7258d4e..11a67375979 100644 --- a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_policy.c +++ b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_policy.c @@ -48,6 +48,17 @@ static uint8_t rpl_policy_mrhof_parent_set_size_conf = 3; // default parent set static uint16_t rpl_policy_minimum_dao_target_refresh_conf = 0; // by default follow the configuration static uint16_t rpl_policy_address_registration_timeout_value = 0; // Address registration timeouts in minutes 0 use address lifetime +static bool rpl_policy_force_tunnel_to_BR = false; + +bool rpl_policy_force_tunnel(void) +{ + return rpl_policy_force_tunnel_to_BR; +} + +void rpl_policy_force_tunnel_set(bool enable) +{ + rpl_policy_force_tunnel_to_BR = enable; +} /* TODO - application API to control when to join new instances / DODAGs * * Eg, allow application to ignore local DODAGs, or specify known instance IDs, diff --git a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_policy.h b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_policy.h index ac9ca67a1f5..91e49175879 100644 --- a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_policy.h +++ b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_policy.h @@ -21,6 +21,9 @@ #include "Core/include/ns_address_internal.h" #include "rpl_control.h" +bool rpl_policy_force_tunnel(void); +void rpl_policy_force_tunnel_set(bool enable); + bool rpl_policy_join_instance(rpl_domain_t *domain, uint8_t instance_id, const uint8_t *dodagid); bool rpl_policy_join_dodag(rpl_domain_t *domain, uint8_t g_mop_prf, uint8_t instance_id, const uint8_t *dodagid); bool rpl_policy_join_config(rpl_domain_t *domain, const rpl_dodag_conf_t *conf, bool *leaf_only); diff --git a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_structures.h b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_structures.h index f6a5a18beda..837d0fa9ab5 100644 --- a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_structures.h +++ b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_structures.h @@ -180,6 +180,7 @@ struct rpl_instance { bool requested_dao_ack: 1; /* If we requested an ACK (so we retry if no ACK, rather than assuming success) */ bool pending_neighbour_confirmation: 1; /* if we have not finished address registration state to parent */ bool parent_was_selected: 1; + bool advertised_dodag_membership_since_last_repair: 1; /* advertised dodag membership since last repair */ uint8_t poison_count; uint8_t repair_dis_count; uint16_t repair_dis_timer; @@ -192,7 +193,7 @@ struct rpl_instance { rpl_dodag_version_t *current_dodag_version; /* Pointer to DODAG version we are a member of (if any) */ uint16_t current_rank; /* Current rank in current DODAG Version */ uint16_t parent_selection_timer; - rpl_dodag_version_t *last_advertised_dodag_version; /* Pointer to last DODAG version we advertised */ + trickle_t dio_timer; /* Trickle timer for DIO transmission */ rpl_dao_root_transit_children_list_t root_children; rpl_dao_target_list_t dao_targets; /* List of DAO targets */ diff --git a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_upward.c b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_upward.c index 3037755bbd0..9dc69c6c38b 100644 --- a/features/nanostack/sal-stack-nanostack/source/RPL/rpl_upward.c +++ b/features/nanostack/sal-stack-nanostack/source/RPL/rpl_upward.c @@ -347,6 +347,14 @@ void rpl_instance_poison(rpl_instance_t *instance, uint8_t count) rpl_instance_inconsistency(instance); } +void rpl_control_instant_poison(protocol_interface_info_entry_t *cur, rpl_domain_t *domain) +{ + ns_list_foreach(rpl_instance_t, instance, &domain->instances) { + rpl_instance_poison(instance, 1); + rpl_instance_dio_trigger(instance, cur, NULL); + } +} + void rpl_instance_force_leaf(rpl_instance_t *instance) { instance->current_rank = RPL_RANK_INFINITE; @@ -363,7 +371,7 @@ void rpl_instance_trigger_parent_selection(rpl_instance_t *instance, uint16_t de } } if (instance->parent_selection_timer == 0 || instance->parent_selection_timer > delay) { - instance->parent_selection_timer = randLIB_randomise_base(delay, 0x8000, 0x999A) /* Random between delay * 1.0-1.2 */; + instance->parent_selection_timer = randLIB_randomise_base(delay, 0x8000, 0xc000) /* Random between delay * 1.0-1.5 */; tr_debug("Timed parent triggered %u", instance->parent_selection_timer); } } @@ -1620,6 +1628,10 @@ void rpl_instance_dio_trigger(rpl_instance_t *instance, protocol_interface_info_ instance->poison_count--; rank = RPL_RANK_INFINITE; tr_debug("Poison count -> set RPL_RANK_INFINITE"); + if (instance->poison_count == 0) { + //Report RPL user that Poison message is triggered + rpl_control_event(instance->domain, RPL_EVENT_POISON_FINISHED); + } } // Always send config in unicasts (as required), never in multicasts (optional) @@ -1665,8 +1677,9 @@ void rpl_instance_dio_trigger(rpl_instance_t *instance, protocol_interface_info_ #endif } rpl_dodag_version_limit_greediness(dodag_version, rank); - - instance->last_advertised_dodag_version = dodag_version; + if (rank != RPL_RANK_INFINITE) { + instance->advertised_dodag_membership_since_last_repair = true; + } } static void rpl_instance_dis_timer(rpl_instance_t *instance, uint16_t seconds) @@ -1715,6 +1728,7 @@ void rpl_instance_set_local_repair(rpl_instance_t *instance, bool repair) instance->repair_dis_count = 0; } else { instance->repair_dis_timer = 0; + instance->advertised_dodag_membership_since_last_repair = false; } /* When repair ends, eliminate all higher-rank neighbours (potential sub-DODAG) from table */ @@ -1839,7 +1853,7 @@ void rpl_upward_dio_timer(rpl_instance_t *instance, uint16_t ticks) /* Delay sending first DIO if we are still potentially gathering info */ /* Important to always send DIOs if we ever have sent any, so we can indicate problems to others */ - if (!rpl_instance_am_root(instance) && !instance->last_advertised_dodag_version && rpl_policy_parent_confirmation_requested()) { + if (!rpl_instance_am_root(instance) && !instance->poison_count && !instance->advertised_dodag_membership_since_last_repair && rpl_policy_parent_confirmation_requested()) { // We don't have DAO target generated if (ns_list_count(&instance->dao_targets) == 0) { diff --git a/features/nanostack/sal-stack-nanostack/source/Security/Common/security_lib.c b/features/nanostack/sal-stack-nanostack/source/Security/Common/security_lib.c index ff3d31a0beb..a48616a086f 100644 --- a/features/nanostack/sal-stack-nanostack/source/Security/Common/security_lib.c +++ b/features/nanostack/sal-stack-nanostack/source/Security/Common/security_lib.c @@ -128,6 +128,10 @@ void tls_server_hash_copy(uint8_t *ptr, tls_msg_t *tmp_msg, sec_suite_t *suite) tls_build_server_hello_msg(ptr, suite->tls_session); tls_handshake_copy(tmp_msg, t_heap); tr_debug("Pana server S-Hello,Cert hash"); +#else + (void) ptr; + (void) tmp_msg; + (void) suite; #endif } #endif diff --git a/features/nanostack/sal-stack-nanostack/source/Security/PANA/pana_server.c b/features/nanostack/sal-stack-nanostack/source/Security/PANA/pana_server.c index e2b863e8f7e..092b4ad59c9 100644 --- a/features/nanostack/sal-stack-nanostack/source/Security/PANA/pana_server.c +++ b/features/nanostack/sal-stack-nanostack/source/Security/PANA/pana_server.c @@ -1721,6 +1721,8 @@ static void pana_client_authentication_fail(sec_suite_t *suite) int8_t pana_server_nvm_callback_set(pana_server_update_cb *update_cb, pana_server_session_get_cb *nvm_get, pana_server_session_get_by_id_cb *nvm_session_get, uint8_t *nvm_static_buffer) { (void)update_cb; + (void)nvm_get; + (void)nvm_session_get; (void)nvm_static_buffer; return -1; } diff --git a/features/nanostack/sal-stack-nanostack/source/Security/TLS/tls_lib.c b/features/nanostack/sal-stack-nanostack/source/Security/TLS/tls_lib.c index f23517a62c0..dcd4f8e53f5 100644 --- a/features/nanostack/sal-stack-nanostack/source/Security/TLS/tls_lib.c +++ b/features/nanostack/sal-stack-nanostack/source/Security/TLS/tls_lib.c @@ -68,7 +68,9 @@ static uint8_t tls_parse_server_key_exchange(uint8_t *ptr, uint16_t len, sec_sui static uint8_t *tls_set_client_key_excange(uint8_t *ptr, sec_suite_t *tls_suite); static uint8_t tls_parse_server_hello(uint8_t *ptr, sec_suite_t *tls_suite); +#ifdef PANA_SERVER_API static uint8_t tls_parse_client_hello(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite); +#endif static tls_psk_key_t *tls_get_key(uint16_t key_id); tls_session_t *amr_tls_session_allocate(void) @@ -171,7 +173,7 @@ void tls_finnish_copy(uint8_t *ptr, tls_heap_t *heap_ptr) } -uint8_t tls_parse_client_hello(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite) +static uint8_t tls_parse_client_hello(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite) { uint8_t ret_val = 0, i = 0; uint16_t tls_version; @@ -548,6 +550,7 @@ uint8_t tls_parse_server_key_exchange(uint8_t *ptr, uint16_t len, sec_suite_t *t return 0; } +#ifdef ECC static uint8_t tls_parse_client_key_exchange(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite) { (void)len; @@ -567,6 +570,7 @@ static uint8_t tls_parse_client_key_exchange(uint8_t *ptr, uint16_t len, sec_sui return 0; } +#endif void tls_read_certi_signature(tls_heap_t *theap, uint8_t certificate) @@ -589,8 +593,8 @@ void tls_read_certi_signature(tls_heap_t *theap, uint8_t certificate) } - -uint8_t tls_parse_certificate_verify(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite) +#ifdef ECC +static uint8_t tls_parse_certificate_verify(uint8_t *ptr, uint16_t len, sec_suite_t *tls_suite) { (void)len; uint16_t sig_algh, sig_len; @@ -653,7 +657,7 @@ uint8_t tls_parse_certificate_verify(uint8_t *ptr, uint16_t len, sec_suite_t *tl } return 1; } - +#endif tls_ecc_heap_t *ecc_allocate_ram(void) { @@ -1690,6 +1694,7 @@ buffer_t *tls_server_up(buffer_t *buf, sec_suite_t *tls_suite) buf = tls_certificate_buffer_store(buf, certi_rx, tls_suite); } #else + (void)tls_suite; if (buf) { buf = buffer_free(buf); } diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_common.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_common.h index 724351d0295..71c2d9a4d11 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_common.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_common.h @@ -41,6 +41,7 @@ struct fhss_structure { uint8_t active_fhss_events; uint16_t number_of_channels; uint16_t number_of_uc_channels; + uint16_t number_of_bc_channels; uint16_t optimal_packet_length; fhss_states fhss_state; uint32_t fhss_timeout; diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_ws.c b/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_ws.c index 7810453bb7e..9377967e3d4 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_ws.c +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_ws.c @@ -195,7 +195,7 @@ void fhss_set_txrx_slot_length(fhss_structure_t *fhss_structure) if (fhss_structure->ws->fhss_configuration.fhss_broadcast_interval == 0 || fhss_structure->ws->fhss_configuration.fhss_bc_dwell_interval == 0) { return; } - uint32_t txrx_slot_length_ms_tmp = WS_TXRX_SLOT_LEN_MS; + uint32_t txrx_slot_length_ms_tmp = WS_TXRX_SLOT_LEN_MS_MAX; if (fhss_structure->callbacks.read_datarate) { /* Calculate minimum TX slot length which can fit optimal packet length twice. * Twice, because 0, 1, 4, 5... hop starts transmission at the beginning of TX slot and 2, 3, 6, 7... hop at the middle of TX slot @@ -217,9 +217,14 @@ void fhss_set_txrx_slot_length(fhss_structure_t *fhss_structure) if (datarate) { txrx_slot_length_ms_tmp = ((fhss_structure->optimal_packet_length * 2) * (8000000 / datarate)) / 1000; // Do not allow using too high TX slot length. - if (txrx_slot_length_ms_tmp > WS_TXRX_SLOT_LEN_MS) { - tr_debug("TX slot length setting too high %"PRIu32"ms, using %"PRIu32"ms", txrx_slot_length_ms_tmp, (uint32_t)WS_TXRX_SLOT_LEN_MS); - txrx_slot_length_ms_tmp = WS_TXRX_SLOT_LEN_MS; + if (txrx_slot_length_ms_tmp > WS_TXRX_SLOT_LEN_MS_MAX) { + tr_debug("TX slot length setting too high %"PRIu32"ms, using %"PRIu32"ms", txrx_slot_length_ms_tmp, (uint32_t)WS_TXRX_SLOT_LEN_MS_MAX); + txrx_slot_length_ms_tmp = WS_TXRX_SLOT_LEN_MS_MAX; + } + // Do not allow using too low TX slot length. + if (txrx_slot_length_ms_tmp < WS_TXRX_SLOT_LEN_MS_MIN) { + tr_debug("TX slot length setting too low %"PRIu32"ms, using %"PRIu32"ms", txrx_slot_length_ms_tmp, (uint32_t)WS_TXRX_SLOT_LEN_MS_MIN); + txrx_slot_length_ms_tmp = WS_TXRX_SLOT_LEN_MS_MIN; } } } @@ -241,14 +246,14 @@ static int32_t fhss_ws_calc_bc_channel(fhss_structure_t *fhss_structure) int32_t next_channel = fhss_structure->ws->fhss_configuration.broadcast_fixed_channel; if (fhss_structure->ws->fhss_configuration.ws_bc_channel_function == WS_TR51CF) { - next_channel = tr51_get_bc_channel_index(fhss_structure->ws->tr51_channel_table, fhss_structure->ws->tr51_output_table, fhss_structure->ws->bc_slot, fhss_structure->ws->fhss_configuration.bsi, fhss_structure->number_of_channels, NULL); + next_channel = tr51_get_bc_channel_index(fhss_structure->ws->tr51_channel_table, fhss_structure->ws->tr51_output_table, fhss_structure->ws->bc_slot, fhss_structure->ws->fhss_configuration.bsi, fhss_structure->number_of_bc_channels, NULL); next_channel = fhss_channel_index_from_mask(fhss_structure->ws->fhss_configuration.channel_mask, next_channel, fhss_structure->number_of_channels); - if (++fhss_structure->ws->bc_slot == fhss_structure->number_of_channels) { + if (++fhss_structure->ws->bc_slot == fhss_structure->number_of_bc_channels) { fhss_structure->ws->bc_slot = 0; } } else if (fhss_structure->ws->fhss_configuration.ws_bc_channel_function == WS_DH1CF) { fhss_structure->ws->bc_slot++; - next_channel = dh1cf_get_bc_channel_index(fhss_structure->ws->bc_slot, fhss_structure->ws->fhss_configuration.bsi, fhss_structure->number_of_channels); + next_channel = dh1cf_get_bc_channel_index(fhss_structure->ws->bc_slot, fhss_structure->ws->fhss_configuration.bsi, fhss_structure->number_of_bc_channels); next_channel = fhss_channel_index_from_mask(fhss_structure->ws->fhss_configuration.channel_mask, next_channel, fhss_structure->number_of_channels); } else if (fhss_structure->ws->fhss_configuration.ws_bc_channel_function == WS_VENDOR_DEF_CF) { if (fhss_structure->ws->fhss_configuration.vendor_defined_cf) { @@ -297,12 +302,13 @@ static void fhss_broadcast_handler(const fhss_api_t *fhss_api, uint16_t delay) if (!fhss_structure) { return; } - + platform_enter_critical(); if (fhss_structure->ws->fhss_configuration.fhss_bc_dwell_interval == 0 || fhss_structure->ws->fhss_configuration.fhss_broadcast_interval == 0) { // stop broadcast schedule fhss_structure->ws->is_on_bc_channel = false; fhss_structure->ws->synchronization_time = 0; fhss_structure->ws->broadcast_timer_running = false; + platform_exit_critical(); return; } @@ -338,7 +344,7 @@ static void fhss_broadcast_handler(const fhss_api_t *fhss_api, uint16_t delay) } if (fhss_structure->ws->fhss_configuration.ws_bc_channel_function == WS_TR51CF) { - fhss_structure->ws->bc_slot %= fhss_structure->number_of_channels; + fhss_structure->ws->bc_slot %= fhss_structure->number_of_bc_channels; } if (fhss_structure->ws->is_on_bc_channel == false) { @@ -404,6 +410,7 @@ static void fhss_broadcast_handler(const fhss_api_t *fhss_api, uint16_t delay) tr_info("%u BC_done", fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api)); } #endif + platform_exit_critical(); } static int own_floor(float value) @@ -924,7 +931,7 @@ static uint32_t fhss_ws_get_retry_period_callback(const fhss_api_t *api, uint8_t uint32_t cur_time_us = fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api); uint32_t tx_trig_offset_us = (txrx_slot_length_us / 2) * calc_own_tx_trig_slot(fhss_structure->own_hop); - uint32_t next_tx_trig_slot_start_us = unicast_start_us + (txrx_slot_length_us * !fhss_ws_check_tx_allowed(fhss_structure)) + tx_trig_offset_us; + uint32_t next_tx_trig_slot_start_us = unicast_start_us + (txrx_slot_length_us * (fhss_structure->own_hop & 1)) + tx_trig_offset_us; uint32_t next_tx_trig_slot_end_us = next_tx_trig_slot_start_us + (txrx_slot_length_us / 2); while ((next_tx_trig_slot_start_us < cur_time_us) || ((next_tx_trig_slot_start_us - cur_time_us) > (uint32_t) MS_TO_US(fhss_structure->ws->fhss_configuration.fhss_broadcast_interval))) { if (cur_time_us < next_tx_trig_slot_end_us) { @@ -950,6 +957,7 @@ static void fhss_unicast_handler(const fhss_api_t *fhss_api, uint16_t delay) if (!fhss_structure) { return; } + platform_enter_critical(); int32_t delay_us = fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api) - fhss_structure->ws->next_uc_timeout; if (!fhss_structure->ws->uc_slot && !fhss_structure->ws->next_uc_timeout) { delay_us = 0; @@ -969,6 +977,7 @@ static void fhss_unicast_handler(const fhss_api_t *fhss_api, uint16_t delay) if (!timeout) { fhss_stop_timer(fhss_structure, fhss_unicast_handler); fhss_structure->ws->unicast_timer_running = false; + platform_exit_critical(); return; } fhss_ws_start_timer(fhss_structure, timeout - (delay_us * fhss_structure->platform_functions.fhss_resolution_divider), fhss_unicast_handler); @@ -980,6 +989,7 @@ static void fhss_unicast_handler(const fhss_api_t *fhss_api, uint16_t delay) fhss_structure->callbacks.tx_poll(fhss_structure->fhss_api); } } + platform_exit_critical(); } int fhss_ws_set_callbacks(fhss_structure_t *fhss_structure) @@ -1081,13 +1091,13 @@ int fhss_ws_remove_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[ int fhss_ws_configuration_set(fhss_structure_t *fhss_structure, const fhss_ws_configuration_t *fhss_configuration) { - int channel_count = channel_list_count_channels(fhss_configuration->channel_mask); + int channel_count_bc = channel_list_count_channels(fhss_configuration->channel_mask); int channel_count_uc = channel_list_count_channels(fhss_configuration->unicast_channel_mask); - if (channel_count <= 0) { + if (channel_count_bc <= 0 || fhss_configuration->channel_mask_size == 0) { return -1; } - if (fhss_structure->number_of_channels < channel_count || + if (fhss_structure->number_of_bc_channels < channel_count_bc || (channel_count_uc && fhss_structure->number_of_uc_channels < channel_count_uc)) { // Channel amount changed to largeneed to reallocate channel table ns_dyn_mem_free(fhss_structure->ws->tr51_channel_table); @@ -1095,7 +1105,7 @@ int fhss_ws_configuration_set(fhss_structure_t *fhss_structure, const fhss_ws_co ns_dyn_mem_free(fhss_structure->ws->tr51_output_table); fhss_structure->ws->tr51_output_table = NULL; - if (fhss_ws_manage_channel_table_allocation(fhss_structure, channel_count_uc > channel_count ? channel_count_uc : channel_count)) { + if (fhss_ws_manage_channel_table_allocation(fhss_structure, channel_count_uc > channel_count_bc ? channel_count_uc : channel_count_bc)) { return -1; } } @@ -1118,10 +1128,11 @@ int fhss_ws_configuration_set(fhss_structure_t *fhss_structure, const fhss_ws_co for (uint8_t i = 0; i < 8; i++) { fhss_structure->ws->fhss_configuration.unicast_channel_mask[i] = fhss_configuration->channel_mask[i]; } - channel_count_uc = channel_count; + channel_count_uc = channel_count_bc; } - fhss_structure->number_of_channels = channel_count; + fhss_structure->number_of_channels = fhss_configuration->channel_mask_size; + fhss_structure->number_of_bc_channels = channel_count_bc; fhss_structure->number_of_uc_channels = channel_count_uc; if (fhss_configuration->ws_uc_channel_function == WS_FIXED_CHANNEL) { fhss_structure->rx_channel = fhss_configuration->unicast_fixed_channel; @@ -1132,7 +1143,7 @@ int fhss_ws_configuration_set(fhss_structure_t *fhss_structure, const fhss_ws_co fhss_structure->ws->fhss_configuration.broadcast_fixed_channel, fhss_structure->ws->fhss_configuration.ws_uc_channel_function, fhss_structure->ws->fhss_configuration.ws_bc_channel_function, - fhss_structure->number_of_channels, + fhss_structure->number_of_bc_channels, fhss_structure->number_of_uc_channels, fhss_structure->ws->fhss_configuration.fhss_uc_dwell_interval, fhss_structure->ws->fhss_configuration.fhss_bc_dwell_interval, diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_ws.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_ws.h index b9e35665ecf..e9751bb1514 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_ws.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/fhss/fhss_ws.h @@ -19,8 +19,10 @@ // TX slot length is optimised to this packet length #define OPTIMAL_PACKET_LENGTH 500 -// Default TX/RX slot length in milliseconds. Is used when datarate is not given by PHY. -#define WS_TXRX_SLOT_LEN_MS 100 +// Max TX/RX slot length in milliseconds. Is used when datarate is not given by PHY or calculated slot length exceeds maximum allowed. +#define WS_TXRX_SLOT_LEN_MS_MAX 100 +// Min TX/RX slot length in milliseconds. Is used when calculated slot length is under minimum allowed. +#define WS_TXRX_SLOT_LEN_MS_MIN 13 // Default minimum broadcast synchronization interval in seconds #define DEFAULT_MIN_SYNCH_INTERVAL 60 // Drift compensation allowed if at least SYNCH_COMPENSATION_MIN_INTERVAL (seconds) since last synchronization diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/fnet_config.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/fnet_config.h index 85f2340c263..54bb282c4e7 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/fnet_config.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/fnet_config.h @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2017, Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2016 by Andrey Butok. FNET Community. * Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc. * diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp.h index 04881c1f84b..d3109581b5f 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp.h @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2019 Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2016 by Andrey Butok. FNET Community. * Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc. * diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp_config.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp_config.h index 81732fbf62b..ab376cec256 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp_config.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/port/compiler/fnet_comp_config.h @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2019 Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2016 by Andrey Butok. FNET Community. * Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc. * diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/fnet_services.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/fnet_services.h index 197d0b4cc0c..255b8ea950b 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/fnet_services.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/fnet_services.h @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2017, Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2016 by Andrey Butok. FNET Community. * Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc. * diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/fnet_services_config.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/fnet_services_config.h index bb33a14c411..c93f83a0ca7 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/fnet_services_config.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/fnet_services_config.h @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2017, Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2016 by Andrey Butok. FNET Community. * Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc. * diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/mdns/fnet_mdns.c b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/mdns/fnet_mdns.c index 4ae61bef831..94561a3a5b9 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/mdns/fnet_mdns.c +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/mdns/fnet_mdns.c @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2017, 2019 Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2016 by Andrey Butok. FNET Community. * *************************************************************************** diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/mdns/fnet_mdns.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/mdns/fnet_mdns.h index 38511a37a79..ff3e2f71197 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/mdns/fnet_mdns.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/mdns/fnet_mdns.h @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2017, Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2016 by Andrey Butok. FNET Community. * *************************************************************************** diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/poll/fnet_poll.c b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/poll/fnet_poll.c index 28234e0ba4d..8dbd864af9b 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/poll/fnet_poll.c +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/poll/fnet_poll.c @@ -1,5 +1,6 @@ /************************************************************************** * Copyright (c) 2017, Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2016 by Andrey Butok. FNET Community. * Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc. * diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/serial/fnet_serial.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/serial/fnet_serial.h index 38afbb0baa8..3bfde795206 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/serial/fnet_serial.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/services/serial/fnet_serial.h @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2017, Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2016 by Andrey Butok. FNET Community. * Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc. * diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/stack/fnet_debug.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/stack/fnet_debug.h index 5d19ddeeda9..b918c9b10b8 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/stack/fnet_debug.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/stack/fnet_debug.h @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2017, Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2016 by Andrey Butok. FNET Community. * Copyright 2008-2010 by Andrey Butok. Freescale Semiconductor, Inc. * diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/stack/fnet_stdlib.c b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/stack/fnet_stdlib.c index 8fbdb2f77b8..61c2580ce4b 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/stack/fnet_stdlib.c +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/mdns/fnet/fnet_stack/stack/fnet_stdlib.c @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright (c) 2017, Arm Limited and affiliates. +* SPDX-License-Identifier: Apache-2.0 * Copyright 2011-2016 by Andrey Butok. FNET Community. * Copyright 2008-2010 by Freescale Semiconductor, Inc. * Copyright 2003 by Motorola SPS. diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/nd_proxy/nd_proxy.h b/features/nanostack/sal-stack-nanostack/source/Service_Libs/nd_proxy/nd_proxy.h index b92ead820ea..004d10f325d 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/nd_proxy/nd_proxy.h +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/nd_proxy/nd_proxy.h @@ -142,9 +142,9 @@ bool nd_proxy_upstream_route_onlink(int8_t downstream_id, uint8_t *address); NS_DUMMY_DEFINITIONS_OK #define nd_proxy_downstream_interface_register(interface_id, nd_proxy_req, bridge_state_update) -1 -#define nd_proxy_downstream_interface_unregister(interface_id) -1 -#define nd_proxy_upstream_interface_register(interface_id, route_validation_req) -1 -#define nd_proxy_upstream_interface_unregister(interface_id) -1 +#define nd_proxy_downstream_interface_unregister(interface_id) (-1) +#define nd_proxy_upstream_interface_register(interface_id, route_validation_req) (-1) +#define nd_proxy_upstream_interface_unregister(interface_id) (-1) #define nd_proxy_enabled_for_downstream(interface_id) false #define nd_proxy_enabled_for_upstream(interface_id) false #define nd_proxy_target_address_validation(upstream_id, address) false diff --git a/features/nanostack/sal-stack-nanostack/source/Service_Libs/utils/ns_conf.c b/features/nanostack/sal-stack-nanostack/source/Service_Libs/utils/ns_conf.c index 93de03ce43b..b2e0f26d152 100644 --- a/features/nanostack/sal-stack-nanostack/source/Service_Libs/utils/ns_conf.c +++ b/features/nanostack/sal-stack-nanostack/source/Service_Libs/utils/ns_conf.c @@ -17,7 +17,7 @@ #include "nsconfig.h" #include "ns_types.h" - +#include "eventOS_event.h" #include "Core/include/ns_monitor.h" #include "mac_api.h" // for mcps_packet_ingress_rate_limit_by_memory #include "MAC/IEEE802_15_4/mac_mcps_sap.h" // for mcps_packet_ingress_rate_limit_by_memory diff --git a/features/nanostack/sal-stack-nanostack/source/libNET/src/ns_net.c b/features/nanostack/sal-stack-nanostack/source/libNET/src/ns_net.c index b863aa29922..09c3fc1b7b3 100644 --- a/features/nanostack/sal-stack-nanostack/source/libNET/src/ns_net.c +++ b/features/nanostack/sal-stack-nanostack/source/libNET/src/ns_net.c @@ -1072,7 +1072,7 @@ int8_t arm_network_certificate_revocation_list_remove(const arm_cert_revocation_ */ int8_t arm_network_key_get(int8_t interface_id, ns_keys_t *key) { -#ifndef PANA +#ifndef PANA_SERVER (void)interface_id; (void)key; #endif @@ -1081,7 +1081,7 @@ int8_t arm_network_key_get(int8_t interface_id, ns_keys_t *key) int8_t arm_pana_server_library_init(int8_t interface_id, net_tls_cipher_e cipher_mode, const uint8_t *key_material, uint32_t time_period_before_activate_key) { -#ifndef PANA +#ifndef PANA_SERVER (void)interface_id; (void)cipher_mode; (void)key_material; @@ -1092,7 +1092,7 @@ int8_t arm_pana_server_library_init(int8_t interface_id, net_tls_cipher_e cipher int8_t arm_pana_activate_new_key(int8_t interface_id) { -#ifndef PANA +#ifndef PANA_SERVER (void)interface_id; #endif return pana_server_trig_new_key(interface_id); @@ -1100,7 +1100,7 @@ int8_t arm_pana_activate_new_key(int8_t interface_id) int8_t arm_pana_server_key_update(int8_t interface_id, const uint8_t *network_key_material) { -#ifndef PANA +#ifndef PANA_SERVER (void)interface_id; (void)network_key_material; #endif @@ -1199,7 +1199,7 @@ int8_t arm_6lowpan_bootsrap_set_for_selected_interface(int8_t interface_id) int8_t arm_nwk_interface_configure_6lowpan_bootstrap_set(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode, net_6lowpan_mode_extension_e net_6lowpan_mode_extension) { int8_t ret_val; - + (void)bootstrap_mode; ret_val = arm_6lowpan_bootsrap_set_for_selected_interface(interface_id); if (ret_val == 0) {