nl802154.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. #ifndef __NL802154_H
  2. #define __NL802154_H
  3. /*
  4. * 802.15.4 netlink interface public header
  5. *
  6. * Copyright 2014 Alexander Aring <aar@pengutronix.de>
  7. *
  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.
  11. *
  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.
  19. *
  20. */
  21. #define NL802154_GENL_NAME "nl802154"
  22. enum nl802154_commands {
  23. /* don't change the order or add anything between, this is ABI! */
  24. /* currently we don't shipping this file via uapi, ignore the above one */
  25. NL802154_CMD_UNSPEC,
  26. NL802154_CMD_GET_WPAN_PHY, /* can dump */
  27. NL802154_CMD_SET_WPAN_PHY,
  28. NL802154_CMD_NEW_WPAN_PHY,
  29. NL802154_CMD_DEL_WPAN_PHY,
  30. NL802154_CMD_GET_INTERFACE, /* can dump */
  31. NL802154_CMD_SET_INTERFACE,
  32. NL802154_CMD_NEW_INTERFACE,
  33. NL802154_CMD_DEL_INTERFACE,
  34. NL802154_CMD_SET_CHANNEL,
  35. NL802154_CMD_SET_PAN_ID,
  36. NL802154_CMD_SET_SHORT_ADDR,
  37. NL802154_CMD_SET_TX_POWER,
  38. NL802154_CMD_SET_CCA_MODE,
  39. NL802154_CMD_SET_CCA_ED_LEVEL,
  40. NL802154_CMD_SET_MAX_FRAME_RETRIES,
  41. NL802154_CMD_SET_BACKOFF_EXPONENT,
  42. NL802154_CMD_SET_MAX_CSMA_BACKOFFS,
  43. NL802154_CMD_SET_LBT_MODE,
  44. /* add new commands above here */
  45. /* used to define NL802154_CMD_MAX below */
  46. __NL802154_CMD_AFTER_LAST,
  47. NL802154_CMD_MAX = __NL802154_CMD_AFTER_LAST - 1
  48. };
  49. enum nl802154_attrs {
  50. /* don't change the order or add anything between, this is ABI! */
  51. /* currently we don't shipping this file via uapi, ignore the above one */
  52. NL802154_ATTR_UNSPEC,
  53. NL802154_ATTR_WPAN_PHY,
  54. NL802154_ATTR_WPAN_PHY_NAME,
  55. NL802154_ATTR_IFINDEX,
  56. NL802154_ATTR_IFNAME,
  57. NL802154_ATTR_IFTYPE,
  58. NL802154_ATTR_WPAN_DEV,
  59. NL802154_ATTR_PAGE,
  60. NL802154_ATTR_CHANNEL,
  61. NL802154_ATTR_PAN_ID,
  62. NL802154_ATTR_SHORT_ADDR,
  63. NL802154_ATTR_TX_POWER,
  64. NL802154_ATTR_CCA_MODE,
  65. NL802154_ATTR_CCA_OPT,
  66. NL802154_ATTR_CCA_ED_LEVEL,
  67. NL802154_ATTR_MAX_FRAME_RETRIES,
  68. NL802154_ATTR_MAX_BE,
  69. NL802154_ATTR_MIN_BE,
  70. NL802154_ATTR_MAX_CSMA_BACKOFFS,
  71. NL802154_ATTR_LBT_MODE,
  72. NL802154_ATTR_GENERATION,
  73. NL802154_ATTR_CHANNELS_SUPPORTED,
  74. NL802154_ATTR_SUPPORTED_CHANNEL,
  75. NL802154_ATTR_EXTENDED_ADDR,
  76. /* add attributes here, update the policy in nl802154.c */
  77. __NL802154_ATTR_AFTER_LAST,
  78. NL802154_ATTR_MAX = __NL802154_ATTR_AFTER_LAST - 1
  79. };
  80. enum nl802154_iftype {
  81. /* for backwards compatibility TODO */
  82. NL802154_IFTYPE_UNSPEC = -1,
  83. NL802154_IFTYPE_NODE,
  84. NL802154_IFTYPE_MONITOR,
  85. NL802154_IFTYPE_COORD,
  86. /* keep last */
  87. NUM_NL802154_IFTYPES,
  88. NL802154_IFTYPE_MAX = NUM_NL802154_IFTYPES - 1
  89. };
  90. /**
  91. * enum nl802154_cca_modes - cca modes
  92. *
  93. * @__NL802154_CCA_INVALID: cca mode number 0 is reserved
  94. * @NL802154_CCA_ENERGY: Energy above threshold
  95. * @NL802154_CCA_CARRIER: Carrier sense only
  96. * @NL802154_CCA_ENERGY_CARRIER: Carrier sense with energy above threshold
  97. * @NL802154_CCA_ALOHA: CCA shall always report an idle medium
  98. * @NL802154_CCA_UWB_SHR: UWB preamble sense based on the SHR of a frame
  99. * @NL802154_CCA_UWB_MULTIPEXED: UWB preamble sense based on the packet with
  100. * the multiplexed preamble
  101. * @__NL802154_CCA_ATTR_AFTER_LAST: Internal
  102. * @NL802154_CCA_ATTR_MAX: Maximum CCA attribute number
  103. */
  104. enum nl802154_cca_modes {
  105. __NL802154_CCA_INVALID,
  106. NL802154_CCA_ENERGY,
  107. NL802154_CCA_CARRIER,
  108. NL802154_CCA_ENERGY_CARRIER,
  109. NL802154_CCA_ALOHA,
  110. NL802154_CCA_UWB_SHR,
  111. NL802154_CCA_UWB_MULTIPEXED,
  112. /* keep last */
  113. __NL802154_CCA_ATTR_AFTER_LAST,
  114. NL802154_CCA_ATTR_MAX = __NL802154_CCA_ATTR_AFTER_LAST - 1
  115. };
  116. /**
  117. * enum nl802154_cca_opts - additional options for cca modes
  118. *
  119. * @NL802154_CCA_OPT_ENERGY_CARRIER_OR: NL802154_CCA_ENERGY_CARRIER with OR
  120. * @NL802154_CCA_OPT_ENERGY_CARRIER_AND: NL802154_CCA_ENERGY_CARRIER with AND
  121. */
  122. enum nl802154_cca_opts {
  123. NL802154_CCA_OPT_ENERGY_CARRIER_AND,
  124. NL802154_CCA_OPT_ENERGY_CARRIER_OR,
  125. /* keep last */
  126. __NL802154_CCA_OPT_ATTR_AFTER_LAST,
  127. NL802154_CCA_OPT_ATTR_MAX = __NL802154_CCA_OPT_ATTR_AFTER_LAST - 1
  128. };
  129. #endif /* __NL802154_H */