Skip to content

Commit d879422

Browse files
author
Arto Kinnunen
committed
Merge commit '77818568c6d9389ef1eb82e40ebfbbf26626c9d3' into mbedos511
* commit '77818568c6d9389ef1eb82e40ebfbbf26626c9d3': Squashed 'features/nanostack/sal-stack-nanostack/' changes from ccd30a3..513a38e
2 parents 923ce13 + 7781856 commit d879422

File tree

211 files changed

+4852
-4760
lines changed

Some content is hidden

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

211 files changed

+4852
-4760
lines changed

features/nanostack/sal-stack-nanostack/nanostack/ccmLIB.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ typedef struct {
7070
uint16_t data_len; /**< Length of data IN. */
7171
const uint8_t *adata_ptr; /**< Pointer to authentication data. */
7272
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*/
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*/
7676
uint8_t mic_len; /**< ccm_sec_init() sets here the length of MIC. */
7777
uint8_t *mic; /**< Encrypt process writes MIC. Decrypt reads it and compares it with the MIC obtained from data. */
7878
const uint8_t *key_ptr; /**< Encyption key pointer to 128-bit key. */

features/nanostack/sal-stack-nanostack/nanostack/dhcp_service_api.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666
* /enum dhcp_instance_type
6767
* /brief DHCP instance types.
6868
*/
69-
typedef enum dhcp_instance_type
70-
{
69+
typedef enum dhcp_instance_type {
7170
DHCP_INSTANCE_CLIENT,
7271
DHCP_INSTANCE_SERVER,
7372
DHCP_INTANCE_RELAY_AGENT

features/nanostack/sal-stack-nanostack/nanostack/ethernet_mac_api.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ typedef struct eth_mac_api_s eth_mac_api_t;
4242
typedef struct eth_data_conf_s {
4343
uint8_t msduHandle; /**< Handle associated with MSDU */
4444
uint8_t status; /**< Status of the last transaction */
45-
}eth_data_conf_t;
45+
} eth_data_conf_t;
4646

4747
/**
4848
* \brief Struct eth_data_req_s defines arguments for data request message
@@ -67,7 +67,7 @@ typedef struct eth_data_ind_s {
6767
uint16_t etehernet_type; /**< Ethernet type */
6868
uint8_t link_quality; /**< Link quality */
6969
int8_t dbm; /**< measured dBm */
70-
}eth_data_ind_t;
70+
} eth_data_ind_t;
7171

7272
/**
7373
* @brief Creates ethernet MAC API instance which will use driver given
@@ -91,37 +91,37 @@ extern int8_t ethernet_mac_destroy(eth_mac_api_t *mac_api);
9191
* @param api API to handle the request
9292
* @param data Data containing request parameters
9393
*/
94-
typedef void eth_mac_data_request(const eth_mac_api_t* api, const eth_data_req_t *data);
94+
typedef void eth_mac_data_request(const eth_mac_api_t *api, const eth_data_req_t *data);
9595

9696
/**
9797
* @brief data_confirm confirm is called as a response to data_request
9898
* @param api The API which handled the request
9999
* @param data Data containing confirm parameters
100100
*/
101-
typedef void eth_mac_data_confirm(const eth_mac_api_t* api, const eth_data_conf_t *data );
101+
typedef void eth_mac_data_confirm(const eth_mac_api_t *api, const eth_data_conf_t *data);
102102

103103
/**
104104
* @brief data_indication Data indication is called when MAC layer has received data
105105
* @param api The API which handled the response
106106
* @param data Data containing indication parameters
107107
*/
108-
typedef void eth_mac_data_indication(const eth_mac_api_t* api, const eth_data_ind_t *data );
108+
typedef void eth_mac_data_indication(const eth_mac_api_t *api, const eth_data_ind_t *data);
109109

