Skip to contentSkip to conversation

IEEE 802.15.4 stack: generic parts v2

GIT PULL In review Dmitry Eremin-Solenikov 7 participants 22 messages Jun 5, 2009 – Jun 6, 2009

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

Hello,

This is a second version of pull/merge request for our IEEE 802.15.4 stack. Major changes from previous post:
* Several macroses replaced with inline functions to ensure type correctness.
* Reformat source to (mostly) fit into 80 columns
* Drop constants 'reservation' declarations from headers
* Split policy from nl802154.h to separate source file.
* Add documentation for our netlink protocol.

The following changes since commit 9fa7eb283c5cdc2b0f4a8cfe6387ed82e5e9a3d3:
Linus Torvalds (1):

        Linux 2.6.30-rc8

are available in the git repository at:

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

Dmitry Eremin-Solenikov (5):
Add constants for the ieee 802.15.4 stack
net: add IEEE 802.15.4 socket family implementation
net: add NL802154 interface for configuration of 802.15.4 devices
ieee802154: add documentation about our stack
ieee802154: add simple HardMAC driver sample

 Documentation/networking/ieee802154.txt |   76 +++++
 MAINTAINERS                             |   12 +
 drivers/Makefile                        |    1 +
 drivers/ieee802154/Kconfig              |   22 ++
 drivers/ieee802154/Makefile             |    3 +
 drivers/ieee802154/fakehard.c           |  270 ++++++++++++++++
 drivers/net/Kconfig                     |    2 +
 include/linux/if_arp.h                  |    2 +
 include/linux/if_ether.h                |    1 +
 include/linux/nl802154.h                |  119 +++++++
 include/linux/socket.h                  |    4 +-
 include/net/ieee802154/af_ieee802154.h  |   60 ++++
 include/net/ieee802154/mac_def.h        |  160 ++++++++++
 include/net/ieee802154/netdevice.h      |  115 +++++++
 include/net/ieee802154/nl802154.h       |   41 +++
 net/Kconfig                             |    1 +
 net/Makefile                            |    1 +
 net/core/dev.c                          |    6 +-
 net/core/sock.c                         |    3 +
 net/ieee802154/Kconfig                  |   12 +
 net/ieee802154/Makefile                 |    5 +
 net/ieee802154/af802154.h               |   36 +++
 net/ieee802154/af_ieee802154.c          |  372 ++++++++++++++++++++++
 net/ieee802154/dgram.c                  |  394 +++++++++++++++++++++++
 net/ieee802154/netlink.c                |  523 +++++++++++++++++++++++++++++++
 net/ieee802154/nl_policy.c              |   65 ++++
 net/ieee802154/raw.c                    |  254 +++++++++++++++
 27 files changed, 2557 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/networking/ieee802154.txt
 create mode 100644 drivers/ieee802154/Kconfig
 create mode 100644 drivers/ieee802154/Makefile
 create mode 100644 drivers/ieee802154/fakehard.c
 create mode 100644 include/linux/nl802154.h
 create mode 100644 include/net/ieee802154/af_ieee802154.h
 create mode 100644 include/net/ieee802154/mac_def.h
 create mode 100644 include/net/ieee802154/netdevice.h
 create mode 100644 include/net/ieee802154/nl802154.h
 create mode 100644 net/ieee802154/Kconfig
 create mode 100644 net/ieee802154/Makefile
 create mode 100644 net/ieee802154/af802154.h
 create mode 100644 net/ieee802154/af_ieee802154.c
 create mode 100644 net/ieee802154/dgram.c
 create mode 100644 net/ieee802154/netlink.c
 create mode 100644 net/ieee802154/nl_policy.c
 create mode 100644 net/ieee802154/raw.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 stack

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

---
 include/linux/if_arp.h   |    2 ++
 include/linux/if_ether.h |    1 +
 include/linux/socket.h   |    4 +++-
 net/core/dev.c           |    6 ++++--
 net/core/sock.c          |    3 +++
 5 files changed, 13 insertions(+), 3 deletions(-)
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 +1 -0
index cfe4fe1..11a60e4 100644
@@ -106,6 +106,7 @@
 #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		*/
 
 /*
  *	This is an Ethernet frame header.
include/linux/socket.h +3 -1
index 421afb4..642d1f1 100644
@@ -194,7 +194,8 @@ 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_MAX		37	/* For now.. */
 
 /* Protocol families, same as address families. */
 #define PF_UNSPEC	AF_UNSPEC
@@ -233,6 +234,7 @@ struct ucred {
 #define PF_RXRPC	AF_RXRPC
 #define PF_ISDN		AF_ISDN
 #define PF_PHONET	AF_PHONET
+#define PF_IEEE802154	AF_IEEE802154
 #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..8a1644c 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_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_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_MAX"
 };
 
Signature · 1 line
1.6.3.1
#2 lore raw

PATCH 2/5 net: add IEEE 802.15.4 socket family 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 the socket interface for communication over 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.

Configuration interface, drivers and software MAC 802.15.4 implementation 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 |   60 +++++
 include/net/ieee802154/mac_def.h       |  160 +++++++++++++
 include/net/ieee802154/netdevice.h     |  115 +++++++++
 net/Kconfig                            |    1 +
 net/Makefile                           |    1 +
 net/ieee802154/Kconfig                 |   12 +
 net/ieee802154/Makefile                |    4 +
 net/ieee802154/af802154.h              |   36 +++
 net/ieee802154/af_ieee802154.c         |  372 ++++++++++++++++++++++++++++++
 net/ieee802154/dgram.c                 |  394 ++++++++++++++++++++++++++++++++
 net/ieee802154/raw.c                   |  254 ++++++++++++++++++++
 11 files changed, 1409 insertions(+), 0 deletions(-)
 create mode 100644 include/net/ieee802154/af_ieee802154.h
 create mode 100644 include/net/ieee802154/mac_def.h
 create mode 100644 include/net/ieee802154/netdevice.h
 create mode 100644 net/ieee802154/Kconfig
 create mode 100644 net/ieee802154/Makefile
 create mode 100644 net/ieee802154/af802154.h
 create mode 100644 net/ieee802154/af_ieee802154.c
 create mode 100644 net/ieee802154/dgram.c
 create mode 100644 net/ieee802154/raw.c
