Skip to contentSkip to conversation

IEEE 802.15.4 implementation for Linux

RFC New Dmitry Eremin-Solenikov 6 participants 12 messages May 26, 2009 – May 30, 2009 2 messages not in the archive

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

Hi,

As a part of research activities in the Embedded Systems - Open Platform Group from Siemens Corporate Technology we are working on adding support for the IEEE 802.15.4 Wireless Personal Area Networks to the Linux. Our current implementation is neither certified nor even feature complete. However we'd like to present current state of our patchset to the Linux developers community to gain comments, fixes, ideas, etc. This is not yet a pull request, but more like an RFC.

The project page is available at http://apps.sourceforge.net/trac/linux-zigbee
with source code of kernel part available from git at
http://zigbee-linux.git.sourceforge.net, mirrored for convenience at
git://git.kernel.org/pub/scm/linux/kernel/git/lumag/lowpan.git

The source code for userspace utils is available from git at
http://linux-zigbee.git.sourceforge.net/

Several comments about our implementation:
* As with 802.11 there are two types of devices: the smart ones that implement most parts of the protocol by themselves and more or less dumb ones which simply send and receive what they are told. Currently we do only support the second type of devices (SoftMAC)
* The implementation is split between code driving radio, (master, mwpanX
interface: mdev.c), code processing frames according the IEEE 802.15.4 rules (slave wpanX devices) and finally sockets (af_ieee802154.c, dgram.c, raw.c).
* We do present two example drivers using our stack. One is purely virtual one either looping the packets back or connecting several virtual interfaces (the one at fakelb.c), and the driver for the Freescale MC13192 evaluation boards (13192-SARD, 13192-EVK) using our custom firmware (currently only available at request, we are working on publishing it). The driver for the Atmel at86rf230/at86rf231 chips will follow in several weeks.

The following changes since commit 59a3759d0fe8d969888c741bb33f4946e4d3750d:
Linus Torvalds (1):

        Linux 2.6.30-rc7

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lumag/lowpan.git for-review-v0

Dmitry Eremin-Solenikov (5):
Add constants for the ieee 802.15.4/ZigBee stack
net: add IEEE 802.15.4 partial implementation
ieee802154: add socket address family code
ieee802154: add virtual loopback driver
ieee802154: add serial dongle driver

 drivers/Makefile                       |    1 +
 drivers/ieee802154/Kconfig             |   26 +
 drivers/ieee802154/Makefile            |    4 +
 drivers/ieee802154/fakelb.c            |  335 +++++++++++
 drivers/ieee802154/serial.c            | 1001 ++++++++++++++++++++++++++++++++
 drivers/net/Kconfig                    |    2 +
 include/linux/if.h                     |    2 +
 include/linux/if_arp.h                 |    2 +
 include/linux/if_ether.h               |    2 +
 include/linux/socket.h                 |    6 +-
 include/linux/tty.h                    |    3 +-
 include/net/ieee802154/af_ieee802154.h |   65 ++
 include/net/ieee802154/beacon.h        |   53 ++
 include/net/ieee802154/beacon_hash.h   |   40 ++
 include/net/ieee802154/const.h         |  696 ++++++++++++++++++++++
 include/net/ieee802154/crc.h           |   38 ++
 include/net/ieee802154/dev.h           |  107 ++++
 include/net/ieee802154/mac_def.h       |   96 +++
 include/net/ieee802154/netdev.h        |   74 +++
 include/net/ieee802154/nl.h            |  166 ++++++
 include/net/ieee802154/phy.h           |  117 ++++
 net/Kconfig                            |    1 +
 net/Makefile                           |    1 +
 net/core/dev.c                         |    6 +-
 net/core/sock.c                        |    3 +
 net/ieee802154/Kconfig                 |   12 +
 net/ieee802154/Makefile                |    6 +
 net/ieee802154/af_ieee802154.c         |  312 ++++++++++
 net/ieee802154/beacon.c                |  251 ++++++++
 net/ieee802154/beacon_hash.c           |  105 ++++
 net/ieee802154/crc.c                   |   73 +++
 net/ieee802154/dev.c                   |  935 +++++++++++++++++++++++++++++
 net/ieee802154/dgram.c                 |  372 ++++++++++++
 net/ieee802154/mac_cmd.c               |  226 +++++++
 net/ieee802154/main.c                  |  175 ++++++
 net/ieee802154/mdev.c                  |  189 ++++++
 net/ieee802154/netlink.c               |  637 ++++++++++++++++++++
 net/ieee802154/raw.c                   |  249 ++++++++
 net/ieee802154/scan.c                  |  211 +++++++
 net/ieee802154/start.c                 |   46 ++
 40 files changed, 6642 insertions(+), 4 deletions(-)
 create mode 100644 drivers/ieee802154/Kconfig
 create mode 100644 drivers/ieee802154/Makefile
 create mode 100644 drivers/ieee802154/fakelb.c
 create mode 100644 drivers/ieee802154/serial.c
 create mode 100644 include/net/ieee802154/af_ieee802154.h
 create mode 100644 include/net/ieee802154/beacon.h
 create mode 100644 include/net/ieee802154/beacon_hash.h
 create mode 100644 include/net/ieee802154/const.h
 create mode 100644 include/net/ieee802154/crc.h
 create mode 100644 include/net/ieee802154/dev.h
 create mode 100644 include/net/ieee802154/mac_def.h
 create mode 100644 include/net/ieee802154/netdev.h
 create mode 100644 include/net/ieee802154/nl.h
 create mode 100644 include/net/ieee802154/phy.h
 create mode 100644 net/ieee802154/Kconfig
 create mode 100644 net/ieee802154/Makefile
 create mode 100644 net/ieee802154/af_ieee802154.c
 create mode 100644 net/ieee802154/beacon.c
 create mode 100644 net/ieee802154/beacon_hash.c
 create mode 100644 net/ieee802154/crc.c
 create mode 100644 net/ieee802154/dev.c
 create mode 100644 net/ieee802154/dgram.c
 create mode 100644 net/ieee802154/mac_cmd.c
 create mode 100644 net/ieee802154/main.c
 create mode 100644 net/ieee802154/mdev.c
 create mode 100644 net/ieee802154/netlink.c
 create mode 100644 net/ieee802154/raw.c
 create mode 100644 net/ieee802154/scan.c
 create mode 100644 net/ieee802154/start.c
Signature · 7 lines
With best wishes
Dmitry

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

PATCH 1/5 Add constants for the ieee 802.15.4/ZigBee stack

IEEE 802.15.4/ZigBee stack requires several constants to be defined/adjusted.

---
 include/linux/if.h       |    2 ++
 include/linux/if_arp.h   |    2 ++
 include/linux/if_ether.h |    2 ++
 include/linux/socket.h   |    6 +++++-
 net/core/dev.c           |    6 ++++--
 net/core/sock.c          |    3 +++
 6 files changed, 18 insertions(+), 3 deletions(-)