110110
/**
111111
* @brief Set 48 bit address from MAC
112112
* @param api API to handle the request
113113
* @param mac48 Pointer having mac address to be set
114114
* @return 0 if successful, -1 otherwise
115115
*/
116-
typedef int8_t eth_mac_mac48_address_set(const eth_mac_api_t* api, const uint8_t *mac48);
116+
typedef int8_t eth_mac_mac48_address_set(const eth_mac_api_t *api, const uint8_t *mac48);
117117

118118
/**
119119
* @brief Read 48 bit address from MAC
120120
* @param api API to handle the request
121121
* @param mac48_buf Pointer where mac address can be written
122122
* @return 0 if successful, -1 otherwise
123123
*/
124-
typedef int8_t eth_mac_mac48_address_get(const eth_mac_api_t* api, uint8_t *mac48_buf);
124+
typedef int8_t eth_mac_mac48_address_get(const eth_mac_api_t *api, uint8_t *mac48_buf);
125125

126126
/**
127127
* @brief Upper layer will call this function, when MAC is taken into use
@@ -132,7 +132,7 @@ typedef int8_t eth_mac_mac48_address_get(const eth_mac_api_t* api, uint8_t *mac4
132132
* @return 0 if success; -1 if api is NULL or not found
133133
*/
134134
typedef int8_t eth_mac_api_initialize(eth_mac_api_t *api, eth_mac_data_confirm *conf_cb,
135-
eth_mac_data_indication *ind_cb, uint8_t parent_id);
135+
eth_mac_data_indication *ind_cb, uint8_t parent_id);
136136

