Skip to content

Commit 7e1fb3c

Browse files
Squashed 'features/nanostack/sal-stack-nanostack/' changes from 82bbdcc..4a188ea
4a188ea Merge branch 'release_internal' into release_external 27ba18e removed ws resources from nanostack. b693eae Merge pull request ARMmbed#1778 from ARMmbed/ws_bbr_update 543dd1e Renamed symbol to micro seconds. ab5d98a Added ND proxy support to ws border router f7c71c0 Remove new unittests from release external. ac55c15 Merge branch 'release_internal' into release_external f9b9e47 Fix GCC_ARM/ARM compiler warnings (ARMmbed#1777) 40efd39 Coverity tool reported error fix (ARMmbed#1776) b063457 Merge pull request ARMmbed#1775 from ARMmbed/mac_header_trace_fix b1fd538 Removed Debug trace support from common mac header class 90a36a6 coverity reported error fixes. (ARMmbed#1770) 9644114 Merge pull request ARMmbed#1774 from ARMmbed/debug_trace_fix 1e490f0 Removed debug trace which could be called at interrupt routine 1373a5f Clarify parameter name in phy_csma_params_t (ARMmbed#1773) 4a32a6c fixes for coverity tool reported issues. (ARMmbed#1772) 545d262 Update copyright year (ARMmbed#1771) 5ae07da address error handling fix. (ARMmbed#1769) 13c1ceb Clean multicast address when interface is shutdown 88bb7cc correct interface passed to address compare. (ARMmbed#1768) 53949a4 Thread device registers new address upon receipt of error notification. (ARMmbed#1767) 1653b06 replace ETX calculation for Wi-SUN 745c1dd refactor RPL dis sending 6e1cc58 Merge pull request ARMmbed#1764 from ARMmbed/mle_purge_fix 0b920d8 Fixed broken neighbor purge from list a6f3a0d Thread network data handling refactored (ARMmbed#1762) 87cc2c9 Merge pull request ARMmbed#1763 from ARMmbed/mle_fixs 944f9ca Fix broken MLE neigbor list write operation. 833e740 updated address error payload (ARMmbed#1761) 2565170 Add CBOR parsing to simpleenrolment message e38c70f fix duplicate address detection (ARMmbed#1760) 7648c1c Scope updated to three and prefix added to destination address. (ARMmbed#1758) 5612e08 DUA.ntf updates (ARMmbed#1752) 708bb3b pbbr stop removed to fix failing tests. (ARMmbed#1757) 1444c2f Add POC code for storing multicast address 684efef Fix MLR message handling b691b78 context id update (ARMmbed#1753) 5635089 fix key sequence issues when keys are rotated 74db027 fix for sleepy node poll. (ARMmbed#1750) 49adf2e Link entry for neighbour (ARMmbed#1749) 5bad8ee Correct MAC neighbour table sizes for Thread (ARMmbed#1748) 3858eb0 valgrind reported error: fixed uninitialised variables. (ARMmbed#1747) 24ef520 Update licenses in new WS files (ARMmbed#1745) 77dccdf valgrind tool reported error fix: (ARMmbed#1746) 9ac47a8 Adjust WS build configurations (ARMmbed#1744) c593e2b DUA.ntf to MTD child implemented (ARMmbed#1735) 3f5c6c1 Update missing SPDX identifiers to test files (ARMmbed#1743) 130fec4 Fix GCC_ARM linker error with some Thread builds (ARMmbed#1742) 65574a4 Merge pull request ARMmbed#1741 from ARMmbed/merge_koli_to_master 2dc41c0 Merge remote-tracking branch 'origin/koli' 2fc10b5 Put smarter dag max rank increment 2048. 0 affect a lot of troubles. d311040 RPL print update, nud and aneighbour update f9b23d4 Fix compiler warnings (ARMmbed#1740) 5a1f295 Merge pull request ARMmbed#1738 from ARMmbed/master_merge_to_koli abee481 Fix merge compile problems 2c77c37 Merge branch 'master' into koli 32fe4b8 Increase too small maximum root path length (ARMmbed#1737) 03bc696 Fix LLC unit test's 3702f57 LLC data indication and fhss channel set update 45905fa Update DHCP service memory allocation (ARMmbed#1734) 9c9b9e3 Fix crash which will happen if address registration fail and operation is triggered again by NULL pointer. cb83216 Enabled proper wi-sun security level 6. 7990fa9 Fix data for 6lowpan when mle is disabled. 501a612 Wi-sun trigle timer update: 47619c4 Function name code conventions fix. 1350bc5 mac_neighbor_info() macro defned for simplify code 41b84e4 Added check when weighting rule update must do network scan. 0215058 Fix ns_dyn_mem_init stub 33398ef Added Neighbor connected and trusted state update for wisun 24aa802 Integrate Mac neighbour table to Thread and 6Lowpan code 37c6342 Mac neighbour table update 7bb978e Thread Neighbor class update 26dd252 Removed almost duplicate mle entry discover for ll64 7a0aaa5 Rename some parameters which will help integration to new neighbor table. 3f905a1 Update nsdynmemLIB unit test stub (ARMmbed#1730) 2bd3e91 Return 0 instead of -1 on null pointer (ARMmbed#1728) fde5104 Function parameter and name refactor. e0f7dcf Updates to thread extension bootstrap (ARMmbed#1714) 13b3b05 Thread Neighbor and MLE API update 49ccb9d Removed threadNeighbour flag from mle_table_entry_t. e142eec Removed unused holdTime parameter from mle_table_entry. c8a99cb MLE service Update and integrate new features 726b08b Adjust NULL string tracing (ARMmbed#1726) 66636b8 Merge pull request ARMmbed#1724 from ARMmbed/IOTTHD-2537 2710836 Enable security to wi-sun with test security key. 8994bb2 MAC Security update c56886f MAC: Fixed frame length when calling FHSS TX conditions 4eb5567 CCM & AES update for support multiple user and context. 7544ef3 added response to confirmable unicast. (ARMmbed#1722) a8a5a90 duplicate address detection fix (ARMmbed#1720) 721c0b0 MLE service releases CCM library in error case (ARMmbed#1719) d0467a0 Fix stack overflow (ARMmbed#1718) 7ea9001 Added support for multiple registrations in one message 0a36af3 WS IE library update and LLC data confirmation update 4352709 MAC enhanced ACK RX and TX support 0b7f9fe Update Thread child id request timeout handling (ARMmbed#1715) 3e8df0a added neighbor advertisement sending after dad complete. (ARMmbed#1713) a46a363 updated multicast address registration timer (ARMmbed#1711) 7c6c482 Added target EID tlv to Dua response 2d3aff9 Delete parent mle-entry in case of parent lost or updated (ARMmbed#1707) b43db5f duplicate address handling (ARMmbed#1709) cb54705 Address generation changed to slaac based generation (ARMmbed#1708) ee0306b changed coap message type to non-confirmable. (ARMmbed#1706) 776e0e5 Merge pull request ARMmbed#1705 from ARMmbed/IOTTHD-2531 d92b2f9 Thread advertisement adjustment (ARMmbed#1703) f8d3d67 WS: Learn parent unicast dwell time bd88fa0 WS Lib: Fixed byte order of fixed channel 1f9162d Merge pull request ARMmbed#1704 from ARMmbed/IOTTHD-2484 2e15944 FHSS unit tests: Datarate storage removed e64bd19 FHSS: Implemented checking TX time 0ba4b9a Merge pull request ARMmbed#1700 from ARMmbed/IOTTHD-2483 1adb52b coap message type decided based on destination (ARMmbed#1702) d1cf42d multicast handling updated(ARMmbed#1701) 44110a1 Thread bootstrap improvements (ARMmbed#1699) 34c0df9 FHSS unit tests: fixed tests after TX slot update ddd7e92 FHSS: Calculate number of TX slots using defined slot length eaf35d2 Lowered Thread advertisement speedup threshold values (ARMmbed#1691) b67f2d8 Reset children when no response from parent (ARMmbed#1698) 3569c8a Mleid bbr fix (ARMmbed#1697) 1fc81fc Thread device learns weighting from advertisement (ARMmbed#1696) ba98835 Merge pull request ARMmbed#1689 from ARMmbed/IOTTHD-2475 28307de Randomize channel used in fixed channel 3412f4a WS bootstrap: Moved calculating and setting FHSS hop to own function 51a498b reset Dodag if global address is lost. c0e8cae Merge branch 'koli' into IOTTHD-2475 0ec37a6 Count the amount of configuration solicits c8f5c8d FHSS unit tests: Updated FHSS config tests. 490384f FHSS unit tests: Test TX/RX slots 4fdbc09 FHSS: Calculate hop count using RPL rank 8f194f8 FHSS: Implemented TX slot calculation b06b58a FHSS: Implemented setting hop count API d73d210 FHSS: Moved own hop to common FHSS structure caafff0 FHSS: Check TX slot for unicast frames 7406149 Merge pull request ARMmbed#1684 from ARMmbed/IOTTHD-2476 cc5f6d8 FHSS: validate received synch info. c48f0ef Merge pull request ARMmbed#1687 from ARMmbed/disable_channel_traces d5d1a13 Fixed trickle configuration for Discovery eef3bd7 FHSS: Disable FHSS channel debugs for WS fc74a31 Fixed unit test for support extensions. e803974 FHSS and Mac extension enable update. 4859f16 MAC RF extension enable e73e9b2 Merge pull request ARMmbed#1682 from ARMmbed/IOTTHD-2460 03f7105 fixed EAPOL parent selection cbdd2a9 Fixed set channel unit test ce1ab34 FHSS: Do not change channel during asynch transmissions c0456a3 Defined own structure to give CSMA backoff symbol time and cca mode. dff1e7d Merge pull request ARMmbed#1677 from ARMmbed/merge_MtoK 34dcbb6 Merge pull request ARMmbed#1674 from ARMmbed/IOTTHD-2443 3f9b34d Merge branch 'master' into koli f578c26 Updated border router configuration 1ce2385 RF PHY extension update 32db0cd FHSS: Learn FHSS configuration from parent PA config 5974344 Merge pull request ARMmbed#1670 from ARMmbed/IOTTHD-2449 82a8bca FHSS: support FHSS created by application 67f578a Calculated RSL from neighbours 4aa6890 Merge pull request ARMmbed#1664 from ARMmbed/IOTTHD-2442 65e2fad Fixed uninitialized parameter use at rpl instance allocate. 4767dd5 Merge pull request ARMmbed#1666 from ARMmbed/fhss_is_bc_flag_fix 6ffc81a FHSS unit tests: Fixed tests 14e1597 Fixed missing TX ime calculation for pre-builded MAC packet send. 03f447a FHSS: Do not use broadcast queue when fixed channel 40f3685 FHSS: do not push asynch messages in broadcast queue 45daec9 FHSS: FHSS is on BC channel by default 2dbc92c FHSS: Remove failed handle after successful transmission a152f45 Merge branch 'koli' into IOTTHD-2442 ea583c6 FHSS: Fixed updating broadcast synch c3aa7d1 Select correct parent based on network size and route cost 7bf3994 Fixed Code style warning. 2e1f32f Fixed WS_NESTED_IE information discover return length check. 445745a LLC Neighbor, Mac packet rebuild, mac timer update and phy Extension. 6cb78ff Distribute and learn network size bc4f46f Merge pull request ARMmbed#1656 from ARMmbed/IOTTHD-2441 7f94971 FHSS: Added random timeout before polling TX queue after channel change b6e40af Merge pull request ARMmbed#1653 from ARMmbed/IOTTHD-2366 b28fcaa FHSS unit tests: Test failed TX allocation fbe7795 Modified neighbour processing b2cff91 FHSS: Use channel retries with WS 9b11201 FHSS: Moved TX fail handler in FHSS common 9fff108 Merge pull request ARMmbed#1650 from ARMmbed/merge_MtoK2 04797c2 Detect border router connection lost 5227398 Merge branch 'master' into koli c0e8673 Merge pull request ARMmbed#1647 from ARMmbed/IOTTHD-2405 b7428e0 Merge pull request ARMmbed#1646 from ARMmbed/IOTTHD-2404 04449e8 FHSS unit tests: Test tx conditions and tx done callbacks baaec35 Merge pull request ARMmbed#1644 from ARMmbed/ws_start_bc 69c1483 FHSS: Added excluded channels in neighbor table 92acbd2 WS: fixed merge conflicts 4e01969 Merge branch 'koli' into ws_start_bc 97200b3 Added version number increase in border router 27c8b65 FHSS: unit test update 6eb1255 FHSS: WS bootstrap to start broadcast schedule 659a1c4 FHSS: Write BT-IE 64f31b1 Merge pull request ARMmbed#1635 from ARMmbed/IOTTHD-2217 7706f2e FHSS: Do not return to RX channel when configured fixed channel 908eb17 Change RPL dis destination address to RPL address 666dbbf FHSS: Start broadcast schedule only if device is border router 98f9991 FHSS: Set neighbor info get function 126275b Merge pull request ARMmbed#1632 from ARMmbed/IOTTHD-2402 7fa2c2b WS: Learn channel function from parent 3980870 WS: Enable FHSS in bootstrap ff72d95 Merge pull request ARMmbed#1629 from ARMmbed/cppcheck_fixes 85f1345 MAC: Check length pointer in ie vector length validate 672c4ef FHSS: Removed unnecessary fhss_api NULL e5637fd FHSS: Initialize next_channel in broadcast channel calculation cab9849 Send address registration to all PC parents (ARMmbed#1618) 5417936 Merge pull request ARMmbed#1623 from ARMmbed/mergeMtoK3 ad41972 Wait RPL to be ready before bootstrap is ready a314db0 Merge branch 'master' into koli f6ac06f Fhss ut improvements (ARMmbed#1622) 60a3b0f Fixed ETX update at LLC layer. bb152ce Merge pull request ARMmbed#1617 from ARMmbed/IOTTHD-2321 49c213a FHSS unit tests: Added more tx handle tests d5cc85a FHSS unit tests: Test removing parent info and get neighbor info 2d01008 FHSS unit tests: test setting parent BC info 681dedd Merge pull request ARMmbed#1613 from ARMmbed/IOTTHD-2320 7e59035 Fix broken unit test build. 6be455f WS ETX update 0efc062 ETX service update e5aba03 WS PAN advert validation update 802ce3e WS bootstrap update be296cd WS IE lib update cfa5fd9 FHSS: Store parent broadcast info pointer d0171be FHSS: Implemented get neighbor info and set/remove parent info callbacks 686ad9c Fix acynch --> asynch b4059b8 WS neighbor class integrated to use new FHSS structures c1b0d96 Merge pull request ARMmbed#1610 from ARMmbed/IOTTHD-2313 3d98860 FHSS: Implemented WS timing/schedule info structure f96db0c Merge pull request ARMmbed#1607 from ARMmbed/merge_MtoK 72bb71f Fixed missing params after merging master to koli d119df9 Merge branch 'master' into koli 8166585 Merge pull request ARMmbed#1602 from ARMmbed/IOTTHD-2311 90fbb45 Fixed LLC data unit test and add new functions to test 94e516f Integrated new WS IE header and payload API's c553e8c WS ie library read update 7db0938 fixed mac_mlme valgrind errors. 4e2a743 Fixed thread test some of. 2680dd6 Fixed unstable unit test verified by valgrind. 18eda56 Merge pull request ARMmbed#1605 from ARMmbed/fhss_ut_valgrind_fix eb96eae FHSS unit tests: fixed uninitialized varnings 27b7864 Fixed mac helper stub issues. a88590f FHSS unit tests: Test tr51cf with excluded channels 3c9356a FHSS unit tests: Updated channel function tests 3a562d3 FHSS: Added excluded channels in channel function interface b9606c9 FHSS: Static channel functions added 695e64c Merge pull request ARMmbed#1601 from ARMmbed/IOTTHD-2214 f973986 FHSS unit tests: Implemented FHSS common unit tests 2188af4 FHSS unit tests: Removed FHSS common functions from FHSS e6bac6a Rename and refactor structures and function names. b037628 Fixed unit test and stubs 8153fe3 Fixed Asynch request missing msdu_handle set at LLC. 1af46d8 WS bootstrap update c771df0 LLC update UTT / BT information to ws neighbor and refresh mac neighbor a43f6ad Mac helper API update: 14792db Ws neighbor hoping storage init integrated to interface init. ae7945d Wi-sun neighbor hopping infor storage API definition 8f5c0bf FHSS: Removed fhss_beacon, fhss_beacon_tasklet and fhss_mac_interface 1e94358 Fixed unitest build. 3b9a4b0 Base Integration for Mac neighbor table to WS 7729e20 Mac neighbor table integrate to interface structure 2c6f30a Addede NULL check some of mac neighbor table check. ed45fda Mac neighbor table unit test's. 0f85841 Added mac_neighbor_table stub's fc4c97b Generic mesh neighbor table class. 4b81978 Process advertisement solicit and process response (ARMmbed#1592) 73c6bc1 Merge pull request ARMmbed#1589 from ARMmbed/IOTTHD-2218 057b6ec Omit NA sending in ARO success cases. Use ACK instead. (ARMmbed#1587) 4686668 ws_management_api unit tests (ARMmbed#1591) 9ae6511 FHSS unit tests: Implemented FHSS WS tests 8147217 Added trickle for Advertisement and processing of response (ARMmbed#1586) c52b039 Merge pull request ARMmbed#1584 from ARMmbed/IOTTHD-2055 ac58048 FHSS: WS FHSS to use pre-set TX time feeee0f FHSS: Synch callback to write ufsi 3e8112b Merge pull request ARMmbed#1578 from ARMmbed/IOTTHD-2286 4cd6c49 Merge pull request ARMmbed#1579 from ARMmbed/fhss_bug_fix 296a2f1 FHSS: Fixed scramble table bug 80e4270 FHSS: Added vendor defined CF support 24f418c Merge pull request ARMmbed#1575 from ARMmbed/IOTTHD-2288 a849c8d FHSS unit tests: Update FHSS tests 83bd90e FHSS: fhss_struct defined static 04ae3c3 FHSS: separated is_bc_callback to FHSS and WS 59fe586 FHSS: removed allocation of scramble table 1ca1d0b FHSS: Continued fhss_structure cleaning 036e19c Api Updates to LLC, ws_ie_lib and ws_info 192007b Fixed MAC Asynch message send and header build bug. e0494b7 WS address registration callback for SLAAC (ARMmbed#1568) 93b7e32 FHSS: superframe handlers separated ff66ae9 FHSS: Separate FHSS and WS parameters - Configuration structs moved 6ace69b Merge pull request ARMmbed#1573 from ARMmbed/fhss_cleaning1 07d4089 FHSS: Cleaning. Static functions. Separated tx fail and retry callbacks 8b9d39b Merge pull request ARMmbed#1571 from ARMmbed/fhss_callback_update 316b007 FHSS: removed unnecessary state set handler db1ded0 WS LLC data service enabled to WS bootstrap. c326e4a Fixed MPX header size calculation to MPX data request. fa2d7d0 Removed Adaptation interface depency from LLC away. 4356ae8 separated BBR to own file (ARMmbed#1567) 75d93f8 Merge pull request ARMmbed#1564 from ARMmbed/IOTTHD-2213 19c4be6 FHSS: Separated tx done cb for FHSS and WS 3e326d1 FHSS: separated synch info write for FHSS and WS 15d4465 Function and parameter rename. 5af7992 Unit test for llc data service. ffb3639 Fixed stubs. 3f66f6a LLC delete added for test purpose b48cda0 Impelement LLC reset 47458c8 WS IE Lib unit test and fixed mac ie lib stub 6b6e509 MPX header module unit test. 55309e8 ws_llc_asynch_request() API update 5d9a379 Wisun spesific IE elemts write operation library. c718985 FHSS: Calculate destination slot and ufsi b4e1616 Merge pull request ARMmbed#1561 from ARMmbed/IOTTHD-2172 096aeef ws create interface and start rpl for poc (ARMmbed#1562) 77c851a FHSS: Added BSI in ws configuration 7d4a2f8 FHSS: Start broadcast schedule when bc intervals are known e55ec8a FHSS: Prevent changing unicast channel when broadcast is active b60b113 FHSS: Broadcast handler implemented 9bf1d1f WS Bootstrap skeleton (ARMmbed#1559) 3fb6390 Merge pull request ARMmbed#1560 from ARMmbed/mergeMtoK2 b78a370 Merge branch 'master' into koli 8b43c6e Merge pull request ARMmbed#1555 from ARMmbed/IOTTHD-2215 78314e8 FHSS: WS FHSS enable implemented d04b818 FHSS: Compensation callback to return timeout value 472becb FHSS: FHSS configuration to union b5f9e01 FHSS unit tests: Fixed after FHSS enable/down updates 2cbe6dc FHSS: Moved FHSS reset and down to FHSS module 4719187 FHSS: Separated FHSS enable functions for FHSS and WS FHSS f4548d8 FHSS: Implemented WS configuration structure 7ace04b Initial commit for ws_bootstrap (ARMmbed#1556) 9e46cf9 Added malformed message check to nested IE discovery. 7f4c184 Added support for write and discover Nested IE elements. e3d8150 SW MAC Asynch data request support 9a98177 Merge pull request ARMmbed#1552 from ARMmbed/cf_update 30075dd FHSS: TR51 channel function updated (bug in the spec?) 6b04d5a Merge pull request ARMmbed#1548 from ARMmbed/IOTTHD-2093 4249fad Integrated ws llc and mpx features. a49bf11 Fix Const pointer wrong use. 3e1972f WS LLC module implementation base 957f270 MPX frame support 93f0ed7 MAC ie library update: b2198b3 MPX support Integrate 2531c49 WS LLC and MAC MPX API definition and IE types definition. a5493d2 FHSS: Do not send TX failure if TX in progress in channel change 958991a FHSS: Few FHSS functions to static 7237796 Merge pull request ARMmbed#1545 from ARMmbed/IOTTHD-2097 f794990 FHSS: Implemented destination channel change in TX handle callback d2957a1 FHSS: fhss tx conditions callbacks added c1e7300 FHSS: hard coded channel function 1d54c7d FHSS: fhss tx handle callbacks added 0cc1889 FHSS: Moved external API set to fhss and fhss_ws c6cfb6c Merge pull request ARMmbed#1544 from ARMmbed/fhss_headers_refactored 1b4e203 FHSS: refactoring FHSS header files e047723 Merge pull request ARMmbed#1541 from ARMmbed/IOTTHD-2171 5d98e3e FHSS: Added support for TR51 channel function c8a9c7c FHSS: function to calculate nearest (larger or equal) prime number 5e70ec1 FHSS: ws struct to hold ws specific parameters f2d7558 FHSS unit tests: Fixed tests 149f17b FHSS: Own create api for WS e19de33 FHSS: WS to use Direct Hash channel function fb99776 FHSS: Some cleaning 7a21ca1 FHSS: Added common superframe handler a881580 FHSS: Added ws handler for FHSS state set f7ab36c FHSS: Created FHSS state set handler f6c61fc Added Copyrights c445590 MAC IE element library 6e94b08 MCPS-Data-REQ API update 38aedc5 Remove commented code away. 663fd3e Fixed missing doxygen tags. b9f7bf4 MAC functional updates and fix's: 2cef8ac Merge pull request ARMmbed#1538 from ARMmbed/mergeMtoK 321f700 Merge pull request ARMmbed#1534 from ARMmbed/IOTTHD-2047 146d7c4 Merge branch 'master' into koli 100db21 FHSS unit test: Added FHSS common to unit test makefile 37425ca FHSS: Separated common FHSS functions to own module 59b7b76 FHSS: Removed massive trace flags 60dfccb FHSS: Removed unnecessary channel functions e456662 FHSS: Removed scramble table generation from fhss enable b643622 Merge pull request ARMmbed#1532 from ARMmbed/IOTTHD-2049 b741f98 MCPS Data request API update. c329f61 MAC API update and internal update 55861f3 FHSS unit tests: Fixed tests after API change f9a31e9 FHSS API: Added callback to read synch info f94b2ab FHSS: FHSS to use synch info callback 6830fd3 FHSS API: Added synch info write callback ad5a1e1 Merge pull request ARMmbed#1527 from ARMmbed/IOTTHD-2095 3ed145f FHSS API: Added new configurations 0f9f0bb FHSS: Platform API to support multiple simultaneous timeouts bf65e9c Unit tests: Added PHY extension stub 322167e MAC: RX time get function implemented 23d3a58 MAC: Created a function to set TX time 2384c33 PHY API: extension to support timestamp 209e49a Merge pull request ARMmbed#1528 from ARMmbed/IOTTHD-2046 89a85a8 FHSS: Added copyright headers, comments etc. 5d0f44e Unit tests: DH1CF channel function tests implemented fbd5568 FHSS: DH1CF channel functions implemented cf03db2 FHSS: Implemented tr51 channel functions 00af7f1 Unit tests: Created channel function unit tests git-subtree-dir: features/nanostack/sal-stack-nanostack git-subtree-split: 4a188ea
1 parent 8e546a3 commit 7e1fb3c