include/net/ieee802154/af_ieee802154.h new file +60 -0
new file mode 100644
index 0000000..874f1e7
@@ -0,0 +1,60 @@
+/*
+ * 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;
+	};
+};
+
+#define IEEE802154_PANID_BROADCAST	0xffff
+#define IEEE802154_ADDR_BROADCAST	0xffff
+#define IEEE802154_ADDR_UNDEF		0xfffe
+
+struct sockaddr_ieee802154 {
+	sa_family_t family; /* AF_IEEE802154 */
+	struct ieee802154_addr addr;
+};
+
+/* master device */
+#define IEEE802154_SIOC_ADD_SLAVE		(SIOCDEVPRIVATE + 0)
+
+#endif
include/net/ieee802154/mac_def.h new file +160 -0

160 lines not on this page · raw message

include/net/ieee802154/netdevice.h new file +115 -0

115 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..1c1de97
@@ -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 +4 -0
new file mode 100644
index 0000000..cb88054
@@ -0,0 +1,4 @@
+obj-$(CONFIG_IEEE802154) +=	af_802154.o
+af_802154-objs		:= af_ieee802154.o raw.o dgram.o
+
+EXTRA_CFLAGS += -Wall -DDEBUG
net/ieee802154/af802154.h new file +36 -0
new file mode 100644
index 0000000..0ee663d
@@ -0,0 +1,36 @@
+/*
+ * Internal interfaces for ieee 802.15.4 address family.
+ *
+ * Copyright 2007, 2008, 2009 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 AF802154_H
+#define AF802154_H
+
+struct sk_buff;
+struct net_devce;
+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);
+struct net_device *ieee802154_get_dev(struct net *net,
+		struct ieee802154_addr *addr);
+
+#endif
net/ieee802154/af_ieee802154.c new file +372 -0

372 lines not on this page · raw message

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

394 lines not on this page · raw message

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

254 lines not on this page · raw message

Signature · 6 lines
1.6.3.1

--
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
#3 lore raw

PATCH 3/5 net: add NL802154 interface for configuration of 802.15.4 devices

Add a netlink interface for configuration of IEEE 802.15.4 device. Also this interface specifies events notification sent by devices towards higher layers.

---
 include/linux/nl802154.h          |  119 +++++++++
 include/net/ieee802154/nl802154.h |   41 +++
 net/ieee802154/Makefile           |    3 +-
 net/ieee802154/netlink.c          |  523 +++++++++++++++++++++++++++++++++++++
 net/ieee802154/nl_policy.c        |   65 +++++
 5 files changed, 750 insertions(+), 1 deletions(-)
 create mode 100644 include/linux/nl802154.h
 create mode 100644 include/net/ieee802154/nl802154.h
 create mode 100644 net/ieee802154/netlink.c
 create mode 100644 net/ieee802154/nl_policy.c
include/linux/nl802154.h new file +119 -0
new file mode 100644
index 0000000..2cda00c
@@ -0,0 +1,119 @@
+/*
+ * nl802154.h
+ *
+ * Copyright (C) 2007, 2008, 2009 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.
+ *
+ */
+
+#ifndef NL802154_H
+#define NL802154_H
+
+#define IEEE802154_NL_NAME "802.15.4 MAC"
+#define IEEE802154_MCAST_COORD_NAME "coordinator"
+#define IEEE802154_MCAST_BEACON_NAME "beacon"
+
+enum {
+	__IEEE802154_ATTR_INVALID,
+
+	IEEE802154_ATTR_DEV_NAME,
+	IEEE802154_ATTR_DEV_INDEX,
+
+	IEEE802154_ATTR_STATUS,
+
+	IEEE802154_ATTR_SHORT_ADDR,
+	IEEE802154_ATTR_HW_ADDR,
+	IEEE802154_ATTR_PAN_ID,
+
+	IEEE802154_ATTR_CHANNEL,
+
+	IEEE802154_ATTR_COORD_SHORT_ADDR,
+	IEEE802154_ATTR_COORD_HW_ADDR,
+	IEEE802154_ATTR_COORD_PAN_ID,
+
+	IEEE802154_ATTR_SRC_SHORT_ADDR,
+	IEEE802154_ATTR_SRC_HW_ADDR,
+	IEEE802154_ATTR_SRC_PAN_ID,
+
+	IEEE802154_ATTR_DEST_SHORT_ADDR,
+	IEEE802154_ATTR_DEST_HW_ADDR,
+	IEEE802154_ATTR_DEST_PAN_ID,
+
+	IEEE802154_ATTR_CAPABILITY,
+	IEEE802154_ATTR_REASON,
+	IEEE802154_ATTR_SCAN_TYPE,
+	IEEE802154_ATTR_CHANNELS,
+	IEEE802154_ATTR_DURATION,
+	IEEE802154_ATTR_ED_LIST,
+	IEEE802154_ATTR_BCN_ORD,
+	IEEE802154_ATTR_SF_ORD,
+	IEEE802154_ATTR_PAN_COORD,
+	IEEE802154_ATTR_BAT_EXT,
+	IEEE802154_ATTR_COORD_REALIGN,
+	IEEE802154_ATTR_SEC,
+
+	__IEEE802154_ATTR_MAX,
+};
+
+#define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1)
+
+extern struct nla_policy ieee802154_policy[];
+
+/* commands */
+/* REQ should be responded with CONF
+ * and INDIC with RESP
+ */
+enum {
+	__IEEE802154_COMMAND_INVALID,
+
+	IEEE802154_ASSOCIATE_REQ,
+	IEEE802154_ASSOCIATE_CONF,
+	IEEE802154_DISASSOCIATE_REQ,
+	IEEE802154_DISASSOCIATE_CONF,
+	IEEE802154_GET_REQ,
+	IEEE802154_GET_CONF,
+	IEEE802154_RESET_REQ,
+	IEEE802154_RESET_CONF,
+	IEEE802154_SCAN_REQ,
+	IEEE802154_SCAN_CONF,
+	IEEE802154_SET_REQ,
+	IEEE802154_SET_CONF,
+	IEEE802154_START_REQ,
+	IEEE802154_START_CONF,
+	IEEE802154_SYNC_REQ,
+	IEEE802154_POLL_REQ,
+	IEEE802154_POLL_CONF,
+
+	IEEE802154_ASSOCIATE_INDIC,
+	IEEE802154_ASSOCIATE_RESP,
+	IEEE802154_DISASSOCIATE_INDIC,
+	IEEE802154_BEACON_NOTIFY_INDIC,
+	IEEE802154_ORPHAN_INDIC,
+	IEEE802154_ORPHAN_RESP,
+	IEEE802154_COMM_STATUS_INDIC,
+	IEEE802154_SYNC_LOSS_INDIC,
+
+	IEEE802154_GTS_REQ, /* Not supported yet */
+	IEEE802154_GTS_INDIC, /* Not supported yet */
+	IEEE802154_GTS_CONF, /* Not supported yet */
+	IEEE802154_RX_ENABLE_REQ, /* Not supported yet */
+	IEEE802154_RX_ENABLE_CONF, /* Not supported yet */
+
+	__IEEE802154_CMD_MAX,
+};
+
+#define IEEE802154_CMD_MAX (__IEEE802154_CMD_MAX - 1)
+
+#endif
include/net/ieee802154/nl802154.h new file +41 -0