include/linux/if.h +2 -0
index 1108f3e..3f574b8 100644
@@ -68,6 +68,8 @@
 #define IFF_MASTER_ARPMON 0x100		/* bonding master, ARP mon in use */
 #define IFF_WAN_HDLC	0x200		/* WAN HDLC device		*/
 
+#define IFF_IEEE802154_COORD 0x100	/* IEEE802.15.4 PAN coordinator */
+
 #define IF_GET_IFACE	0x0001		/* for querying only */
 #define IF_GET_PROTO	0x0002
 
include/linux/if_arp.h +2 -0
index 5ff8980..b554300 100644
@@ -86,6 +86,8 @@
 #define ARPHRD_IEEE80211 801		/* IEEE 802.11			*/
 #define ARPHRD_IEEE80211_PRISM 802	/* IEEE 802.11 + Prism2 header  */
 #define ARPHRD_IEEE80211_RADIOTAP 803	/* IEEE 802.11 + radiotap header */
+#define ARPHRD_IEEE802154	  804
+#define ARPHRD_IEEE802154_PHY	  805
 
 #define ARPHRD_PHONET	820		/* PhoNet media type		*/
 #define ARPHRD_PHONET_PIPE 821		/* PhoNet pipe header		*/
include/linux/if_ether.h +2 -0
index cfe4fe1..0a08e92 100644
@@ -106,6 +106,8 @@
 #define ETH_P_DSA	0x001B		/* Distributed Switch Arch.	*/
 #define ETH_P_TRAILER	0x001C		/* Trailer switch tagging	*/
 #define ETH_P_PHONET	0x00F5		/* Nokia Phonet frames          */
+#define ETH_P_IEEE802154 0x00F6		/* IEEE802.15.4 frame		*/
+#define ETH_P_IEEE802154_MAC 0x00F7	/* IEEE802.15.4 MAC frame	*/
 
 /*
  *	This is an Ethernet frame header.
include/linux/socket.h +5 -1
index 421afb4..09d792e 100644
@@ -194,7 +194,9 @@ struct ucred {
 #define AF_RXRPC	33	/* RxRPC sockets 		*/
 #define AF_ISDN		34	/* mISDN sockets 		*/
 #define AF_PHONET	35	/* Phonet sockets		*/
-#define AF_MAX		36	/* For now.. */
+#define AF_IEEE802154	36	/* IEEE802154 sockets		*/
+#define AF_ZIGBEE	37	/* ZIGBEE sockets		*/
+#define AF_MAX		38	/* For now.. */
 
 /* Protocol families, same as address families. */
 #define PF_UNSPEC	AF_UNSPEC
@@ -233,6 +235,8 @@ struct ucred {
 #define PF_RXRPC	AF_RXRPC
 #define PF_ISDN		AF_ISDN
 #define PF_PHONET	AF_PHONET
+#define PF_IEEE802154	AF_IEEE802154
+#define PF_ZIGBEE	AF_ZIGBEE
 #define PF_MAX		AF_MAX
 
 /* Maximum queue length specifiable by listen.  */
net/core/dev.c +4 -2
index e2e9e4a..4119dfc 100644
@@ -268,7 +268,8 @@ static const unsigned short netdev_lock_type[] =
 	 ARPHRD_IRDA, ARPHRD_FCPP, ARPHRD_FCAL, ARPHRD_FCPL,
 	 ARPHRD_FCFABRIC, ARPHRD_IEEE802_TR, ARPHRD_IEEE80211,
 	 ARPHRD_IEEE80211_PRISM, ARPHRD_IEEE80211_RADIOTAP, ARPHRD_PHONET,
-	 ARPHRD_PHONET_PIPE, ARPHRD_VOID, ARPHRD_NONE};
+	 ARPHRD_PHONET_PIPE, ARPHRD_IEEE802154, ARPHRD_IEEE802154_PHY,
+	 ARPHRD_VOID, ARPHRD_NONE};
 
 static const char *netdev_lock_name[] =
 	{"_xmit_NETROM", "_xmit_ETHER", "_xmit_EETHER", "_xmit_AX25",
@@ -285,7 +286,8 @@ static const char *netdev_lock_name[] =
 	 "_xmit_IRDA", "_xmit_FCPP", "_xmit_FCAL", "_xmit_FCPL",
 	 "_xmit_FCFABRIC", "_xmit_IEEE802_TR", "_xmit_IEEE80211",
 	 "_xmit_IEEE80211_PRISM", "_xmit_IEEE80211_RADIOTAP", "_xmit_PHONET",
-	 "_xmit_PHONET_PIPE", "_xmit_VOID", "_xmit_NONE"};
+	 "_xmit_PHONET_PIPE", "_xmit_IEEE802154", "_xmit_IEEE802154_PHY",
+	 "_xmit_VOID", "_xmit_NONE"};
 
 static struct lock_class_key netdev_xmit_lock_key[ARRAY_SIZE(netdev_lock_type)];
 static struct lock_class_key netdev_addr_lock_key[ARRAY_SIZE(netdev_lock_type)];
