linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bluetooth-next] 6lowpan: move shared settings to lowpan_netdev_setup
@ 2015-10-02 18:28 Alexander Aring
  2015-10-05  8:00 ` Jukka Rissanen
  2015-10-08 12:26 ` Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Aring @ 2015-10-02 18:28 UTC (permalink / raw)
  To: linux-wpan; +Cc: kernel, linux-bluetooth, Alexander Aring, Jukka Rissanen

This patch moves values for all lowpan interface to the shared
implementation of 6lowpan. This patch also quietly fixes the forgotten
IFF_NO_QUEUE flag for the bluetooth 6LoWPAN interface. An identically
commit is 4afbc0d ("net: 6lowpan: convert to using IFF_NO_QUEUE") which
wasn't changed for bluetooth 6lowpan.

All 6lowpan interfaces should be virtual with IFF_NO_QUEUE, using EUI64
address length, the mtu size is 1280 (IPV6_MIN_MTU) and the netdev type
is ARPHRD_6LOWPAN.

Cc: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 include/net/6lowpan.h         | 2 ++
 net/6lowpan/core.c            | 5 +++++
 net/bluetooth/6lowpan.c       | 6 ------
 net/ieee802154/6lowpan/core.c | 4 ----
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
index c17f556..07db532 100644
--- a/include/net/6lowpan.h
+++ b/include/net/6lowpan.h
@@ -61,6 +61,8 @@
 #define UIP_PROTO_UDP			17 /* ipv6 next header value for UDP */
 #define UIP_FRAGH_LEN			8  /* ipv6 fragment header size */
 
+#define EUI64_ADDR_LEN		8
+
 #define LOWPAN_NHC_MAX_ID_LEN	1
 /* Max IPHC Header len without IPv6 hdr specific inline data.
  * Useful for getting the "extra" bytes we need at worst case compression.
diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
index ae1896f..83b19e0 100644
--- a/net/6lowpan/core.c
+++ b/net/6lowpan/core.c
@@ -17,6 +17,11 @@
 
 void lowpan_netdev_setup(struct net_device *dev, enum lowpan_lltypes lltype)
 {
+	dev->addr_len = EUI64_ADDR_LEN;
+	dev->type = ARPHRD_6LOWPAN;
+	dev->mtu = IPV6_MIN_MTU;
+	dev->priv_flags |= IFF_NO_QUEUE;
+
 	lowpan_priv(dev)->lltype = lltype;
 }
 EXPORT_SYMBOL(lowpan_netdev_setup);
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 131e79c..bc840a5 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -35,7 +35,6 @@ static struct dentry *lowpan_enable_debugfs;
 static struct dentry *lowpan_control_debugfs;
 
 #define IFACE_NAME_TEMPLATE "bt%d"
-#define EUI64_ADDR_LEN 8
 
 struct skb_cb {
 	struct in6_addr addr;
@@ -674,13 +673,8 @@ static struct header_ops header_ops = {
 
 static void netdev_setup(struct net_device *dev)
 {
-	dev->addr_len		= EUI64_ADDR_LEN;
-	dev->type		= ARPHRD_6LOWPAN;
-
 	dev->hard_header_len	= 0;
 	dev->needed_tailroom	= 0;
-	dev->mtu		= IPV6_MIN_MTU;
-	dev->tx_queue_len	= 0;
 	dev->flags		= IFF_RUNNING | IFF_POINTOPOINT |
 				  IFF_MULTICAST;
 	dev->watchdog_timeo	= 0;
diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
index 44420ed..20c49c7 100644
--- a/net/ieee802154/6lowpan/core.c
+++ b/net/ieee802154/6lowpan/core.c
@@ -101,13 +101,9 @@ static const struct net_device_ops lowpan_netdev_ops = {
 
 static void lowpan_setup(struct net_device *ldev)
 {
-	ldev->addr_len		= IEEE802154_ADDR_LEN;
 	memset(ldev->broadcast, 0xff, IEEE802154_ADDR_LEN);
-	ldev->type		= ARPHRD_6LOWPAN;
 	/* We need an ipv6hdr as minimum len when calling xmit */
 	ldev->hard_header_len	= sizeof(struct ipv6hdr);
-	ldev->mtu		= IPV6_MIN_MTU;
-	ldev->priv_flags	|= IFF_NO_QUEUE;
 	ldev->flags		= IFF_BROADCAST | IFF_MULTICAST;
 
 	ldev->netdev_ops	= &lowpan_netdev_ops;
-- 
2.6.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bluetooth-next] 6lowpan: move shared settings to lowpan_netdev_setup
  2015-10-02 18:28 [PATCH bluetooth-next] 6lowpan: move shared settings to lowpan_netdev_setup Alexander Aring