File tree

171 files changed

+8412
-4861
lines changed

Some content is hidden

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

171 files changed

+8412
-4861
lines changed

nanostack/ccmLIB.h

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014-2017, Arm Limited and affiliates.
2+
* Copyright (c) 2014-2018, Arm Limited and affiliates.
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,18 +18,19 @@
1818
#define CCMLIB_H_
1919

2020
#include "ns_types.h"
21+
#include "platform/arm_hal_aes.h"
2122

2223
/**
2324
*
2425
* \file ccmLIB.h
2526
* \brief CCM Library API.
2627
*
2728
* \section ccm-api CCM Library API:
28-
* - ccm_sec_init(), A function to init CCM library.
29+
* - ccm_sec_init(), A function to init CCM context.
2930
* - ccm_process_run(), A function to run configured CCM process.
3031
*
3132
* \section ccm-instruction CCM process sequence:
32-
* 1. Init CCM library by, ccm key, ccm_sec_init()
33+
* 1. Init CCM context by, ccm key, ccm_sec_init()
3334
* - security level
3435
* - 128-bit CCM key
3536
* - mode: AES_CCM_ENCRYPT or AES_CCM_DECRYPT
@@ -41,11 +42,6 @@
4142
* -If 0 Process ok
4243
* -< 0 MIC fail or parameter fail
4344
*
44-
* \section ccm-mutex CCM Mutex for Multi Thread System
45-
* If you are running a multi thread system and the CCM library will be used for multiple thread, do the following:
46-
* 1. Add compiler flag to library build process CCM_USE_MUTEX.
47-
* 2. Define OS-specific mutex at the application.
48-
* 3. Implement arm_ccm_mutex_lock() arm_ccm_mutex_unlock() function for using the generated and initialized mutex.
4945
*/
5046
#ifdef __cplusplus
5147
extern "C" {
@@ -63,41 +59,39 @@ extern "C" {
6359
#define AES_CCM_DECRYPT 0x01 /**< Decryption mode */
6460

6561

66-
/**
67-
* \brief A function for locking CCM mutex if the OS is multi thread. If you are using single thread create an empty function.
68-
*/
69-
extern void arm_ccm_mutex_lock(void);
70-
/**
71-
* \brief A function for unlocking CCM mutex if the OS is multi thread. If you are using single thread create an empty function
72-
*/
73-
extern void arm_ccm_mutex_unlock(void);
74-
7562
/*!
7663
* \struct ccm_globals_t
7764
* \brief CCM global structure.
7865
* The structure is used for configuring NONCE, adata and data before calling ccm_process_run().
7966
*/
8067
typedef struct {
81-
uint8_t exp_nonce[15]; /**< CCM NONCE buffer Nonce. */
82-
uint8_t *data_ptr; /**< Pointer to data IN. */
83-
uint16_t data_len; /**< Length of data IN. */
68+
uint8_t exp_nonce[15]; /**< CCM NONCE buffer Nonce. */
69+
uint8_t *data_ptr; /**< Pointer to data IN. */
70+
uint16_t data_len; /**< Length of data IN. */
8471
const uint8_t *adata_ptr; /**< Pointer to authentication data. */
85-
uint16_t adata_len; /**< Length of authentication data. */
86-
uint8_t mic_len; /**< ccm_sec_init() sets here the length of MIC. */
87-
uint8_t *mic; /**< Encrypt process writes MIC. Decrypt reads it and compares it with the MIC obtained from data. */
72+
uint16_t adata_len; /**< Length of authentication data. */
73+
unsigned ccm_encode_mode:1; /**< Encryption modeAES_CCM_ENCRYPT or AES_CCM_DECRYPT. */
74+
unsigned ccm_sec_level:3; /**< Encryption operation security level 0-7. */
75+
unsigned ccm_l_param:4; /**< Can be 2 or 3. 2 when NONCE length is 13 and 3 when 12*/
76+
uint8_t mic_len; /**< ccm_sec_init() sets here the length of MIC. */
77+
uint8_t *mic; /**< Encrypt process writes MIC. Decrypt reads it and compares it with the MIC obtained from data. */
78+
const uint8_t *key_ptr; /**< Encyption key pointer to 128-bit key. */
79+
arm_aes_context_t *aes_context; /**< Allocated AES context. */
8880
} ccm_globals_t;
8981

82+
9083
/**
91-
* \brief A function to initialize the CCM library.
84+
* \brief A function to initialize the CCM context.
85+
* \param ccm_context pointer to initialized XXM context
9286
* \param sec_level Used CCM security level (0-7).
9387
* \param ccm_key Pointer to 128-key.
9488
* \param mode AES_CCM_ENCRYPT or AES_CCM_DECRYPT.
9589
* \param ccm_l Can be 2 or 3. 2 when NONCE length is 13 and 3 when 12. (NONCE length = (15-ccm_l))
9690
*
97-
* \return Pointer to Global CCM parameter buffer.
98-
* \return 0 When parameter fails or CCM is busy.
91+
* \return true when AES context allocation is OK and given parameters.
92+
* \return false CCM parameters or AES context allocation fail.
9993
*/
100-
extern ccm_globals_t *ccm_sec_init(uint8_t sec_level, const uint8_t *ccm_key, uint8_t mode, uint8_t ccm_l);
94+
extern bool ccm_sec_init(ccm_globals_t *ccm_context, uint8_t sec_level, const uint8_t *ccm_key, uint8_t mode, uint8_t ccm_l);
10195

10296
/**
10397
* \brief A function to run the configured CCM process.
@@ -109,6 +103,14 @@ extern ccm_globals_t *ccm_sec_init(uint8_t sec_level, const uint8_t *ccm_key, ui
109103
* \return -2 Null pointer given to function.
110104
*/
111105
extern int8_t ccm_process_run(ccm_globals_t *ccm_params);
106+
107+
/**
108+
* \brief A function to free aes context. Call only if ccm_process_run() is not called
109+
* \param ccm_params CCM parameters
110+
*
111+
*/
112+
extern void ccm_free(ccm_globals_t *ccm_params);
113+
112114
#ifdef __cplusplus
113115
}
114116
#endif

nanostack/fhss_api.h

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016-2017, Arm Limited and affiliates.
2+
* Copyright (c) 2016-2018, Arm Limited and affiliates.
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -74,17 +74,16 @@ typedef bool fhss_use_broadcast_queue(const fhss_api_t *api, bool is_broadcast_a
7474
* @param is_broadcast_addr Destination address type of packet (true if broadcast address).
7575
* @param destination_address Destination MAC address.
7676
* @param frame_type Frame type of packet (Frames types are defined by FHSS api).
77-
* @param synch_info Pointer to where FHSS synchronization info is written (if synch frame).
7877
* @param frame_length MSDU length of the frame.
7978
* @param phy_header_length PHY header length.
8079
* @param phy_tail_length PHY tail length.
80+
* @param tx_time TX time.
8181
* @return 0 Success.
8282
* @return -1 Transmission of the packet is currently not allowed, try again.
8383
* @return -2 Invalid api.
8484
* @return -3 Broadcast packet on Unicast channel (not allowed), push packet back to queue.
85-
* @return -4 Synchronization info missing.
8685
*/
87-
typedef int fhss_tx_handle(const fhss_api_t *api, bool is_broadcast_addr, uint8_t *destination_address, int frame_type, uint8_t *synch_info, uint16_t frame_length, uint8_t phy_header_length, uint8_t phy_tail_length);
86+
typedef int fhss_tx_handle(const fhss_api_t *api, bool is_broadcast_addr, uint8_t *destination_address, int frame_type, uint16_t frame_length, uint8_t phy_header_length, uint8_t phy_tail_length, uint32_t tx_time);
8887

8988
/**
9089
* @brief Check TX permission.
@@ -152,6 +151,17 @@ typedef uint32_t fhss_read_timestamp(const fhss_api_t *api);
152151
*/
153152
typedef uint16_t fhss_get_retry_period(const fhss_api_t *api, uint8_t *destination_address, uint16_t phy_mtu);
154153

154+
/**
155+
* @brief Write synchronization info to given pointer.
156+
* @param api FHSS instance.
157+
* @param ptr Pointer to data. Start of written data for Synch frame. Start of IE header for Data frame.
158+
* @param length Length of IE header. Ignored when Synch frame.
159+
* @param frame_type Frame type of packet (Frames types are defined by FHSS api).
160+
* @param tx_time TX time must be referenced to the first symbol following the SFD of the transmitted frame.
161+
* @return -1 on fail, write length otherwise.
162+
*/
163+
typedef int16_t fhss_write_synch_info(const fhss_api_t *api, uint8_t *ptr, uint8_t length, int frame_type, uint32_t tx_time);
164+
155165
/**
156166
* @brief Initialize MAC functions.
157167
* @param api FHSS instance.
@@ -177,6 +187,7 @@ struct fhss_api {
177187
fhss_synch_state_set *synch_state_set; /**< Change synchronization state. */
178188
fhss_read_timestamp *read_timestamp; /**< Read timestamp. */
179189
fhss_get_retry_period *get_retry_period; /**< Get retransmission period. */
190+
fhss_write_synch_info *write_synch_info; /**< Write synchronization info to TX frame*/
180191
fhss_init_callbacks *init_callbacks; /**< Initialize MAC functions. */
181192
};
182193

@@ -256,6 +267,18 @@ typedef int mac_broadcast_notify(const fhss_api_t *fhss_api, uint32_t broadcast_
256267
*/
257268
typedef int mac_read_coordinator_mac_address(const fhss_api_t *fhss_api, uint8_t *mac_address);
258269

270+
/**
271+
* @brief Read synchronization info for a specific peer.
272+
* @param fhss_api FHSS instance.
273+
* @param info_ptr Pointer to info data.
274+
* @param mac_address MAC address pointer.
275+
* @param info_type Type of the read info (UTT-IE, BT-IE, US-IE, BS-IE).
276+
* @param rx_timestamp Time of reception of the element.
277+
* @return >=0 Length of the info.
278+
* @return -1 Fail.
279+
*/
280+
typedef int mac_read_synch_info(const fhss_api_t *fhss_api, uint8_t *info_ptr, uint8_t *mac_address, int info_type, uint32_t rx_timestamp);
281+
259282
/**
260283
* \brief Struct fhss_callback defines functions that software MAC needs to implement.
261284
* Function pointers are passed to FHSS using fhss_init_callbacks function.
@@ -270,6 +293,7 @@ struct fhss_callback {
270293
mac_tx_poll *tx_poll; /**< Poll TX queue. */
271294
mac_broadcast_notify *broadcast_notify; /**< Broadcast channel notification from FHSS. */
272295
mac_read_coordinator_mac_address *read_coord_mac_address; /**< Read coordinator MAC address. */
296+
mac_read_synch_info *read_synch_info; /**< Read information element for a specific MAC address. */
273297
};
274298

275299
#ifdef __cplusplus

nanostack/fhss_config.h

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2017, Arm Limited and affiliates.
2+
* Copyright (c) 2015-2018, Arm Limited and affiliates.
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,6 +28,23 @@
2828
extern "C" {
2929
#endif
3030

31+
#include "fhss_ws_extension.h"
32+
33+
/**
34+
* @brief WS channel functions.
35+
*/
36+
typedef enum
37+
{
38+
/** Fixed channel. */
39+
WS_FIXED_CHANNEL,
40+
/** TR51 channel function. */
41+
WS_TR51CF,
42+
/** Direct Hash channel function. */
43+
WS_DH1CF,
44+
/** Vendor Defined channel function. */
45+
WS_VENDOR_DEF_CF
46+
} fhss_ws_channel_functions;
47+
3148
/**
3249
* \brief Struct fhss_tuning_parameter defines FHSS tuning parameters.
3350
* All delays are given in microseconds.
@@ -63,20 +80,59 @@ typedef struct fhss_configuration
6380

6481
} fhss_configuration_t;
6582

83+
/**
84+
* @brief Get channel using vendor defined channel function.
85+
* @param api FHSS instance.
86+
* @param slot Slot number in channel schedule.
87+
* @param eui64 EUI-64 address of node for which the (unicast) schedule is calculated. NULL for broadcast schedule.
88+
* @param bsi Broadcast schedule identifier used in (broadcast) schedule calculation.
89+
* @param number_of_channels Number of channels in schedule.
90+
* @return Channel.
91+
*/
92+
typedef int32_t fhss_vendor_defined_cf(const fhss_api_t *api, uint16_t slot, uint8_t eui64[8], uint16_t bsi, uint16_t number_of_channels);
93+
94+
/**
95+
* \brief Struct fhss_ws_configuration defines configuration of WS FHSS.
96+
*/
97+
typedef struct fhss_ws_configuration
98+
{
99+
/** WS channel function. */
100+
fhss_ws_channel_functions ws_channel_function;
101+
102+
/** Broadcast schedule identifier. */
103+
uint16_t bsi;
104+
105+
/** Unicast dwell interval. Range: 15-250 milliseconds. */
106+
uint8_t fhss_uc_dwell_interval;
107+
108+
/** Broadcast interval. Duration between broadcast dwell intervals. Range: 0-16777216 milliseconds. */
109+
uint32_t fhss_broadcast_interval;
110+
111+
/** Broadcast dwell interval. Range: 15-250 milliseconds. */
112+
uint8_t fhss_bc_dwell_interval;
113+
114+
/** Channel mask. */
115+
uint32_t channel_mask[8];
116+
117+
/** Vendor defined channel function. */
118+
fhss_vendor_defined_cf *vendor_defined_cf;
119+
120+
} fhss_ws_configuration_t;
121+
66122
/**
67123
* \brief Struct fhss_timer defines interface between FHSS and FHSS platform timer.
68124
* Application must implement FHSS timer driver which is then used by FHSS with this interface.
69125
*/
70126
typedef struct fhss_timer
71127
{
72-
/** Start timeout (1us) */
128+
/** Start timeout (1us). Timer must support multiple simultaneous timeouts */
73129
int (*fhss_timer_start)(uint32_t, void (*fhss_timer_callback)(const fhss_api_t *fhss_api, uint16_t), const fhss_api_t *fhss_api);
74130

75131
/** Stop timeout */
76-
int (*fhss_timer_stop)(const fhss_api_t *fhss_api);
132+
int (*fhss_timer_stop)(void (*fhss_timer_callback)(const fhss_api_t *fhss_api, uint16_t), const fhss_api_t *fhss_api);
77133

78134
/** Get remaining time of started timeout*/
79-
uint32_t (*fhss_get_remaining_slots)(const fhss_api_t *fhss_api);
135+
uint32_t (*fhss_get_remaining_slots)(void (*fhss_timer_callback)(const fhss_api_t *fhss_api, uint16_t), const fhss_api_t *fhss_api);
80136

81137
/** Get timestamp since initialization of driver. Overflow of 32-bit counter is allowed (1us) */
82138
uint32_t (*fhss_get_timestamp)(const fhss_api_t *fhss_api);

0 commit comments

Comments
 (0)