blob: f41ea24052206d7657ee8c10b90d857bdb1e373a [file] [log] [blame]
Sergey Lapin02cf2282009-06-08 12:18:50 +00001
2 Linux IEEE 802.15.4 implementation
3
4
5Introduction
6============
7
8The Linux-ZigBee project goal is to provide complete implementation
9of IEEE 802.15.4 / ZigBee / 6LoWPAN protocols. IEEE 802.15.4 is a stack
10of protocols for organizing Low-Rate Wireless Personal Area Networks.
11
Lucas De Marchi25985ed2011-03-30 22:57:33 -030012Currently only IEEE 802.15.4 layer is implemented. We have chosen
Sergey Lapin02cf2282009-06-08 12:18:50 +000013to use plain Berkeley socket API, the generic Linux networking stack
14to transfer IEEE 802.15.4 messages and a special protocol over genetlink
15for configuration/management
16
17
18Socket API
19==========
20
21int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
22.....
23
24The address family, socket addresses etc. are defined in the
Dmitry Baryshkov48a2f112009-08-07 02:58:39 +000025include/net/af_ieee802154.h header or in the special header
Sergey Lapin02cf2282009-06-08 12:18:50 +000026in our userspace package (see either linux-zigbee sourceforge download page
27or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee).
28
29One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
30
31
32MLME - MAC Level Management
33============================
34
35Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands.
Dmitry Baryshkov48a2f112009-08-07 02:58:39 +000036See the include/net/nl802154.h header. Our userspace tools package
Sergey Lapin02cf2282009-06-08 12:18:50 +000037(see above) provides CLI configuration utility for radio interfaces and simple
38coordinator for IEEE 802.15.4 networks as an example users of MLME protocol.
39
40
41Kernel side
42=============
43
44Like with WiFi, there are several types of devices implementing IEEE 802.15.4.
451) 'HardMAC'. The MAC layer is implemented in the device itself, the device
46 exports MLME and data API.
472) 'SoftMAC' or just radio. These types of devices are just radio transceivers
48 possibly with some kinds of acceleration like automatic CRC computation and
49 comparation, automagic ACK handling, address matching, etc.
50
51Those types of devices require different approach to be hooked into Linux kernel.
52
53
54HardMAC
55=======
56
Dmitry Baryshkov48a2f112009-08-07 02:58:39 +000057See the header include/net/ieee802154_netdev.h. You have to implement Linux
Sergey Lapin02cf2282009-06-08 12:18:50 +000058net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
Dmitry Eremin-Solenikova0aea572009-08-19 18:53:39 +040059code via plain sk_buffs. On skb reception skb->cb must contain additional
60info as described in the struct ieee802154_mac_cb. During packet transmission
61the skb->cb is used to provide additional data to device's header_ops->create
62function. Be aware, that this data can be overriden later (when socket code
63submits skb to qdisc), so if you need something from that cb later, you should
64store info in the skb->data on your own.
Sergey Lapin02cf2282009-06-08 12:18:50 +000065
66To hook the MLME interface you have to populate the ml_priv field of your
67net_device with a pointer to struct ieee802154_mlme_ops instance. All fields are
68required.
69
70We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c
71
72
73SoftMAC
74=======
75
Thadeu Lima de Souza Cascardo987b8812009-07-26 12:34:40 -030076We are going to provide intermediate layer implementing IEEE 802.15.4 MAC
Sergey Lapin02cf2282009-06-08 12:18:50 +000077in software. This is currently WIP.
78
Dmitry Baryshkov48a2f112009-08-07 02:58:39 +000079See header include/net/mac802154.h and several drivers in drivers/ieee802154/.
Dmitry Eremin-Solenikova0aea572009-08-19 18:53:39 +040080