41 lines not on this page · raw message

net/ieee802154/Makefile +2 -1
index cb88054..0b11995 100644
@@ -1,4 +1,5 @@
-obj-$(CONFIG_IEEE802154) +=	af_802154.o
+obj-$(CONFIG_IEEE802154) +=	nl802154.o af_802154.o
+nl802154-objs		:= netlink.o nl_policy.o
 af_802154-objs		:= af_ieee802154.o raw.o dgram.o
 
 EXTRA_CFLAGS += -Wall -DDEBUG
net/ieee802154/netlink.c new file +523 -0

523 lines not on this page · raw message

net/ieee802154/nl_policy.c new file +65 -0

65 lines not on this page · raw message

Signature · 1 line
1.6.3.1
#4 lore raw

PATCH 4/5 ieee802154: add documentation about our stack

Add MAINTAINERS entry and a small text describing our stack interfaces, how to hook the drivers, etc.

---
 Documentation/networking/ieee802154.txt |   76 +++++++++++++++++++++++++++++++
 MAINTAINERS                             |   12 +++++
 2 files changed, 88 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/networking/ieee802154.txt
Documentation/networking/ieee802154.txt new file +76 -0
new file mode 100644
index 0000000..a0280ad
@@ -0,0 +1,76 @@
+
+		Linux IEEE 802.15.4 implementation
+
+
+Introduction
+============
+
+The Linux-ZigBee project goal is to provide complete implementation
+of IEEE 802.15.4 / ZigBee / 6LoWPAN protocols. IEEE 802.15.4 is a stack
+of protocols for organizing Low-Rate Wireless Personal Area Networks.
+
+Currently only IEEE 802.15.4 layer is implemented. We have choosen
+to use plain Berkeley socket API, the generic Linux networking stack
+to transfer IEEE 802.15.4 messages and a special protocol over genetlink
+for configuration/management
+
+
+Socket API
+==========
+
+int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
+.....
+
+The address family, socket addresses etc. are defined in the
+include/net/ieee802154/af_ieee802154.h header or in the special header
+in our userspace package (see either linux-zigbee sourceforge download page
+or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee).
+
+One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
+
+
+MLME - MAC Level Management
+============================
+
+Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands.
+See the include/net/ieee802154/nl802154.h header. Our userspace tools package
+(see above) provides CLI configuration utility for radio interfaces and simple
+coordinator for IEEE 802.15.4 networks as an example users of MLME protocol.
+
+
+Kernel side
+=============
+
+Like with WiFi, there are several types of devices implementing IEEE 802.15.4.
+1) 'HardMAC'. The MAC layer is implemented in the device itself, the device
+   exports MLME and data API.
+2) 'SoftMAC' or just radio. These types of devices are just radio transceivers
+   possibly with some kinds of acceleration like automatic CRC computation and
+   comparation, automagic ACK handling, address matching, etc.
+
+Those types of devices require different approach to be hooked into Linux kernel.
+
+
+HardMAC
+=======
+
+See the header include/net/ieee802154/netdevice.h. You have to implement Linux
+net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
+code via plain sk_buffs. The control block of sk_buffs will contain additional
+info as described in the struct ieee802154_mac_cb.
+
+To hook the MLME interface you have to populate the ml_priv field of your
+net_device with a pointer to struct ieee802154_mlme_ops instance. All fields are
+required.
+
+We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c
+
+
+SoftMAC
+=======
+
+We are going to provide intermediate layer impelementing IEEE 802.15.4 MAC
+in software. This is currently WIP.
+
+See header include/net/ieee802154/mac802154.h and several drivers in
+drivers/ieee802154/
MAINTAINERS +12 -0
index cf4abdd..a1bbc8f 100644
@@ -2816,6 +2816,18 @@ L:	linux1394-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
 S:	Maintained
 F:	drivers/ieee1394/raw1394*
 
+IEEE 802.15.4 SUBSYSTEM
+P:	Dmitry Eremin-Solenikov
+M:	[email protected]
+P:	Sergey Lapin
+M:	[email protected]
+L:	linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
+W:	http://apps.sourceforge.net/trac/linux-zigbee
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/lumag/lowpan.git
+S:	Maintained
+F:	net/ieee802154/
+F:	drivers/ieee801254/
+
 INTEGRITY MEASUREMENT ARCHITECTURE (IMA)
 P:	Mimi Zohar
 M:	zohar-r/[email protected]
Signature · 6 lines
1.6.3.1

--
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
#5 lore raw

PATCH 5/5 ieee802154: add simple HardMAC driver sample

fakehard is a really simple driver implementing only necessary callbacks and serves the role of an example of driver for HardMAC IEEE 802.15.4 device.

---
 drivers/Makefile              |    1 +
 drivers/ieee802154/Kconfig    |   22 ++++
 drivers/ieee802154/Makefile   |    3 +
 drivers/ieee802154/fakehard.c |  270 +++++++++++++++++++++++++++++++++++++++++
 drivers/net/Kconfig           |    2 +
 5 files changed, 298 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ieee802154/Kconfig
 create mode 100644 drivers/ieee802154/Makefile
 create mode 100644 drivers/ieee802154/fakehard.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 +22 -0
new file mode 100644
index 0000000..25740bd
@@ -0,0 +1,22 @@
+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.
+
+config IEEE802154_FAKEHARD
+	tristate "Fake LR-WPAN driver with several interconnected devices"
+	depends on  IEEE802154_DRIVERS
+	---help---
+	  Say Y here to enable the fake driver that serves as an example
+          of HardMAC device driver.
+
+          This driver can also be built as a module. To do so say M here.
+	  The module will be called 'fakehard'.
+
drivers/ieee802154/Makefile new file +3 -0
new file mode 100644
index 0000000..e0e8e1a
@@ -0,0 +1,3 @@
+obj-$(CONFIG_IEEE802154_FAKEHARD) += fakehard.o
+
+EXTRA_CFLAGS += -DDEBUG -DCONFIG_FFD
drivers/ieee802154/fakehard.c new file +270 -0

270 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.3.1

--
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

Re: [PATCH 4/5] ieee802154: add documentation about our stack

In reply to Dmitry Eremin-Solenikov

Hi Dmitry,

Quoted 67 lines

Add MAINTAINERS entry and a small text describing our stack interfaces, how to hook the drivers, etc.

