Skip to contentSkip to conversation

ieee802154: structural directory changes

PATCH In review Alexander Aring 2 participants 8 messages Dec 20, 2014 – Dec 30, 2014

Subsystems (2)
lore
Share & tools
lore

Alexander Aring

author maintainer
#0 lore raw

cover ieee802154: structural directory changes

This patch series contains structural changes according the ieee802154 directory. The current situation is that this directory contains stuff about ieee802154 6lowpan, ieee802154 address family and netlink interface. This patch series introduce now sub directories for 6lowpan and af802154 implementation to getting a better overview about these implementations. The ieee802154 directory contains stuff for nl802154, netlink and sysfs only.

Alexander Aring (5):
ieee802154: create af802154 sub-directory
ieee802154: af802154: rename internal header
ieee802154: af802154: rename af_ieee802154 to core
ieee802154: create 6lowpan sub-directory
ieee802154: 6lowpan: rename internal header

 net/ieee802154/{reassembly.h => 6lowpan/6lowpan_i.h} | 6 +++---
 net/ieee802154/{ => 6lowpan}/6lowpan_rtnl.c          | 2 +-
 net/ieee802154/6lowpan/Makefile                      | 3 +++
 net/ieee802154/{ => 6lowpan}/reassembly.c            | 2 +-
 net/ieee802154/Makefile                              | 6 ++----
 net/ieee802154/af802154/Makefile                     | 3 +++
 net/ieee802154/{af802154.h => af802154/af802154_i.h} | 6 +++---
 net/ieee802154/{af_ieee802154.c => af802154/core.c}  | 2 +-
 net/ieee802154/{ => af802154}/dgram.c                | 2 +-
 net/ieee802154/{ => af802154}/raw.c                  | 2 +-
 10 files changed, 19 insertions(+), 15 deletions(-)
 rename net/ieee802154/{reassembly.h => 6lowpan/6lowpan_i.h} (85%)
 rename net/ieee802154/{ => 6lowpan}/6lowpan_rtnl.c (99%)
 create mode 100644 net/ieee802154/6lowpan/Makefile
 rename net/ieee802154/{ => 6lowpan}/reassembly.c (99%)
 create mode 100644 net/ieee802154/af802154/Makefile
 rename net/ieee802154/{af802154.h => af802154/af802154_i.h} (93%)
 rename net/ieee802154/{af_ieee802154.c => af802154/core.c} (99%)
 rename net/ieee802154/{ => af802154}/dgram.c (99%)
 rename net/ieee802154/{ => af802154}/raw.c (99%)
Signature · 1 line
2.2.0
author maintainer
#1 lore raw

PATCH 1/5 ieee802154: create af802154 sub-directory

This patch creates an af802154 sub-directory inside ieee802154. Additional we move all af802154 relevant files into this sub-directory instead of placeing the address family files inside ieee802154.

---
 net/ieee802154/Makefile                       | 3 +--
 net/ieee802154/af802154/Makefile              | 3 +++
 net/ieee802154/{ => af802154}/af802154.h      | 0
 net/ieee802154/{ => af802154}/af_ieee802154.c | 0
 net/ieee802154/{ => af802154}/dgram.c         | 0
 net/ieee802154/{ => af802154}/raw.c           | 0
 6 files changed, 4 insertions(+), 2 deletions(-)
 create mode 100644 net/ieee802154/af802154/Makefile
 rename net/ieee802154/{ => af802154}/af802154.h (100%)
 rename net/ieee802154/{ => af802154}/af_ieee802154.c (100%)
 rename net/ieee802154/{ => af802154}/dgram.c (100%)
 rename net/ieee802154/{ => af802154}/raw.c (100%)
net/ieee802154/Makefile +1 -2
index 9f6970f..9f88d1b 100644
@@ -1,9 +1,8 @@
-obj-$(CONFIG_IEEE802154) += ieee802154.o af_802154.o
+obj-$(CONFIG_IEEE802154) += ieee802154.o af802154/
 obj-$(CONFIG_IEEE802154_6LOWPAN) += ieee802154_6lowpan.o
 
 ieee802154_6lowpan-y := 6lowpan_rtnl.o reassembly.o
 ieee802154-y := netlink.o nl-mac.o nl-phy.o nl_policy.o core.o \
                 header_ops.o sysfs.o nl802154.o
