1#ifndef __NL802154_H
2#define __NL802154_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#define NL802154_GENL_NAME "nl802154"
23
24enum nl802154_commands {
25
26
27 NL802154_CMD_UNSPEC,
28
29 NL802154_CMD_GET_WPAN_PHY,
30 NL802154_CMD_SET_WPAN_PHY,
31 NL802154_CMD_NEW_WPAN_PHY,
32 NL802154_CMD_DEL_WPAN_PHY,
33
34 NL802154_CMD_GET_INTERFACE,
35 NL802154_CMD_SET_INTERFACE,
36 NL802154_CMD_NEW_INTERFACE,
37 NL802154_CMD_DEL_INTERFACE,
38
39 NL802154_CMD_SET_CHANNEL,
40
41 NL802154_CMD_SET_PAN_ID,
42 NL802154_CMD_SET_SHORT_ADDR,
43
44 NL802154_CMD_SET_TX_POWER,
45 NL802154_CMD_SET_CCA_MODE,
46 NL802154_CMD_SET_CCA_ED_LEVEL,
47
48 NL802154_CMD_SET_MAX_FRAME_RETRIES,
49
50 NL802154_CMD_SET_BACKOFF_EXPONENT,
51 NL802154_CMD_SET_MAX_CSMA_BACKOFFS,
52
53 NL802154_CMD_SET_LBT_MODE,
54
55 NL802154_CMD_SET_ACKREQ_DEFAULT,
56
57 NL802154_CMD_SET_WPAN_PHY_NETNS,
58
59
60
61#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
62 NL802154_CMD_SET_SEC_PARAMS,
63 NL802154_CMD_GET_SEC_KEY,
64 NL802154_CMD_NEW_SEC_KEY,
65 NL802154_CMD_DEL_SEC_KEY,
66 NL802154_CMD_GET_SEC_DEV,
67 NL802154_CMD_NEW_SEC_DEV,
68 NL802154_CMD_DEL_SEC_DEV,
69 NL802154_CMD_GET_SEC_DEVKEY,
70 NL802154_CMD_NEW_SEC_DEVKEY,
71 NL802154_CMD_DEL_SEC_DEVKEY,
72 NL802154_CMD_GET_SEC_LEVEL,
73 NL802154_CMD_NEW_SEC_LEVEL,
74 NL802154_CMD_DEL_SEC_LEVEL,
75#endif
76
77
78 __NL802154_CMD_AFTER_LAST,
79 NL802154_CMD_MAX = __NL802154_CMD_AFTER_LAST - 1
80};
81
82enum nl802154_attrs {
83
84
85 NL802154_ATTR_UNSPEC,
86
87 NL802154_ATTR_WPAN_PHY,
88 NL802154_ATTR_WPAN_PHY_NAME,
89
90 NL802154_ATTR_IFINDEX,
91 NL802154_ATTR_IFNAME,
92 NL802154_ATTR_IFTYPE,
93
94 NL802154_ATTR_WPAN_DEV,
95
96 NL802154_ATTR_PAGE,
97 NL802154_ATTR_CHANNEL,
98
99 NL802154_ATTR_PAN_ID,
100 NL802154_ATTR_SHORT_ADDR,
101
102 NL802154_ATTR_TX_POWER,
103
104 NL802154_ATTR_CCA_MODE,
105 NL802154_ATTR_CCA_OPT,
106 NL802154_ATTR_CCA_ED_LEVEL,
107
108 NL802154_ATTR_MAX_FRAME_RETRIES,
109
110 NL802154_ATTR_MAX_BE,
111 NL802154_ATTR_MIN_BE,
112 NL802154_ATTR_MAX_CSMA_BACKOFFS,
113
114 NL802154_ATTR_LBT_MODE,
115
116 NL802154_ATTR_GENERATION,
117
118 NL802154_ATTR_CHANNELS_SUPPORTED,
119 NL802154_ATTR_SUPPORTED_CHANNEL,
120
121 NL802154_ATTR_EXTENDED_ADDR,
122
123 NL802154_ATTR_WPAN_PHY_CAPS,
124
125 NL802154_ATTR_SUPPORTED_COMMANDS,
126
127 NL802154_ATTR_ACKREQ_DEFAULT,
128
129 NL802154_ATTR_PAD,
130
131 NL802154_ATTR_PID,
132 NL802154_ATTR_NETNS_FD,
133
134
135
136#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
137 NL802154_ATTR_SEC_ENABLED,
138 NL802154_ATTR_SEC_OUT_LEVEL,
139 NL802154_ATTR_SEC_OUT_KEY_ID,
140 NL802154_ATTR_SEC_FRAME_COUNTER,
141
142 NL802154_ATTR_SEC_LEVEL,
143 NL802154_ATTR_SEC_DEVICE,
144 NL802154_ATTR_SEC_DEVKEY,
145 NL802154_ATTR_SEC_KEY,
146#endif
147
148 __NL802154_ATTR_AFTER_LAST,
149 NL802154_ATTR_MAX = __NL802154_ATTR_AFTER_LAST - 1
150};
151
152enum nl802154_iftype {
153
154 NL802154_IFTYPE_UNSPEC = -1,
155
156 NL802154_IFTYPE_NODE,
157 NL802154_IFTYPE_MONITOR,
158 NL802154_IFTYPE_COORD,
159
160
161 NUM_NL802154_IFTYPES,
162 NL802154_IFTYPE_MAX = NUM_NL802154_IFTYPES - 1
163};
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189enum nl802154_wpan_phy_capability_attr {
190 __NL802154_CAP_ATTR_INVALID,
191
192 NL802154_CAP_ATTR_IFTYPES,
193
194 NL802154_CAP_ATTR_CHANNELS,
195 NL802154_CAP_ATTR_TX_POWERS,
196
197 NL802154_CAP_ATTR_CCA_ED_LEVELS,
198 NL802154_CAP_ATTR_CCA_MODES,
199 NL802154_CAP_ATTR_CCA_OPTS,
200
201 NL802154_CAP_ATTR_MIN_MINBE,
202 NL802154_CAP_ATTR_MAX_MINBE,
203
204 NL802154_CAP_ATTR_MIN_MAXBE,
205 NL802154_CAP_ATTR_MAX_MAXBE,
206
207 NL802154_CAP_ATTR_MIN_CSMA_BACKOFFS,
208 NL802154_CAP_ATTR_MAX_CSMA_BACKOFFS,
209
210 NL802154_CAP_ATTR_MIN_FRAME_RETRIES,
211 NL802154_CAP_ATTR_MAX_FRAME_RETRIES,
212
213 NL802154_CAP_ATTR_LBT,
214
215
216 __NL802154_CAP_ATTR_AFTER_LAST,
217 NL802154_CAP_ATTR_MAX = __NL802154_CAP_ATTR_AFTER_LAST - 1
218};
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234enum nl802154_cca_modes {
235 __NL802154_CCA_INVALID,
236 NL802154_CCA_ENERGY,
237 NL802154_CCA_CARRIER,
238 NL802154_CCA_ENERGY_CARRIER,
239 NL802154_CCA_ALOHA,
240 NL802154_CCA_UWB_SHR,
241 NL802154_CCA_UWB_MULTIPLEXED,
242
243
244 __NL802154_CCA_ATTR_AFTER_LAST,
245 NL802154_CCA_ATTR_MAX = __NL802154_CCA_ATTR_AFTER_LAST - 1
246};
247
248
249
250
251
252
253
254enum nl802154_cca_opts {
255 NL802154_CCA_OPT_ENERGY_CARRIER_AND,
256 NL802154_CCA_OPT_ENERGY_CARRIER_OR,
257
258
259 __NL802154_CCA_OPT_ATTR_AFTER_LAST,
260 NL802154_CCA_OPT_ATTR_MAX = __NL802154_CCA_OPT_ATTR_AFTER_LAST - 1
261};
262
263
264
265
266
267
268
269
270
271
272
273enum nl802154_supported_bool_states {
274 NL802154_SUPPORTED_BOOL_FALSE,
275 NL802154_SUPPORTED_BOOL_TRUE,
276
277 __NL802154_SUPPORTED_BOOL_INVALD,
278 NL802154_SUPPORTED_BOOL_BOTH,
279
280
281 __NL802154_SUPPORTED_BOOL_AFTER_LAST,
282 NL802154_SUPPORTED_BOOL_MAX = __NL802154_SUPPORTED_BOOL_AFTER_LAST - 1
283};
284
285#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
286
287enum nl802154_dev_addr_modes {
288 NL802154_DEV_ADDR_NONE,
289 __NL802154_DEV_ADDR_INVALID,
290 NL802154_DEV_ADDR_SHORT,
291 NL802154_DEV_ADDR_EXTENDED,
292
293
294 __NL802154_DEV_ADDR_AFTER_LAST,
295 NL802154_DEV_ADDR_MAX = __NL802154_DEV_ADDR_AFTER_LAST - 1
296};
297
298enum nl802154_dev_addr_attrs {
299 NL802154_DEV_ADDR_ATTR_UNSPEC,
300
301 NL802154_DEV_ADDR_ATTR_PAN_ID,
302 NL802154_DEV_ADDR_ATTR_MODE,
303 NL802154_DEV_ADDR_ATTR_SHORT,
304 NL802154_DEV_ADDR_ATTR_EXTENDED,
305 NL802154_DEV_ADDR_ATTR_PAD,
306
307
308 __NL802154_DEV_ADDR_ATTR_AFTER_LAST,
309 NL802154_DEV_ADDR_ATTR_MAX = __NL802154_DEV_ADDR_ATTR_AFTER_LAST - 1
310};
311
312enum nl802154_key_id_modes {
313 NL802154_KEY_ID_MODE_IMPLICIT,
314 NL802154_KEY_ID_MODE_INDEX,
315 NL802154_KEY_ID_MODE_INDEX_SHORT,
316 NL802154_KEY_ID_MODE_INDEX_EXTENDED,
317
318
319 __NL802154_KEY_ID_MODE_AFTER_LAST,
320 NL802154_KEY_ID_MODE_MAX = __NL802154_KEY_ID_MODE_AFTER_LAST - 1
321};
322
323enum nl802154_key_id_attrs {
324 NL802154_KEY_ID_ATTR_UNSPEC,
325
326 NL802154_KEY_ID_ATTR_MODE,
327 NL802154_KEY_ID_ATTR_INDEX,
328 NL802154_KEY_ID_ATTR_IMPLICIT,
329 NL802154_KEY_ID_ATTR_SOURCE_SHORT,
330 NL802154_KEY_ID_ATTR_SOURCE_EXTENDED,
331 NL802154_KEY_ID_ATTR_PAD,
332
333
334 __NL802154_KEY_ID_ATTR_AFTER_LAST,
335 NL802154_KEY_ID_ATTR_MAX = __NL802154_KEY_ID_ATTR_AFTER_LAST - 1
336};
337
338enum nl802154_seclevels {
339 NL802154_SECLEVEL_NONE,
340 NL802154_SECLEVEL_MIC32,
341 NL802154_SECLEVEL_MIC64,
342 NL802154_SECLEVEL_MIC128,
343 NL802154_SECLEVEL_ENC,
344 NL802154_SECLEVEL_ENC_MIC32,
345 NL802154_SECLEVEL_ENC_MIC64,
346 NL802154_SECLEVEL_ENC_MIC128,
347
348
349 __NL802154_SECLEVEL_AFTER_LAST,
350 NL802154_SECLEVEL_MAX = __NL802154_SECLEVEL_AFTER_LAST - 1
351};
352
353enum nl802154_frames {
354 NL802154_FRAME_BEACON,
355 NL802154_FRAME_DATA,
356 NL802154_FRAME_ACK,
357 NL802154_FRAME_CMD,
358
359
360 __NL802154_FRAME_AFTER_LAST,
361 NL802154_FRAME_MAX = __NL802154_FRAME_AFTER_LAST - 1
362};
363
364enum nl802154_cmd_frames {
365 __NL802154_CMD_FRAME_INVALID,
366 NL802154_CMD_FRAME_ASSOC_REQUEST,
367 NL802154_CMD_FRAME_ASSOC_RESPONSE,
368 NL802154_CMD_FRAME_DISASSOC_NOTIFY,
369 NL802154_CMD_FRAME_DATA_REQUEST,
370 NL802154_CMD_FRAME_PAN_ID_CONFLICT_NOTIFY,
371 NL802154_CMD_FRAME_ORPHAN_NOTIFY,
372 NL802154_CMD_FRAME_BEACON_REQUEST,
373 NL802154_CMD_FRAME_COORD_REALIGNMENT,
374 NL802154_CMD_FRAME_GTS_REQUEST,
375
376
377 __NL802154_CMD_FRAME_AFTER_LAST,
378 NL802154_CMD_FRAME_MAX = __NL802154_CMD_FRAME_AFTER_LAST - 1
379};
380
381enum nl802154_seclevel_attrs {
382 NL802154_SECLEVEL_ATTR_UNSPEC,
383
384 NL802154_SECLEVEL_ATTR_LEVELS,
385 NL802154_SECLEVEL_ATTR_FRAME,
386 NL802154_SECLEVEL_ATTR_CMD_FRAME,
387 NL802154_SECLEVEL_ATTR_DEV_OVERRIDE,
388
389
390 __NL802154_SECLEVEL_ATTR_AFTER_LAST,
391 NL802154_SECLEVEL_ATTR_MAX = __NL802154_SECLEVEL_ATTR_AFTER_LAST - 1
392};
393
394
395enum {
396 NL802154_DEVKEY_IGNORE,
397 NL802154_DEVKEY_RESTRICT,
398 NL802154_DEVKEY_RECORD,
399
400
401 __NL802154_DEVKEY_AFTER_LAST,
402 NL802154_DEVKEY_MAX = __NL802154_DEVKEY_AFTER_LAST - 1
403};
404
405enum nl802154_dev {
406 NL802154_DEV_ATTR_UNSPEC,
407
408 NL802154_DEV_ATTR_FRAME_COUNTER,
409 NL802154_DEV_ATTR_PAN_ID,
410 NL802154_DEV_ATTR_SHORT_ADDR,
411 NL802154_DEV_ATTR_EXTENDED_ADDR,
412 NL802154_DEV_ATTR_SECLEVEL_EXEMPT,
413 NL802154_DEV_ATTR_KEY_MODE,
414 NL802154_DEV_ATTR_PAD,
415
416
417 __NL802154_DEV_ATTR_AFTER_LAST,
418 NL802154_DEV_ATTR_MAX = __NL802154_DEV_ATTR_AFTER_LAST - 1
419};
420
421enum nl802154_devkey {
422 NL802154_DEVKEY_ATTR_UNSPEC,
423
424 NL802154_DEVKEY_ATTR_FRAME_COUNTER,
425 NL802154_DEVKEY_ATTR_EXTENDED_ADDR,
426 NL802154_DEVKEY_ATTR_ID,
427 NL802154_DEVKEY_ATTR_PAD,
428
429
430 __NL802154_DEVKEY_ATTR_AFTER_LAST,
431 NL802154_DEVKEY_ATTR_MAX = __NL802154_DEVKEY_ATTR_AFTER_LAST - 1
432};
433
434enum nl802154_key {
435 NL802154_KEY_ATTR_UNSPEC,
436
437 NL802154_KEY_ATTR_ID,
438 NL802154_KEY_ATTR_USAGE_FRAMES,
439 NL802154_KEY_ATTR_USAGE_CMDS,
440 NL802154_KEY_ATTR_BYTES,
441
442
443 __NL802154_KEY_ATTR_AFTER_LAST,
444 NL802154_KEY_ATTR_MAX = __NL802154_KEY_ATTR_AFTER_LAST - 1
445};
446
447#define NL802154_KEY_SIZE 16
448#define NL802154_CMD_FRAME_NR_IDS 256
449
450#endif
451
452#endif
453