---
 Documentation/networking/ieee802154.txt |   76 +++++++++++++++++++++++++++++++
 MAINTAINERS                             |   12 +++++
 2 files changed, 88 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/networking/ieee802154.txt
Documentation/networking/ieee802154.txt new file +50 -0
new file mode 100644
index 0000000..a0280ad
@@ -0,0 +1,76 @@
+
+		Linux IEEE 802.15.4 implementation
+
+
+Introduction
+============
+
+The Linux-ZigBee project goal is to provide complete implementation
+of IEEE 802.15.4 / ZigBee / 6LoWPAN protocols. IEEE 802.15.4 is a stack
+of protocols for organizing Low-Rate Wireless Personal Area Networks.
+
+Currently only IEEE 802.15.4 layer is implemented. We have choosen
+to use plain Berkeley socket API, the generic Linux networking stack
+to transfer IEEE 802.15.4 messages and a special protocol over genetlink
+for configuration/management
+
+
+Socket API
+==========
+
+int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
+.....
+
+The address family, socket addresses etc. are defined in the
+include/net/ieee802154/af_ieee802154.h header or in the special header
+in our userspace package (see either linux-zigbee sourceforge download page
+or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee).
+
+One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
+
+
+MLME - MAC Level Management
+============================
+
+Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands.
+See the include/net/ieee802154/nl802154.h header. Our userspace tools package
+(see above) provides CLI configuration utility for radio interfaces and simple
+coordinator for IEEE 802.15.4 networks as an example users of MLME protocol.
+
+
+Kernel side
+=============
+
+Like with WiFi, there are several types of devices implementing IEEE 802.15.4.
+1) 'HardMAC'. The MAC layer is implemented in the device itself, the device
+   exports MLME and data API.
+2) 'SoftMAC' or just radio. These types of devices are just radio transceivers
+   possibly with some kinds of acceleration like automatic CRC computation and
+   comparation, automagic ACK handling, address matching, etc.
+

Documentation/networking/ieee802154.txt line 60

Quoted 10 lines
Documentation/networking/ieee802154.txt new file +10 -0
+Those types of devices require different approach to be hooked into Linux kernel.
+
+
+HardMAC
+=======
+
+See the header include/net/ieee802154/netdevice.h. You have to implement Linux
+net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
+code via plain sk_buffs. The control block of sk_buffs will contain additional
+info as described in the struct ieee802154_mac_cb.

are you sending IP packets over this ARPHRD_IEEE802154 network devices or are you just abusing it as a control interface. If it is the later then can we please stop doing this. I really dislike these irda0, wmaster0 and alike stuff. If you can't configure it as real IP device, you should not use struct net_device at all from my point of view. For all your control details you have netlink so no need for an extra device here unless it can actually talk IP (or similar like IPX etc.).

The irda0 code is legacy and mostly unmaintained so might not go away, but for the wmaster0 we will remove that soon (looks at Johannes).

Regards

Marcel

#7 lore raw

Re: [PATCH 4/5] ieee802154: add documentation about our stack

2009/6/5 Marcel Holtmann <[email protected]>:

Quoted 80 lines

Hi Dmitry,

Quoted 67 lines

Add MAINTAINERS entry and a small text describing our stack interfaces, how to hook the drivers, etc.

---
 Documentation/networking/ieee802154.txt |   76 +++++++++++++++++++++++++++++++ MAINTAINERS                             |   12 +++++

 2 files changed, 88 insertions(+), 0 deletions(-)

 create mode 100644 Documentation/networking/ieee802154.txt

Documentation/networking/ieee802154.txt new file +50 -0
new file mode 100644
index 0000000..a0280ad
@@ -0,0 +1,76 @@
+
+             Linux IEEE 802.15.4 implementation
+
+
+Introduction
+============
+
+The Linux-ZigBee project goal is to provide complete implementation
+of IEEE 802.15.4 / ZigBee / 6LoWPAN protocols. IEEE 802.15.4 is a stack
+of protocols for organizing Low-Rate Wireless Personal Area Networks.
+
+Currently only IEEE 802.15.4 layer is implemented. We have choosen
+to use plain Berkeley socket API, the generic Linux networking stack
+to transfer IEEE 802.15.4 messages and a special protocol over genetlink
+for configuration/management
+
+
+Socket API
+==========
+
+int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
+.....
+
+The address family, socket addresses etc. are defined in the
+include/net/ieee802154/af_ieee802154.h header or in the special header
+in our userspace package (see either linux-zigbee sourceforge download page
+or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee).
+
+One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
+
+
+MLME - MAC Level Management
+============================
+
+Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands.
+See the include/net/ieee802154/nl802154.h header. Our userspace tools package
+(see above) provides CLI configuration utility for radio interfaces and simple
+coordinator for IEEE 802.15.4 networks as an example users of MLME protocol.
+
+
+Kernel side
+=============
+
+Like with WiFi, there are several types of devices implementing IEEE 802.15.4.
+1) 'HardMAC'. The MAC layer is implemented in the device itself, the device
+   exports MLME and data API.
+2) 'SoftMAC' or just radio. These types of devices are just radio transceivers
+   possibly with some kinds of acceleration like automatic CRC computation and
+   comparation, automagic ACK handling, address matching, etc.
+

Documentation/networking/ieee802154.txt line 60

Quoted 10 lines
Documentation/networking/ieee802154.txt new file +10 -0
+Those types of devices require different approach to be hooked into Linux kernel.
+
+
+HardMAC
+=======
+
+See the header include/net/ieee802154/netdevice.h. You have to implement Linux
+net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
+code via plain sk_buffs. The control block of sk_buffs will contain additional
+info as described in the struct ieee802154_mac_cb.
Quoted 7 lines

are you sending IP packets over this ARPHRD_IEEE802154 network devices or are you just abusing it as a control interface. If it is the later then can we please stop doing this. I really dislike these irda0, wmaster0 and alike stuff. If you can't configure it as real IP device, you should not use struct net_device at all from my point of view. For all your control details you have netlink so no need for an extra device here unless it can actually talk IP (or similar like IPX etc.).

Hmm. Once I've thought about it, as net_device seemed a Really Big Thing to me to be used for our stack. However from the beginning we wanted to use plain BSD sockets API, we wanted to use sk_buffs (of course) for the whole message interface.
And when prototyping lowpan_device, I ended duplicating lots of net_device functionality on my own.
Either we have to develop some lightweight "net_device" abstracted from IP & Ko, but containing sk_buff queues, header ops, etc, or end up with functionality duplication and hacks like in bluetooth (where skb->dev is used to store hci_dev instead of net_device).

