Skip to content

Commit

Permalink
FW-867. Move IEEE802154E security option to config.h
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyClaeys committed May 29, 2020
1 parent 7ed3719 commit c02bfe4
Show file tree
Hide file tree
Showing 26 changed files with 306 additions and 197 deletions.
2 changes: 0 additions & 2 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ if env['atmel_24ghz'] == 1:
env.Append(CPPDEFINES='ATMEL_24GHZ')
if env['noadaptivesync'] == 1:
env.Append(CPPDEFINES='NOADAPTIVESYNC')
if env['l2_security'] == 1:
env.Append(CPPDEFINES='L2_SECURITY_ACTIVE')
if 11 <= env['fix_channel'] <= 26:
env.Append(CPPDEFINES={'IEEE802154E_SINGLE_CHANNEL': env['fix_channel']})
if env['deadline_option'] == 1:
Expand Down
10 changes: 0 additions & 10 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ project:
forcetopology Force the topology to the one indicated in the
openstack/02a-MAClow/topology.c file.
noadaptivesync Do not use adaptive synchronization.
l2_security Use hop-by-hop encryption and authentication.
0 (off), 1 (on)
ide qtcreator
fix_channel Set single channel hopping for debugging
0 (off, default), i (on, channel=i [11:26])
Expand Down Expand Up @@ -150,7 +148,6 @@ command_line_options = {
'debug': ['0', '1'],
'atmel_24ghz': ['0', '1'],
'noadaptivesync': ['0', '1'],
'l2_security': ['0', '1'],
'fix_channel': ['0'] + map(str, range(11, 27)),
'deadline_option': ['0', '1'],
'ide': ['none', 'qtcreator'],
Expand Down Expand Up @@ -288,13 +285,6 @@ command_line_vars.AddVariables(
validate_option, # validator
int, # converter
),
(
'l2_security', # key
'', # help
command_line_options['l2_security'][0], # default
validate_option, # validator
int, # converter
),
(
'fix_channel', # key
'', # help
Expand Down
6 changes: 6 additions & 0 deletions bsp/boards/iot-lab_A8-M3/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
\author Alaeddine Weslati <alaeddine.weslati@inria.fr>, January 2014.
\author Tengfei Chang <tengfei.chang@inria.fr>, May 2017.
*/

#include "config.h"
#include "stm32f10x_lib.h"
#include "board.h"
// bsp modules
Expand Down Expand Up @@ -96,6 +98,10 @@ void board_init(void){
debugpins_init();
//enable nvic for the radio
NVIC_radio();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
cryptoengine_init();
#enabled
}

void board_sleep(void) {
Expand Down
6 changes: 5 additions & 1 deletion bsp/boards/iot-lab_A8-M3/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
\brief Implementation of cryptoengine based on AT86RF231's hardware accelerator.
*/

#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)

#include <stdint.h>
#include <string.h>
#include "at86rf231.h"
Expand Down Expand Up @@ -518,4 +522,4 @@ static void inc_counter(uint8_t* counter) {
} while (n);
}


#endif /* BOARD_CRYPTOENGINE_ENABLED */
5 changes: 5 additions & 0 deletions bsp/boards/iot-lab_M3/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
\author Alaeddine Weslati <alaeddine.weslati@inria.fr>, January 2014.
\author Tengfei Chang <tengfei.chang@inria.fr>, May 2017.
*/

#include "config.h"
#include "stm32f10x_conf.h"
#include "board.h"
// bsp modules
Expand Down Expand Up @@ -92,7 +94,10 @@ void board_init(void)
debugpins_init();
//enable nvic for the radio
NVIC_radio();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
cryptoengine_init();
#endif
}

void board_sleep(void) {
Expand Down
6 changes: 5 additions & 1 deletion bsp/boards/iot-lab_M3/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
\brief Implementation of cryptoengine based on AT86RF231's hardware accelerator.
*/

#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)

#include <stdint.h>
#include <string.h>
#include "at86rf231.h"
Expand Down Expand Up @@ -518,4 +522,4 @@ static void inc_counter(uint8_t* counter) {
} while (n);
}


#endif /* BOARD_CRYPTOENGINE_ENABLED */
3 changes: 3 additions & 0 deletions bsp/boards/openmote-b-24ghz/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ void board_init(void) {
i2c_init();

// sensors_init();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
cryptoengine_init();
#endif
}

void antenna_init(void) {
Expand Down
8 changes: 5 additions & 3 deletions bsp/boards/openmote-b-24ghz/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <source/cpu.h>
#include <source/interrupt.h>

#include "config.h"

//=========================== defines =========================================

//===== interrupt state
Expand Down Expand Up @@ -71,11 +73,11 @@
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef L2_SECURITY_ACTIVE
#ifdef OPENWSN_IEEE802154E_SECURITY_C
#define PORT_delayTx 14 // 366us (measured xxxus)
#else
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
#endif
#endif
#define PORT_delayRx 0 // 0us (can not measure)
// radio watchdog
#endif
Expand Down
7 changes: 7 additions & 0 deletions bsp/boards/openmote-b-24ghz/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
\author Malisa Vucinic <malishav@gmail.com>, March 2015.
*/

#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)

#include <stdint.h>

#include <headers/hw_sys_ctrl.h>
Expand Down Expand Up @@ -157,3 +162,5 @@ static owerror_t load_key(uint8_t key[16], uint8_t* /* out */ key_location) {
*key_location = DEFAULT_KEY_AREA;
return E_SUCCESS;
}

#endif /* BOARD_CRYPTOENGINE_ENABLED */
3 changes: 3 additions & 0 deletions bsp/boards/openmote-b-subghz/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ void board_init(void) {
i2c_init();

// sensors_init();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
cryptoengine_init();
#endif
}

void antenna_init(void) {
Expand Down
8 changes: 5 additions & 3 deletions bsp/boards/openmote-b-subghz/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <source/cpu.h>
#include <source/interrupt.h>

#include "config.h"

//=========================== defines =========================================

//===== interrupt state
Expand Down Expand Up @@ -70,11 +72,11 @@
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef L2_SECURITY_ACTIVE
#ifdef OPENWSN_IEEE802154E_SECURITY_C
#define PORT_delayTx 14 // 366us (measured xxxus)
#else
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
#endif
#endif
#define PORT_delayRx 0 // 0us (can not measure)
// radio watchdog
#endif
Expand Down
7 changes: 7 additions & 0 deletions bsp/boards/openmote-b-subghz/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
\author Malisa Vucinic <malishav@gmail.com>, March 2015.
*/

#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)

#include <stdint.h>

#include <headers/hw_sys_ctrl.h>
Expand Down Expand Up @@ -157,3 +162,5 @@ static owerror_t load_key(uint8_t key[16], uint8_t* /* out */ key_location) {
*key_location = DEFAULT_KEY_AREA;
return E_SUCCESS;
}

#endif /* BOARD_CRYPTOENGINE_ENABLED */
5 changes: 4 additions & 1 deletion bsp/boards/openmote-b/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ void board_init(void) {
radio_init();
i2c_init();
sensors_init();
cryptoengine_init();

#if defined(BOARD_CRYPTOENGINE_ENABLED)
cryptoengine_init();
#endif
}

void antenna_init(void) {
Expand Down
8 changes: 5 additions & 3 deletions bsp/boards/openmote-b/board_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <source/cpu.h>
#include <source/interrupt.h>

#include "config.h"

//=========================== defines =========================================

//===== interrupt state
Expand Down Expand Up @@ -70,11 +72,11 @@
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us)
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us)
// radio speed related
#ifdef L2_SECURITY_ACTIVE
#ifdef OPENWSN_IEEE802154E_SECURITY_C
#define PORT_delayTx 14 // 366us (measured xxxus)
#else
#else
#define PORT_delayTx 12 // 366us (measured xxxus)
#endif
#endif
#define PORT_delayRx 0 // 0us (can not measure)
// radio watchdog
#endif
Expand Down
6 changes: 6 additions & 0 deletions bsp/boards/openmote-b/cryptoengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
\author Malisa Vucinic <malishav@gmail.com>, March 2015.
*/
#include "config.h"

#if defined(BOARD_CRYPTOENGINE_ENABLED)

#include <stdint.h>

#include <headers/hw_sys_ctrl.h>
Expand Down Expand Up @@ -157,3 +161,5 @@ static owerror_t load_key(uint8_t key[16], uint8_t* /* out */ key_location) {
*key_location = DEFAULT_KEY_AREA;
return E_SUCCESS;
}

#endif /* BOARD_CRYPTOENGINE_ENABLED */
Loading

0 comments on commit c02bfe4

Please sign in to comment.