13ae75e02SAlexander Aring #ifndef __NL802154_H 23ae75e02SAlexander Aring #define __NL802154_H 33ae75e02SAlexander Aring /* 43ae75e02SAlexander Aring * 802.15.4 netlink interface public header 53ae75e02SAlexander Aring * 63ae75e02SAlexander Aring * Copyright 2014 Alexander Aring <aar@pengutronix.de> 73ae75e02SAlexander Aring * 83ae75e02SAlexander Aring * Permission to use, copy, modify, and/or distribute this software for any 93ae75e02SAlexander Aring * purpose with or without fee is hereby granted, provided that the above 103ae75e02SAlexander Aring * copyright notice and this permission notice appear in all copies. 113ae75e02SAlexander Aring * 123ae75e02SAlexander Aring * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 133ae75e02SAlexander Aring * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 143ae75e02SAlexander Aring * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 153ae75e02SAlexander Aring * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 163ae75e02SAlexander Aring * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 173ae75e02SAlexander Aring * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 183ae75e02SAlexander Aring * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 193ae75e02SAlexander Aring * 203ae75e02SAlexander Aring */ 213ae75e02SAlexander Aring 22451dc48cSAlexander Aring #include <linux/types.h> 23451dc48cSAlexander Aring 243ae75e02SAlexander Aring #define NL802154_GENL_NAME "nl802154" 253ae75e02SAlexander Aring 263ae75e02SAlexander Aring enum nl802154_commands { 273ae75e02SAlexander Aring /* don't change the order or add anything between, this is ABI! */ 283ae75e02SAlexander Aring /* currently we don't shipping this file via uapi, ignore the above one */ 293ae75e02SAlexander Aring NL802154_CMD_UNSPEC, 303ae75e02SAlexander Aring 313ae75e02SAlexander Aring NL802154_CMD_GET_WPAN_PHY, /* can dump */ 323ae75e02SAlexander Aring NL802154_CMD_SET_WPAN_PHY, 333ae75e02SAlexander Aring NL802154_CMD_NEW_WPAN_PHY, 343ae75e02SAlexander Aring NL802154_CMD_DEL_WPAN_PHY, 353ae75e02SAlexander Aring 363ae75e02SAlexander Aring NL802154_CMD_GET_INTERFACE, /* can dump */ 373ae75e02SAlexander Aring NL802154_CMD_SET_INTERFACE, 383ae75e02SAlexander Aring NL802154_CMD_NEW_INTERFACE, 393ae75e02SAlexander Aring NL802154_CMD_DEL_INTERFACE, 403ae75e02SAlexander Aring 413ae75e02SAlexander Aring NL802154_CMD_SET_CHANNEL, 423ae75e02SAlexander Aring 433ae75e02SAlexander Aring NL802154_CMD_SET_PAN_ID, 443ae75e02SAlexander Aring NL802154_CMD_SET_SHORT_ADDR, 453ae75e02SAlexander Aring 463ae75e02SAlexander Aring NL802154_CMD_SET_TX_POWER, 473ae75e02SAlexander Aring NL802154_CMD_SET_CCA_MODE, 483ae75e02SAlexander Aring NL802154_CMD_SET_CCA_ED_LEVEL, 493ae75e02SAlexander Aring 503ae75e02SAlexander Aring NL802154_CMD_SET_MAX_FRAME_RETRIES, 513ae75e02SAlexander Aring 523ae75e02SAlexander Aring NL802154_CMD_SET_BACKOFF_EXPONENT, 533ae75e02SAlexander Aring NL802154_CMD_SET_MAX_CSMA_BACKOFFS, 543ae75e02SAlexander Aring 553ae75e02SAlexander Aring NL802154_CMD_SET_LBT_MODE, 563ae75e02SAlexander Aring 57c91208d8SAlexander Aring NL802154_CMD_SET_ACKREQ_DEFAULT, 58c91208d8SAlexander Aring 5966e5c267SAlexander Aring NL802154_CMD_SET_WPAN_PHY_NETNS, 6066e5c267SAlexander Aring 61a26c5fd7SAlexander Aring NL802154_CMD_SET_SEC_PARAMS, 62a26c5fd7SAlexander Aring NL802154_CMD_GET_SEC_KEY, /* can dump */ 63a26c5fd7SAlexander Aring NL802154_CMD_NEW_SEC_KEY, 64a26c5fd7SAlexander Aring NL802154_CMD_DEL_SEC_KEY, 65a26c5fd7SAlexander Aring NL802154_CMD_GET_SEC_DEV, /* can dump */ 66a26c5fd7SAlexander Aring NL802154_CMD_NEW_SEC_DEV, 67a26c5fd7SAlexander Aring NL802154_CMD_DEL_SEC_DEV, 68a26c5fd7SAlexander Aring NL802154_CMD_GET_SEC_DEVKEY, /* can dump */ 69a26c5fd7SAlexander Aring NL802154_CMD_NEW_SEC_DEVKEY, 70a26c5fd7SAlexander Aring NL802154_CMD_DEL_SEC_DEVKEY, 71a26c5fd7SAlexander Aring NL802154_CMD_GET_SEC_LEVEL, /* can dump */ 72a26c5fd7SAlexander Aring NL802154_CMD_NEW_SEC_LEVEL, 73a26c5fd7SAlexander Aring NL802154_CMD_DEL_SEC_LEVEL, 7482543936SGal Pressman 7551147284SMiquel Raynal NL802154_CMD_SCAN_EVENT, 76ed3557c9SMiquel Raynal NL802154_CMD_TRIGGER_SCAN, 77ed3557c9SMiquel Raynal NL802154_CMD_ABORT_SCAN, 78ed3557c9SMiquel Raynal NL802154_CMD_SCAN_DONE, 79*9bc11450SMiquel Raynal NL802154_CMD_SEND_BEACONS, 80*9bc11450SMiquel Raynal NL802154_CMD_STOP_BEACONS, 8151147284SMiquel Raynal 8282543936SGal Pressman /* add new commands above here */ 83a26c5fd7SAlexander Aring 843ae75e02SAlexander Aring /* used to define NL802154_CMD_MAX below */ 853ae75e02SAlexander Aring __NL802154_CMD_AFTER_LAST, 863ae75e02SAlexander Aring NL802154_CMD_MAX = __NL802154_CMD_AFTER_LAST - 1 873ae75e02SAlexander Aring }; 883ae75e02SAlexander Aring 893ae75e02SAlexander Aring enum nl802154_attrs { 903ae75e02SAlexander Aring /* don't change the order or add anything between, this is ABI! */ 913ae75e02SAlexander Aring /* currently we don't shipping this file via uapi, ignore the above one */ 923ae75e02SAlexander Aring NL802154_ATTR_UNSPEC, 933ae75e02SAlexander Aring 943ae75e02SAlexander Aring NL802154_ATTR_WPAN_PHY, 953ae75e02SAlexander Aring NL802154_ATTR_WPAN_PHY_NAME, 963ae75e02SAlexander Aring 973ae75e02SAlexander Aring NL802154_ATTR_IFINDEX, 983ae75e02SAlexander Aring NL802154_ATTR_IFNAME, 993ae75e02SAlexander Aring NL802154_ATTR_IFTYPE, 1003ae75e02SAlexander Aring 1013ae75e02SAlexander Aring NL802154_ATTR_WPAN_DEV, 1023ae75e02SAlexander Aring 1033ae75e02SAlexander Aring NL802154_ATTR_PAGE, 1043ae75e02SAlexander Aring NL802154_ATTR_CHANNEL, 1053ae75e02SAlexander Aring 1063ae75e02SAlexander Aring NL802154_ATTR_PAN_ID, 1073ae75e02SAlexander Aring NL802154_ATTR_SHORT_ADDR, 1083ae75e02SAlexander Aring 1093ae75e02SAlexander Aring NL802154_ATTR_TX_POWER, 1103ae75e02SAlexander Aring 1113ae75e02SAlexander Aring NL802154_ATTR_CCA_MODE, 112ba2a9506SAlexander Aring NL802154_ATTR_CCA_OPT, 1133ae75e02SAlexander Aring NL802154_ATTR_CCA_ED_LEVEL, 1143ae75e02SAlexander Aring 1153ae75e02SAlexander Aring NL802154_ATTR_MAX_FRAME_RETRIES, 1163ae75e02SAlexander Aring 1173ae75e02SAlexander Aring NL802154_ATTR_MAX_BE, 1183ae75e02SAlexander Aring NL802154_ATTR_MIN_BE, 1193ae75e02SAlexander Aring NL802154_ATTR_MAX_CSMA_BACKOFFS, 1203ae75e02SAlexander Aring 1213ae75e02SAlexander Aring NL802154_ATTR_LBT_MODE, 1223ae75e02SAlexander Aring 1233ae75e02SAlexander Aring NL802154_ATTR_GENERATION, 1243ae75e02SAlexander Aring 1253ae75e02SAlexander Aring NL802154_ATTR_CHANNELS_SUPPORTED, 1263ae75e02SAlexander Aring NL802154_ATTR_SUPPORTED_CHANNEL, 1273ae75e02SAlexander Aring 1283ae75e02SAlexander Aring NL802154_ATTR_EXTENDED_ADDR, 1293ae75e02SAlexander Aring 1300e665457SAlexander Aring NL802154_ATTR_WPAN_PHY_CAPS, 1310e665457SAlexander Aring 132133be026SVarka Bhadram NL802154_ATTR_SUPPORTED_COMMANDS, 133133be026SVarka Bhadram 134c91208d8SAlexander Aring NL802154_ATTR_ACKREQ_DEFAULT, 135c91208d8SAlexander Aring 136aece0c3fSAlexander Aring NL802154_ATTR_PAD, 137aece0c3fSAlexander Aring 13866e5c267SAlexander Aring NL802154_ATTR_PID, 13966e5c267SAlexander Aring NL802154_ATTR_NETNS_FD, 14066e5c267SAlexander Aring 14151147284SMiquel Raynal NL802154_ATTR_COORDINATOR, 142ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_TYPE, 143ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_FLAGS, 144ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_CHANNELS, 145ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_PREAMBLE_CODES, 146ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_MEAN_PRF, 147ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_DURATION, 148ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_DONE_REASON, 149*9bc11450SMiquel Raynal NL802154_ATTR_BEACON_INTERVAL, 15051147284SMiquel Raynal 1513ae75e02SAlexander Aring /* add attributes here, update the policy in nl802154.c */ 1523ae75e02SAlexander Aring 153a26c5fd7SAlexander Aring #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL 154a26c5fd7SAlexander Aring NL802154_ATTR_SEC_ENABLED, 155a26c5fd7SAlexander Aring NL802154_ATTR_SEC_OUT_LEVEL, 156a26c5fd7SAlexander Aring NL802154_ATTR_SEC_OUT_KEY_ID, 157a26c5fd7SAlexander Aring NL802154_ATTR_SEC_FRAME_COUNTER, 158a26c5fd7SAlexander Aring 159a26c5fd7SAlexander Aring NL802154_ATTR_SEC_LEVEL, 160a26c5fd7SAlexander Aring NL802154_ATTR_SEC_DEVICE, 161a26c5fd7SAlexander Aring NL802154_ATTR_SEC_DEVKEY, 162a26c5fd7SAlexander Aring NL802154_ATTR_SEC_KEY, 163a26c5fd7SAlexander Aring #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */ 164a26c5fd7SAlexander Aring 1653ae75e02SAlexander Aring __NL802154_ATTR_AFTER_LAST, 1663ae75e02SAlexander Aring NL802154_ATTR_MAX = __NL802154_ATTR_AFTER_LAST - 1 1673ae75e02SAlexander Aring }; 1683ae75e02SAlexander Aring 1693ae75e02SAlexander Aring enum nl802154_iftype { 170451dc48cSAlexander Aring NL802154_IFTYPE_UNSPEC = (~(__u32)0), 1713ae75e02SAlexander Aring 172451dc48cSAlexander Aring NL802154_IFTYPE_NODE = 0, 1733ae75e02SAlexander Aring NL802154_IFTYPE_MONITOR, 1743ae75e02SAlexander Aring NL802154_IFTYPE_COORD, 1753ae75e02SAlexander Aring 1763ae75e02SAlexander Aring /* keep last */ 1773ae75e02SAlexander Aring NUM_NL802154_IFTYPES, 1783ae75e02SAlexander Aring NL802154_IFTYPE_MAX = NUM_NL802154_IFTYPES - 1 1793ae75e02SAlexander Aring }; 1803ae75e02SAlexander Aring 181b40d6376SAlexander Aring /** 1820e665457SAlexander Aring * enum nl802154_wpan_phy_capability_attr - wpan phy capability attributes 1830e665457SAlexander Aring * 1840e665457SAlexander Aring * @__NL802154_CAP_ATTR_INVALID: attribute number 0 is reserved 1850e665457SAlexander Aring * @NL802154_CAP_ATTR_CHANNELS: a nested attribute for nl802154_channel_attr 1860e665457SAlexander Aring * @NL802154_CAP_ATTR_TX_POWERS: a nested attribute for 1870e665457SAlexander Aring * nl802154_wpan_phy_tx_power 1880e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_CCA_ED_LEVEL: minimum value for cca_ed_level 1890e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_CCA_ED_LEVEL: maxmimum value for cca_ed_level 1900e665457SAlexander Aring * @NL802154_CAP_ATTR_CCA_MODES: nl802154_cca_modes flags 1910e665457SAlexander Aring * @NL802154_CAP_ATTR_CCA_OPTS: nl802154_cca_opts flags 1920e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_MINBE: minimum of minbe value 1930e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_MINBE: maximum of minbe value 1940e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_MAXBE: minimum of maxbe value 1950e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_MINBE: maximum of maxbe value 1960e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_CSMA_BACKOFFS: minimum of csma backoff value 1970e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_CSMA_BACKOFFS: maximum of csma backoffs value 1980e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_FRAME_RETRIES: minimum of frame retries value 1990e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_FRAME_RETRIES: maximum of frame retries value 2000e665457SAlexander Aring * @NL802154_CAP_ATTR_IFTYPES: nl802154_iftype flags 2010e665457SAlexander Aring * @NL802154_CAP_ATTR_LBT: nl802154_supported_bool_states flags 2020e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX: highest cap attribute currently defined 2030e665457SAlexander Aring * @__NL802154_CAP_ATTR_AFTER_LAST: internal use 2040e665457SAlexander Aring */ 2050e665457SAlexander Aring enum nl802154_wpan_phy_capability_attr { 2060e665457SAlexander Aring __NL802154_CAP_ATTR_INVALID, 2070e665457SAlexander Aring 2080e665457SAlexander Aring NL802154_CAP_ATTR_IFTYPES, 2090e665457SAlexander Aring 2100e665457SAlexander Aring NL802154_CAP_ATTR_CHANNELS, 2110e665457SAlexander Aring NL802154_CAP_ATTR_TX_POWERS, 2120e665457SAlexander Aring 2130e665457SAlexander Aring NL802154_CAP_ATTR_CCA_ED_LEVELS, 2140e665457SAlexander Aring NL802154_CAP_ATTR_CCA_MODES, 2150e665457SAlexander Aring NL802154_CAP_ATTR_CCA_OPTS, 2160e665457SAlexander Aring 2170e665457SAlexander Aring NL802154_CAP_ATTR_MIN_MINBE, 2180e665457SAlexander Aring NL802154_CAP_ATTR_MAX_MINBE, 2190e665457SAlexander Aring 2200e665457SAlexander Aring NL802154_CAP_ATTR_MIN_MAXBE, 2210e665457SAlexander Aring NL802154_CAP_ATTR_MAX_MAXBE, 2220e665457SAlexander Aring 2230e665457SAlexander Aring NL802154_CAP_ATTR_MIN_CSMA_BACKOFFS, 2240e665457SAlexander Aring NL802154_CAP_ATTR_MAX_CSMA_BACKOFFS, 2250e665457SAlexander Aring 2260e665457SAlexander Aring NL802154_CAP_ATTR_MIN_FRAME_RETRIES, 2270e665457SAlexander Aring NL802154_CAP_ATTR_MAX_FRAME_RETRIES, 2280e665457SAlexander Aring 2290e665457SAlexander Aring NL802154_CAP_ATTR_LBT, 2300e665457SAlexander Aring 2310e665457SAlexander Aring /* keep last */ 2320e665457SAlexander Aring __NL802154_CAP_ATTR_AFTER_LAST, 2330e665457SAlexander Aring NL802154_CAP_ATTR_MAX = __NL802154_CAP_ATTR_AFTER_LAST - 1 2340e665457SAlexander Aring }; 2350e665457SAlexander Aring 2360e665457SAlexander Aring /** 23751147284SMiquel Raynal * enum nl802154_coord - Netlink attributes for a coord 23851147284SMiquel Raynal * 23951147284SMiquel Raynal * @__NL802154_COORD_INVALID: invalid 24051147284SMiquel Raynal * @NL802154_COORD_PANID: PANID of the coordinator (2 bytes) 24151147284SMiquel Raynal * @NL802154_COORD_ADDR: coordinator address, (8 bytes or 2 bytes) 24251147284SMiquel Raynal * @NL802154_COORD_CHANNEL: channel number, related to @NL802154_COORD_PAGE (u8) 24351147284SMiquel Raynal * @NL802154_COORD_PAGE: channel page, related to @NL802154_COORD_CHANNEL (u8) 24451147284SMiquel Raynal * @NL802154_COORD_PREAMBLE_CODE: Preamble code used when the beacon was received, 24551147284SMiquel Raynal * this is PHY dependent and optional (u8) 24651147284SMiquel Raynal * @NL802154_COORD_MEAN_PRF: Mean PRF used when the beacon was received, 24751147284SMiquel Raynal * this is PHY dependent and optional (u8) 24851147284SMiquel Raynal * @NL802154_COORD_SUPERFRAME_SPEC: superframe specification of the PAN (u16) 24951147284SMiquel Raynal * @NL802154_COORD_LINK_QUALITY: signal quality of beacon in unspecified units, 25051147284SMiquel Raynal * scaled to 0..255 (u8) 25151147284SMiquel Raynal * @NL802154_COORD_GTS_PERMIT: set to true if GTS is permitted on this PAN 25251147284SMiquel Raynal * @NL802154_COORD_PAYLOAD_DATA: binary data containing the raw data from the 25351147284SMiquel Raynal * frame payload, (only if beacon or probe response had data) 25451147284SMiquel Raynal * @NL802154_COORD_PAD: attribute used for padding for 64-bit alignment 25551147284SMiquel Raynal * @NL802154_COORD_MAX: highest coordinator attribute 25651147284SMiquel Raynal */ 25751147284SMiquel Raynal enum nl802154_coord { 25851147284SMiquel Raynal __NL802154_COORD_INVALID, 25951147284SMiquel Raynal NL802154_COORD_PANID, 26051147284SMiquel Raynal NL802154_COORD_ADDR, 26151147284SMiquel Raynal NL802154_COORD_CHANNEL, 26251147284SMiquel Raynal NL802154_COORD_PAGE, 26351147284SMiquel Raynal NL802154_COORD_PREAMBLE_CODE, 26451147284SMiquel Raynal NL802154_COORD_MEAN_PRF, 26551147284SMiquel Raynal NL802154_COORD_SUPERFRAME_SPEC, 26651147284SMiquel Raynal NL802154_COORD_LINK_QUALITY, 26751147284SMiquel Raynal NL802154_COORD_GTS_PERMIT, 26851147284SMiquel Raynal NL802154_COORD_PAYLOAD_DATA, 26951147284SMiquel Raynal NL802154_COORD_PAD, 27051147284SMiquel Raynal 27151147284SMiquel Raynal /* keep last */ 27251147284SMiquel Raynal NL802154_COORD_MAX, 27351147284SMiquel Raynal }; 27451147284SMiquel Raynal 27551147284SMiquel Raynal /** 276ed3557c9SMiquel Raynal * enum nl802154_scan_types - Scan types 277ed3557c9SMiquel Raynal * 278ed3557c9SMiquel Raynal * @__NL802154_SCAN_INVALID: scan type number 0 is reserved 279ed3557c9SMiquel Raynal * @NL802154_SCAN_ED: An ED scan allows a device to obtain a measure of the peak 280ed3557c9SMiquel Raynal * energy in each requested channel 281ed3557c9SMiquel Raynal * @NL802154_SCAN_ACTIVE: Locate any coordinator transmitting Beacon frames using 282ed3557c9SMiquel Raynal * a Beacon Request command 283ed3557c9SMiquel Raynal * @NL802154_SCAN_PASSIVE: Locate any coordinator transmitting Beacon frames 284ed3557c9SMiquel Raynal * @NL802154_SCAN_ORPHAN: Relocate coordinator following a loss of synchronisation 285ed3557c9SMiquel Raynal * @NL802154_SCAN_ENHANCED_ACTIVE: Same as Active using Enhanced Beacon Request 286ed3557c9SMiquel Raynal * command instead of Beacon Request command 287ed3557c9SMiquel Raynal * @NL802154_SCAN_RIT_PASSIVE: Passive scan for RIT Data Request command frames 288ed3557c9SMiquel Raynal * instead of Beacon frames 289ed3557c9SMiquel Raynal * @NL802154_SCAN_ATTR_MAX: Maximum SCAN attribute number 290ed3557c9SMiquel Raynal */ 291ed3557c9SMiquel Raynal enum nl802154_scan_types { 292ed3557c9SMiquel Raynal __NL802154_SCAN_INVALID, 293ed3557c9SMiquel Raynal NL802154_SCAN_ED, 294ed3557c9SMiquel Raynal NL802154_SCAN_ACTIVE, 295ed3557c9SMiquel Raynal NL802154_SCAN_PASSIVE, 296ed3557c9SMiquel Raynal NL802154_SCAN_ORPHAN, 297ed3557c9SMiquel Raynal NL802154_SCAN_ENHANCED_ACTIVE, 298ed3557c9SMiquel Raynal NL802154_SCAN_RIT_PASSIVE, 299ed3557c9SMiquel Raynal 300ed3557c9SMiquel Raynal /* keep last */ 301ed3557c9SMiquel Raynal NL802154_SCAN_ATTR_MAX, 302ed3557c9SMiquel Raynal }; 303ed3557c9SMiquel Raynal 304ed3557c9SMiquel Raynal /** 305ed3557c9SMiquel Raynal * enum nl802154_scan_done_reasons - End of scan reasons 306ed3557c9SMiquel Raynal * 307ed3557c9SMiquel Raynal * @__NL802154_SCAN_DONE_REASON_INVALID: scan done reason number 0 is reserved. 308ed3557c9SMiquel Raynal * @NL802154_SCAN_DONE_REASON_FINISHED: The scan just finished naturally after 309ed3557c9SMiquel Raynal * going through all the requested and possible (complex) channels. 310ed3557c9SMiquel Raynal * @NL802154_SCAN_DONE_REASON_ABORTED: The scan was aborted upon user request. 311ed3557c9SMiquel Raynal * a Beacon Request command 312ed3557c9SMiquel Raynal * @NL802154_SCAN_DONE_REASON_MAX: Maximum scan done reason attribute number. 313ed3557c9SMiquel Raynal */ 314ed3557c9SMiquel Raynal enum nl802154_scan_done_reasons { 315ed3557c9SMiquel Raynal __NL802154_SCAN_DONE_REASON_INVALID, 316ed3557c9SMiquel Raynal NL802154_SCAN_DONE_REASON_FINISHED, 317ed3557c9SMiquel Raynal NL802154_SCAN_DONE_REASON_ABORTED, 318ed3557c9SMiquel Raynal 319ed3557c9SMiquel Raynal /* keep last */ 320ed3557c9SMiquel Raynal NL802154_SCAN_DONE_REASON_MAX, 321ed3557c9SMiquel Raynal }; 322ed3557c9SMiquel Raynal 323ed3557c9SMiquel Raynal /** 324b40d6376SAlexander Aring * enum nl802154_cca_modes - cca modes 325b40d6376SAlexander Aring * 326b40d6376SAlexander Aring * @__NL802154_CCA_INVALID: cca mode number 0 is reserved 327b40d6376SAlexander Aring * @NL802154_CCA_ENERGY: Energy above threshold 328b40d6376SAlexander Aring * @NL802154_CCA_CARRIER: Carrier sense only 329b40d6376SAlexander Aring * @NL802154_CCA_ENERGY_CARRIER: Carrier sense with energy above threshold 330b40d6376SAlexander Aring * @NL802154_CCA_ALOHA: CCA shall always report an idle medium 331b40d6376SAlexander Aring * @NL802154_CCA_UWB_SHR: UWB preamble sense based on the SHR of a frame 332d446278cSChristoffer Holmstedt * @NL802154_CCA_UWB_MULTIPLEXED: UWB preamble sense based on the packet with 333b40d6376SAlexander Aring * the multiplexed preamble 334b40d6376SAlexander Aring * @__NL802154_CCA_ATTR_AFTER_LAST: Internal 335b40d6376SAlexander Aring * @NL802154_CCA_ATTR_MAX: Maximum CCA attribute number 336b40d6376SAlexander Aring */ 337b40d6376SAlexander Aring enum nl802154_cca_modes { 338b40d6376SAlexander Aring __NL802154_CCA_INVALID, 339b40d6376SAlexander Aring NL802154_CCA_ENERGY, 340b40d6376SAlexander Aring NL802154_CCA_CARRIER, 341b40d6376SAlexander Aring NL802154_CCA_ENERGY_CARRIER, 342b40d6376SAlexander Aring NL802154_CCA_ALOHA, 343b40d6376SAlexander Aring NL802154_CCA_UWB_SHR, 344d446278cSChristoffer Holmstedt NL802154_CCA_UWB_MULTIPLEXED, 345b40d6376SAlexander Aring 346b40d6376SAlexander Aring /* keep last */ 347b40d6376SAlexander Aring __NL802154_CCA_ATTR_AFTER_LAST, 348b40d6376SAlexander Aring NL802154_CCA_ATTR_MAX = __NL802154_CCA_ATTR_AFTER_LAST - 1 349b40d6376SAlexander Aring }; 350b40d6376SAlexander Aring 351b40d6376SAlexander Aring /** 352b40d6376SAlexander Aring * enum nl802154_cca_opts - additional options for cca modes 353b40d6376SAlexander Aring * 354b40d6376SAlexander Aring * @NL802154_CCA_OPT_ENERGY_CARRIER_OR: NL802154_CCA_ENERGY_CARRIER with OR 355b40d6376SAlexander Aring * @NL802154_CCA_OPT_ENERGY_CARRIER_AND: NL802154_CCA_ENERGY_CARRIER with AND 356b40d6376SAlexander Aring */ 357b40d6376SAlexander Aring enum nl802154_cca_opts { 358b40d6376SAlexander Aring NL802154_CCA_OPT_ENERGY_CARRIER_AND, 359b40d6376SAlexander Aring NL802154_CCA_OPT_ENERGY_CARRIER_OR, 360b40d6376SAlexander Aring 361b40d6376SAlexander Aring /* keep last */ 362b40d6376SAlexander Aring __NL802154_CCA_OPT_ATTR_AFTER_LAST, 363b40d6376SAlexander Aring NL802154_CCA_OPT_ATTR_MAX = __NL802154_CCA_OPT_ATTR_AFTER_LAST - 1 364b40d6376SAlexander Aring }; 365b40d6376SAlexander Aring 366fea3318dSAlexander Aring /** 367fea3318dSAlexander Aring * enum nl802154_supported_bool_states - bool states for bool capability entry 368fea3318dSAlexander Aring * 369fea3318dSAlexander Aring * @NL802154_SUPPORTED_BOOL_FALSE: indicates to set false 370fea3318dSAlexander Aring * @NL802154_SUPPORTED_BOOL_TRUE: indicates to set true 371fea3318dSAlexander Aring * @__NL802154_SUPPORTED_BOOL_INVALD: reserved 372fea3318dSAlexander Aring * @NL802154_SUPPORTED_BOOL_BOTH: indicates to set true and false 373fea3318dSAlexander Aring * @__NL802154_SUPPORTED_BOOL_AFTER_LAST: Internal 374fea3318dSAlexander Aring * @NL802154_SUPPORTED_BOOL_MAX: highest value for bool states 375fea3318dSAlexander Aring */ 376fea3318dSAlexander Aring enum nl802154_supported_bool_states { 377fea3318dSAlexander Aring NL802154_SUPPORTED_BOOL_FALSE, 378fea3318dSAlexander Aring NL802154_SUPPORTED_BOOL_TRUE, 379fea3318dSAlexander Aring /* to handle them in a mask */ 380fea3318dSAlexander Aring __NL802154_SUPPORTED_BOOL_INVALD, 381fea3318dSAlexander Aring NL802154_SUPPORTED_BOOL_BOTH, 382fea3318dSAlexander Aring 383fea3318dSAlexander Aring /* keep last */ 384fea3318dSAlexander Aring __NL802154_SUPPORTED_BOOL_AFTER_LAST, 385fea3318dSAlexander Aring NL802154_SUPPORTED_BOOL_MAX = __NL802154_SUPPORTED_BOOL_AFTER_LAST - 1 386fea3318dSAlexander Aring }; 387fea3318dSAlexander Aring 388a26c5fd7SAlexander Aring #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL 389a26c5fd7SAlexander Aring 390a26c5fd7SAlexander Aring enum nl802154_dev_addr_modes { 391a26c5fd7SAlexander Aring NL802154_DEV_ADDR_NONE, 392a26c5fd7SAlexander Aring __NL802154_DEV_ADDR_INVALID, 393a26c5fd7SAlexander Aring NL802154_DEV_ADDR_SHORT, 394a26c5fd7SAlexander Aring NL802154_DEV_ADDR_EXTENDED, 395a26c5fd7SAlexander Aring 396a26c5fd7SAlexander Aring /* keep last */ 397a26c5fd7SAlexander Aring __NL802154_DEV_ADDR_AFTER_LAST, 398a26c5fd7SAlexander Aring NL802154_DEV_ADDR_MAX = __NL802154_DEV_ADDR_AFTER_LAST - 1 399a26c5fd7SAlexander Aring }; 400a26c5fd7SAlexander Aring 401a26c5fd7SAlexander Aring enum nl802154_dev_addr_attrs { 402a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_UNSPEC, 403a26c5fd7SAlexander Aring 404a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_PAN_ID, 405a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_MODE, 406a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_SHORT, 407a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_EXTENDED, 408e7479122SNicolas Dichtel NL802154_DEV_ADDR_ATTR_PAD, 409a26c5fd7SAlexander Aring 410a26c5fd7SAlexander Aring /* keep last */ 411a26c5fd7SAlexander Aring __NL802154_DEV_ADDR_ATTR_AFTER_LAST, 412a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_MAX = __NL802154_DEV_ADDR_ATTR_AFTER_LAST - 1 413a26c5fd7SAlexander Aring }; 414a26c5fd7SAlexander Aring 415a26c5fd7SAlexander Aring enum nl802154_key_id_modes { 416a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_IMPLICIT, 417a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_INDEX, 418a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_INDEX_SHORT, 419a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_INDEX_EXTENDED, 420a26c5fd7SAlexander Aring 421a26c5fd7SAlexander Aring /* keep last */ 422a26c5fd7SAlexander Aring __NL802154_KEY_ID_MODE_AFTER_LAST, 423a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_MAX = __NL802154_KEY_ID_MODE_AFTER_LAST - 1 424a26c5fd7SAlexander Aring }; 425a26c5fd7SAlexander Aring 426a26c5fd7SAlexander Aring enum nl802154_key_id_attrs { 427a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_UNSPEC, 428a26c5fd7SAlexander Aring 429a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_MODE, 430a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_INDEX, 431a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_IMPLICIT, 432a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_SOURCE_SHORT, 433a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_SOURCE_EXTENDED, 434e7479122SNicolas Dichtel NL802154_KEY_ID_ATTR_PAD, 435a26c5fd7SAlexander Aring 436a26c5fd7SAlexander Aring /* keep last */ 437a26c5fd7SAlexander Aring __NL802154_KEY_ID_ATTR_AFTER_LAST, 438a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_MAX = __NL802154_KEY_ID_ATTR_AFTER_LAST - 1 439a26c5fd7SAlexander Aring }; 440a26c5fd7SAlexander Aring 441a26c5fd7SAlexander Aring enum nl802154_seclevels { 442a26c5fd7SAlexander Aring NL802154_SECLEVEL_NONE, 443a26c5fd7SAlexander Aring NL802154_SECLEVEL_MIC32, 444a26c5fd7SAlexander Aring NL802154_SECLEVEL_MIC64, 445a26c5fd7SAlexander Aring NL802154_SECLEVEL_MIC128, 446a26c5fd7SAlexander Aring NL802154_SECLEVEL_ENC, 447a26c5fd7SAlexander Aring NL802154_SECLEVEL_ENC_MIC32, 448a26c5fd7SAlexander Aring NL802154_SECLEVEL_ENC_MIC64, 449a26c5fd7SAlexander Aring NL802154_SECLEVEL_ENC_MIC128, 450a26c5fd7SAlexander Aring 451a26c5fd7SAlexander Aring /* keep last */ 452a26c5fd7SAlexander Aring __NL802154_SECLEVEL_AFTER_LAST, 453a26c5fd7SAlexander Aring NL802154_SECLEVEL_MAX = __NL802154_SECLEVEL_AFTER_LAST - 1 454a26c5fd7SAlexander Aring }; 455a26c5fd7SAlexander Aring 456a26c5fd7SAlexander Aring enum nl802154_frames { 457a26c5fd7SAlexander Aring NL802154_FRAME_BEACON, 458a26c5fd7SAlexander Aring NL802154_FRAME_DATA, 459a26c5fd7SAlexander Aring NL802154_FRAME_ACK, 460a26c5fd7SAlexander Aring NL802154_FRAME_CMD, 461a26c5fd7SAlexander Aring 462a26c5fd7SAlexander Aring /* keep last */ 463a26c5fd7SAlexander Aring __NL802154_FRAME_AFTER_LAST, 464a26c5fd7SAlexander Aring NL802154_FRAME_MAX = __NL802154_FRAME_AFTER_LAST - 1 465a26c5fd7SAlexander Aring }; 466a26c5fd7SAlexander Aring 467a26c5fd7SAlexander Aring enum nl802154_cmd_frames { 468a26c5fd7SAlexander Aring __NL802154_CMD_FRAME_INVALID, 469a26c5fd7SAlexander Aring NL802154_CMD_FRAME_ASSOC_REQUEST, 470a26c5fd7SAlexander Aring NL802154_CMD_FRAME_ASSOC_RESPONSE, 471a26c5fd7SAlexander Aring NL802154_CMD_FRAME_DISASSOC_NOTIFY, 472a26c5fd7SAlexander Aring NL802154_CMD_FRAME_DATA_REQUEST, 473a26c5fd7SAlexander Aring NL802154_CMD_FRAME_PAN_ID_CONFLICT_NOTIFY, 474a26c5fd7SAlexander Aring NL802154_CMD_FRAME_ORPHAN_NOTIFY, 475a26c5fd7SAlexander Aring NL802154_CMD_FRAME_BEACON_REQUEST, 476a26c5fd7SAlexander Aring NL802154_CMD_FRAME_COORD_REALIGNMENT, 477a26c5fd7SAlexander Aring NL802154_CMD_FRAME_GTS_REQUEST, 478a26c5fd7SAlexander Aring 479a26c5fd7SAlexander Aring /* keep last */ 480a26c5fd7SAlexander Aring __NL802154_CMD_FRAME_AFTER_LAST, 481a26c5fd7SAlexander Aring NL802154_CMD_FRAME_MAX = __NL802154_CMD_FRAME_AFTER_LAST - 1 482a26c5fd7SAlexander Aring }; 483a26c5fd7SAlexander Aring 484a26c5fd7SAlexander Aring enum nl802154_seclevel_attrs { 485a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_UNSPEC, 486a26c5fd7SAlexander Aring 487a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_LEVELS, 488a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_FRAME, 489a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_CMD_FRAME, 490a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_DEV_OVERRIDE, 491a26c5fd7SAlexander Aring 492a26c5fd7SAlexander Aring /* keep last */ 493a26c5fd7SAlexander Aring __NL802154_SECLEVEL_ATTR_AFTER_LAST, 494a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_MAX = __NL802154_SECLEVEL_ATTR_AFTER_LAST - 1 495a26c5fd7SAlexander Aring }; 496a26c5fd7SAlexander Aring 497a26c5fd7SAlexander Aring /* TODO what is this? couldn't find in mib */ 498a26c5fd7SAlexander Aring enum { 499a26c5fd7SAlexander Aring NL802154_DEVKEY_IGNORE, 500a26c5fd7SAlexander Aring NL802154_DEVKEY_RESTRICT, 501a26c5fd7SAlexander Aring NL802154_DEVKEY_RECORD, 502a26c5fd7SAlexander Aring 503a26c5fd7SAlexander Aring /* keep last */ 504a26c5fd7SAlexander Aring __NL802154_DEVKEY_AFTER_LAST, 505a26c5fd7SAlexander Aring NL802154_DEVKEY_MAX = __NL802154_DEVKEY_AFTER_LAST - 1 506a26c5fd7SAlexander Aring }; 507a26c5fd7SAlexander Aring 508a26c5fd7SAlexander Aring enum nl802154_dev { 509a26c5fd7SAlexander Aring NL802154_DEV_ATTR_UNSPEC, 510a26c5fd7SAlexander Aring 511a26c5fd7SAlexander Aring NL802154_DEV_ATTR_FRAME_COUNTER, 512a26c5fd7SAlexander Aring NL802154_DEV_ATTR_PAN_ID, 513a26c5fd7SAlexander Aring NL802154_DEV_ATTR_SHORT_ADDR, 514a26c5fd7SAlexander Aring NL802154_DEV_ATTR_EXTENDED_ADDR, 515a26c5fd7SAlexander Aring NL802154_DEV_ATTR_SECLEVEL_EXEMPT, 516a26c5fd7SAlexander Aring NL802154_DEV_ATTR_KEY_MODE, 517e7479122SNicolas Dichtel NL802154_DEV_ATTR_PAD, 518a26c5fd7SAlexander Aring 519a26c5fd7SAlexander Aring /* keep last */ 520a26c5fd7SAlexander Aring __NL802154_DEV_ATTR_AFTER_LAST, 521a26c5fd7SAlexander Aring NL802154_DEV_ATTR_MAX = __NL802154_DEV_ATTR_AFTER_LAST - 1 522a26c5fd7SAlexander Aring }; 523a26c5fd7SAlexander Aring 524a26c5fd7SAlexander Aring enum nl802154_devkey { 525a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_UNSPEC, 526a26c5fd7SAlexander Aring 527a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_FRAME_COUNTER, 528a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_EXTENDED_ADDR, 529a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_ID, 530e7479122SNicolas Dichtel NL802154_DEVKEY_ATTR_PAD, 531a26c5fd7SAlexander Aring 532a26c5fd7SAlexander Aring /* keep last */ 533a26c5fd7SAlexander Aring __NL802154_DEVKEY_ATTR_AFTER_LAST, 534a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_MAX = __NL802154_DEVKEY_ATTR_AFTER_LAST - 1 535a26c5fd7SAlexander Aring }; 536a26c5fd7SAlexander Aring 537a26c5fd7SAlexander Aring enum nl802154_key { 538a26c5fd7SAlexander Aring NL802154_KEY_ATTR_UNSPEC, 539a26c5fd7SAlexander Aring 540a26c5fd7SAlexander Aring NL802154_KEY_ATTR_ID, 541a26c5fd7SAlexander Aring NL802154_KEY_ATTR_USAGE_FRAMES, 542a26c5fd7SAlexander Aring NL802154_KEY_ATTR_USAGE_CMDS, 543a26c5fd7SAlexander Aring NL802154_KEY_ATTR_BYTES, 544a26c5fd7SAlexander Aring 545a26c5fd7SAlexander Aring /* keep last */ 546a26c5fd7SAlexander Aring __NL802154_KEY_ATTR_AFTER_LAST, 547a26c5fd7SAlexander Aring NL802154_KEY_ATTR_MAX = __NL802154_KEY_ATTR_AFTER_LAST - 1 548a26c5fd7SAlexander Aring }; 549a26c5fd7SAlexander Aring 550a26c5fd7SAlexander Aring #define NL802154_KEY_SIZE 16 551a26c5fd7SAlexander Aring #define NL802154_CMD_FRAME_NR_IDS 256 552a26c5fd7SAlexander Aring 553a26c5fd7SAlexander Aring #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */ 554a26c5fd7SAlexander Aring 5553ae75e02SAlexander Aring #endif /* __NL802154_H */ 556