Hmm. AX.25, AppleTalk, CAN, DecNet, most of other procotols sitting inside Linux kernel do use net_device structure, why should we differ?

Moreover, once we implement 6lowpan support (an encapsulation for IPv6 frames into IEEE 802.15.4 ones) it will be possible to send IPv6 frames directly over IEEE 802.15.4.

Signature · 2 lines
With best wishes
Dmitry
#8 lore raw

Re: [PATCH 4/5] ieee802154: add documentation about our stack

Hi Dmitry,

Quoted 86 lines
Quoted 78 lines
Quoted 67 lines

Add MAINTAINERS entry and a small text describing our stack interfaces, how to hook the drivers, etc.

---
 Documentation/networking/ieee802154.txt |   76 +++++++++++++++++++++++++++++++
 MAINTAINERS                             |   12 +++++
 2 files changed, 88 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/networking/ieee802154.txt
Documentation/networking/ieee802154.txt new file +50 -0
new file mode 100644
index 0000000..a0280ad
@@ -0,0 +1,76 @@
+
+             Linux IEEE 802.15.4 implementation
+
+
+Introduction
+============
+
+The Linux-ZigBee project goal is to provide complete implementation
+of IEEE 802.15.4 / ZigBee / 6LoWPAN protocols. IEEE 802.15.4 is a stack
+of protocols for organizing Low-Rate Wireless Personal Area Networks.
+
+Currently only IEEE 802.15.4 layer is implemented. We have choosen
+to use plain Berkeley socket API, the generic Linux networking stack
+to transfer IEEE 802.15.4 messages and a special protocol over genetlink
+for configuration/management
+
+
+Socket API
+==========
+
+int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
+.....
+
+The address family, socket addresses etc. are defined in the
+include/net/ieee802154/af_ieee802154.h header or in the special header
+in our userspace package (see either linux-zigbee sourceforge download page
+or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee).
+
+One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
+
+
+MLME - MAC Level Management
+============================
+
+Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands.
+See the include/net/ieee802154/nl802154.h header. Our userspace tools package
+(see above) provides CLI configuration utility for radio interfaces and simple
+coordinator for IEEE 802.15.4 networks as an example users of MLME protocol.
+
+
+Kernel side
+=============
+
+Like with WiFi, there are several types of devices implementing IEEE 802.15.4.
+1) 'HardMAC'. The MAC layer is implemented in the device itself, the device
+   exports MLME and data API.
+2) 'SoftMAC' or just radio. These types of devices are just radio transceivers
+   possibly with some kinds of acceleration like automatic CRC computation and
+   comparation, automagic ACK handling, address matching, etc.
+

Documentation/networking/ieee802154.txt line 60

Quoted 10 lines
Documentation/networking/ieee802154.txt new file +10 -0
+Those types of devices require different approach to be hooked into Linux kernel.
+
+
+HardMAC
+=======
+
+See the header include/net/ieee802154/netdevice.h. You have to implement Linux
+net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
+code via plain sk_buffs. The control block of sk_buffs will contain additional
+info as described in the struct ieee802154_mac_cb.
Quoted 7 lines

are you sending IP packets over this ARPHRD_IEEE802154 network devices or are you just abusing it as a control interface. If it is the later then can we please stop doing this. I really dislike these irda0, wmaster0 and alike stuff. If you can't configure it as real IP device, you should not use struct net_device at all from my point of view. For all your control details you have netlink so no need for an extra device here unless it can actually talk IP (or similar like IPX etc.).

Quoted 10 lines

Hmm. Once I've thought about it, as net_device seemed a Really Big Thing to me to be used for our stack. However from the beginning we wanted to use plain BSD sockets API, we wanted to use sk_buffs (of course) for the whole message interface.
And when prototyping lowpan_device, I ended duplicating lots of net_device functionality on my own.
Either we have to develop some lightweight "net_device" abstracted from IP & Ko, but containing sk_buff queues, header ops, etc, or end up with functionality duplication and hacks like in bluetooth (where skb->dev is used to store hci_dev instead of net_device).

that skb->dev pointer is typed as net_device is just a cosmetic detail from my point of view. And having Bluetooth use it as hci_dev is not actually a hack. We just can't send Bluetooth HCI skb directly to the IP layer, but we also don't do that ;)

Quoted 2 lines

Hmm. AX.25, AppleTalk, CAN, DecNet, most of other procotols sitting inside Linux kernel do use net_device structure, why should we differ?

Don't know about CAN since I never looked deep enough into it. However for the other, they do transport some sort of networking packets over it. So my point is as long as I can use ifconfig of ip to set an address on these interfaces and route them it makes sense to. Just to reuse net_device because it is convenient for a control interface sounds wrong to me. The IrDA stuff is one big example of this.

Quoted 3 lines

Moreover, once we implement 6lowpan support (an encapsulation for IPv6 frames into IEEE 802.15.4 ones) it will be possible to send IPv6 frames directly over IEEE 802.15.4.

So using the socket interfaces has nothing do with the net_device you are creating. So that argument doesn't work for me. Even mac80211 nowadays uses a proper hardware abstraction (ieee80211_hw and ieee80211_ops) and you should do the same.

Once you have actually implemented 6lowpan then these are the ones that should use net_device and show up within ifconfig.

Regards

Marcel

#9 lore raw

Re: [PATCH 4/5] ieee802154: add documentation about our stack

2009/6/5 Marcel Holtmann <[email protected]>:

Quoted 107 lines

Hi Dmitry,

Quoted 86 lines
Quoted 78 lines
Quoted 67 lines

Add MAINTAINERS entry and a small text describing our stack interfaces, how to hook the drivers, etc.

---
 Documentation/networking/ieee802154.txt |   76 +++++++++++++++++++++++++++++++ MAINTAINERS                             |   12 +++++

 2 files changed, 88 insertions(+), 0 deletions(-)

 create mode 100644 Documentation/networking/ieee802154.txt

