4 * 802.15.4 netlink interface public header
6 * Copyright 2014 Alexander Aring <aar@pengutronix.de>
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 #define NL802154_GENL_NAME "nl802154"
24 enum nl802154_commands
{
25 /* don't change the order or add anything between, this is ABI! */
26 /* currently we don't shipping this file via uapi, ignore the above one */
29 NL802154_CMD_GET_WPAN_PHY
, /* can dump */
30 NL802154_CMD_SET_WPAN_PHY
,
31 NL802154_CMD_NEW_WPAN_PHY
,
32 NL802154_CMD_DEL_WPAN_PHY
,
34 NL802154_CMD_GET_INTERFACE
, /* can dump */
35 NL802154_CMD_SET_INTERFACE
,
36 NL802154_CMD_NEW_INTERFACE
,
37 NL802154_CMD_DEL_INTERFACE
,
39 NL802154_CMD_SET_CHANNEL
,
41 NL802154_CMD_SET_PAN_ID
,
42 NL802154_CMD_SET_SHORT_ADDR
,
44 NL802154_CMD_SET_TX_POWER
,
45 NL802154_CMD_SET_CCA_MODE
,
46 NL802154_CMD_SET_CCA_ED_LEVEL
,
48 NL802154_CMD_SET_MAX_FRAME_RETRIES
,
50 NL802154_CMD_SET_BACKOFF_EXPONENT
,
51 NL802154_CMD_SET_MAX_CSMA_BACKOFFS
,
53 NL802154_CMD_SET_LBT_MODE
,
55 NL802154_CMD_SET_ACKREQ_DEFAULT
,
57 /* add new commands above here */
59 /* used to define NL802154_CMD_MAX below */
60 __NL802154_CMD_AFTER_LAST
,
61 NL802154_CMD_MAX
= __NL802154_CMD_AFTER_LAST
- 1
65 /* don't change the order or add anything between, this is ABI! */
66 /* currently we don't shipping this file via uapi, ignore the above one */
69 NL802154_ATTR_WPAN_PHY
,
70 NL802154_ATTR_WPAN_PHY_NAME
,
72 NL802154_ATTR_IFINDEX
,
76 NL802154_ATTR_WPAN_DEV
,
79 NL802154_ATTR_CHANNEL
,
82 NL802154_ATTR_SHORT_ADDR
,
84 NL802154_ATTR_TX_POWER
,
86 NL802154_ATTR_CCA_MODE
,
87 NL802154_ATTR_CCA_OPT
,
88 NL802154_ATTR_CCA_ED_LEVEL
,
90 NL802154_ATTR_MAX_FRAME_RETRIES
,
94 NL802154_ATTR_MAX_CSMA_BACKOFFS
,
96 NL802154_ATTR_LBT_MODE
,
98 NL802154_ATTR_GENERATION
,
100 NL802154_ATTR_CHANNELS_SUPPORTED
,
101 NL802154_ATTR_SUPPORTED_CHANNEL
,
103 NL802154_ATTR_EXTENDED_ADDR
,
105 NL802154_ATTR_WPAN_PHY_CAPS
,
107 NL802154_ATTR_SUPPORTED_COMMANDS
,
109 NL802154_ATTR_ACKREQ_DEFAULT
,
111 /* add attributes here, update the policy in nl802154.c */
113 __NL802154_ATTR_AFTER_LAST
,
114 NL802154_ATTR_MAX
= __NL802154_ATTR_AFTER_LAST
- 1
117 enum nl802154_iftype
{
118 /* for backwards compatibility TODO */
119 NL802154_IFTYPE_UNSPEC
= -1,
121 NL802154_IFTYPE_NODE
,
122 NL802154_IFTYPE_MONITOR
,
123 NL802154_IFTYPE_COORD
,
126 NUM_NL802154_IFTYPES
,
127 NL802154_IFTYPE_MAX
= NUM_NL802154_IFTYPES
- 1
131 * enum nl802154_wpan_phy_capability_attr - wpan phy capability attributes
133 * @__NL802154_CAP_ATTR_INVALID: attribute number 0 is reserved
134 * @NL802154_CAP_ATTR_CHANNELS: a nested attribute for nl802154_channel_attr
135 * @NL802154_CAP_ATTR_TX_POWERS: a nested attribute for
136 * nl802154_wpan_phy_tx_power
137 * @NL802154_CAP_ATTR_MIN_CCA_ED_LEVEL: minimum value for cca_ed_level
138 * @NL802154_CAP_ATTR_MAX_CCA_ED_LEVEL: maxmimum value for cca_ed_level
139 * @NL802154_CAP_ATTR_CCA_MODES: nl802154_cca_modes flags
140 * @NL802154_CAP_ATTR_CCA_OPTS: nl802154_cca_opts flags
141 * @NL802154_CAP_ATTR_MIN_MINBE: minimum of minbe value
142 * @NL802154_CAP_ATTR_MAX_MINBE: maximum of minbe value
143 * @NL802154_CAP_ATTR_MIN_MAXBE: minimum of maxbe value
144 * @NL802154_CAP_ATTR_MAX_MINBE: maximum of maxbe value
145 * @NL802154_CAP_ATTR_MIN_CSMA_BACKOFFS: minimum of csma backoff value
146 * @NL802154_CAP_ATTR_MAX_CSMA_BACKOFFS: maximum of csma backoffs value
147 * @NL802154_CAP_ATTR_MIN_FRAME_RETRIES: minimum of frame retries value
148 * @NL802154_CAP_ATTR_MAX_FRAME_RETRIES: maximum of frame retries value
149 * @NL802154_CAP_ATTR_IFTYPES: nl802154_iftype flags
150 * @NL802154_CAP_ATTR_LBT: nl802154_supported_bool_states flags
151 * @NL802154_CAP_ATTR_MAX: highest cap attribute currently defined
152 * @__NL802154_CAP_ATTR_AFTER_LAST: internal use
154 enum nl802154_wpan_phy_capability_attr
{
155 __NL802154_CAP_ATTR_INVALID
,
157 NL802154_CAP_ATTR_IFTYPES
,
159 NL802154_CAP_ATTR_CHANNELS
,
160 NL802154_CAP_ATTR_TX_POWERS
,
162 NL802154_CAP_ATTR_CCA_ED_LEVELS
,
163 NL802154_CAP_ATTR_CCA_MODES
,
164 NL802154_CAP_ATTR_CCA_OPTS
,
166 NL802154_CAP_ATTR_MIN_MINBE
,
167 NL802154_CAP_ATTR_MAX_MINBE
,
169 NL802154_CAP_ATTR_MIN_MAXBE
,
170 NL802154_CAP_ATTR_MAX_MAXBE
,
172 NL802154_CAP_ATTR_MIN_CSMA_BACKOFFS
,
173 NL802154_CAP_ATTR_MAX_CSMA_BACKOFFS
,
175 NL802154_CAP_ATTR_MIN_FRAME_RETRIES
,
176 NL802154_CAP_ATTR_MAX_FRAME_RETRIES
,
178 NL802154_CAP_ATTR_LBT
,
181 __NL802154_CAP_ATTR_AFTER_LAST
,
182 NL802154_CAP_ATTR_MAX
= __NL802154_CAP_ATTR_AFTER_LAST
- 1
186 * enum nl802154_cca_modes - cca modes
188 * @__NL802154_CCA_INVALID: cca mode number 0 is reserved
189 * @NL802154_CCA_ENERGY: Energy above threshold
190 * @NL802154_CCA_CARRIER: Carrier sense only
191 * @NL802154_CCA_ENERGY_CARRIER: Carrier sense with energy above threshold
192 * @NL802154_CCA_ALOHA: CCA shall always report an idle medium
193 * @NL802154_CCA_UWB_SHR: UWB preamble sense based on the SHR of a frame
194 * @NL802154_CCA_UWB_MULTIPLEXED: UWB preamble sense based on the packet with
195 * the multiplexed preamble
196 * @__NL802154_CCA_ATTR_AFTER_LAST: Internal
197 * @NL802154_CCA_ATTR_MAX: Maximum CCA attribute number
199 enum nl802154_cca_modes
{
200 __NL802154_CCA_INVALID
,
202 NL802154_CCA_CARRIER
,
203 NL802154_CCA_ENERGY_CARRIER
,
205 NL802154_CCA_UWB_SHR
,
206 NL802154_CCA_UWB_MULTIPLEXED
,
209 __NL802154_CCA_ATTR_AFTER_LAST
,
210 NL802154_CCA_ATTR_MAX
= __NL802154_CCA_ATTR_AFTER_LAST
- 1
214 * enum nl802154_cca_opts - additional options for cca modes
216 * @NL802154_CCA_OPT_ENERGY_CARRIER_OR: NL802154_CCA_ENERGY_CARRIER with OR
217 * @NL802154_CCA_OPT_ENERGY_CARRIER_AND: NL802154_CCA_ENERGY_CARRIER with AND
219 enum nl802154_cca_opts
{
220 NL802154_CCA_OPT_ENERGY_CARRIER_AND
,
221 NL802154_CCA_OPT_ENERGY_CARRIER_OR
,
224 __NL802154_CCA_OPT_ATTR_AFTER_LAST
,
225 NL802154_CCA_OPT_ATTR_MAX
= __NL802154_CCA_OPT_ATTR_AFTER_LAST
- 1
229 * enum nl802154_supported_bool_states - bool states for bool capability entry
231 * @NL802154_SUPPORTED_BOOL_FALSE: indicates to set false
232 * @NL802154_SUPPORTED_BOOL_TRUE: indicates to set true
233 * @__NL802154_SUPPORTED_BOOL_INVALD: reserved
234 * @NL802154_SUPPORTED_BOOL_BOTH: indicates to set true and false
235 * @__NL802154_SUPPORTED_BOOL_AFTER_LAST: Internal
236 * @NL802154_SUPPORTED_BOOL_MAX: highest value for bool states
238 enum nl802154_supported_bool_states
{
239 NL802154_SUPPORTED_BOOL_FALSE
,
240 NL802154_SUPPORTED_BOOL_TRUE
,
241 /* to handle them in a mask */
242 __NL802154_SUPPORTED_BOOL_INVALD
,
243 NL802154_SUPPORTED_BOOL_BOTH
,
246 __NL802154_SUPPORTED_BOOL_AFTER_LAST
,
247 NL802154_SUPPORTED_BOOL_MAX
= __NL802154_SUPPORTED_BOOL_AFTER_LAST
- 1
250 #endif /* __NL802154_H */