Zephyr Project API  3.3.0
A Scalable Open Source RTOS
ieee802154.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_NET_IEEE802154_H_
13#define ZEPHYR_INCLUDE_NET_IEEE802154_H_
14
15#include <limits.h>
16#include <zephyr/net/net_l2.h>
17#include <zephyr/net/net_mgmt.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
31/* See IEEE 802.15.4-2006, sections 5.5.3.2, 6.4.1 and 7.2.1.9 */
32#define IEEE802154_MAX_PHY_PACKET_SIZE 127
33#define IEEE802154_FCS_LENGTH 2
34#define IEEE802154_MTU (IEEE802154_MAX_PHY_PACKET_SIZE - IEEE802154_FCS_LENGTH)
35/* TODO: Support flexible MTU for IEEE 802.15.4-2015 */
36
37#define IEEE802154_SHORT_ADDR_LENGTH 2
38#define IEEE802154_EXT_ADDR_LENGTH 8
39#define IEEE802154_MAX_ADDR_LENGTH IEEE802154_EXT_ADDR_LENGTH
40
41#define IEEE802154_NO_CHANNEL USHRT_MAX
42
43/* See IEEE 802.15.4-2006, section 7.2.1.4 */
44#define IEEE802154_BROADCAST_ADDRESS 0xFFFF
45#define IEEE802154_NO_SHORT_ADDRESS_ASSIGNED 0xFFFE
46#define IEEE802154_SHORT_ADDRESS_NOT_ASSOCIATED 0x0000
47#define IEEE802154_BROADCAST_PAN_ID 0xFFFF
48
57 uint8_t _unused : 3;
58};
59
60/* This not meant to be used by any code but 802.15.4 L2 stack */
62 uint16_t pan_id; /* in CPU byte order */
64 /* short address:
65 * 0 == not associated,
66 * 0xfffe == associated but no short address assigned
67 * see section 7.4.2
68 */
69 uint16_t short_addr; /* in CPU byte order */
71 struct net_linkaddr_storage linkaddr; /* in big endian */
72#ifdef CONFIG_NET_L2_IEEE802154_SECURITY
73 struct ieee802154_security_ctx sec_ctx;
74#endif
75#ifdef CONFIG_NET_L2_IEEE802154_MGMT
76 struct ieee802154_req_params *scan_ctx; /* guarded by scan_ctx_lock */
77 struct k_sem scan_ctx_lock;
78
79 uint8_t coord_ext_addr[IEEE802154_MAX_ADDR_LENGTH]; /* in little endian */
80 uint16_t coord_short_addr; /* in CPU byte order */
81#endif
85
86 uint8_t ack_seq; /* guarded by ack_lock */
87 uint8_t ack_received : 1; /* guarded by ack_lock */
88 uint8_t ack_requested : 1; /* guarded by ack_lock */
89 uint8_t _unused : 6;
90 struct k_sem ack_lock;
91
92 struct k_sem ctx_lock; /* guards all mutable context attributes unless
93 * otherwise mentioned on attribute level
94 */
95};
96
97#define IEEE802154_L2_CTX_TYPE struct ieee802154_context
98
99#ifdef __cplusplus
100}
101#endif
102
107#endif /* ZEPHYR_INCLUDE_NET_IEEE802154_H_ */
Crypto Cipher structure definitions.
#define IEEE802154_MAX_ADDR_LENGTH
Definition: ieee802154.h:39
net_l2_flags
Definition: net_l2.h:33
Public API for network L2 interface.
Network Management API public header.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
__INT16_TYPE__ int16_t
Definition: stdint.h:73
Definition: cipher.h:110
Definition: ieee802154.h:61
uint8_t ack_seq
Definition: ieee802154.h:86
uint8_t ack_received
Definition: ieee802154.h:87
uint8_t ext_addr[8]
Definition: ieee802154.h:70
struct k_sem ctx_lock
Definition: ieee802154.h:92
uint8_t ack_requested
Definition: ieee802154.h:88
uint8_t sequence
Definition: ieee802154.h:84
struct k_sem ack_lock
Definition: ieee802154.h:90
uint16_t short_addr
Definition: ieee802154.h:69
struct net_linkaddr_storage linkaddr
Definition: ieee802154.h:71
int16_t tx_power
Definition: ieee802154.h:82
enum net_l2_flags flags
Definition: ieee802154.h:83
uint16_t channel
Definition: ieee802154.h:63
uint16_t pan_id
Definition: ieee802154.h:62
Scanning parameters.
Definition: ieee802154_mgmt.h:186
Definition: ieee802154.h:49
uint8_t key_len
Definition: ieee802154.h:54
uint8_t key[16]
Definition: ieee802154.h:53
uint8_t level
Definition: ieee802154.h:55
struct cipher_ctx dec
Definition: ieee802154.h:52
struct cipher_ctx enc
Definition: ieee802154.h:51
uint32_t frame_counter
Definition: ieee802154.h:50
uint8_t key_mode
Definition: ieee802154.h:56
Hardware link address structure.
Definition: net_linkaddr.h:88