Documentation/networking/ieee802154.txt new file +50 -0
new file mode 100644
index 0000000..a0280ad
@@ -0,0 +1,76 @@
+
+             Linux IEEE 802.15.4 implementation
+
+
+Introduction
+============
+
+The Linux-ZigBee project goal is to provide complete implementation
+of IEEE 802.15.4 / ZigBee / 6LoWPAN protocols. IEEE 802.15.4 is a stack
+of protocols for organizing Low-Rate Wireless Personal Area Networks.
+
+Currently only IEEE 802.15.4 layer is implemented. We have choosen
+to use plain Berkeley socket API, the generic Linux networking stack
+to transfer IEEE 802.15.4 messages and a special protocol over genetlink
+for configuration/management
+
+
+Socket API
+==========
+
+int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
+.....
+
+The address family, socket addresses etc. are defined in the
+include/net/ieee802154/af_ieee802154.h header or in the special header
+in our userspace package (see either linux-zigbee sourceforge download page
+or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee).
+
+One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
+
+
+MLME - MAC Level Management
+============================
+
+Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands.
+See the include/net/ieee802154/nl802154.h header. Our userspace tools package
+(see above) provides CLI configuration utility for radio interfaces and simple
+coordinator for IEEE 802.15.4 networks as an example users of MLME protocol.
+
+
+Kernel side
+=============
+
+Like with WiFi, there are several types of devices implementing IEEE 802.15.4.
+1) 'HardMAC'. The MAC layer is implemented in the device itself, the device
+   exports MLME and data API.
+2) 'SoftMAC' or just radio. These types of devices are just radio transceivers
+   possibly with some kinds of acceleration like automatic CRC computation and
+   comparation, automagic ACK handling, address matching, etc.
+

Documentation/networking/ieee802154.txt line 60

Quoted 10 lines
Documentation/networking/ieee802154.txt new file +10 -0
+Those types of devices require different approach to be hooked into Linux kernel.
+
+
+HardMAC
+=======
+
+See the header include/net/ieee802154/netdevice.h. You have to implement Linux
+net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
+code via plain sk_buffs. The control block of sk_buffs will contain additional
+info as described in the struct ieee802154_mac_cb.
Quoted 7 lines

are you sending IP packets over this ARPHRD_IEEE802154 network devices or are you just abusing it as a control interface. If it is the later then can we please stop doing this. I really dislike these irda0, wmaster0 and alike stuff. If you can't configure it as real IP device, you should not use struct net_device at all from my point of view. For all your control details you have netlink so no need for an extra device here unless it can actually talk IP (or similar like IPX etc.).

Quoted 10 lines

Hmm. Once I've thought about it, as net_device seemed a Really Big Thing to me to be used for our stack. However from the beginning we wanted to use plain BSD sockets API, we wanted to use sk_buffs (of course) for the whole message interface.
And when prototyping lowpan_device, I ended duplicating lots of net_device functionality on my own.
Either we have to develop some lightweight "net_device" abstracted from IP & Ko, but containing sk_buff queues, header ops, etc, or end up with functionality duplication and hacks like in bluetooth (where skb->dev is used to store hci_dev instead of net_device).

that skb->dev pointer is typed as net_device is just a cosmetic detail from my point of view. And having Bluetooth use it as hci_dev is not actually a hack. We just can't send Bluetooth HCI skb directly to the IP layer, but we also don't do that ;)

Quoted 2 lines

Hmm. AX.25, AppleTalk, CAN, DecNet, most of other procotols sitting inside Linux kernel do use net_device structure, why should we differ?

Quoted 6 lines

Don't know about CAN since I never looked deep enough into it. However for the other, they do transport some sort of networking packets over it. So my point is as long as I can use ifconfig of ip to set an address on these interfaces and route them it makes sense to. Just to reuse net_device because it is convenient for a control interface sounds wrong to me. The IrDA stuff is one big example of this.

Hmm. Let's make things clear: do you request for ip/ifconfig to be working
upon a net_device or do you request that network packets are transmitted
over the net_device?

Quoted 8 lines
Quoted 3 lines

Moreover, once we implement 6lowpan support (an encapsulation for IPv6 frames into IEEE 802.15.4 ones) it will be possible to send IPv6 frames directly over IEEE 802.15.4.

So using the socket interfaces has nothing do with the net_device you are creating. So that argument doesn't work for me. Even mac80211 nowadays uses a proper hardware abstraction (ieee80211_hw and ieee80211_ops) and you should do the same.