-af_802154-y := af_ieee802154.o raw.o dgram.o
 
 ccflags-y += -D__CHECK_ENDIAN__
net/ieee802154/af802154/Makefile new file +3 -0
new file mode 100644
index 0000000..f039520
@@ -0,0 +1,3 @@
+obj-y += af_802154.o
+
+af_802154-y := af_ieee802154.o raw.o dgram.o
net/ieee802154/af802154/af802154.h renamed from net/ieee802154/af802154.h +0 -0
similarity index 100%
rename from net/ieee802154/af802154.h
rename to net/ieee802154/af802154/af802154.h
net/ieee802154/af802154/af_ieee802154.c renamed from net/ieee802154/af_ieee802154.c +0 -0
similarity index 100%
rename from net/ieee802154/af_ieee802154.c
rename to net/ieee802154/af802154/af_ieee802154.c
net/ieee802154/af802154/dgram.c renamed from net/ieee802154/dgram.c +0 -0
similarity index 100%
rename from net/ieee802154/dgram.c
rename to net/ieee802154/af802154/dgram.c
net/ieee802154/af802154/raw.c renamed from net/ieee802154/raw.c +0 -0
similarity index 100%
rename from net/ieee802154/raw.c
rename to net/ieee802154/af802154/raw.c
Signature · 1 line
2.2.0
author maintainer
#2 lore raw

PATCH 2/5 ieee802154: af802154: rename internal header

In reply to Alexander Aring

This patch renames the internal header for af802154. This naming convention is like ieee802154_i.h in mac802154 and avoids naming confusing with the global af802154 header.

---
 net/ieee802154/af802154/{af802154.h => af802154_i.h} | 6 +++---
 net/ieee802154/af802154/af_ieee802154.c              | 2 +-
 net/ieee802154/af802154/dgram.c                      | 2 +-
 net/ieee802154/af802154/raw.c                        | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
 rename net/ieee802154/af802154/{af802154.h => af802154_i.h} (93%)
net/ieee802154/af802154/af802154_i.h renamed from net/ieee802154/af802154/af802154.h +3 -3
similarity index 93%
rename from net/ieee802154/af802154/af802154.h
rename to net/ieee802154/af802154/af802154_i.h
index 343b63e..e5c7bb5 100644
@@ -17,8 +17,8 @@
  * Dmitry Eremin-Solenikov <[email protected]>
  */
 
-#ifndef AF802154_H
-#define AF802154_H
+#ifndef AF802154_I_H
+#define AF802154_I_H
 
 struct sk_buff;
 struct net_device;
@@ -30,4 +30,4 @@ int ieee802154_dgram_deliver(struct net_device *dev, struct sk_buff *skb);
 struct net_device *ieee802154_get_dev(struct net *net,
 				      const struct ieee802154_addr *addr);
 
-#endif
+#endif /* AF802154_I_H */
net/ieee802154/af802154/af_ieee802154.c +1 -1
index d0a1282..41a7bcf 100644
@@ -34,7 +34,7 @@
 #include <net/af_ieee802154.h>
 #include <net/ieee802154_netdev.h>
 
-#include "af802154.h"
+#include "af802154_i.h"
 
 /* Utility function for families */
 struct net_device*
net/ieee802154/af802154/dgram.c +1 -1
index d1930b7..3a8487b 100644
@@ -30,7 +30,7 @@
 
 #include <asm/ioctls.h>
 
-#include "af802154.h"
+#include "af802154_i.h"
 
 static HLIST_HEAD(dgram_head);
 static DEFINE_RWLOCK(dgram_lock);
net/ieee802154/af802154/raw.c +1 -1
index 1674b115..0315f76 100644
@@ -26,7 +26,7 @@
 #include <net/af_ieee802154.h>
 #include <net/ieee802154_netdev.h>
 
-#include "af802154.h"
+#include "af802154_i.h"
 
 static HLIST_HEAD(raw_head);
 static DEFINE_RWLOCK(raw_lock);
Signature · 1 line
2.2.0
author maintainer
#3 lore raw

PATCH 3/5 ieee802154: af802154: rename af_ieee802154 to core

In reply to Alexander Aring

This patch renames the af_ieee802154 file to core. This file contains some core af802154 functionality which is used by raw and dgram socket implementation.