137137
/**
138138
* \brief Struct eth_mac_api_s defines functions for two-way communications between ethernet MAC and Upper layer.

features/nanostack/sal-stack-nanostack/nanostack/fhss_api.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ typedef struct fhss_callback fhss_callback_t;
4646
/**
4747
* @brief FHSS states.
4848
*/
49-
typedef enum
50-
{
49+
typedef enum {
5150
FHSS_UNSYNCHRONIZED,
5251
FHSS_SYNCHRONIZED,
5352
} fhss_states;

features/nanostack/sal-stack-nanostack/nanostack/fhss_config.h

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ extern "C" {
3333
/**
3434
* @brief WS channel functions.
3535
*/
36-
typedef enum
37-
{
36+
typedef enum {
3837
/** Fixed channel. */
3938
WS_FIXED_CHANNEL,
4039
/** TR51 channel function. */
@@ -49,8 +48,7 @@ typedef enum
4948
* \brief Struct fhss_tuning_parameter defines FHSS tuning parameters.
5049
* All delays are given in microseconds.
5150
*/
52-
typedef struct fhss_tuning_parameter
53-
{
51+
typedef struct fhss_tuning_parameter {
5452
/** Delay between data pushed to PHY TX function and TX started (Contains CSMA-CA maximum random period). */
5553
uint32_t tx_processing_delay;
5654

@@ -64,8 +62,7 @@ typedef struct fhss_tuning_parameter
6462
/**
6563
* \brief Struct fhss_configuration defines basic configuration of FHSS.
6664
*/
67-
typedef struct fhss_configuration
68-
{
65+
typedef struct fhss_configuration {
6966
/** Tuning parameters can be used to enhance synchronization accuracy*/
7067
fhss_tuning_parameter_t fhss_tuning_parameters;
7168

@@ -94,8 +91,7 @@ typedef int32_t fhss_vendor_defined_cf(const fhss_api_t *api, uint16_t slot, uin
9491
/**
9592
* \brief Struct fhss_ws_configuration defines configuration of WS FHSS.
9693
*/
97-
typedef struct fhss_ws_configuration
98-
{
94+
typedef struct fhss_ws_configuration {
9995
/** WS unicast channel function. */
10096
fhss_ws_channel_functions ws_uc_channel_function;
10197

@@ -132,8 +128,7 @@ typedef struct fhss_ws_configuration
132128
* \brief Struct fhss_timer defines interface between FHSS and FHSS platform timer.
133129
* Application must implement FHSS timer driver which is then used by FHSS with this interface.
134130
*/
135-
typedef struct fhss_timer
136-
{
131+
typedef struct fhss_timer {
137132
/** Start timeout (1us). Timer must support multiple simultaneous timeouts */
138133
int (*fhss_timer_start)(uint32_t, void (*fhss_timer_callback)(const fhss_api_t *fhss_api, uint16_t), const fhss_api_t *fhss_api);
139134

@@ -154,8 +149,7 @@ typedef struct fhss_timer
154149
* \brief Struct fhss_synch_configuration defines the synchronization time configurations.
155150
* Border router application must define and set these configuration for FHSS network.
156151
*/
157-
typedef struct fhss_synch_configuration
158-
{
152+
typedef struct fhss_synch_configuration {
159153
/** Number of broadcast channels. */
160154
uint8_t fhss_number_of_bc_channels;
161155

@@ -174,8 +168,7 @@ typedef struct fhss_synch_configuration
174168
/**
175169
* \brief Struct fhss_statistics defines the available FHSS statistics.
176170
*/
177-
typedef struct fhss_statistics
178-
{
171+
typedef struct fhss_statistics {
179172
/** FHSS synchronization drift compensation (us/channel). */
180173
int16_t fhss_drift_compensation;
181174

features/nanostack/sal-stack-nanostack/nanostack/fhss_ws_extension.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern "C" {
3434
* @brief unicast_timing_info Unicast timing/hopping schedule information structure.
3535
*/
3636
typedef struct unicast_timing_info {
37-
unsigned unicast_channel_function:3; /**< Unicast schedule channel function */
37+
unsigned unicast_channel_function: 3; /**< Unicast schedule channel function */
3838
uint8_t unicast_dwell_interval; /**< Unicast dwell interval */
3939
uint16_t unicast_number_of_channels; /**< Unicast number of channels */
4040
uint16_t fixed_channel; /**< Unicast fixed channel*/
@@ -46,7 +46,7 @@ typedef struct unicast_timing_info {
4646
* @brief broadcast_timing_info Broadcast timing/hopping schedule information structure.
4747
*/
4848
typedef struct broadcast_timing_info {
49-
unsigned broadcast_channel_function:3; /**< Broadcast schedule channel function */
49+
unsigned broadcast_channel_function: 3; /**< Broadcast schedule channel function */
5050
uint8_t broadcast_dwell_interval; /**< Broadcast dwell interval */
5151
uint16_t fixed_channel; /**< Broadcast fixed channel*/
5252
uint16_t broadcast_slot; /**< Broadcast slot number */

features/nanostack/sal-stack-nanostack/nanostack/mac_api.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ typedef struct mac_description_storage_size_s {
9595
typedef enum mac_extended_address_type {
9696
MAC_EXTENDED_READ_ONLY, /** EUID64 which is unique */
9797
MAC_EXTENDED_DYNAMIC /** Configured MAC 64-bit address to RAM and Radio */
98-
}mac_extended_address_type;
98+
} mac_extended_address_type;
9999
//External MAC functions
100100

101101
/**
@@ -113,14 +113,14 @@ typedef enum mac_extended_address_type {
113113
* @param id The identifier of the MLME primitive
114114
* @param data Primitive specific data (\see mlme.h)
115115
*/
116-
typedef void mlme_request(const mac_api_t* api, mlme_primitive id, const void *data);
116+
typedef void mlme_request(const mac_api_t *api, mlme_primitive id, const void *data);
117117

118118
/**
119119
* @brief mcps_request MCPS_DATA request call
120120
* @param api API to handle the request
121121
* @param data MCPS-DATA.request specific values
122122
*/
123-
typedef void mcps_data_request(const mac_api_t* api, const mcps_data_req_t *data);
123+
typedef void mcps_data_request(const mac_api_t *api, const mcps_data_req_t *data);
124124

125125
/**
126126
* @brief mcps_request MCPS_DATA with IE extions request call
@@ -131,15 +131,15 @@ typedef void mcps_data_request(const mac_api_t* api, const mcps_data_req_t *data
131131
*
132132
* Asynch data request is mac standard extension. asynch_channel_list include channel mask which channel message is requested to send.
133133
*/
134-
typedef void mcps_data_request_ext(const mac_api_t* api, const mcps_data_req_t *data, const mcps_data_req_ie_list_t *ie_ext, const struct channel_list_s *asynch_channel_list);
134+
typedef void mcps_data_request_ext(const mac_api_t *api, const mcps_data_req_t *data, const mcps_data_req_ie_list_t *ie_ext, const struct channel_list_s *asynch_channel_list);
135135

136136
/**
137137
* @brief mcps_purge_request MCPS_PURGE request call
138138
* @param api API to handle the request
139139
* @param data MCPS-PURGE.request specific values
140140
* @return 0 in case of success, non-zero otherwise
141141
*/
142-
typedef uint8_t mcps_purge_request(const mac_api_t* api, const mcps_purge_t *data);
142+
typedef uint8_t mcps_purge_request(const mac_api_t *api, const mcps_purge_t *data);
143143

144144
//Upper layer specific callback functions (will also be set by Upper layer after mac_api_t has been created and given to it)
145145

@@ -148,30 +148,30 @@ typedef uint8_t mcps_purge_request(const mac_api_t* api, const mcps_purge_t *dat
148148
* @param api The API which handled the response
149149
* @param data MCPS-DATA.confirm specific values
150150
*/
151-
typedef void mcps_data_confirm(const mac_api_t* api, const mcps_data_conf_t *data);
151+
typedef void mcps_data_confirm(const mac_api_t *api, const mcps_data_conf_t *data);
152152

153153
/**
154154
* @brief mcps_data_confirm_ext MCPS-DATA confirm with Enhanced ACK payload is called as a response to MCPS-DATA request
155155
* @param api The API which handled the response
156156
* @param data MCPS-DATA.confirm specific values
157157
* @param conf_data Possible Confirmation Data
158158
*/
159-
typedef void mcps_data_confirm_ext(const mac_api_t* api, const mcps_data_conf_t *data, const mcps_data_conf_payload_t *conf_data);
159+
typedef void mcps_data_confirm_ext(const mac_api_t *api, const mcps_data_conf_t *data, const mcps_data_conf_payload_t *conf_data);
160160

161161
/**
162162
* @brief mcps_data_indication MCPS-DATA indication is called when MAC layer has received data
163163
* @param api The API which handled the response
164164
* @param data MCPS-DATA.indication specific values
165165
*/
166-
typedef void mcps_data_indication(const mac_api_t* api, const mcps_data_ind_t *data);
166+
typedef void mcps_data_indication(const mac_api_t *api, const mcps_data_ind_t *data);
167167

168168
/**
169169
* @brief mcps_data_indication MCPS-DATA indication is called when MAC layer has received data
170170
* @param api The API which handled the response
171171
* @param data MCPS-DATA.indication specific values
172172
* @param ie_ext Information element list
173173
*/
174-
typedef void mcps_data_indication_ext(const mac_api_t* api, const mcps_data_ind_t *data, const mcps_data_ie_list_t *ie_ext);
174+
typedef void mcps_data_indication_ext(const mac_api_t *api, const mcps_data_ind_t *data, const mcps_data_ie_list_t *ie_ext);
175175

176176
/**
177177
* @brief mcps_ack_data_req_ext Callback for request IE elements and payload to enhanced ACK
@@ -180,52 +180,52 @@ typedef void mcps_data_indication_ext(const mac_api_t* api, const mcps_data_ind_
180180
* @param rssi Signal strength for received packet
181181
* @param lqi Link quality to neighbor
182182
*/
183-
typedef void mcps_ack_data_req_ext(const mac_api_t* api, mcps_ack_data_payload_t *data, int8_t rssi, uint8_t lqi);
183+
typedef void mcps_ack_data_req_ext(const mac_api_t *api, mcps_ack_data_payload_t *data, int8_t rssi, uint8_t lqi);
184184

185185

186186
/**
187187
* @brief mcps_purge_confirm MCPS-PURGE confirm is called as a response to MCPS-PURGE request
188188
* @param api The API which handled the request
189189
* @param data MCPS-PURGE.confirm specific values
190190
*/
191-
typedef void mcps_purge_confirm( const mac_api_t* api, mcps_purge_conf_t *data );
191+
typedef void mcps_purge_confirm(const mac_api_t *api, mcps_purge_conf_t *data);
192192

193193
/**
194194
* @brief mlme_confirm One of the MLME primitive confirm callbacks
195195
* @param api API which handled the response
196196
* @param id The identifier of the MLME primitive
197197
* @param data Primitive specific data (\see mlme.h)
198198
*/
199-
typedef void mlme_confirm(const mac_api_t* api, mlme_primitive id, const void *data);
199+
typedef void mlme_confirm(const mac_api_t *api, mlme_primitive id, const void *data);
200200

201201
/**
202202
* @brief mlme_indication One of the
203203
* @param api API which handled the response
204204
* @param id The identifier of the MLME primitive
205205
* @param data Primitive specific data (\see mlme.h)
206206
*/
207-
typedef void mlme_indication(const mac_api_t* api, mlme_primitive id, const void *data);
207+
typedef void mlme_indication(const mac_api_t *api, mlme_primitive id, const void *data);
208208

209209
/**
210210
* @brief Set extended address from MAC
211211
* @param api API to handle the request
212212
* @param mac64 pointer
213213
*/
214-
typedef int8_t mac_ext_mac64_address_set(const mac_api_t* api, const uint8_t *mac64);
214+
typedef int8_t mac_ext_mac64_address_set(const mac_api_t *api, const uint8_t *mac64);
215215

216216
/**
217217
* @brief Read extended address from MAC
218218
* @param api API to handle the request
219219
* @param mac64_buf Pointer where mac extended address can be written
220220
*/
221-
typedef int8_t mac_ext_mac64_address_get(const mac_api_t* api, mac_extended_address_type type, uint8_t *mac64_buf);
221+
typedef int8_t mac_ext_mac64_address_get(const mac_api_t *api, mac_extended_address_type type, uint8_t *mac64_buf);
222222

223223
/**
224224
* @brief Read MAC security description storage sizes from MAC
225225
* @param api API to handle the request
226226
* @param buffer Pointer where supported sizes can be written
227227
*/
228-
typedef int8_t mac_storage_decription_sizes_get(const mac_api_t* api, mac_description_storage_size_t *buffer);
228+
typedef int8_t mac_storage_decription_sizes_get(const mac_api_t *api, mac_description_storage_size_t *buffer);
229229

230230
/**
231231
* @brief mac_api_initialize Initialises MAC layer into use, callbacks must be non-NULL.

features/nanostack/sal-stack-nanostack/nanostack/mac_common_defines.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
* See IEEE standard 802.15.4-2006 (e.g end of table 41) for more details
6262
*/
6363
typedef struct mlme_security_s {
64-
unsigned SecurityLevel:3; /**< Security level */
65-
unsigned KeyIdMode:2; /**< 2-bit value which define key source and ID use case */
64+
unsigned SecurityLevel: 3; /**< Security level */
65+
unsigned KeyIdMode: 2; /**< 2-bit value which define key source and ID use case */
6666
uint8_t KeyIndex; /**< Key index */
6767
uint8_t Keysource[8]; /**< Key source */
6868
} mlme_security_t;
@@ -79,7 +79,7 @@ typedef struct mlme_security_s {
7979
*/
8080
typedef struct mac_header_IE_s {
8181
uint8_t *content_ptr; /**< Content data */
82-
unsigned length:7; /**< Element length 0- 127 */
82+
unsigned length: 7; /**< Element length 0- 127 */
8383
uint8_t id; /**< Element ID */
8484
} mac_header_IE_t;
8585

@@ -95,8 +95,8 @@ typedef struct mac_header_IE_s {
9595
*/
9696
typedef struct mac_payload_IE_s {
9797
uint8_t *content_ptr; /**< Content data */
98-
unsigned length:11; /**< Element length 0- 2047 */
99-
unsigned id:4; /**< Group ID */
98+
unsigned length: 11; /**< Element length 0- 2047 */
99+
unsigned id: 4; /**< Group ID */
100100
} mac_payload_IE_t;
101101

102102
#endif /* MAC_COMMON_DEFINES_H_ */

features/nanostack/sal-stack-nanostack/nanostack/mac_mcps.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@
3232
* See IEEE standard 802.15.4-2006 (table 41) for more details
3333
*/
3434
typedef struct mcps_data_req_s {
35-
unsigned SrcAddrMode:2; /**< Source address mode */
36-
unsigned DstAddrMode:2; /**< Destination address mode */
35+
unsigned SrcAddrMode: 2; /**< Source address mode */
36+
unsigned DstAddrMode: 2; /**< Destination address mode */
3737
uint16_t DstPANId; /**< Destination PAN ID */
3838
uint8_t DstAddr[8]; /**< Destination address */
3939
uint16_t msduLength; /**< Service data unit length */
4040
uint8_t *msdu; /**< Service data unit */
4141
uint8_t msduHandle; /**< Handle associated with MSDU */
4242
bool TxAckReq: 1; /**< Specifies whether ACK is needed or not */
43-
bool InDirectTx:1; /**< Specifies whether indirect or direct transmission is used */
43+
bool InDirectTx: 1; /**< Specifies whether indirect or direct transmission is used */
4444
bool PendingBit: 1; /**< Specifies whether more fragments are to be sent or not */
45-
bool SeqNumSuppressed:1; /**< True suppress sequence number from frame. This will be only checked when 2015 extension is enabled */
46-
bool PanIdSuppressed:1; /**< True suppress PAN-id is done when possible from frame. This will be only checked when 2015 extension is enabled */
45+
bool SeqNumSuppressed: 1; /**< True suppress sequence number from frame. This will be only checked when 2015 extension is enabled */
46+
bool PanIdSuppressed: 1; /**< True suppress PAN-id is done when possible from frame. This will be only checked when 2015 extension is enabled */
4747
mlme_security_t Key; /**< Security key */
4848
} mcps_data_req_t;
4949

@@ -82,10 +82,10 @@ typedef struct mcps_data_conf_payload_s {
8282
* See IEEE standard 802.15.4-2006 (table 43) for more details
8383
*/
8484
typedef struct mcps_data_ind_s {
85-
unsigned SrcAddrMode:2; /**< 0x00 = no address 0x01 = reserved 0x02 = 16-bit short address 0x03 = 64-bit extended address */
85+
unsigned SrcAddrMode: 2; /**< 0x00 = no address 0x01 = reserved 0x02 = 16-bit short address 0x03 = 64-bit extended address */
8686
uint16_t SrcPANId; /**< Source PAN ID */
8787
uint8_t SrcAddr[8]; /**< Source address */
88-
unsigned DstAddrMode:2; /**< Destination address mode */
88+
unsigned DstAddrMode: 2; /**< Destination address mode */
8989
uint16_t DstPANId; /**< Destination PAN ID */
9090
uint8_t DstAddr[8]; /**< Destination address */
9191
uint8_t mpduLinkQuality; /**< LQI value measured during reception of the MPDU */

0 commit comments

Comments
 (0)