We have more or less the same abstraction for the simple radios (if you'd like, please check the serie at the branch for-review-v2, or the serie that was posted several days ago. Basically simple radio provide interface for packet rx/tx, energy detection, etc. Then mac802154 (mac80211 analogy) comes into play:
all radio packets, queue processing, etc. are guided by master interface, which multiplexes packets from/to one or several ARPHRD_IEEE802154 interfaces. Those interfaces then decode if the packet is beacon, command or data frame, passes data frames to socket family, calls netlink callbacks for commands, etc.

While I understand that master interface can be dropped/replaced by non-net_device thing, I think that logical interfaces should be provided via net_device. Please correct me if I'm wrong here.

For HardMAC (that part that is presented in this patchseri) we've cut this scheme
directly at ARPHRD_IEEE802154 device. The device driver on it's own sends/ receives data frames via hardware and calls MLME callbacks where appropriate.

Quoted 2 lines

Once you have actually implemented 6lowpan then these are the ones that should use net_device and show up within ifconfig.

Signature · 2 lines
With best wishes
Dmitry
#10 lore raw

Re: [PATCH 4/5] ieee802154: add documentation about our stack

In reply to Marcel Holtmann
Quoted 10 lines · Marcel Holtmann
Quoted 2 lines

Hmm. AX.25, AppleTalk, CAN, DecNet, most of other procotols sitting inside Linux kernel do use net_device structure, why should we differ?

Don't know about CAN since I never looked deep enough into it. However for the other, they do transport some sort of networking packets over it. So my point is as long as I can use ifconfig of ip to set an address on these interfaces and route them it makes sense to. Just to reuse net_device because it is convenient for a control interface sounds wrong to me. The IrDA stuff is one big example of this.

ieee802154 does actually transport networking packets. It is networking and not just another peer-to-peer interface, so I guess it shall be implemented as a network.

Kind regards,
Maxim

#11 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

In reply to Dmitry Eremin-Solenikov

net/ieee802154/nl_policy.c line 24

Quoted 4 lines · Dmitry Eremin-Solenikov
net/ieee802154/nl_policy.c new file +4 -0
+/* This source file is shared between kernel and userspace sources, thus
+ * a bit of __KERNEL__ checks
+ */
+#ifdef __KERNEL__

It's a C file. It can't be shared expect by copying, hence IMO these things are pointless.

johannes

#12 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

Quoted 9 lines · Johannes Berg

net/ieee802154/nl_policy.c line 24

Quoted 4 lines · Dmitry Eremin-Solenikov
net/ieee802154/nl_policy.c new file +4 -0
+/* This source file is shared between kernel and userspace sources, thus
+ * a bit of __KERNEL__ checks
+ */
+#ifdef __KERNEL__

It's a C file. It can't be shared expect by copying, hence IMO these things are pointless.

It is shared by copying. And I'd strongly prefer to have it shared directly by 'cp', not by 'cp' and 'patch'. E.g. currently I can ensure that policy definitions and commands are current just by comparing files. I'd like to still have that ability. Thus, I'd ask to permit this stuff in.

Signature · 2 lines
With best wishes
Dmitry
maintainer
#13 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Fri, 5 Jun 2009 11:15:29 +0400

Quoted 11 lines · Johannes Berg
Quoted 9 lines · Dmitry Eremin-Solenikov

net/ieee802154/nl_policy.c line 24

Quoted 5 lines
net/ieee802154/nl_policy.c new file +4 -0
+/* This source file is shared between kernel and userspace sources, thus
+ * a bit of __KERNEL__ checks
+ */
+#ifdef __KERNEL__

It's a C file. It can't be shared expect by copying, hence IMO these things are pointless.

Quoted 5 lines

It is shared by copying. And I'd strongly prefer to have it shared directly by 'cp', not by 'cp' and 'patch'. E.g. currently I can ensure that policy definitions and commands are current just by comparing files. I'd like to still have that ability. Thus, I'd ask to permit this stuff in.

You can maintain your own code in your own directories in your own source tree however you like.

But if you want you code in the upstream kernel, you have to clean it of things like this.

I agree with Johannes, you have to get rid of this.

#14 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

Quoted 20 lines · David Miller

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Fri, 5 Jun 2009 11:15:29 +0400

Quoted 11 lines · Johannes Berg
Quoted 9 lines · Dmitry Eremin-Solenikov

Review

Quoted 5 lines
(quoted diff) +4 -0
+/* This source file is shared between kernel and userspace sources, thus
+ * a bit of __KERNEL__ checks
+ */
+#ifdef __KERNEL__

It's a C file. It can't be shared expect by copying, hence IMO these things are pointless.

Quoted 5 lines

It is shared by copying. And I'd strongly prefer to have it shared directly by 'cp', not by 'cp' and 'patch'. E.g. currently I can ensure that policy definitions and commands are current just by comparing files. I'd like to still have that ability. Thus, I'd ask to permit this stuff in.

Quoted 7 lines

You can maintain your own code in your own directories in your own source tree however you like.

But if you want you code in the upstream kernel, you have to clean it of things like this.

I agree with Johannes, you have to get rid of this.

I've pushed an updated version with the following patch instead of the original one.

Quoted 1 line

From 354e1cf8e3831232d3aba3ce506d0b77ec120282 Mon Sep 17 00:00:00 2001

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Fri, 5 Jun 2009 12:45:47 +0400
Subject: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

Add a netlink interface for configuration of IEEE 802.15.4 device. Also this interface specifies events notification sent by devices towards higher layers.

---
 include/linux/nl802154.h          |  119 +++++++++
 include/net/ieee802154/nl802154.h |   41 +++
 net/ieee802154/Makefile           |    3 +-
 net/ieee802154/netlink.c          |  523 +++++++++++++++++++++++++++++++++++++
 net/ieee802154/nl_policy.c        |   52 ++++
 5 files changed, 737 insertions(+), 1 deletions(-)
 create mode 100644 include/linux/nl802154.h
 create mode 100644 include/net/ieee802154/nl802154.h
 create mode 100644 net/ieee802154/netlink.c
 create mode 100644 net/ieee802154/nl_policy.c
include/linux/nl802154.h new file +119 -0
new file mode 100644
index 0000000..2cda00c
@@ -0,0 +1,119 @@
+/*
+ * nl802154.h
+ *
+ * Copyright (C) 2007, 2008, 2009 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.
+ *
+ */
+
+#ifndef NL802154_H
+#define NL802154_H
+
+#define IEEE802154_NL_NAME "802.15.4 MAC"
+#define IEEE802154_MCAST_COORD_NAME "coordinator"
+#define IEEE802154_MCAST_BEACON_NAME "beacon"
+
+enum {
+	__IEEE802154_ATTR_INVALID,
+
+	IEEE802154_ATTR_DEV_NAME,
+	IEEE802154_ATTR_DEV_INDEX,
+
+	IEEE802154_ATTR_STATUS,
+
+	IEEE802154_ATTR_SHORT_ADDR,
+	IEEE802154_ATTR_HW_ADDR,
+	IEEE802154_ATTR_PAN_ID,
+
+	IEEE802154_ATTR_CHANNEL,
+
+	IEEE802154_ATTR_COORD_SHORT_ADDR,
+	IEEE802154_ATTR_COORD_HW_ADDR,
+	IEEE802154_ATTR_COORD_PAN_ID,
+
+	IEEE802154_ATTR_SRC_SHORT_ADDR,
+	IEEE802154_ATTR_SRC_HW_ADDR,
+	IEEE802154_ATTR_SRC_PAN_ID,
+
+	IEEE802154_ATTR_DEST_SHORT_ADDR,
+	IEEE802154_ATTR_DEST_HW_ADDR,
+	IEEE802154_ATTR_DEST_PAN_ID,
+
+	IEEE802154_ATTR_CAPABILITY,
+	IEEE802154_ATTR_REASON,
+	IEEE802154_ATTR_SCAN_TYPE,
+	IEEE802154_ATTR_CHANNELS,
+	IEEE802154_ATTR_DURATION,
+	IEEE802154_ATTR_ED_LIST,
+	IEEE802154_ATTR_BCN_ORD,
+	IEEE802154_ATTR_SF_ORD,
+	IEEE802154_ATTR_PAN_COORD,
+	IEEE802154_ATTR_BAT_EXT,
+	IEEE802154_ATTR_COORD_REALIGN,
+	IEEE802154_ATTR_SEC,
+
+	__IEEE802154_ATTR_MAX,
+};
+
+#define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1)
+
+extern struct nla_policy ieee802154_policy[];
+
+/* commands */
+/* REQ should be responded with CONF
+ * and INDIC with RESP
+ */
+enum {
+	__IEEE802154_COMMAND_INVALID,
+
+	IEEE802154_ASSOCIATE_REQ,
+	IEEE802154_ASSOCIATE_CONF,
+	IEEE802154_DISASSOCIATE_REQ,
+	IEEE802154_DISASSOCIATE_CONF,
+	IEEE802154_GET_REQ,
+	IEEE802154_GET_CONF,
+	IEEE802154_RESET_REQ,
+	IEEE802154_RESET_CONF,
+	IEEE802154_SCAN_REQ,
+	IEEE802154_SCAN_CONF,
+	IEEE802154_SET_REQ,
+	IEEE802154_SET_CONF,
+	IEEE802154_START_REQ,
+	IEEE802154_START_CONF,
+	IEEE802154_SYNC_REQ,
+	IEEE802154_POLL_REQ,
+	IEEE802154_POLL_CONF,
+
+	IEEE802154_ASSOCIATE_INDIC,
+	IEEE802154_ASSOCIATE_RESP,
+	IEEE802154_DISASSOCIATE_INDIC,
+	IEEE802154_BEACON_NOTIFY_INDIC,
+	IEEE802154_ORPHAN_INDIC,
+	IEEE802154_ORPHAN_RESP,
+	IEEE802154_COMM_STATUS_INDIC,
+	IEEE802154_SYNC_LOSS_INDIC,
+
+	IEEE802154_GTS_REQ, /* Not supported yet */
+	IEEE802154_GTS_INDIC, /* Not supported yet */
+	IEEE802154_GTS_CONF, /* Not supported yet */
+	IEEE802154_RX_ENABLE_REQ, /* Not supported yet */
+	IEEE802154_RX_ENABLE_CONF, /* Not supported yet */
+
+	__IEEE802154_CMD_MAX,
+};
+
+#define IEEE802154_CMD_MAX (__IEEE802154_CMD_MAX - 1)
+
+#endif
include/net/ieee802154/nl802154.h new file +41 -0

41 lines not on this page · raw message

net/ieee802154/Makefile +2 -1
index cb88054..0b11995 100644
@@ -1,4 +1,5 @@
-obj-$(CONFIG_IEEE802154) +=	af_802154.o
+obj-$(CONFIG_IEEE802154) +=	nl802154.o af_802154.o
+nl802154-objs		:= netlink.o nl_policy.o
 af_802154-objs		:= af_ieee802154.o raw.o dgram.o
 
 EXTRA_CFLAGS += -Wall -DDEBUG
net/ieee802154/netlink.c new file +523 -0

523 lines not on this page · raw message

net/ieee802154/nl_policy.c new file +52 -0

52 lines not on this page · raw message

Signature · 11 lines
1.6.3.1


-- 
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
#15 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

Quoted 11 lines
net/ieee802154/netlink.c new file +10 -0
@@ -0,0 +1,523 @@
+/*
+ * Netlink inteface for IEEE 802.15.4 stack
+ *
+ * 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,

net/ieee802154/netlink.c line 20

Quoted 10 lines
net/ieee802154/netlink.c new file +10 -0
+ * 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, please toss all my @siemens.com addresses from all patches, since my access is already disabled and it's pointless to have invalid emails in source tree. Please replace them with @ossfans.org ones.

#16 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

2009/6/5 Sergey Lapin <[email protected]>:

Quoted 16 lines
Quoted 16 lines
net/ieee802154/netlink.c new file +15 -0
@@ -0,0 +1,523 @@
+/*
+ * Netlink inteface for IEEE 802.15.4 stack
+ *
+ * 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
Quoted 8 lines

net/ieee802154/netlink.c

Quoted 5 lines
net/ieee802154/netlink.c new file +5 -0
+ * 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, please toss all my @siemens.com addresses from all patches, since my access is already disabled and it's pointless to have invalid emails in source tree. Please replace them with @ossfans.org ones.

Could you please send an incremental patch on top of this serie? I hope that my last
push can be pulled/merged and I don't want to redo all commits.

Signature · 2 lines
With best wishes
Dmitry
#17 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

Quoted 3 lines · Dmitry Eremin-Solenikov

Could you please send an incremental patch on top of this serie? I hope that my last
push can be pulled/merged and I don't want to redo all commits.

I would recommend that you use StGit (http://www.procode.org/stgit/) as it makes it a lot easier to incorporate change requests/feedback as you can modify the individual git commits directly.

Cheers,
Jesper Brouer

--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------
--
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

#18 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

In reply to Dmitry Eremin-Solenikov

Hi Dmitry,

Quoted 7 lines
Quoted 3 lines

Dmitry, please toss all my @siemens.com addresses from all patches, since my access is already disabled and it's pointless to have invalid emails in source tree. Please replace them with @ossfans.org ones.

Could you please send an incremental patch on top of this serie? I hope that my last
push can be pulled/merged and I don't want to redo all commits.

either start getting used to git-rebase or manual rebase of commits. You better be familiar with git before asking people to merge. We are expecting you to provide proper trees to pull from a patches to apply.

And since Dave and Johannes already asked you to fix the __KERNEL__ part you have to redo the pull request anyway.

Regards

Marcel

--
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

#19 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

2009/6/5 Marcel Holtmann <[email protected]>:

Quoted 6 lines

Hi Dmitry,

Quoted 4 lines
Quoted 3 lines

Dmitry, please toss all my @siemens.com addresses from all patches, since my access is already disabled and it's pointless to have invalid emails in source tree. Please replace them with @ossfans.org ones.

Quoted 7 lines
Quoted 3 lines

Could you please send an incremental patch on top of this serie? I hope that my last
push can be pulled/merged and I don't want to redo all commits.

either start getting used to git-rebase or manual rebase of commits. You better be familiar with git before asking people to merge. We are expecting you to provide proper trees to pull from a patches to apply.

I am used to git rebase and git merge. I am used to maintaining topic branches and merging them into development trees. I'd just prefer to have a 'merge-ready' branch that isn't rebased too much, if things can be done clearly w/o unnecessary
rebase.

Quoted 2 lines

And since Dave and Johannes already asked you to fix the __KERNEL__ part you have to redo the pull request anyway.

It's done long ago.

Signature · 2 lines
With best wishes
Dmitry
maintainer
#20 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

In reply to Dmitry Eremin-Solenikov

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Fri, 5 Jun 2009 14:45:06 +0400

Quoted 3 lines

Could you please send an incremental patch on top of this serie? I hope that my last
push can be pulled/merged and I don't want to redo all commits.

Dmitry, no shortcuts ok?

Just respin the series and resend it just like anyone else has to.

The changes just aren't ready, and until they are you'll need to respin them like this a few more times.

#21 lore raw

Re: [PATCH 3/5] net: add NL802154 interface for configuration of 802.15.4 devices

2009/6/6, David Miller <[email protected]>:

Quoted 10 lines

From: Dmitry Eremin-Solenikov <[email protected]>

Date: Fri, 5 Jun 2009 14:45:06 +0400

Quoted 3 lines

Could you please send an incremental patch on top of this serie? I hope that my last
push can be pulled/merged and I don't want to redo all commits.

Quoted 6 lines

Dmitry, no shortcuts ok?

Just respin the series and resend it just like anyone else has to.

The changes just aren't ready, and until they are you'll need to respin them like this a few more times.

I'm on vacation for the next following days. In the mean time Sergey Lapin will continue working on this patchset, updating it to pass through review.

Signature · 2 lines
With best wishes
Dmitry