---
 net/ieee802154/af802154/Makefile                    | 2 +-
 net/ieee802154/af802154/{af_ieee802154.c => core.c} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename net/ieee802154/af802154/{af_ieee802154.c => core.c} (100%)
net/ieee802154/af802154/Makefile +1 -1
index f039520..d37fd88 100644
@@ -1,3 +1,3 @@
 obj-y += af_802154.o
 
-af_802154-y := af_ieee802154.o raw.o dgram.o
+af_802154-y := core.o raw.o dgram.o
net/ieee802154/af802154/core.c renamed from net/ieee802154/af802154/af_ieee802154.c +0 -0
similarity index 100%
rename from net/ieee802154/af802154/af_ieee802154.c
rename to net/ieee802154/af802154/core.c
Signature · 1 line
2.2.0
author maintainer
#4 lore raw

PATCH 4/5 ieee802154: create 6lowpan sub-directory

In reply to Alexander Aring

This patch creates an 6lowpan sub-directory inside ieee802154. Additional we move all ieee802154 6lowpan relevant files into this sub-directory instead of placeing the 6lowpan related files inside ieee802154.

---
 net/ieee802154/{ => 6lowpan}/6lowpan_rtnl.c | 0
 net/ieee802154/6lowpan/Makefile             | 3 +++
 net/ieee802154/{ => 6lowpan}/reassembly.c   | 0
 net/ieee802154/{ => 6lowpan}/reassembly.h   | 0
 net/ieee802154/Makefile                     | 3 +--
 5 files changed, 4 insertions(+), 2 deletions(-)
 rename net/ieee802154/{ => 6lowpan}/6lowpan_rtnl.c (100%)
 create mode 100644 net/ieee802154/6lowpan/Makefile
 rename net/ieee802154/{ => 6lowpan}/reassembly.c (100%)
 rename net/ieee802154/{ => 6lowpan}/reassembly.h (100%)
net/ieee802154/6lowpan/6lowpan_rtnl.c renamed from net/ieee802154/6lowpan_rtnl.c +0 -0
similarity index 100%
rename from net/ieee802154/6lowpan_rtnl.c
rename to net/ieee802154/6lowpan/6lowpan_rtnl.c
net/ieee802154/6lowpan/Makefile new file +3 -0
new file mode 100644
index 0000000..936959b
@@ -0,0 +1,3 @@
+obj-y += ieee802154_6lowpan.o
+
+ieee802154_6lowpan-y := 6lowpan_rtnl.o reassembly.o
net/ieee802154/6lowpan/reassembly.c renamed from net/ieee802154/reassembly.c +0 -0
similarity index 100%
rename from net/ieee802154/reassembly.c
rename to net/ieee802154/6lowpan/reassembly.c
net/ieee802154/6lowpan/reassembly.h renamed from net/ieee802154/reassembly.h +0 -0
similarity index 100%
rename from net/ieee802154/reassembly.h
rename to net/ieee802154/6lowpan/reassembly.h
net/ieee802154/Makefile +1 -2
index 9f88d1b..5af3d7e 100644
@@ -1,7 +1,6 @@
 obj-$(CONFIG_IEEE802154) += ieee802154.o af802154/
-obj-$(CONFIG_IEEE802154_6LOWPAN) += ieee802154_6lowpan.o
+obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan/
 
-ieee802154_6lowpan-y := 6lowpan_rtnl.o reassembly.o
 ieee802154-y := netlink.o nl-mac.o nl-phy.o nl_policy.o core.o \
                 header_ops.o sysfs.o nl802154.o
 
Signature · 1 line
2.2.0
author maintainer
#5 lore raw

PATCH 5/5 ieee802154: 6lowpan: rename internal header

In reply to Alexander Aring

This patch renames the internal header for af802154. This naming convention is like ieee802154_i.h in mac802154 and avoids naming confusing with the global af802154 header. Furthermore this header contains more ieee802154 specific definitions.

---
 net/ieee802154/6lowpan/{reassembly.h => 6lowpan_i.h} | 6 +++---
 net/ieee802154/6lowpan/6lowpan_rtnl.c                | 2 +-
 net/ieee802154/6lowpan/reassembly.c                  | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
 rename net/ieee802154/6lowpan/{reassembly.h => 6lowpan_i.h} (85%)
