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, 76*ed3557c9SMiquel Raynal NL802154_CMD_TRIGGER_SCAN, 77*ed3557c9SMiquel Raynal NL802154_CMD_ABORT_SCAN, 78*ed3557c9SMiquel Raynal NL802154_CMD_SCAN_DONE, 7951147284SMiquel Raynal 8082543936SGal Pressman /* add new commands above here */ 81a26c5fd7SAlexander Aring 823ae75e02SAlexander Aring /* used to define NL802154_CMD_MAX below */ 833ae75e02SAlexander Aring __NL802154_CMD_AFTER_LAST, 843ae75e02SAlexander Aring NL802154_CMD_MAX = __NL802154_CMD_AFTER_LAST - 1 853ae75e02SAlexander Aring }; 863ae75e02SAlexander Aring 873ae75e02SAlexander Aring enum nl802154_attrs { 883ae75e02SAlexander Aring /* don't change the order or add anything between, this is ABI! */ 893ae75e02SAlexander Aring /* currently we don't shipping this file via uapi, ignore the above one */ 903ae75e02SAlexander Aring NL802154_ATTR_UNSPEC, 913ae75e02SAlexander Aring 923ae75e02SAlexander Aring NL802154_ATTR_WPAN_PHY, 933ae75e02SAlexander Aring NL802154_ATTR_WPAN_PHY_NAME, 943ae75e02SAlexander Aring 953ae75e02SAlexander Aring NL802154_ATTR_IFINDEX, 963ae75e02SAlexander Aring NL802154_ATTR_IFNAME, 973ae75e02SAlexander Aring NL802154_ATTR_IFTYPE, 983ae75e02SAlexander Aring 993ae75e02SAlexander Aring NL802154_ATTR_WPAN_DEV, 1003ae75e02SAlexander Aring 1013ae75e02SAlexander Aring NL802154_ATTR_PAGE, 1023ae75e02SAlexander Aring NL802154_ATTR_CHANNEL, 1033ae75e02SAlexander Aring 1043ae75e02SAlexander Aring NL802154_ATTR_PAN_ID, 1053ae75e02SAlexander Aring NL802154_ATTR_SHORT_ADDR, 1063ae75e02SAlexander Aring 1073ae75e02SAlexander Aring NL802154_ATTR_TX_POWER, 1083ae75e02SAlexander Aring 1093ae75e02SAlexander Aring NL802154_ATTR_CCA_MODE, 110ba2a9506SAlexander Aring NL802154_ATTR_CCA_OPT, 1113ae75e02SAlexander Aring NL802154_ATTR_CCA_ED_LEVEL, 1123ae75e02SAlexander Aring 1133ae75e02SAlexander Aring NL802154_ATTR_MAX_FRAME_RETRIES, 1143ae75e02SAlexander Aring 1153ae75e02SAlexander Aring NL802154_ATTR_MAX_BE, 1163ae75e02SAlexander Aring NL802154_ATTR_MIN_BE, 1173ae75e02SAlexander Aring NL802154_ATTR_MAX_CSMA_BACKOFFS, 1183ae75e02SAlexander Aring 1193ae75e02SAlexander Aring NL802154_ATTR_LBT_MODE, 1203ae75e02SAlexander Aring 1213ae75e02SAlexander Aring NL802154_ATTR_GENERATION, 1223ae75e02SAlexander Aring 1233ae75e02SAlexander Aring NL802154_ATTR_CHANNELS_SUPPORTED, 1243ae75e02SAlexander Aring NL802154_ATTR_SUPPORTED_CHANNEL, 1253ae75e02SAlexander Aring 1263ae75e02SAlexander Aring NL802154_ATTR_EXTENDED_ADDR, 1273ae75e02SAlexander Aring 1280e665457SAlexander Aring NL802154_ATTR_WPAN_PHY_CAPS, 1290e665457SAlexander Aring 130133be026SVarka Bhadram NL802154_ATTR_SUPPORTED_COMMANDS, 131133be026SVarka Bhadram 132c91208d8SAlexander Aring NL802154_ATTR_ACKREQ_DEFAULT, 133c91208d8SAlexander Aring 134aece0c3fSAlexander Aring NL802154_ATTR_PAD, 135aece0c3fSAlexander Aring 13666e5c267SAlexander Aring NL802154_ATTR_PID, 13766e5c267SAlexander Aring NL802154_ATTR_NETNS_FD, 13866e5c267SAlexander Aring 13951147284SMiquel Raynal NL802154_ATTR_COORDINATOR, 140*ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_TYPE, 141*ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_FLAGS, 142*ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_CHANNELS, 143*ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_PREAMBLE_CODES, 144*ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_MEAN_PRF, 145*ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_DURATION, 146*ed3557c9SMiquel Raynal NL802154_ATTR_SCAN_DONE_REASON, 14751147284SMiquel Raynal 1483ae75e02SAlexander Aring /* add attributes here, update the policy in nl802154.c */ 1493ae75e02SAlexander Aring 150a26c5fd7SAlexander Aring #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL 151a26c5fd7SAlexander Aring NL802154_ATTR_SEC_ENABLED, 152a26c5fd7SAlexander Aring NL802154_ATTR_SEC_OUT_LEVEL, 153a26c5fd7SAlexander Aring NL802154_ATTR_SEC_OUT_KEY_ID, 154a26c5fd7SAlexander Aring NL802154_ATTR_SEC_FRAME_COUNTER, 155a26c5fd7SAlexander Aring 156a26c5fd7SAlexander Aring NL802154_ATTR_SEC_LEVEL, 157a26c5fd7SAlexander Aring NL802154_ATTR_SEC_DEVICE, 158a26c5fd7SAlexander Aring NL802154_ATTR_SEC_DEVKEY, 159a26c5fd7SAlexander Aring NL802154_ATTR_SEC_KEY, 160a26c5fd7SAlexander Aring #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */ 161a26c5fd7SAlexander Aring 1623ae75e02SAlexander Aring __NL802154_ATTR_AFTER_LAST, 1633ae75e02SAlexander Aring NL802154_ATTR_MAX = __NL802154_ATTR_AFTER_LAST - 1 1643ae75e02SAlexander Aring }; 1653ae75e02SAlexander Aring 1663ae75e02SAlexander Aring enum nl802154_iftype { 167451dc48cSAlexander Aring NL802154_IFTYPE_UNSPEC = (~(__u32)0), 1683ae75e02SAlexander Aring 169451dc48cSAlexander Aring NL802154_IFTYPE_NODE = 0, 1703ae75e02SAlexander Aring NL802154_IFTYPE_MONITOR, 1713ae75e02SAlexander Aring NL802154_IFTYPE_COORD, 1723ae75e02SAlexander Aring 1733ae75e02SAlexander Aring /* keep last */ 1743ae75e02SAlexander Aring NUM_NL802154_IFTYPES, 1753ae75e02SAlexander Aring NL802154_IFTYPE_MAX = NUM_NL802154_IFTYPES - 1 1763ae75e02SAlexander Aring }; 1773ae75e02SAlexander Aring 178b40d6376SAlexander Aring /** 1790e665457SAlexander Aring * enum nl802154_wpan_phy_capability_attr - wpan phy capability attributes 1800e665457SAlexander Aring * 1810e665457SAlexander Aring * @__NL802154_CAP_ATTR_INVALID: attribute number 0 is reserved 1820e665457SAlexander Aring * @NL802154_CAP_ATTR_CHANNELS: a nested attribute for nl802154_channel_attr 1830e665457SAlexander Aring * @NL802154_CAP_ATTR_TX_POWERS: a nested attribute for 1840e665457SAlexander Aring * nl802154_wpan_phy_tx_power 1850e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_CCA_ED_LEVEL: minimum value for cca_ed_level 1860e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_CCA_ED_LEVEL: maxmimum value for cca_ed_level 1870e665457SAlexander Aring * @NL802154_CAP_ATTR_CCA_MODES: nl802154_cca_modes flags 1880e665457SAlexander Aring * @NL802154_CAP_ATTR_CCA_OPTS: nl802154_cca_opts flags 1890e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_MINBE: minimum of minbe value 1900e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_MINBE: maximum of minbe value 1910e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_MAXBE: minimum of maxbe value 1920e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_MINBE: maximum of maxbe value 1930e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_CSMA_BACKOFFS: minimum of csma backoff value 1940e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_CSMA_BACKOFFS: maximum of csma backoffs value 1950e665457SAlexander Aring * @NL802154_CAP_ATTR_MIN_FRAME_RETRIES: minimum of frame retries value 1960e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX_FRAME_RETRIES: maximum of frame retries value 1970e665457SAlexander Aring * @NL802154_CAP_ATTR_IFTYPES: nl802154_iftype flags 1980e665457SAlexander Aring * @NL802154_CAP_ATTR_LBT: nl802154_supported_bool_states flags 1990e665457SAlexander Aring * @NL802154_CAP_ATTR_MAX: highest cap attribute currently defined 2000e665457SAlexander Aring * @__NL802154_CAP_ATTR_AFTER_LAST: internal use 2010e665457SAlexander Aring */ 2020e665457SAlexander Aring enum nl802154_wpan_phy_capability_attr { 2030e665457SAlexander Aring __NL802154_CAP_ATTR_INVALID, 2040e665457SAlexander Aring 2050e665457SAlexander Aring NL802154_CAP_ATTR_IFTYPES, 2060e665457SAlexander Aring 2070e665457SAlexander Aring NL802154_CAP_ATTR_CHANNELS, 2080e665457SAlexander Aring NL802154_CAP_ATTR_TX_POWERS, 2090e665457SAlexander Aring 2100e665457SAlexander Aring NL802154_CAP_ATTR_CCA_ED_LEVELS, 2110e665457SAlexander Aring NL802154_CAP_ATTR_CCA_MODES, 2120e665457SAlexander Aring NL802154_CAP_ATTR_CCA_OPTS, 2130e665457SAlexander Aring 2140e665457SAlexander Aring NL802154_CAP_ATTR_MIN_MINBE, 2150e665457SAlexander Aring NL802154_CAP_ATTR_MAX_MINBE, 2160e665457SAlexander Aring 2170e665457SAlexander Aring NL802154_CAP_ATTR_MIN_MAXBE, 2180e665457SAlexander Aring NL802154_CAP_ATTR_MAX_MAXBE, 2190e665457SAlexander Aring 2200e665457SAlexander Aring NL802154_CAP_ATTR_MIN_CSMA_BACKOFFS, 2210e665457SAlexander Aring NL802154_CAP_ATTR_MAX_CSMA_BACKOFFS, 2220e665457SAlexander Aring 2230e665457SAlexander Aring NL802154_CAP_ATTR_MIN_FRAME_RETRIES, 2240e665457SAlexander Aring NL802154_CAP_ATTR_MAX_FRAME_RETRIES, 2250e665457SAlexander Aring 2260e665457SAlexander Aring NL802154_CAP_ATTR_LBT, 2270e665457SAlexander Aring 2280e665457SAlexander Aring /* keep last */ 2290e665457SAlexander Aring __NL802154_CAP_ATTR_AFTER_LAST, 2300e665457SAlexander Aring NL802154_CAP_ATTR_MAX = __NL802154_CAP_ATTR_AFTER_LAST - 1 2310e665457SAlexander Aring }; 2320e665457SAlexander Aring 2330e665457SAlexander Aring /** 23451147284SMiquel Raynal * enum nl802154_coord - Netlink attributes for a coord 23551147284SMiquel Raynal * 23651147284SMiquel Raynal * @__NL802154_COORD_INVALID: invalid 23751147284SMiquel Raynal * @NL802154_COORD_PANID: PANID of the coordinator (2 bytes) 23851147284SMiquel Raynal * @NL802154_COORD_ADDR: coordinator address, (8 bytes or 2 bytes) 23951147284SMiquel Raynal * @NL802154_COORD_CHANNEL: channel number, related to @NL802154_COORD_PAGE (u8) 24051147284SMiquel Raynal * @NL802154_COORD_PAGE: channel page, related to @NL802154_COORD_CHANNEL (u8) 24151147284SMiquel Raynal * @NL802154_COORD_PREAMBLE_CODE: Preamble code used when the beacon was received, 24251147284SMiquel Raynal * this is PHY dependent and optional (u8) 24351147284SMiquel Raynal * @NL802154_COORD_MEAN_PRF: Mean PRF used when the beacon was received, 24451147284SMiquel Raynal * this is PHY dependent and optional (u8) 24551147284SMiquel Raynal * @NL802154_COORD_SUPERFRAME_SPEC: superframe specification of the PAN (u16) 24651147284SMiquel Raynal * @NL802154_COORD_LINK_QUALITY: signal quality of beacon in unspecified units, 24751147284SMiquel Raynal * scaled to 0..255 (u8) 24851147284SMiquel Raynal * @NL802154_COORD_GTS_PERMIT: set to true if GTS is permitted on this PAN 24951147284SMiquel Raynal * @NL802154_COORD_PAYLOAD_DATA: binary data containing the raw data from the 25051147284SMiquel Raynal * frame payload, (only if beacon or probe response had data) 25151147284SMiquel Raynal * @NL802154_COORD_PAD: attribute used for padding for 64-bit alignment 25251147284SMiquel Raynal * @NL802154_COORD_MAX: highest coordinator attribute 25351147284SMiquel Raynal */ 25451147284SMiquel Raynal enum nl802154_coord { 25551147284SMiquel Raynal __NL802154_COORD_INVALID, 25651147284SMiquel Raynal NL802154_COORD_PANID, 25751147284SMiquel Raynal NL802154_COORD_ADDR, 25851147284SMiquel Raynal NL802154_COORD_CHANNEL, 25951147284SMiquel Raynal NL802154_COORD_PAGE, 26051147284SMiquel Raynal NL802154_COORD_PREAMBLE_CODE, 26151147284SMiquel Raynal NL802154_COORD_MEAN_PRF, 26251147284SMiquel Raynal NL802154_COORD_SUPERFRAME_SPEC, 26351147284SMiquel Raynal NL802154_COORD_LINK_QUALITY, 26451147284SMiquel Raynal NL802154_COORD_GTS_PERMIT, 26551147284SMiquel Raynal NL802154_COORD_PAYLOAD_DATA, 26651147284SMiquel Raynal NL802154_COORD_PAD, 26751147284SMiquel Raynal 26851147284SMiquel Raynal /* keep last */ 26951147284SMiquel Raynal NL802154_COORD_MAX, 27051147284SMiquel Raynal }; 27151147284SMiquel Raynal 27251147284SMiquel Raynal /** 273*ed3557c9SMiquel Raynal * enum nl802154_scan_types - Scan types 274*ed3557c9SMiquel Raynal * 275*ed3557c9SMiquel Raynal * @__NL802154_SCAN_INVALID: scan type number 0 is reserved 276*ed3557c9SMiquel Raynal * @NL802154_SCAN_ED: An ED scan allows a device to obtain a measure of the peak 277*ed3557c9SMiquel Raynal * energy in each requested channel 278*ed3557c9SMiquel Raynal * @NL802154_SCAN_ACTIVE: Locate any coordinator transmitting Beacon frames using 279*ed3557c9SMiquel Raynal * a Beacon Request command 280*ed3557c9SMiquel Raynal * @NL802154_SCAN_PASSIVE: Locate any coordinator transmitting Beacon frames 281*ed3557c9SMiquel Raynal * @NL802154_SCAN_ORPHAN: Relocate coordinator following a loss of synchronisation 282*ed3557c9SMiquel Raynal * @NL802154_SCAN_ENHANCED_ACTIVE: Same as Active using Enhanced Beacon Request 283*ed3557c9SMiquel Raynal * command instead of Beacon Request command 284*ed3557c9SMiquel Raynal * @NL802154_SCAN_RIT_PASSIVE: Passive scan for RIT Data Request command frames 285*ed3557c9SMiquel Raynal * instead of Beacon frames 286*ed3557c9SMiquel Raynal * @NL802154_SCAN_ATTR_MAX: Maximum SCAN attribute number 287*ed3557c9SMiquel Raynal */ 288*ed3557c9SMiquel Raynal enum nl802154_scan_types { 289*ed3557c9SMiquel Raynal __NL802154_SCAN_INVALID, 290*ed3557c9SMiquel Raynal NL802154_SCAN_ED, 291*ed3557c9SMiquel Raynal NL802154_SCAN_ACTIVE, 292*ed3557c9SMiquel Raynal NL802154_SCAN_PASSIVE, 293*ed3557c9SMiquel Raynal NL802154_SCAN_ORPHAN, 294*ed3557c9SMiquel Raynal NL802154_SCAN_ENHANCED_ACTIVE, 295*ed3557c9SMiquel Raynal NL802154_SCAN_RIT_PASSIVE, 296*ed3557c9SMiquel Raynal 297*ed3557c9SMiquel Raynal /* keep last */ 298*ed3557c9SMiquel Raynal NL802154_SCAN_ATTR_MAX, 299*ed3557c9SMiquel Raynal }; 300*ed3557c9SMiquel Raynal 301*ed3557c9SMiquel Raynal /** 302*ed3557c9SMiquel Raynal * enum nl802154_scan_done_reasons - End of scan reasons 303*ed3557c9SMiquel Raynal * 304*ed3557c9SMiquel Raynal * @__NL802154_SCAN_DONE_REASON_INVALID: scan done reason number 0 is reserved. 305*ed3557c9SMiquel Raynal * @NL802154_SCAN_DONE_REASON_FINISHED: The scan just finished naturally after 306*ed3557c9SMiquel Raynal * going through all the requested and possible (complex) channels. 307*ed3557c9SMiquel Raynal * @NL802154_SCAN_DONE_REASON_ABORTED: The scan was aborted upon user request. 308*ed3557c9SMiquel Raynal * a Beacon Request command 309*ed3557c9SMiquel Raynal * @NL802154_SCAN_DONE_REASON_MAX: Maximum scan done reason attribute number. 310*ed3557c9SMiquel Raynal */ 311*ed3557c9SMiquel Raynal enum nl802154_scan_done_reasons { 312*ed3557c9SMiquel Raynal __NL802154_SCAN_DONE_REASON_INVALID, 313*ed3557c9SMiquel Raynal NL802154_SCAN_DONE_REASON_FINISHED, 314*ed3557c9SMiquel Raynal NL802154_SCAN_DONE_REASON_ABORTED, 315*ed3557c9SMiquel Raynal 316*ed3557c9SMiquel Raynal /* keep last */ 317*ed3557c9SMiquel Raynal NL802154_SCAN_DONE_REASON_MAX, 318*ed3557c9SMiquel Raynal }; 319*ed3557c9SMiquel Raynal 320*ed3557c9SMiquel Raynal /** 321b40d6376SAlexander Aring * enum nl802154_cca_modes - cca modes 322b40d6376SAlexander Aring * 323b40d6376SAlexander Aring * @__NL802154_CCA_INVALID: cca mode number 0 is reserved 324b40d6376SAlexander Aring * @NL802154_CCA_ENERGY: Energy above threshold 325b40d6376SAlexander Aring * @NL802154_CCA_CARRIER: Carrier sense only 326b40d6376SAlexander Aring * @NL802154_CCA_ENERGY_CARRIER: Carrier sense with energy above threshold 327b40d6376SAlexander Aring * @NL802154_CCA_ALOHA: CCA shall always report an idle medium 328b40d6376SAlexander Aring * @NL802154_CCA_UWB_SHR: UWB preamble sense based on the SHR of a frame 329d446278cSChristoffer Holmstedt * @NL802154_CCA_UWB_MULTIPLEXED: UWB preamble sense based on the packet with 330b40d6376SAlexander Aring * the multiplexed preamble 331b40d6376SAlexander Aring * @__NL802154_CCA_ATTR_AFTER_LAST: Internal 332b40d6376SAlexander Aring * @NL802154_CCA_ATTR_MAX: Maximum CCA attribute number 333b40d6376SAlexander Aring */ 334b40d6376SAlexander Aring enum nl802154_cca_modes { 335b40d6376SAlexander Aring __NL802154_CCA_INVALID, 336b40d6376SAlexander Aring NL802154_CCA_ENERGY, 337b40d6376SAlexander Aring NL802154_CCA_CARRIER, 338b40d6376SAlexander Aring NL802154_CCA_ENERGY_CARRIER, 339b40d6376SAlexander Aring NL802154_CCA_ALOHA, 340b40d6376SAlexander Aring NL802154_CCA_UWB_SHR, 341d446278cSChristoffer Holmstedt NL802154_CCA_UWB_MULTIPLEXED, 342b40d6376SAlexander Aring 343b40d6376SAlexander Aring /* keep last */ 344b40d6376SAlexander Aring __NL802154_CCA_ATTR_AFTER_LAST, 345b40d6376SAlexander Aring NL802154_CCA_ATTR_MAX = __NL802154_CCA_ATTR_AFTER_LAST - 1 346b40d6376SAlexander Aring }; 347b40d6376SAlexander Aring 348b40d6376SAlexander Aring /** 349b40d6376SAlexander Aring * enum nl802154_cca_opts - additional options for cca modes 350b40d6376SAlexander Aring * 351b40d6376SAlexander Aring * @NL802154_CCA_OPT_ENERGY_CARRIER_OR: NL802154_CCA_ENERGY_CARRIER with OR 352b40d6376SAlexander Aring * @NL802154_CCA_OPT_ENERGY_CARRIER_AND: NL802154_CCA_ENERGY_CARRIER with AND 353b40d6376SAlexander Aring */ 354b40d6376SAlexander Aring enum nl802154_cca_opts { 355b40d6376SAlexander Aring NL802154_CCA_OPT_ENERGY_CARRIER_AND, 356b40d6376SAlexander Aring NL802154_CCA_OPT_ENERGY_CARRIER_OR, 357b40d6376SAlexander Aring 358b40d6376SAlexander Aring /* keep last */ 359b40d6376SAlexander Aring __NL802154_CCA_OPT_ATTR_AFTER_LAST, 360b40d6376SAlexander Aring NL802154_CCA_OPT_ATTR_MAX = __NL802154_CCA_OPT_ATTR_AFTER_LAST - 1 361b40d6376SAlexander Aring }; 362b40d6376SAlexander Aring 363fea3318dSAlexander Aring /** 364fea3318dSAlexander Aring * enum nl802154_supported_bool_states - bool states for bool capability entry 365fea3318dSAlexander Aring * 366fea3318dSAlexander Aring * @NL802154_SUPPORTED_BOOL_FALSE: indicates to set false 367fea3318dSAlexander Aring * @NL802154_SUPPORTED_BOOL_TRUE: indicates to set true 368fea3318dSAlexander Aring * @__NL802154_SUPPORTED_BOOL_INVALD: reserved 369fea3318dSAlexander Aring * @NL802154_SUPPORTED_BOOL_BOTH: indicates to set true and false 370fea3318dSAlexander Aring * @__NL802154_SUPPORTED_BOOL_AFTER_LAST: Internal 371fea3318dSAlexander Aring * @NL802154_SUPPORTED_BOOL_MAX: highest value for bool states 372fea3318dSAlexander Aring */ 373fea3318dSAlexander Aring enum nl802154_supported_bool_states { 374fea3318dSAlexander Aring NL802154_SUPPORTED_BOOL_FALSE, 375fea3318dSAlexander Aring NL802154_SUPPORTED_BOOL_TRUE, 376fea3318dSAlexander Aring /* to handle them in a mask */ 377fea3318dSAlexander Aring __NL802154_SUPPORTED_BOOL_INVALD, 378fea3318dSAlexander Aring NL802154_SUPPORTED_BOOL_BOTH, 379fea3318dSAlexander Aring 380fea3318dSAlexander Aring /* keep last */ 381fea3318dSAlexander Aring __NL802154_SUPPORTED_BOOL_AFTER_LAST, 382fea3318dSAlexander Aring NL802154_SUPPORTED_BOOL_MAX = __NL802154_SUPPORTED_BOOL_AFTER_LAST - 1 383fea3318dSAlexander Aring }; 384fea3318dSAlexander Aring 385a26c5fd7SAlexander Aring #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL 386a26c5fd7SAlexander Aring 387a26c5fd7SAlexander Aring enum nl802154_dev_addr_modes { 388a26c5fd7SAlexander Aring NL802154_DEV_ADDR_NONE, 389a26c5fd7SAlexander Aring __NL802154_DEV_ADDR_INVALID, 390a26c5fd7SAlexander Aring NL802154_DEV_ADDR_SHORT, 391a26c5fd7SAlexander Aring NL802154_DEV_ADDR_EXTENDED, 392a26c5fd7SAlexander Aring 393a26c5fd7SAlexander Aring /* keep last */ 394a26c5fd7SAlexander Aring __NL802154_DEV_ADDR_AFTER_LAST, 395a26c5fd7SAlexander Aring NL802154_DEV_ADDR_MAX = __NL802154_DEV_ADDR_AFTER_LAST - 1 396a26c5fd7SAlexander Aring }; 397a26c5fd7SAlexander Aring 398a26c5fd7SAlexander Aring enum nl802154_dev_addr_attrs { 399a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_UNSPEC, 400a26c5fd7SAlexander Aring 401a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_PAN_ID, 402a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_MODE, 403a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_SHORT, 404a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_EXTENDED, 405e7479122SNicolas Dichtel NL802154_DEV_ADDR_ATTR_PAD, 406a26c5fd7SAlexander Aring 407a26c5fd7SAlexander Aring /* keep last */ 408a26c5fd7SAlexander Aring __NL802154_DEV_ADDR_ATTR_AFTER_LAST, 409a26c5fd7SAlexander Aring NL802154_DEV_ADDR_ATTR_MAX = __NL802154_DEV_ADDR_ATTR_AFTER_LAST - 1 410a26c5fd7SAlexander Aring }; 411a26c5fd7SAlexander Aring 412a26c5fd7SAlexander Aring enum nl802154_key_id_modes { 413a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_IMPLICIT, 414a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_INDEX, 415a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_INDEX_SHORT, 416a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_INDEX_EXTENDED, 417a26c5fd7SAlexander Aring 418a26c5fd7SAlexander Aring /* keep last */ 419a26c5fd7SAlexander Aring __NL802154_KEY_ID_MODE_AFTER_LAST, 420a26c5fd7SAlexander Aring NL802154_KEY_ID_MODE_MAX = __NL802154_KEY_ID_MODE_AFTER_LAST - 1 421a26c5fd7SAlexander Aring }; 422a26c5fd7SAlexander Aring 423a26c5fd7SAlexander Aring enum nl802154_key_id_attrs { 424a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_UNSPEC, 425a26c5fd7SAlexander Aring 426a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_MODE, 427a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_INDEX, 428a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_IMPLICIT, 429a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_SOURCE_SHORT, 430a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_SOURCE_EXTENDED, 431e7479122SNicolas Dichtel NL802154_KEY_ID_ATTR_PAD, 432a26c5fd7SAlexander Aring 433a26c5fd7SAlexander Aring /* keep last */ 434a26c5fd7SAlexander Aring __NL802154_KEY_ID_ATTR_AFTER_LAST, 435a26c5fd7SAlexander Aring NL802154_KEY_ID_ATTR_MAX = __NL802154_KEY_ID_ATTR_AFTER_LAST - 1 436a26c5fd7SAlexander Aring }; 437a26c5fd7SAlexander Aring 438a26c5fd7SAlexander Aring enum nl802154_seclevels { 439a26c5fd7SAlexander Aring NL802154_SECLEVEL_NONE, 440a26c5fd7SAlexander Aring NL802154_SECLEVEL_MIC32, 441a26c5fd7SAlexander Aring NL802154_SECLEVEL_MIC64, 442a26c5fd7SAlexander Aring NL802154_SECLEVEL_MIC128, 443a26c5fd7SAlexander Aring NL802154_SECLEVEL_ENC, 444a26c5fd7SAlexander Aring NL802154_SECLEVEL_ENC_MIC32, 445a26c5fd7SAlexander Aring NL802154_SECLEVEL_ENC_MIC64, 446a26c5fd7SAlexander Aring NL802154_SECLEVEL_ENC_MIC128, 447a26c5fd7SAlexander Aring 448a26c5fd7SAlexander Aring /* keep last */ 449a26c5fd7SAlexander Aring __NL802154_SECLEVEL_AFTER_LAST, 450a26c5fd7SAlexander Aring NL802154_SECLEVEL_MAX = __NL802154_SECLEVEL_AFTER_LAST - 1 451a26c5fd7SAlexander Aring }; 452a26c5fd7SAlexander Aring 453a26c5fd7SAlexander Aring enum nl802154_frames { 454a26c5fd7SAlexander Aring NL802154_FRAME_BEACON, 455a26c5fd7SAlexander Aring NL802154_FRAME_DATA, 456a26c5fd7SAlexander Aring NL802154_FRAME_ACK, 457a26c5fd7SAlexander Aring NL802154_FRAME_CMD, 458a26c5fd7SAlexander Aring 459a26c5fd7SAlexander Aring /* keep last */ 460a26c5fd7SAlexander Aring __NL802154_FRAME_AFTER_LAST, 461a26c5fd7SAlexander Aring NL802154_FRAME_MAX = __NL802154_FRAME_AFTER_LAST - 1 462a26c5fd7SAlexander Aring }; 463a26c5fd7SAlexander Aring 464a26c5fd7SAlexander Aring enum nl802154_cmd_frames { 465a26c5fd7SAlexander Aring __NL802154_CMD_FRAME_INVALID, 466a26c5fd7SAlexander Aring NL802154_CMD_FRAME_ASSOC_REQUEST, 467a26c5fd7SAlexander Aring NL802154_CMD_FRAME_ASSOC_RESPONSE, 468a26c5fd7SAlexander Aring NL802154_CMD_FRAME_DISASSOC_NOTIFY, 469a26c5fd7SAlexander Aring NL802154_CMD_FRAME_DATA_REQUEST, 470a26c5fd7SAlexander Aring NL802154_CMD_FRAME_PAN_ID_CONFLICT_NOTIFY, 471a26c5fd7SAlexander Aring NL802154_CMD_FRAME_ORPHAN_NOTIFY, 472a26c5fd7SAlexander Aring NL802154_CMD_FRAME_BEACON_REQUEST, 473a26c5fd7SAlexander Aring NL802154_CMD_FRAME_COORD_REALIGNMENT, 474a26c5fd7SAlexander Aring NL802154_CMD_FRAME_GTS_REQUEST, 475a26c5fd7SAlexander Aring 476a26c5fd7SAlexander Aring /* keep last */ 477a26c5fd7SAlexander Aring __NL802154_CMD_FRAME_AFTER_LAST, 478a26c5fd7SAlexander Aring NL802154_CMD_FRAME_MAX = __NL802154_CMD_FRAME_AFTER_LAST - 1 479a26c5fd7SAlexander Aring }; 480a26c5fd7SAlexander Aring 481a26c5fd7SAlexander Aring enum nl802154_seclevel_attrs { 482a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_UNSPEC, 483a26c5fd7SAlexander Aring 484a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_LEVELS, 485a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_FRAME, 486a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_CMD_FRAME, 487a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_DEV_OVERRIDE, 488a26c5fd7SAlexander Aring 489a26c5fd7SAlexander Aring /* keep last */ 490a26c5fd7SAlexander Aring __NL802154_SECLEVEL_ATTR_AFTER_LAST, 491a26c5fd7SAlexander Aring NL802154_SECLEVEL_ATTR_MAX = __NL802154_SECLEVEL_ATTR_AFTER_LAST - 1 492a26c5fd7SAlexander Aring }; 493a26c5fd7SAlexander Aring 494a26c5fd7SAlexander Aring /* TODO what is this? couldn't find in mib */ 495a26c5fd7SAlexander Aring enum { 496a26c5fd7SAlexander Aring NL802154_DEVKEY_IGNORE, 497a26c5fd7SAlexander Aring NL802154_DEVKEY_RESTRICT, 498a26c5fd7SAlexander Aring NL802154_DEVKEY_RECORD, 499a26c5fd7SAlexander Aring 500a26c5fd7SAlexander Aring /* keep last */ 501a26c5fd7SAlexander Aring __NL802154_DEVKEY_AFTER_LAST, 502a26c5fd7SAlexander Aring NL802154_DEVKEY_MAX = __NL802154_DEVKEY_AFTER_LAST - 1 503a26c5fd7SAlexander Aring }; 504a26c5fd7SAlexander Aring 505a26c5fd7SAlexander Aring enum nl802154_dev { 506a26c5fd7SAlexander Aring NL802154_DEV_ATTR_UNSPEC, 507a26c5fd7SAlexander Aring 508a26c5fd7SAlexander Aring NL802154_DEV_ATTR_FRAME_COUNTER, 509a26c5fd7SAlexander Aring NL802154_DEV_ATTR_PAN_ID, 510a26c5fd7SAlexander Aring NL802154_DEV_ATTR_SHORT_ADDR, 511a26c5fd7SAlexander Aring NL802154_DEV_ATTR_EXTENDED_ADDR, 512a26c5fd7SAlexander Aring NL802154_DEV_ATTR_SECLEVEL_EXEMPT, 513a26c5fd7SAlexander Aring NL802154_DEV_ATTR_KEY_MODE, 514e7479122SNicolas Dichtel NL802154_DEV_ATTR_PAD, 515a26c5fd7SAlexander Aring 516a26c5fd7SAlexander Aring /* keep last */ 517a26c5fd7SAlexander Aring __NL802154_DEV_ATTR_AFTER_LAST, 518a26c5fd7SAlexander Aring NL802154_DEV_ATTR_MAX = __NL802154_DEV_ATTR_AFTER_LAST - 1 519a26c5fd7SAlexander Aring }; 520a26c5fd7SAlexander Aring 521a26c5fd7SAlexander Aring enum nl802154_devkey { 522a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_UNSPEC, 523a26c5fd7SAlexander Aring 524a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_FRAME_COUNTER, 525a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_EXTENDED_ADDR, 526a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_ID, 527e7479122SNicolas Dichtel NL802154_DEVKEY_ATTR_PAD, 528a26c5fd7SAlexander Aring 529a26c5fd7SAlexander Aring /* keep last */ 530a26c5fd7SAlexander Aring __NL802154_DEVKEY_ATTR_AFTER_LAST, 531a26c5fd7SAlexander Aring NL802154_DEVKEY_ATTR_MAX = __NL802154_DEVKEY_ATTR_AFTER_LAST - 1 532a26c5fd7SAlexander Aring }; 533a26c5fd7SAlexander Aring 534a26c5fd7SAlexander Aring enum nl802154_key { 535a26c5fd7SAlexander Aring NL802154_KEY_ATTR_UNSPEC, 536a26c5fd7SAlexander Aring 537a26c5fd7SAlexander Aring NL802154_KEY_ATTR_ID, 538a26c5fd7SAlexander Aring NL802154_KEY_ATTR_USAGE_FRAMES, 539a26c5fd7SAlexander Aring NL802154_KEY_ATTR_USAGE_CMDS, 540a26c5fd7SAlexander Aring NL802154_KEY_ATTR_BYTES, 541a26c5fd7SAlexander Aring 542a26c5fd7SAlexander Aring /* keep last */ 543a26c5fd7SAlexander Aring __NL802154_KEY_ATTR_AFTER_LAST, 544a26c5fd7SAlexander Aring NL802154_KEY_ATTR_MAX = __NL802154_KEY_ATTR_AFTER_LAST - 1 545a26c5fd7SAlexander Aring }; 546a26c5fd7SAlexander Aring 547a26c5fd7SAlexander Aring #define NL802154_KEY_SIZE 16 548a26c5fd7SAlexander Aring #define NL802154_CMD_FRAME_NR_IDS 256 549a26c5fd7SAlexander Aring 550a26c5fd7SAlexander Aring #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */ 551a26c5fd7SAlexander Aring 5523ae75e02SAlexander Aring #endif /* __NL802154_H */ 553