@ 2015-10-05  8:00 ` Jukka Rissanen
  2015-10-08 12:26 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Jukka Rissanen @ 2015-10-05  8:00 UTC (permalink / raw)
  To: Alexander Aring; +Cc: linux-wpan, kernel, linux-bluetooth

Hi Alex,

this makes sense so ACK from me.


Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>


On pe, 2015-10-02 at 20:28 +0200, Alexander Aring wrote:
> This patch moves values for all lowpan interface to the shared
> implementation of 6lowpan. This patch also quietly fixes the forgotten
> IFF_NO_QUEUE flag for the bluetooth 6LoWPAN interface. An identically
> commit is 4afbc0d ("net: 6lowpan: convert to using IFF_NO_QUEUE") which
> wasn't changed for bluetooth 6lowpan.
> 
> All 6lowpan interfaces should be virtual with IFF_NO_QUEUE, using EUI64
> address length, the mtu size is 1280 (IPV6_MIN_MTU) and the netdev type
> is ARPHRD_6LOWPAN.
> 
> Cc: Jukka Rissanen <jukka.rissanen@linux.intel.com>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
>  include/net/6lowpan.h         | 2 ++
>  net/6lowpan/core.c            | 5 +++++
>  net/bluetooth/6lowpan.c       | 6 ------
>  net/ieee802154/6lowpan/core.c | 4 ----
>  4 files changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
> index c17f556..07db532 100644
> --- a/include/net/6lowpan.h
> +++ b/include/net/6lowpan.h
> @@ -61,6 +61,8 @@
>  #define UIP_PROTO_UDP			17 /* ipv6 next header value for UDP */
>  #define UIP_FRAGH_LEN			8  /* ipv6 fragment header size */
>  
> +#define EUI64_ADDR_LEN		8
> +
>  #define LOWPAN_NHC_MAX_ID_LEN	1
>  /* Max IPHC Header len without IPv6 hdr specific inline data.
>   * Useful for getting the "extra" bytes we need at worst case compression.
> diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
> index ae1896f..83b19e0 100644
> --- a/net/6lowpan/core.c
> +++ b/net/6lowpan/core.c
> @@ -17,6 +17,11 @@
>  
>  void lowpan_netdev_setup(struct net_device *dev, enum lowpan_lltypes lltype)
>  {
> +	dev->addr_len = EUI64_ADDR_LEN;
> +	dev->type = ARPHRD_6LOWPAN;
> +	dev->mtu = IPV6_MIN_MTU;
> +	dev->priv_flags |= IFF_NO_QUEUE;
> +
>  	lowpan_priv(dev)->lltype = lltype;
>  }
>  EXPORT_SYMBOL(lowpan_netdev_setup);
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index 131e79c..bc840a5 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -35,7 +35,6 @@ static struct dentry *lowpan_enable_debugfs;
>  static struct dentry *lowpan_control_debugfs;
>  
>  #define IFACE_NAME_TEMPLATE "bt%d"
> -#define EUI64_ADDR_LEN 8
>  
>  struct skb_cb {
>  	struct in6_addr addr;
> @@ -674,13 +673,8 @@ static struct header_ops header_ops = {
>  
>  static void netdev_setup(struct net_device *dev)
>  {
> -	dev->addr_len		= EUI64_ADDR_LEN;
> -	dev->type		= ARPHRD_6LOWPAN;
> -
>  	dev->hard_header_len	= 0;
>  	dev->needed_tailroom	= 0;
> -	dev->mtu		= IPV6_MIN_MTU;
> -	dev->tx_queue_len	= 0;
>  	dev->flags		= IFF_RUNNING | IFF_POINTOPOINT |
>  				  IFF_MULTICAST;
>  	dev->watchdog_timeo	= 0;
> diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
> index 44420ed..20c49c7 100644
> --- a/net/ieee802154/6lowpan/core.c
> +++ b/net/ieee802154/6lowpan/core.c
> @@ -101,13 +101,9 @@ static const struct net_device_ops lowpan_netdev_ops = {
>  
>  static void lowpan_setup(struct net_device *ldev)
>  {
> -	ldev->addr_len		= IEEE802154_ADDR_LEN;
>  	memset(ldev->broadcast, 0xff, IEEE802154_ADDR_LEN);
> -	ldev->type		= ARPHRD_6LOWPAN;
>  	/* We need an ipv6hdr as minimum len when calling xmit */
>  	ldev->hard_header_len	= sizeof(struct ipv6hdr);
> -	ldev->mtu		= IPV6_MIN_MTU;
> -	ldev->priv_flags	|= IFF_NO_QUEUE;
>  	ldev->flags		= IFF_BROADCAST | IFF_MULTICAST;
>  
>  	ldev->netdev_ops	= &lowpan_netdev_ops;


Cheers,
Jukka




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bluetooth-next] 6lowpan: move shared settings to lowpan_netdev_setup
  2015-10-02 18:28 [PATCH bluetooth-next] 6lowpan: move shared settings to lowpan_netdev_setup Alexander Aring
  2015-10-05  8:00 ` Jukka Rissanen
@ 2015-10-08 12:26 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2015-10-08 12:26 UTC (permalink / raw)
  To: Alexander Aring; +Cc: linux-wpan, kernel, linux-bluetooth, Jukka Rissanen

Hi Alex,

> This patch moves values for all lowpan interface to the shared
> implementation of 6lowpan. This patch also quietly fixes the forgotten
> IFF_NO_QUEUE flag for the bluetooth 6LoWPAN interface. An identically
> commit is 4afbc0d ("net: 6lowpan: convert to using IFF_NO_QUEUE") which
> wasn't changed for bluetooth 6lowpan.
> 
> All 6lowpan interfaces should be virtual with IFF_NO_QUEUE, using EUI64
> address length, the mtu size is 1280 (IPV6_MIN_MTU) and the netdev type
> is ARPHRD_6LOWPAN.
> 
> Cc: Jukka Rissanen <jukka.rissanen@linux.intel.com>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
> include/net/6lowpan.h         | 2 ++
> net/6lowpan/core.c            | 5 +++++
> net/bluetooth/6lowpan.c       | 6 ------
> net/ieee802154/6lowpan/core.c | 4 ----
> 4 files changed, 7 insertions(+), 10 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-08 12:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-02 18:28 [PATCH bluetooth-next] 6lowpan: move shared settings to lowpan_netdev_setup Alexander Aring
2015-10-05  8:00 ` Jukka Rissanen
2015-10-08 12:26 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).