Skip to contentSkip to conversation

IEEE 802.15.4 last-minute fixes.

GIT PULL New Dmitry Eremin-Solenikov 3 participants 13 messages Aug 3, 2009 – Aug 5, 2009 3 messages not in the archive

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

Hi,

Please pull several minor fixes for the IEEE 802.15.4 stack.

The following changes since commit e4c4e448cf557921ffbbbd6d6ddac81fdceacb4f:
Eric Dumazet (1):
neigh: Convert garbage collection from softirq to workqueue

are available in the git repository at:

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

Dmitry Eremin-Solenikov (5):
af_ieee802154: drop IEEE802154_SIOC_ADD_SLAVE declaration
af_ieee802154: fix ioctl processing
nl802154: make ieee802154_policy constant
documentation: fix wrt. headers rename
af_ieee802154: provide dummy get/setsockopt

 Documentation/networking/ieee802154.txt |    9 ++++-----
 include/linux/nl802154.h                |    2 +-
 include/net/af_ieee802154.h             |    3 ---
 net/ieee802154/af_ieee802154.c          |    8 +++++---
 net/ieee802154/dgram.c                  |   14 ++++++++++++++
 net/ieee802154/nl_policy.c              |    3 ++-
 net/ieee802154/raw.c                    |   14 ++++++++++++++
 7 files changed, 40 insertions(+), 13 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#1 lore raw

PATCH 1/5 af_ieee802154: drop IEEE802154_SIOC_ADD_SLAVE declaration

IEEE802154_SIOC_ADD_SLAVE was used to allocate 802.15.4 interfaces on the top of radio. It's not used anymore, drop it.

---
 include/net/af_ieee802154.h |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
include/net/af_ieee802154.h +0 -3
index 0d78605..e9c70ea 100644
@@ -54,7 +54,4 @@ struct sockaddr_ieee802154 {
 	struct ieee802154_addr addr;
 };
 
-/* master device */
-#define IEEE802154_SIOC_ADD_SLAVE		(SIOCDEVPRIVATE + 0)
-
 #endif
Signature · 1 line
1.6.3.3
#2 lore raw

PATCH 2/5 af_ieee802154: fix ioctl processing

fix two errors in ioctl processing:
1) if the ioctl isn't supported one should return -ENOIOCTLCMD
2) don't call ndo_do_ioctl if the device doesn't provide it

---
 net/ieee802154/af_ieee802154.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
net/ieee802154/af_ieee802154.c +5 -3
index 69c8d92..d504c34 100644
@@ -136,7 +136,7 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg,
 		unsigned int cmd)
 {
 	struct ifreq ifr;
-	int ret = -EINVAL;
+	int ret = -ENOIOCTLCMD;
 	struct net_device *dev;
 
 	if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
@@ -146,8 +146,10 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg,
 
 	dev_load(sock_net(sk), ifr.ifr_name);
 	dev = dev_get_by_name(sock_net(sk), ifr.ifr_name);
-	if (dev->type == ARPHRD_IEEE802154 ||
-	    dev->type == ARPHRD_IEEE802154_PHY)
+
+	if ((dev->type == ARPHRD_IEEE802154 ||
+	     dev->type == ARPHRD_IEEE802154_PHY) &&
+	    dev->netdev_ops->ndo_do_ioctl)
 		ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, cmd);
 
 	if (!ret && copy_to_user(arg, &ifr, sizeof(struct ifreq)))
Signature · 1 line
1.6.3.3
#3 lore raw

PATCH 2/5 af_ieee802154: fix ioctl processing

In reply to Dmitry Eremin-Solenikov

fix two errors in ioctl processing:
1) if the ioctl isn't supported one should return -ENOIOCTLCMD
2) don't call ndo_do_ioctl if the device doesn't provide it

---
 net/ieee802154/af_ieee802154.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
net/ieee802154/af_ieee802154.c +5 -3
index 69c8d92..d504c34 100644
@@ -136,7 +136,7 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg,
 		unsigned int cmd)
 {
 	struct ifreq ifr;
-	int ret = -EINVAL;
+	int ret = -ENOIOCTLCMD;
 	struct net_device *dev;
 
 	if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
@@ -146,8 +146,10 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg,
 
 	dev_load(sock_net(sk), ifr.ifr_name);
 	dev = dev_get_by_name(sock_net(sk), ifr.ifr_name);
-	if (dev->type == ARPHRD_IEEE802154 ||
-	    dev->type == ARPHRD_IEEE802154_PHY)
+
+	if ((dev->type == ARPHRD_IEEE802154 ||
+	     dev->type == ARPHRD_IEEE802154_PHY) &&
+	    dev->netdev_ops->ndo_do_ioctl)
 		ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, cmd);
 
 	if (!ret && copy_to_user(arg, &ifr, sizeof(struct ifreq)))
Signature · 1 line
1.6.3.3
#4 lore raw

