nl802154.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * nl802154.h
  3. *
  4. * Copyright (C) 2007, 2008, 2009 Siemens AG
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2
  8. * as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. */
  20. #ifndef IEEE802154_NL_H
  21. #define IEEE802154_NL_H
  22. struct net_device;
  23. struct ieee802154_addr;
  24. /**
  25. * ieee802154_nl_assoc_indic - Notify userland of an association request.
  26. * @dev: The network device on which this association request was
  27. * received.
  28. * @addr: The address of the device requesting association.
  29. * @cap: The capability information field from the device.
  30. *
  31. * This informs a userland coordinator of a device requesting to
  32. * associate with the PAN controlled by the coordinator.
  33. *
  34. * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document.
  35. */
  36. int ieee802154_nl_assoc_indic(struct net_device *dev,
  37. struct ieee802154_addr *addr, u8 cap);
  38. /**
  39. * ieee802154_nl_assoc_confirm - Notify userland of association.
  40. * @dev: The device which has completed association.
  41. * @short_addr: The short address assigned to the device.
  42. * @status: The status of the association.
  43. *
  44. * Inform userland of the result of an association request. If the
  45. * association request included asking the coordinator to allocate
  46. * a short address then it is returned in @short_addr.
  47. *
  48. * Note: This is in section 7.3.2 of the IEEE 802.15.4 document.
  49. */
  50. int ieee802154_nl_assoc_confirm(struct net_device *dev,
  51. u16 short_addr, u8 status);
  52. /**
  53. * ieee802154_nl_disassoc_indic - Notify userland of disassociation.
  54. * @dev: The device on which disassociation was indicated.
  55. * @addr: The device which is disassociating.
  56. * @reason: The reason for the disassociation.
  57. *
  58. * Inform userland that a device has disassociated from the network.
  59. *
  60. * Note: This is in section 7.3.3 of the IEEE 802.15.4 document.
  61. */
  62. int ieee802154_nl_disassoc_indic(struct net_device *dev,
  63. struct ieee802154_addr *addr, u8 reason);
  64. /**
  65. * ieee802154_nl_disassoc_confirm - Notify userland of disassociation
  66. * completion.
  67. * @dev: The device on which disassociation was ordered.
  68. * @status: The result of the disassociation.
  69. *
  70. * Inform userland of the result of requesting that a device
  71. * disassociate, or the result of requesting that we disassociate from
  72. * a PAN managed by another coordinator.
  73. *
  74. * Note: This is in section 7.1.4.3 of the IEEE 802.15.4 document.
  75. */
  76. int ieee802154_nl_disassoc_confirm(struct net_device *dev,
  77. u8 status);
  78. /**
  79. * ieee802154_nl_scan_confirm - Notify userland of completion of scan.
  80. * @dev: The device which was instructed to scan.
  81. * @status: The status of the scan operation.
  82. * @scan_type: What type of scan was performed.
  83. * @unscanned: Any channels that the device was unable to scan.
  84. * @edl: The energy levels (if a passive scan).
  85. *
  86. *
  87. * Note: This is in section 7.1.11 of the IEEE 802.15.4 document.
  88. * Note: This API does not permit the return of an active scan result.
  89. */
  90. int ieee802154_nl_scan_confirm(struct net_device *dev,
  91. u8 status, u8 scan_type, u32 unscanned, u8 page,
  92. u8 *edl/*, struct list_head *pan_desc_list */);
  93. /**
  94. * ieee802154_nl_beacon_indic - Notify userland of a received beacon.
  95. * @dev: The device on which a beacon was received.
  96. * @panid: The PAN of the coordinator.
  97. * @coord_addr: The short address of the coordinator on that PAN.
  98. *
  99. * Note: This is in section 7.1.5 of the IEEE 802.15.4 document.
  100. * Note: This API does not provide extended information such as what
  101. * channel the PAN is on or what the LQI of the beacon frame was on
  102. * receipt.
  103. * Note: This API cannot indicate a beacon frame for a coordinator
  104. * operating in long addressing mode.
  105. */
  106. int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid,
  107. u16 coord_addr);
  108. /**
  109. * ieee802154_nl_start_confirm - Notify userland of completion of start.
  110. * @dev: The device which was instructed to scan.
  111. * @status: The status of the scan operation.
  112. *
  113. * Note: This is in section 7.1.14 of the IEEE 802.15.4 document.
  114. */
  115. int ieee802154_nl_start_confirm(struct net_device *dev, u8 status);
  116. #endif