net/core/sock.c +3 -0
index 7dbf3ff..72d593b 100644
@@ -155,6 +155,7 @@ static const char *af_family_key_strings[AF_MAX+1] = {
   "sk_lock-27"       , "sk_lock-28"          , "sk_lock-AF_CAN"      ,
   "sk_lock-AF_TIPC"  , "sk_lock-AF_BLUETOOTH", "sk_lock-IUCV"        ,
   "sk_lock-AF_RXRPC" , "sk_lock-AF_ISDN"     , "sk_lock-AF_PHONET"   ,
+  "sk_lock-AF_IEEE802154", "sk_lock-AF_ZIGBEE",
   "sk_lock-AF_MAX"
 };
 static const char *af_family_slock_key_strings[AF_MAX+1] = {
@@ -170,6 +171,7 @@ static const char *af_family_slock_key_strings[AF_MAX+1] = {
   "slock-27"       , "slock-28"          , "slock-AF_CAN"      ,
   "slock-AF_TIPC"  , "slock-AF_BLUETOOTH", "slock-AF_IUCV"     ,
   "slock-AF_RXRPC" , "slock-AF_ISDN"     , "slock-AF_PHONET"   ,
+  "slock-AF_IEEE802154", "slock-AF_ZIGBEE",
   "slock-AF_MAX"
 };
 static const char *af_family_clock_key_strings[AF_MAX+1] = {
@@ -185,6 +187,7 @@ static const char *af_family_clock_key_strings[AF_MAX+1] = {
   "clock-27"       , "clock-28"          , "clock-AF_CAN"      ,
   "clock-AF_TIPC"  , "clock-AF_BLUETOOTH", "clock-AF_IUCV"     ,
   "clock-AF_RXRPC" , "clock-AF_ISDN"     , "clock-AF_PHONET"   ,
+  "clock-AF_IEEE802154", "clock-AF_ZIGBEE",
   "clock-AF_MAX"
 };
 
Signature · 1 line
1.6.2.4
#2 lore raw

PATCH 2/5 net: add IEEE 802.15.4 partial implementation

Add support for communication over IEEE 802.15.4 networks. This implementation is neither certified nor complete, but aims to that goal. This commit contains only parts of MAC implementation, socket code and drivers supporting this stack will follow.

Initial implementation was done by Maxim Gorbachyov, Maxim Osipov and Pavel Smolensky as a research project at Siemens AG. Later the stack was heavily reworked to better suit the linux networking model, and is now maitained as an open project partially sponsored by Siemens.

---
 include/net/ieee802154/af_ieee802154.h |   65 +++
 include/net/ieee802154/beacon.h        |   53 ++
 include/net/ieee802154/beacon_hash.h   |   40 ++
 include/net/ieee802154/const.h         |  696 ++++++++++++++++++++++++
 include/net/ieee802154/crc.h           |   38 ++
 include/net/ieee802154/dev.h           |  107 ++++
 include/net/ieee802154/mac_def.h       |   96 ++++
 include/net/ieee802154/netdev.h        |   74 +++
 include/net/ieee802154/nl.h            |  166 ++++++
 include/net/ieee802154/phy.h           |  117 ++++
 net/Kconfig                            |    1 +
 net/Makefile                           |    1 +
 net/ieee802154/Kconfig                 |   12 +
 net/ieee802154/Makefile                |    5 +
 net/ieee802154/beacon.c                |  251 +++++++++
 net/ieee802154/beacon_hash.c           |  105 ++++
 net/ieee802154/crc.c                   |   73 +++
 net/ieee802154/dev.c                   |  935 ++++++++++++++++++++++++++++++++
 net/ieee802154/mac_cmd.c               |  226 ++++++++
 net/ieee802154/main.c                  |  175 ++++++
 net/ieee802154/mdev.c                  |  189 +++++++
 net/ieee802154/netlink.c               |  637 ++++++++++++++++++++++
 net/ieee802154/scan.c                  |  211 +++++++
 net/ieee802154/start.c                 |   46 ++
 24 files changed, 4319 insertions(+), 0 deletions(-)
 create mode 100644 include/net/ieee802154/af_ieee802154.h
 create mode 100644 include/net/ieee802154/beacon.h
 create mode 100644 include/net/ieee802154/beacon_hash.h
 create mode 100644 include/net/ieee802154/const.h
 create mode 100644 include/net/ieee802154/crc.h
 create mode 100644 include/net/ieee802154/dev.h
 create mode 100644 include/net/ieee802154/mac_def.h
 create mode 100644 include/net/ieee802154/netdev.h
 create mode 100644 include/net/ieee802154/nl.h
 create mode 100644 include/net/ieee802154/phy.h
 create mode 100644 net/ieee802154/Kconfig
 create mode 100644 net/ieee802154/Makefile
 create mode 100644 net/ieee802154/beacon.c
 create mode 100644 net/ieee802154/beacon_hash.c
 create mode 100644 net/ieee802154/crc.c
 create mode 100644 net/ieee802154/dev.c
 create mode 100644 net/ieee802154/mac_cmd.c
 create mode 100644 net/ieee802154/main.c
 create mode 100644 net/ieee802154/mdev.c
 create mode 100644 net/ieee802154/netlink.c
 create mode 100644 net/ieee802154/scan.c
 create mode 100644 net/ieee802154/start.c
include/net/ieee802154/af_ieee802154.h new file +65 -0
new file mode 100644
index 0000000..6eb7f51
@@ -0,0 +1,65 @@
+/*
+ * IEEE 802.15.4 inteface for userspace
+ *
+ * Copyright 2007, 2008 Siemens AG
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Written by:
+ * Sergey Lapin <[email protected]>
+ * Dmitry Eremin-Solenikov <[email protected]>
+ */
+
+#ifndef _AF_IEEE802154_H
+#define _AF_IEEE802154_H
+
+#include <linux/socket.h> /* for sa_family_t */
+
+enum {
+	IEEE802154_ADDR_NONE = 0x0,
+	/* RESERVED = 0x01, */
+	IEEE802154_ADDR_SHORT = 0x2, /* 16-bit address + PANid */
+	IEEE802154_ADDR_LONG = 0x3, /* 64-bit address + PANid */
+};
+
+/* address length, octets */
+#define IEEE802154_ADDR_LEN	8
+
+struct ieee802154_addr {
+	int addr_type;
+	u16 pan_id;
+	union {
+		u8 hwaddr[IEEE802154_ADDR_LEN];
+		u16 short_addr;
+	};
+};
+
+struct sockaddr_ieee802154 {
+	sa_family_t family; /* AF_IEEE802154 */
+	struct ieee802154_addr addr;
+};
+
+/* master device */
+#define IEEE802154_SIOC_ADD_SLAVE		(SIOCDEVPRIVATE + 0)
+
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+#include <linux/netdevice.h>
+extern struct proto ieee802154_raw_prot;
+extern struct proto ieee802154_dgram_prot;
+void ieee802154_raw_deliver(struct net_device *dev, struct sk_buff *skb);
+int ieee802154_dgram_deliver(struct net_device *dev, struct sk_buff *skb);
+#endif
+
+#endif
include/net/ieee802154/beacon.h new file +53 -0

53 lines not on this page · raw message

include/net/ieee802154/beacon_hash.h new file +40 -0
new file mode 100644
index 0000000..db8457c
@@ -0,0 +1,40 @@
+/*
+ * MAC beacon hash storage
+ *
+ * Copyright 2007, 2008 Siemens AG
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Written by:
+ * Sergey Lapin <[email protected]>
+ * Dmitry Eremin-Solenikov <[email protected]>
+ */
+
+#ifndef IEEE802154_BEACON_HASH_H
+#define IEEE802154_BEACON_HASH_H
+
+#define IEEE802154_BEACON_HTABLE_SIZE 256
+
+struct beacon_node {
+	struct hlist_node list;
+	struct ieee802154_addr coord_addr;
+	u16 pan_addr;
+};
+struct beacon_node *ieee802154_beacon_find_pan(struct ieee802154_addr *coord_addr,
+			u16 pan_addr);
+void ieee802154_beacon_hash_add(struct ieee802154_addr *coord_addr);
+void ieee802154_beacon_hash_del(struct ieee802154_addr *coord_addr);
+void ieee802154_beacon_hash_dump(void);
+#endif
+
include/net/ieee802154/const.h new file +696 -0

696 lines not on this page · raw message

include/net/ieee802154/crc.h new file +38 -0
new file mode 100644
index 0000000..5b37218
@@ -0,0 +1,38 @@
+/*
+ * based on crc-itu-t.c.
+ * Basically it's CRC-ITU-T but with inverted bit numbering
+ *
+ * Copyright 2007, 2008 Siemens AG
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Written by:
+ * 	Dmitry Eremin-Solenikov <[email protected]>
+ */
+
+extern const u16 ieee802154_crc_table[256];
+
+static inline u16 ieee802154_crc_byte(u16 crc, const u8 data)
+{
+	return (crc >> 8) ^ ieee802154_crc_table[(crc ^ data) & 0xff];
+}
+
+static inline u16 ieee802154_crc(u16 crc, const u8 *buffer, size_t len)
+{
+	while (len--)
+		crc = ieee802154_crc_byte(crc, *buffer++);
+	return crc;
+}
+
+
include/net/ieee802154/dev.h new file +107 -0

107 lines not on this page · raw message

include/net/ieee802154/mac_def.h new file +96 -0

96 lines not on this page · raw message

include/net/ieee802154/netdev.h new file +74 -0

74 lines not on this page · raw message

include/net/ieee802154/nl.h new file +166 -0

166 lines not on this page · raw message

include/net/ieee802154/phy.h new file +117 -0

117 lines not on this page · raw message

net/Kconfig +1 -0
index c19f549..7051b97 100644
@@ -179,6 +179,7 @@ source "net/lapb/Kconfig"
 source "net/econet/Kconfig"
 source "net/wanrouter/Kconfig"
 source "net/phonet/Kconfig"
+source "net/ieee802154/Kconfig"
 source "net/sched/Kconfig"
 source "net/dcb/Kconfig"
 
net/Makefile +1 -0
index 9e00a55..ba324ae 100644
@@ -60,6 +60,7 @@ obj-$(CONFIG_NET_9P)		+= 9p/
 ifneq ($(CONFIG_DCB),)
 obj-y				+= dcb/
 endif
+obj-y				+= ieee802154/
 
 ifeq ($(CONFIG_NET),y)
 obj-$(CONFIG_SYSCTL)		+= sysctl_net.o
net/ieee802154/Kconfig new file +12 -0
new file mode 100644
index 0000000..f540cd1
@@ -0,0 +1,12 @@
+config IEEE802154
+	tristate "IEEE Std 802.15.4 Low-Rate Wireless Personal Area Networks support (EXPERIMENTAL)"
+	depends on EXPERIMENTAL
+	---help---
+	  IEEE Std 802.15.4 defines a low data rate, low power and low complexity
+	  short range wireless personal area networks. It was designed to
+	  organise networks of sensors, switches, etc automation devices. Maximum
+	  allowed data rate is 250 kb/s and typical personal operating space
+	  around 10m.
+
+	  Say Y here to compile LR-WPAN support into the kernel or say M to
+	  compile it as modules.
net/ieee802154/Makefile new file +5 -0
new file mode 100644
index 0000000..d964365
@@ -0,0 +1,5 @@
+obj-$(CONFIG_IEEE802154) +=	ieee802154.o
+ieee802154-objs		:= main.o mdev.o dev.o netlink.o mac_cmd.o scan.o \
+			crc.o beacon.o beacon_hash.o start.o
+
+EXTRA_CFLAGS += -Wall -DDEBUG
net/ieee802154/beacon.c new file +251 -0

251 lines not on this page · raw message

net/ieee802154/beacon_hash.c new file +105 -0

105 lines not on this page · raw message

net/ieee802154/crc.c new file +73 -0

73 lines not on this page · raw message

net/ieee802154/dev.c new file +935 -0

935 lines not on this page · raw message

net/ieee802154/mac_cmd.c new file +226 -0

153 lines not on this page · raw message

net/ieee802154/main.c new file +175 -0

175 lines not on this page · raw message

net/ieee802154/mdev.c new file +189 -0

189 lines not on this page · raw message

net/ieee802154/netlink.c new file +637 -0

637 lines not on this page · raw message

net/ieee802154/scan.c new file +211 -0

211 lines not on this page · raw message

net/ieee802154/start.c new file +46 -0

46 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.2.4

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH 3/5 ieee802154: add socket address family code

Add support for BSD sockets over the IEEE 802.15.4 networks. One can either send RAW datagrams or use SOCK_DGRAM to encapsulate data inside normal IEEE 802.15.4 packets.

---
 net/ieee802154/Makefile        |    3 +-
 net/ieee802154/af_ieee802154.c |  312 +++++++++++++++++++++++++++++++++
 net/ieee802154/dgram.c         |  372 ++++++++++++++++++++++++++++++++++++++++
 net/ieee802154/raw.c           |  249 +++++++++++++++++++++++++++
 4 files changed, 935 insertions(+), 1 deletions(-)
 create mode 100644 net/ieee802154/af_ieee802154.c
 create mode 100644 net/ieee802154/dgram.c
 create mode 100644 net/ieee802154/raw.c
net/ieee802154/Makefile +2 -1
index d964365..aace5b1 100644
@@ -1,5 +1,6 @@
-obj-$(CONFIG_IEEE802154) +=	ieee802154.o
+obj-$(CONFIG_IEEE802154) +=	ieee802154.o af_802154.o
 ieee802154-objs		:= main.o mdev.o dev.o netlink.o mac_cmd.o scan.o \
 			crc.o beacon.o beacon_hash.o start.o
+af_802154-objs		:= af_ieee802154.o raw.o dgram.o
 
 EXTRA_CFLAGS += -Wall -DDEBUG
net/ieee802154/af_ieee802154.c new file +312 -0

312 lines not on this page · raw message

net/ieee802154/dgram.c new file +372 -0

372 lines not on this page · raw message

net/ieee802154/raw.c new file +249 -0

249 lines not on this page · raw message

Signature · 1 line
1.6.2.4

A message that is not in the archive (sent off-list or not yet received): 1243336988-20109-3-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#5 lore raw

PATCH 4/5 ieee802154: add virtual loopback driver

fakelb is a virtual loopback driver implementing one or several interconnected radios. Packets from the radio are either sent back to the node (if no other fake radio are registered) or to all other fake radio.

---
 drivers/Makefile            |    1 +
 drivers/ieee802154/Kconfig  |   23 +++
 drivers/ieee802154/Makefile |    3 +
 drivers/ieee802154/fakelb.c |  335 +++++++++++++++++++++++++++++++++++++++++++
 drivers/net/Kconfig         |    2 +
 5 files changed, 364 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ieee802154/Kconfig
 create mode 100644 drivers/ieee802154/Makefile
 create mode 100644 drivers/ieee802154/fakelb.c
drivers/Makefile +1 -0
index 1266ead..9e7d4e5 100644
@@ -107,3 +107,4 @@ obj-$(CONFIG_SSB)		+= ssb/
 obj-$(CONFIG_VIRTIO)		+= virtio/
 obj-$(CONFIG_STAGING)		+= staging/
 obj-y				+= platform/
+obj-y				+= ieee802154/
drivers/ieee802154/Kconfig new file +23 -0
new file mode 100644
index 0000000..6f03394
@@ -0,0 +1,23 @@
+menuconfig IEEE802154_DRIVERS
+	bool "IEEE 802.15.4 drivers"
+	depends on NETDEVICES && IEEE802154
+	default y
+	---help---
+	  Say Y here to get to see options for IEEE 802.15.4 Low-Rate
+	  Wireless Personal Area Network device drivers. This option alone
+	  does not add any kernel code.
+
+	  If you say N, all options in this submenu will be skipped and disabled.
+
+if IEEE802154_DRIVERS && NETDEVICES && IEEE802154
+config IEEE802154_FAKELB
+	tristate "Fake LR-WPAN driver with several interconnected devices"
+	---help---
+	  Say Y here to enable the fake driver that can emulate a net
+          of several interconnected radio devices.
+
+          This driver can also be built as a module. To do so say M here.
+	  The module will be called 'fakelb'.
+
+endif
+
drivers/ieee802154/Makefile new file +3 -0
new file mode 100644
index 0000000..c3d1db4
@@ -0,0 +1,3 @@
+obj-$(CONFIG_IEEE802154_FAKELB) += fakelb.o
+
+EXTRA_CFLAGS += -DDEBUG -DCONFIG_FFD
drivers/ieee802154/fakelb.c new file +335 -0

335 lines not on this page · raw message

drivers/net/Kconfig +2 -0
index 214a92d..ec8cf21 100644
@@ -2704,6 +2704,8 @@ source "drivers/net/wan/Kconfig"
 
 source "drivers/atm/Kconfig"
 
+source "drivers/ieee802154/Kconfig"
+
 source "drivers/s390/net/Kconfig"
 
 config XEN_NETDEV_FRONTEND
Signature · 6 lines
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

PATCH 5/5 ieee802154: add serial dongle driver

Add a tty ldisc supporting IEEE 802.15.4 over serial line. Currently the only protocol implemented/device supported is our firmware for Freescale 13192 evaluation boards.

---
 drivers/ieee802154/Kconfig  |    3 +
 drivers/ieee802154/Makefile |    1 +
 drivers/ieee802154/serial.c | 1001 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/tty.h         |    3 +-
 4 files changed, 1007 insertions(+), 1 deletions(-)
 create mode 100644 drivers/ieee802154/serial.c
drivers/ieee802154/Kconfig +3 -0
index 6f03394..fdc9792 100644
@@ -19,5 +19,8 @@ config IEEE802154_FAKELB
           This driver can also be built as a module. To do so say M here.
 	  The module will be called 'fakelb'.
 
+config IEEE802154_SERIAL
+	tristate "Simple LR-WPAN UART driver"
+
 endif
 
drivers/ieee802154/Makefile +1 -0
index c3d1db4..a8ce95f 100644
@@ -1,3 +1,4 @@
 obj-$(CONFIG_IEEE802154_FAKELB) += fakelb.o
+obj-$(CONFIG_IEEE802154_SERIAL) += serial.o
 
 EXTRA_CFLAGS += -DDEBUG -DCONFIG_FFD
drivers/ieee802154/serial.c new file +1001 -0

1,001 lines not on this page · raw message

include/linux/tty.h +2 -1
index fc39db9..f533beb 100644
@@ -23,7 +23,7 @@
  */
 #define NR_UNIX98_PTY_DEFAULT	4096      /* Default maximum for Unix98 ptys */
 #define NR_UNIX98_PTY_MAX	(1 << MINORBITS) /* Absolute limit */
-#define NR_LDISCS		19
+#define NR_LDISCS		20
 
 /* line disciplines */
 #define N_TTY		0
@@ -46,6 +46,7 @@
 #define N_GIGASET_M101	16	/* Siemens Gigaset M101 serial DECT adapter */
 #define N_SLCAN		17	/* Serial / USB serial CAN Adaptors */
 #define N_PPS		18	/* Pulse per Second */
+#define N_IEEE802154	19	/* Serial / USB serial IEEE802154.4 devices */
 
 /*
  * This character is the same as _POSIX_VDISABLE: it cannot be used as
Signature · 1 line
1.6.2.4

A message that is not in the archive (sent off-list or not yet received): 1243336988-20109-2-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#8 lore raw

Re: [PATCH 2/5] net: add IEEE 802.15.4 partial implementation

On Tue, 2009-05-26 at 15:23 +0400, Dmitry Eremin-Solenikov wrote:
[...]

Quoted 5 lines
include/net/ieee802154/af_ieee802154.h new file +0 -0
new file mode 100644
index 0000000..6eb7f51

[...]

include/net/ieee802154/af_ieee802154.h line 58

Quoted 3 lines
include/net/ieee802154/af_ieee802154.h new file +3 -0
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+#include <linux/netdevice.h>

The struct declarations would be sufficient.

Quoted 12 lines
include/net/ieee802154/af_ieee802154.h new file +7 -0
+extern struct proto ieee802154_raw_prot;
+extern struct proto ieee802154_dgram_prot;
+void ieee802154_raw_deliver(struct net_device *dev, struct sk_buff *skb);
+int ieee802154_dgram_deliver(struct net_device *dev, struct sk_buff *skb);
+#endif
+
+#endif
include/net/ieee802154/beacon.h new file +0 -0
new file mode 100644
index 0000000..baca263

[...]

include/net/ieee802154/beacon.h line 39

Quoted 9 lines
include/net/ieee802154/beacon.h new file +9 -0
+/* Per spec; optimizations are needed */
+struct ieee802154_pandsc {
+	struct list_head	list;
+	struct ieee802154_addr	addr; /* Contains panid */
+	int			channel;
+	u16			sf;
+	bool			gts_permit;
+	u8			lqi;
+	u32			timestamp; /* FIXME */

When and how does this need to be fixed, if at all?

Quoted 4 lines
include/net/ieee802154/beacon.h new file +4 -0
+	bool			security;
+	u8			mac_sec;
+	bool			sec_fail;
+};

[...]

Quoted 2 lines
include/net/ieee802154/const.h new file +0 -0

[...]

Quoted 5 lines

+/* Time related constants, in microseconds.
+ *
+ * The 1SYM_TIME values are shown how much time is needed to transmit one
+ * symbol across media.
+ * The callculation is following:

Quoted 8 lines

+ * For a 2450 MHZ radio freq rate is 62,5 ksym/sec. A byte (8 bit) transfered
+ * by low 4 bits in first symbol, high 4 bits in next symbol. So, to transmit
+ * 1 byte in 2450Mhz freq 2 symbols are needed. Therefore we have 31,25 kbyte/sec
+ * rate. 1 symbol transfered in 16*10^(-6) sec, or 16 microseconds.
+ * For a 868Mhz and 915Mhz, 1 symbol is equal to 1 byte. So, we have 20kbyte/sec
+ * and 40 kbyte/sec respectively. And 5*10^(-5) sec and 2,5*10(-5) sec,
+ * or 50 and 25 microseconds respectively for 868Mhz and 915Mhz freq.
+ */

This is so verbose as to be unhelpful. Since the following constants only refer to symbol time, it should be sufficient to refer to the specified symbol rates.

include/net/ieee802154/const.h line 53

Quoted 10 lines
include/net/ieee802154/const.h new file +10 -0
+#define IEEE802154_2450MHZ_1SYM_TIME	16
+#define IEEE802154_868MHZ_1SYM_TIME	50
+#define IEEE802154_915MHZ_1SYM_TIME	25
+
+/******************************************************************************/
+/* MAC constants */
+/******************************************************************************/
+/** The number of symbols forming a superframe slot when the superframe order
+ * is equal to 0.
+ */

Don't use two asterisks at the start of a comment unless it's in kernel-doc format.

[...]

Quoted 5 lines

+/**
+ * \brief PHY return codes description
+ *
+ * The return values of PHY operations
+ */

...and definitely don't use Doxygen format.

[...]

Quoted 1 line

+/* #define ZB_ED_EDGE 0x7f */

Define it or delete it.

include/net/ieee802154/const.h line 694

Quoted 4 lines
include/net/ieee802154/const.h new file +4 -0
+/* I've got 0xBE on idle channel; let threshold be a little higher */
+#define ZB_ED_EDGE	0xc8
+/* In an ideal world this should be 1 */
+#define IEEE802154_SLOW_SERIAL_FIXUP	75

Yes but what are these *for*?

include/net/ieee802154/crc.h line 3

Quoted 10 lines
include/net/ieee802154/const.h new file +1 -0
+#endif /* IEEE802154_CONST_H */
include/net/ieee802154/crc.h new file +3 -0
new file mode 100644
index 0000000..5b37218
@@ -0,0 +1,38 @@
+/*
+ * based on crc-itu-t.c.
+ * Basically it's CRC-ITU-T but with inverted bit numbering

This can probably be handled by crc_itu_t_bitreversed():

http://svn.debian.org/wsvn/kernel/dists/trunk/linux-2.6/debian/patches/features/all/lib-crcitut-bit-reversed.patch

(That patch hasn't gone anywhere yet as Greg K-H is dragging his heels over actually fixing his crap, but feel free to resubmit it as part of your own patch series.)

[...]

Quoted 2 lines
include/net/ieee802154/nl.h new file +0 -0

[...]

Quoted 5 lines
include/net/ieee802154/nl.h new file +5 -0
+/* commands */
+/* REQ should be responded with CONF
+ * and INDIC with RESP
+ */
+enum {

include/net/ieee802154/nl.h line 122

Quoted 10 lines
include/net/ieee802154/nl.h new file +10 -0
+	__IEEE802154_COMMAND_INVALID,
+
+	IEEE802154_ASSOCIATE_REQ,
+	IEEE802154_ASSOCIATE_CONF,
+	IEEE802154_DISASSOCIATE_REQ,
+	IEEE802154_DISASSOCIATE_CONF,
+	IEEE802154_GET_REQ,
+	IEEE802154_GET_CONF,
+/* 	IEEE802154_GTS_REQ, */
+/* 	IEEE802154_GTS_CONF, */

Why are some of these commented out? Since they're apparently exposed to user-space you can't insert them later.

[...]

Quoted 2 lines
net/ieee802154/beacon.c new file +0 -0

[...]

Quoted 11 lines
net/ieee802154/beacon.c new file +11 -0
+	/* TODO GTS */
+	gts = 0;
+
+	if (flags & IEEE802154_BEACON_FLAG_GTSPERMIT)
+		gts |= IEEE802154_BEACON_GTS_PERMIT;
+	memcpy(skb_put(skb, sizeof(gts)), &gts, sizeof(gts));
+
+	/* FIXME pending address */
+	addr16_cnt = 0;
+	addr64_cnt = 0;
+#if 0

net/ieee802154/beacon.c line 186

Quoted 10 lines
net/ieee802154/beacon.c new file +10 -0
+	/* need more thinking about this */
+	list_for_each_entry(l, al->list, list) {
+		struct ieee802154_addr *s = container_of(l, struct list_head, list);
+		if (s->addr_type == IEEE802154_ADDR_LONG)
+			addr16_cnt++;
+
+		if (s->addr_type == IEEE802154_ADDR_SHORT)
+			addr64_cnt++;
+	}
+#endif

This all looks very unfinished - as do several other sections with FIXME, #if 0, commented-out code...

[...]

net/ieee802154/beacon.c

Quoted 3 lines
net/ieee802154/beacon.c new file +3 -0
+#define IEEE802154_FETCH_U64(skb, var)			\
+	do {						\
+		if (skb->len < IEEE802154_ADDR_LEN)	\

I see what you did there...

Quoted 3 lines
net/ieee802154/beacon.c new file +3 -0
+			goto exit_error;		\
+		fetch_skb_u64(skb, &var);		\
+	} while (0)

[...]

net/ieee802154/netlink.c line 2

Quoted 5 lines
net/ieee802154/netlink.c new file +2 -0
@@ -0,0 +1,637 @@
+/*
+ * Netlink intefcace for IEEE 802.15.4 stack

[...]

Speling misstake.

Ben.

Signature · 2 lines
Ben Hutchings
Teamwork is essential - it allows you to blame someone else.
#9 lore raw

Re: [PATCH 2/5] net: add IEEE 802.15.4 partial implementation

Quoted 14 lines

[...]

Quoted 2 lines
include/net/ieee802154/nl.h new file +0 -0

[...]

Quoted 10 lines
include/net/ieee802154/nl.h new file +10 -0
+/* commands */
+/* REQ should be responded with CONF
+ * and INDIC with RESP
+ */
+enum {
+     __IEEE802154_COMMAND_INVALID,
+
+     IEEE802154_ASSOCIATE_REQ,
+     IEEE802154_ASSOCIATE_CONF,
+     IEEE802154_DISASSOCIATE_REQ,
Quoted 9 lines

include/net/ieee802154/nl.h line 122

Quoted 5 lines

+     IEEE802154_DISASSOCIATE_CONF,
+     IEEE802154_GET_REQ,
+     IEEE802154_GET_CONF,

include/net/ieee802154/nl.h new file +2 -0
+/*   IEEE802154_GTS_REQ, */
+/*   IEEE802154_GTS_CONF, */

Why are some of these commented out?  Since they're apparently exposed to user-space you can't insert them later.

We are working to define a next version of netlink API for the stack right now. But taking into account, that iz tool & upper layers of stack will be the only users of this API at least for next year, and IEEE802.15.4 spec is evolving, it is probably not necessary to come up with a very final version.

Kind regards,
Maxim

#10 lore raw

Re: [PATCH 2/5] net: add IEEE 802.15.4 partial implementation

In reply to Ben Hutchings
Quoted 8 lines · Ben Hutchings

On Tue, 2009-05-26 at 15:23 +0400, Dmitry Eremin-Solenikov wrote:
[...]

Quoted 5 lines
include/net/ieee802154/af_ieee802154.h new file +0 -0
new file mode 100644
index 0000000..6eb7f51

[...]

Quoted 5 lines

include/net/ieee802154/af_ieee802154.h line 58

Quoted 3 lines
include/net/ieee802154/af_ieee802154.h new file +3 -0
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+#include <linux/netdevice.h>

The struct declarations would be sufficient.

Do you mean just:
struct sk_buff;
struct net_device;

Quoted 26 lines
Quoted 11 lines
include/net/ieee802154/af_ieee802154.h new file +7 -0
+extern struct proto ieee802154_raw_prot;
+extern struct proto ieee802154_dgram_prot;
+void ieee802154_raw_deliver(struct net_device *dev, struct sk_buff *skb);
+int ieee802154_dgram_deliver(struct net_device *dev, struct sk_buff *skb);
+#endif
+
+#endif
include/net/ieee802154/const.h new file +0 -0

[...]

Quoted 5 lines

+/* Time related constants, in microseconds.
+ *
+ * The 1SYM_TIME values are shown how much time is needed to transmit one
+ * symbol across media.
+ * The callculation is following:

Quoted 8 lines

+ * For a 2450 MHZ radio freq rate is 62,5 ksym/sec. A byte (8 bit) transfered
+ * by low 4 bits in first symbol, high 4 bits in next symbol. So, to transmit
+ * 1 byte in 2450Mhz freq 2 symbols are needed. Therefore we have 31,25 kbyte/sec
+ * rate. 1 symbol transfered in 16*10^(-6) sec, or 16 microseconds.
+ * For a 868Mhz and 915Mhz, 1 symbol is equal to 1 byte. So, we have 20kbyte/sec
+ * and 40 kbyte/sec respectively. And 5*10^(-5) sec and 2,5*10(-5) sec,
+ * or 50 and 25 microseconds respectively for 868Mhz and 915Mhz freq.
+ */

Quoted 3 lines

This is so verbose as to be unhelpful. Since the following constants only refer to symbol time, it should be sufficient to refer to the specified symbol rates.

const.h was inherited from the previous implementation of our stack. I somehow missed that it needs a bit of polishing. A great bit.

Quoted 13 lines

include/net/ieee802154/crc.h line 3

Quoted 10 lines
include/net/ieee802154/const.h new file +1 -0
+#endif /* IEEE802154_CONST_H */
include/net/ieee802154/crc.h new file +3 -0
new file mode 100644
index 0000000..5b37218
@@ -0,0 +1,38 @@
+/*
+ * based on crc-itu-t.c.
+ * Basically it's CRC-ITU-T but with inverted bit numbering

This can probably be handled by crc_itu_t_bitreversed():

Quoted 5 lines

http://svn.debian.org/wsvn/kernel/dists/trunk/linux-2.6/debian/patches/features/all/lib-crcitut-bit-reversed.patch

(That patch hasn't gone anywhere yet as Greg K-H is dragging his heels over actually fixing his crap, but feel free to resubmit it as part of your own patch series.)

Fine, I'll use this patch.

Quoted 14 lines

[...]

Quoted 2 lines
include/net/ieee802154/nl.h new file +0 -0

[...]

Quoted 10 lines
include/net/ieee802154/nl.h new file +10 -0
+/* commands */
+/* REQ should be responded with CONF
+ * and INDIC with RESP
+ */
+enum {
+	__IEEE802154_COMMAND_INVALID,
+
+	IEEE802154_ASSOCIATE_REQ,
+	IEEE802154_ASSOCIATE_CONF,
+	IEEE802154_DISASSOCIATE_REQ,
Quoted 8 lines

include/net/ieee802154/nl.h line 122

Quoted 5 lines
include/net/ieee802154/nl.h new file +5 -0
+	IEEE802154_DISASSOCIATE_CONF,
+	IEEE802154_GET_REQ,
+	IEEE802154_GET_CONF,
+/* 	IEEE802154_GTS_REQ, */
+/* 	IEEE802154_GTS_CONF, */

Why are some of these commented out? Since they're apparently exposed to user-space you can't insert them later.

Those are not implemented yet. We planned on appending them later to the end of this enum. Most probably I'll just uncomment them and add simple stubs returning an error instead.

Quoted 21 lines

[...]

Quoted 2 lines
net/ieee802154/beacon.c new file +0 -0

[...]

Quoted 16 lines
net/ieee802154/beacon.c new file +16 -0
+	/* TODO GTS */
+	gts = 0;
+
+	if (flags & IEEE802154_BEACON_FLAG_GTSPERMIT)
+		gts |= IEEE802154_BEACON_GTS_PERMIT;
+	memcpy(skb_put(skb, sizeof(gts)), &gts, sizeof(gts));
+
+	/* FIXME pending address */
+	addr16_cnt = 0;
+	addr64_cnt = 0;
+#if 0
+	/* need more thinking about this */
+	list_for_each_entry(l, al->list, list) {
+		struct ieee802154_addr *s = container_of(l, struct list_head, list);
+		if (s->addr_type == IEEE802154_ADDR_LONG)
+			addr16_cnt++;
Quoted 8 lines

net/ieee802154/beacon.c line 186

Quoted 5 lines
net/ieee802154/beacon.c new file +5 -0
+
+		if (s->addr_type == IEEE802154_ADDR_SHORT)
+			addr64_cnt++;
+	}
+#endif

This all looks very unfinished - as do several other sections with FIXME, #if 0, commented-out code...

As I said, the code is in early stage of development.

Quoted 7 lines

[...]

net/ieee802154/beacon.c

Quoted 3 lines
net/ieee802154/beacon.c new file +3 -0
+#define IEEE802154_FETCH_U64(skb, var)			\
+	do {						\
+		if (skb->len < IEEE802154_ADDR_LEN)	\

I see what you did there...

???

Quoted 4 lines
Quoted 3 lines
net/ieee802154/beacon.c new file +3 -0
+			goto exit_error;		\
+		fetch_skb_u64(skb, &var);		\
+	} while (0)

[...]

Signature · 7 lines
With best wishes
Dmitry

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#11 lore raw

Re: [PATCH 2/5] net: add IEEE 802.15.4 partial implementation

Quoted 15 lines · Dmitry Eremin-Solenikov
Quoted 8 lines · Ben Hutchings

On Tue, 2009-05-26 at 15:23 +0400, Dmitry Eremin-Solenikov wrote:
[...]

Quoted 5 lines
include/net/ieee802154/af_ieee802154.h new file +0 -0
new file mode 100644
index 0000000..6eb7f51

[...]

Quoted 5 lines

include/net/ieee802154/af_ieee802154.h line 58

Quoted 3 lines
include/net/ieee802154/af_ieee802154.h new file +3 -0
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+#include <linux/netdevice.h>

The struct declarations would be sufficient.

Quoted 3 lines

Do you mean just:
struct sk_buff;
struct net_device;

Right.

[...]

Quoted 9 lines
Quoted 7 lines

[...]

include/net/ieee802154/af_ieee802154.h

Quoted 3 lines
include/net/ieee802154/af_ieee802154.h new file +3 -0
+#define IEEE802154_FETCH_U64(skb, var)			\
+	do {						\
+		if (skb->len < IEEE802154_ADDR_LEN)	\

I see what you did there...

???

[...]

This macro works with u64 values, not specifically addresses, which happen to be 8 bytes long too. I infer that someone search-and-replaced instances of the literal 8 with IEEE802154_ADDR_LEN and wrongly replaced this instance.

Ben.

Signature · 2 lines
Ben Hutchings
Logic doesn't apply to the real world. - Marvin Minsky
#12 lore raw
In reply to Dmitry Eremin-Solenikov

Hi Dmitry,

Le Tuesday 26 May 2009 13:21:57 Dmitry Eremin-Solenikov, vous avez écrit :

Quoted 9 lines

Hi,

As a part of research activities in the Embedded Systems - Open Platform Group from Siemens Corporate Technology we are working on adding support for the IEEE 802.15.4 Wireless Personal Area Networks to the Linux. Our current implementation is neither certified nor even feature complete. However we'd like to present current state of our patchset to the Linux developers community to gain comments, fixes, ideas, etc. This is not yet a pull request, but more like an RFC.

Let met just thank you for doing this, I am glad some people worked on this. Got a couple of questions below.

Quoted 11 lines

The project page is available at
http://apps.sourceforge.net/trac/linux-zigbee with source code of kernel part available from git at
http://zigbee-linux.git.sourceforge.net, mirrored for convenience at
git://git.kernel.org/pub/scm/linux/kernel/git/lumag/lowpan.git

The source code for userspace utils is available from git at
http://linux-zigbee.git.sourceforge.net/

From the project page I understand that you plan on providing a ZigBee stack,

based on this 802.15.4 stack ? Do you plan on submitting the ZigBee stack later on ?

Maybe you should mention that this implementation is royalty-free, but that commercial products using it should both respect the GPL license and pay a ZigBee royalty as per the ZigBee Alliance . That is just for clarification since right now it simply does 802.15.4 which is not subject to this royalty thing.

Quoted 10 lines

Several comments about our implementation:
* As with 802.11 there are two types of devices: the smart ones that implement most parts of the protocol by themselves and more or less dumb ones which simply send and receive what they are told. Currently we do only support the second type of devices (SoftMAC)
* The implementation is split between code driving radio, (master, mwpanX
interface: mdev.c), code processing frames according the IEEE 802.15.4 rules (slave wpanX devices) and finally sockets (af_ieee802154.c,
dgram.c, raw.c).

This sounds good. Do you also plan on integrating some meshing algorithm on top of 802.15.4 ? If so,

Quoted 7 lines

* We do present two example drivers using our stack. One is purely virtual one either looping the packets back or connecting several virtual
interfaces (the one at fakelb.c), and the driver for the Freescale MC13192 evaluation boards (13192-SARD, 13192-EVK) using our custom firmware (currently only available at request, we are working on publishing it). The driver for the Atmel at86rf230/at86rf231 chips will follow in several weeks.

Is the virtual interface just like mac80211_hwsim for 802.11 ?h

Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------
#13 lore raw

2009/5/27 Florian Fainelli <[email protected]>:

Quoted 9 lines

Hi Dmitry,

Le Tuesday 26 May 2009 13:21:57 Dmitry Eremin-Solenikov, vous avez écrit :

Quoted 6 lines

The project page is available at
http://apps.sourceforge.net/trac/linux-zigbee with source code of kernel part available from git at
http://zigbee-linux.git.sourceforge.net, mirrored for convenience at
git://git.kernel.org/pub/scm/linux/kernel/git/lumag/lowpan.git

Quoted 6 lines
Quoted 2 lines

The source code for userspace utils is available from git at
http://linux-zigbee.git.sourceforge.net/

From the project page I understand that you plan on providing a ZigBee stack, based on this 802.15.4 stack ? Do you plan on submitting the ZigBee stack later on ?

The ZigBee stack currently is in design stage of development. When it will be more or less "in shape" we will present it to the community.

Quoted 5 lines

Maybe you should mention that this implementation is royalty-free, but that commercial products using it should both respect the GPL license and pay a ZigBee royalty as per the ZigBee Alliance . That is just for clarification since right now it simply does 802.15.4 which is not subject to this royalty thing.

We will look into this, thank you for putting our attention on this topic.

Quoted 12 lines
Quoted 11 lines

Several comments about our implementation:
* As with 802.11 there are two types of devices: the smart ones that implement most parts of the protocol by themselves and more or less dumb ones which simply send and receive what they are told. Currently we do only support the second type of devices (SoftMAC)
* The implementation is split between code driving radio, (master, mwpanX
  interface: mdev.c), code processing frames according the IEEE 802.15.4 rules (slave wpanX devices) and finally sockets (af_ieee802154.c, dgram.c, raw.c).

Quoted 2 lines

This sounds good. Do you also plan on integrating some meshing algorithm on top of 802.15.4 ? If so,

Hmmm. IIUC the 802.15.4 doesn't have any knowledge about meshing. It's the part of higher level protocol. ZigBee part will of course contain some kind of routing/
meshing algos. If you'd like to implement mesing over raw 802.15.4, it's up to your
protocol. We plan to provide all hooks necessary for doing this.

Quoted 9 lines
Quoted 7 lines

* We do present two example drivers using our stack. One is purely virtual one either looping the packets back or connecting several virtual interfaces (the one at fakelb.c), and the driver for the Freescale MC13192 evaluation boards (13192-SARD, 13192-EVK) using our custom firmware (currently only available at request, we are working on publishing it). The driver for the Atmel at86rf230/at86rf231 chips will follow in several weeks.

Is the virtual interface just like mac80211_hwsim for 802.11 ?h

More or less.We do not implement the global 'monitor' interface, only separate radios. We have a page in the wiki that describes usage of this virtual device driver:
http://apps.sourceforge.net/trac/linux-zigbee/wiki/GettingStarted

Signature · 2 lines
With best wishes
Dmitry