PATCH 3/5 nl802154: make ieee802154_policy constant

---
 include/linux/nl802154.h   |    2 +-
 net/ieee802154/nl_policy.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
include/linux/nl802154.h +1 -1
index 2cda00c..266dd96 100644
@@ -69,7 +69,7 @@ enum {
 
 #define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1)
 
-extern struct nla_policy ieee802154_policy[];
+extern const struct nla_policy ieee802154_policy[];
 
 /* commands */
 /* REQ should be responded with CONF
net/ieee802154/nl_policy.c +2 -1
index c7d71d1..83cb4cc 100644
@@ -24,7 +24,7 @@
 
 #define NLA_HW_ADDR NLA_U64
 
-struct nla_policy ieee802154_policy[IEEE802154_ATTR_MAX + 1] = {
+const struct nla_policy ieee802154_policy[IEEE802154_ATTR_MAX + 1] = {
 	[IEEE802154_ATTR_DEV_NAME] = { .type = NLA_STRING, },
 	[IEEE802154_ATTR_DEV_INDEX] = { .type = NLA_U32, },
 
@@ -50,3 +50,4 @@ struct nla_policy ieee802154_policy[IEEE802154_ATTR_MAX + 1] = {
 	[IEEE802154_ATTR_DURATION] = { .type = NLA_U8, },
 	[IEEE802154_ATTR_ED_LIST] = { .len = 27 },
 };
+
Signature · 1 line
1.6.3.3
#5 lore raw

PATCH 4/5 documentation: fix wrt. headers rename

---
 Documentation/networking/ieee802154.txt |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
Documentation/networking/ieee802154.txt +4 -5
index 1d4ed66..1c0c82c 100644
@@ -22,7 +22,7 @@ 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
+include/net/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).
 
@@ -33,7 +33,7 @@ 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 the include/net/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.
 
@@ -54,7 +54,7 @@ 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
+See the header include/net/ieee802154_netdev.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.
@@ -72,5 +72,4 @@ SoftMAC
 We are going to provide intermediate layer implementing IEEE 802.15.4 MAC
 in software. This is currently WIP.
 
-See header include/net/ieee802154/mac802154.h and several drivers in
-drivers/ieee802154/
+See header include/net/mac802154.h and several drivers in drivers/ieee802154/.
Signature · 1 line
1.6.3.3

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

#7 lore raw

PATCH 5/5 af_ieee802154: provide dummy get/setsockopt

Provide dummt get/setsockopt implementations to stop these syscalls from oopsing on our sockets.

---
 net/ieee802154/dgram.c |   14 ++++++++++++++
 net/ieee802154/raw.c   |   14 ++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)
net/ieee802154/dgram.c +14 -0
index 53dd912..d1da6c6 100644
@@ -377,6 +377,18 @@ int ieee802154_dgram_deliver(struct net_device *dev, struct sk_buff *skb)
 	return ret;
 }
 
+static int dgram_getsockopt(struct sock *sk, int level, int optname,
+		    char __user *optval, int __user *optlen)
+{
+	return -EOPNOTSUPP;
+}
+
+static int dgram_setsockopt(struct sock *sk, int level, int optname,
+		    char __user *optval, int __user optlen)
+{
+	return -EOPNOTSUPP;
+}
+
 struct proto ieee802154_dgram_prot = {
 	.name		= "IEEE-802.15.4-MAC",
 	.owner		= THIS_MODULE,
@@ -391,5 +403,7 @@ struct proto ieee802154_dgram_prot = {
 	.connect	= dgram_connect,
 	.disconnect	= dgram_disconnect,
 	.ioctl		= dgram_ioctl,
+	.getsockopt	= dgram_getsockopt,
+	.setsockopt	= dgram_setsockopt,
 };
 
net/ieee802154/raw.c +14 -0
index ea8d1f1..60dee69 100644
@@ -238,6 +238,18 @@ void ieee802154_raw_deliver(struct net_device *dev, struct sk_buff *skb)
 	read_unlock(&raw_lock);
 }
 
+static int raw_getsockopt(struct sock *sk, int level, int optname,
+		    char __user *optval, int __user *optlen)
+{
+	return -EOPNOTSUPP;
+}
+
+static int raw_setsockopt(struct sock *sk, int level, int optname,
+		    char __user *optval, int __user optlen)
+{
+	return -EOPNOTSUPP;
+}
+
 struct proto ieee802154_raw_prot = {
 	.name		= "IEEE-802.15.4-RAW",
 	.owner		= THIS_MODULE,
@@ -250,5 +262,7 @@ struct proto ieee802154_raw_prot = {
 	.unhash		= raw_unhash,
 	.connect	= raw_connect,
 	.disconnect	= raw_disconnect,
+	.getsockopt	= raw_getsockopt,
+	.setsockopt	= raw_setsockopt,
 };
 
Signature · 8 lines
1.6.3.3


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
maintainer
#8 lore raw
In reply to Dmitry Eremin-Solenikov

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Tue, 4 Aug 2009 02:51:37 +0400

Quoted 1 line

Please pull several minor fixes for the IEEE 802.15.4 stack.

No.

Removing an unused macro IS NOT A BUG FIX!

Marking a variable 'const' IS NOT A BUG FIX!

And therefore it is absolutely, positively, not appropriate for 2.6.31-rcX at this time.

Do not send any more patches to me until you can sort your changes properly.

I'm tossing this entire series.

#9 lore raw
Quoted 9 lines · David Miller

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Tue, 4 Aug 2009 02:51:37 +0400

Quoted 1 line

Please pull several minor fixes for the IEEE 802.15.4 stack.

No.

Removing an unused macro IS NOT A BUG FIX!

Quoted 7 lines

Marking a variable 'const' IS NOT A BUG FIX!

And therefore it is absolutely, positively, not appropriate for 2.6.31-rcX at this time.

Do not send any more patches to me until you can sort your changes properly.

Will you pull the serie if I'll remove those two patches? Documentation fix isn't that important, however I'd really ask to pull the remaining two patches.

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

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Tue, 4 Aug 2009 12:51:48 +0400

Quoted 3 lines

Will you pull the serie if I'll remove those two patches? Documentation fix isn't that important, however I'd really ask to pull the remaining two patches.

Yes.

A message that is not in the archive (sent off-list or not yet received): 20090804.055810.201482741.davem-fT/PcQaiUtIeIZ0/[email protected]

#12 lore raw
Quoted 8 lines · David Miller

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Tue, 4 Aug 2009 12:51:48 +0400

Quoted 3 lines

Will you pull the serie if I'll remove those two patches? Documentation fix isn't that important, however I'd really ask to pull the remaining two patches.

Yes.

Pushed the updated branch. Please pull.

The following changes since commit e4c4e448cf557921ffbbbd6d6ddac81fdceacb4f:
Eric Dumazet (1):
neigh: Convert garbage collection from softirq to workqueue

are available in the git repository at:

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

Dmitry Eremin-Solenikov (3):
af_ieee802154: fix ioctl processing
af_ieee802154: provide dummy get/setsockopt
documentation: fix wrt. headers rename

 Documentation/networking/ieee802154.txt |    9 ++++-----
 net/ieee802154/af_ieee802154.c          |    8 +++++---
 net/ieee802154/dgram.c                  |   14 ++++++++++++++
 net/ieee802154/raw.c                    |   14 ++++++++++++++
 4 files changed, 37 insertions(+), 8 deletions(-)
Signature · 9 lines
With best wishes
Dmitry


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
maintainer
#13 lore raw

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Tue, 4 Aug 2009 18:48:10 +0400

Quoted 11 lines · David Miller
Quoted 8 lines

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Tue, 4 Aug 2009 12:51:48 +0400

Quoted 3 lines

Will you pull the serie if I'll remove those two patches? Documentation fix isn't that important, however I'd really ask to pull the remaining two patches.

Yes.

Pushed the updated branch. Please pull.

Please don't resubmit changes like this. It screws up all the nice tracking of every patch we do on patchwork for networking changes.

Please make a formal, full, reposting of the patch series you want me to apply. That way they can be tracked in patchwork, and the patches can be replied to and commented upon (and such comments tracked in patchwork as well).

When I say I'm tossing someone's changes, that means if they resubmit they have to really resubmit everything, the patch postings at all. Don't short-cut it with just a GIT tree refresh and pull request.

Thank you.

A message that is not in the archive (sent off-list or not yet received): 20090804.090921.198630830.davem-fT/PcQaiUtIeIZ0/[email protected]

#15 lore raw
Quoted 19 lines · David Miller

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Tue, 4 Aug 2009 18:48:10 +0400

Quoted 11 lines · David Miller
Quoted 8 lines

From: Dmitry Eremin-Solenikov <[email protected]>
Date: Tue, 4 Aug 2009 12:51:48 +0400

Quoted 3 lines

Will you pull the serie if I'll remove those two patches? Documentation fix isn't that important, however I'd really ask to pull the remaining two patches.

Yes.

Pushed the updated branch. Please pull.

Please don't resubmit changes like this. It screws up all the nice tracking of every patch we do on patchwork for networking changes.

Quoted 8 lines

Please make a formal, full, reposting of the patch series you want me to apply. That way they can be tracked in patchwork, and the patches can be replied to and commented upon (and such comments tracked in patchwork as well).

When I say I'm tossing someone's changes, that means if they resubmit they have to really resubmit everything, the patch postings at all. Don't short-cut it with just a GIT tree refresh and pull request.

Sorry for the troubles from our side. We are still learning how to do things correctly. The patchserie (cut to 3 patches) is resubmitted in a clean way.

Signature · 9 lines
With best wishes
Dmitry


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july