net/ieee802154/6lowpan/6lowpan_i.h renamed from net/ieee802154/6lowpan/reassembly.h +3 -3
similarity index 85%
rename from net/ieee802154/6lowpan/reassembly.h
rename to net/ieee802154/6lowpan/6lowpan_i.h
index 836b16f..edbe803 100644
@@ -1,5 +1,5 @@
-#ifndef __IEEE802154_6LOWPAN_REASSEMBLY_H__
-#define __IEEE802154_6LOWPAN_REASSEMBLY_H__
+#ifndef __IEEE802154_6LOWPAN_I_H__
+#define __IEEE802154_6LOWPAN_I_H__
 
 #include <net/inet_frag.h>
 
@@ -38,4 +38,4 @@ int lowpan_frag_rcv(struct sk_buff *skb, const u8 frag_type);
 void lowpan_net_frag_exit(void);
 int lowpan_net_frag_init(void);
 
-#endif /* __IEEE802154_6LOWPAN_REASSEMBLY_H__ */
+#endif /* __IEEE802154_6LOWPAN_I_H__ */
net/ieee802154/6lowpan/6lowpan_rtnl.c +1 -1
index 27eaa65..1918c43 100644
@@ -55,7 +55,7 @@
 #include <net/6lowpan.h>
 #include <net/ipv6.h>
 
-#include "reassembly.h"
+#include "6lowpan_i.h"
 
 static LIST_HEAD(lowpan_devices);
 static int lowpan_open_count;
net/ieee802154/6lowpan/reassembly.c +1 -1
index 9d980ed..f46e4d1 100644
@@ -28,7 +28,7 @@
 #include <net/ipv6.h>
 #include <net/inet_frag.h>
 
-#include "reassembly.h"
+#include "6lowpan_i.h"
 
 static const char lowpan_frags_cache_name[] = "lowpan-frags";
 
Signature · 1 line
2.2.0
#6 lore raw
In reply to Alexander Aring

Hi Alex,

Quoted 26 lines

This patch series contains structural changes according the ieee802154 directory. The current situation is that this directory contains stuff about ieee802154 6lowpan, ieee802154 address family and netlink interface. This patch series introduce now sub directories for 6lowpan and af802154 implementation to getting a better overview about these implementations. The ieee802154 directory contains stuff for nl802154, netlink and sysfs only.

Alexander Aring (5):
ieee802154: create af802154 sub-directory
ieee802154: af802154: rename internal header
ieee802154: af802154: rename af_ieee802154 to core
ieee802154: create 6lowpan sub-directory
ieee802154: 6lowpan: rename internal header

net/ieee802154/{reassembly.h => 6lowpan/6lowpan_i.h} | 6 +++---
net/ieee802154/{ => 6lowpan}/6lowpan_rtnl.c          | 2 +-
net/ieee802154/6lowpan/Makefile                      | 3 +++
net/ieee802154/{ => 6lowpan}/reassembly.c            | 2 +-
net/ieee802154/Makefile                              | 6 ++----
net/ieee802154/af802154/Makefile                     | 3 +++
net/ieee802154/{af802154.h => af802154/af802154_i.h} | 6 +++---
net/ieee802154/{af_ieee802154.c => af802154/core.c}  | 2 +-
net/ieee802154/{ => af802154}/dgram.c                | 2 +-
net/ieee802154/{ => af802154}/raw.c                  | 2 +-
10 files changed, 19 insertions(+), 15 deletions(-)
Quoted 9 lines

rename net/ieee802154/{reassembly.h => 6lowpan/6lowpan_i.h} (85%) rename net/ieee802154/{ => 6lowpan}/6lowpan_rtnl.c (99%) create mode 100644 net/ieee802154/6lowpan/Makefile rename net/ieee802154/{ => 6lowpan}/reassembly.c (99%) create mode 100644 net/ieee802154/af802154/Makefile rename net/ieee802154/{af802154.h => af802154/af802154_i.h} (93%) rename net/ieee802154/{af_ieee802154.c => af802154/core.c} (99%) rename net/ieee802154/{ => af802154}/dgram.c (99%) rename net/ieee802154/{ => af802154}/raw.c (99%)

