ieee802154.txt 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. Linux IEEE 802.15.4 implementation
  2. Introduction
  3. ============
  4. The Linux-ZigBee project goal is to provide complete implementation
  5. of IEEE 802.15.4 / ZigBee / 6LoWPAN protocols. IEEE 802.15.4 is a stack
  6. of protocols for organizing Low-Rate Wireless Personal Area Networks.
  7. Currently only IEEE 802.15.4 layer is implemented. We have choosen
  8. to use plain Berkeley socket API, the generic Linux networking stack
  9. to transfer IEEE 802.15.4 messages and a special protocol over genetlink
  10. for configuration/management
  11. Socket API
  12. ==========
  13. int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
  14. .....
  15. The address family, socket addresses etc. are defined in the
  16. include/net/af_ieee802154.h header or in the special header
  17. in our userspace package (see either linux-zigbee sourceforge download page
  18. or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee).
  19. One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
  20. MLME - MAC Level Management
  21. ============================
  22. Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands.
  23. See the include/net/nl802154.h header. Our userspace tools package
  24. (see above) provides CLI configuration utility for radio interfaces and simple
  25. coordinator for IEEE 802.15.4 networks as an example users of MLME protocol.
  26. Kernel side
  27. =============
  28. Like with WiFi, there are several types of devices implementing IEEE 802.15.4.
  29. 1) 'HardMAC'. The MAC layer is implemented in the device itself, the device
  30. exports MLME and data API.
  31. 2) 'SoftMAC' or just radio. These types of devices are just radio transceivers
  32. possibly with some kinds of acceleration like automatic CRC computation and
  33. comparation, automagic ACK handling, address matching, etc.
  34. Those types of devices require different approach to be hooked into Linux kernel.
  35. HardMAC
  36. =======
  37. See the header include/net/ieee802154_netdev.h. You have to implement Linux
  38. net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
  39. code via plain sk_buffs. On skb reception skb->cb must contain additional
  40. info as described in the struct ieee802154_mac_cb. During packet transmission
  41. the skb->cb is used to provide additional data to device's header_ops->create
  42. function. Be aware, that this data can be overriden later (when socket code
  43. submits skb to qdisc), so if you need something from that cb later, you should
  44. store info in the skb->data on your own.
  45. To hook the MLME interface you have to populate the ml_priv field of your
  46. net_device with a pointer to struct ieee802154_mlme_ops instance. All fields are
  47. required.
  48. We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c
  49. SoftMAC
  50. =======
  51. We are going to provide intermediate layer implementing IEEE 802.15.4 MAC
  52. in software. This is currently WIP.
  53. See header include/net/mac802154.h and several drivers in drivers/ieee802154/.