the move of the 6lowpan stuff into net/ieee802154/6lowpan/ I can understand. That should be an optional piece. And I assume for 802.15.4 the 6LoWPAN support is more complex since it has to do segmentation and reassembly.

The net/ieee802154/af802154/ part seems pointless to me. What is this trying to achieve? I see that you can build af_802154.ko as a separate module. Which is something that I have not realized until now. So this is something that is intentional. So having ieee802154.ko and ieee802154_6lowpan.ko by itself without the socket is something that is functional?

If so, I find the naming of af_802154.ko and net/ieee802154/af802154/ rather complicated and convoluted. Would ieee802154_socket.ko net/ieee802154/socket/ not something more logical split in this regard?

Regards

Marcel

author maintainer
#7 lore raw

Hi Marcel,

Quoted 38 lines · Marcel Holtmann

Hi Alex,

Quoted 26 lines

This patch series contains structural changes according the ieee802154 directory. The current situation is that this directory contains stuff about ieee802154 6lowpan, ieee802154 address family and netlink interface. This patch series introduce now sub directories for 6lowpan and af802154 implementation to getting a better overview about these implementations. The ieee802154 directory contains stuff for nl802154, netlink and sysfs only.

Alexander Aring (5):
ieee802154: create af802154 sub-directory
ieee802154: af802154: rename internal header
ieee802154: af802154: rename af_ieee802154 to core
ieee802154: create 6lowpan sub-directory
ieee802154: 6lowpan: rename internal header

net/ieee802154/{reassembly.h => 6lowpan/6lowpan_i.h} | 6 +++---
net/ieee802154/{ => 6lowpan}/6lowpan_rtnl.c          | 2 +-
net/ieee802154/6lowpan/Makefile                      | 3 +++
net/ieee802154/{ => 6lowpan}/reassembly.c            | 2 +-
net/ieee802154/Makefile                              | 6 ++----
net/ieee802154/af802154/Makefile                     | 3 +++
net/ieee802154/{af802154.h => af802154/af802154_i.h} | 6 +++---
net/ieee802154/{af_ieee802154.c => af802154/core.c}  | 2 +-
net/ieee802154/{ => af802154}/dgram.c                | 2 +-
net/ieee802154/{ => af802154}/raw.c                  | 2 +-
10 files changed, 19 insertions(+), 15 deletions(-)
Quoted 9 lines

rename net/ieee802154/{reassembly.h => 6lowpan/6lowpan_i.h} (85%) rename net/ieee802154/{ => 6lowpan}/6lowpan_rtnl.c (99%) create mode 100644 net/ieee802154/6lowpan/Makefile rename net/ieee802154/{ => 6lowpan}/reassembly.c (99%) create mode 100644 net/ieee802154/af802154/Makefile rename net/ieee802154/{af802154.h => af802154/af802154_i.h} (93%) rename net/ieee802154/{af_ieee802154.c => af802154/core.c} (99%) rename net/ieee802154/{ => af802154}/dgram.c (99%) rename net/ieee802154/{ => af802154}/raw.c (99%)

Quoted 2 lines

the move of the 6lowpan stuff into net/ieee802154/6lowpan/ I can understand. That should be an optional piece. And I assume for 802.15.4 the 6LoWPAN support is more complex since it has to do segmentation and reassembly.

ok.

Quoted 2 lines

The net/ieee802154/af802154/ part seems pointless to me. What is this trying to achieve? I see that you can build af_802154.ko as a separate module. Which is something that I have not realized until now. So this is something that is intentional. So having ieee802154.ko and ieee802154_6lowpan.ko by itself without the socket is something that is functional?

Yes, the address family functionality can be a separate module. ieee802154_6lowpan.ko doesn't depends on the address family functionality.

If only ieee802154.ko would built without address family and ieee802154_6lowpan.ko then it might be used for receiving monitor mode.

I would change that but add a "default y" to the address family module.

Quoted 2 lines

If so, I find the naming of af_802154.ko and net/ieee802154/af802154/ rather complicated and convoluted. Would ieee802154_socket.ko net/ieee802154/socket/ not something more logical split in this regard?

Don't know, I would keep the naming style to avoid confusing current users. On the other hand, I think there are not many users outside and I like the name socket. Many people knows sockets and doesn't know what a (socket) "address family" is.

I will send a second version of this patch series according these changes.

- Alex