ieee802154: Remove ieee802154_reduced_mlme_ops references.
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/8 ieee802154 socket: Return EMSGSIZE from raw_sendmsg() if packet too big.
The proper return code for trying to send a packet that exceeds the outgoing interface's MTU is EMSGSIZE, not EINVAL, so patch ieee802154's raw_sendmsg() to do the right thing. (Its dgram_sendmsg() was already returning EMSGSIZE for this case.)
--- net/ieee802154/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ieee802154/socket.c +1 -1
@@ -286,7 +286,7 @@ static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)if (size > mtu) {pr_debug ("size = %Zu, mtu = %u\n" , size, mtu); - err = -EINVAL ; + err = -EMSGSIZE ; goto out_dev; }
Signature · 1 line
2.1.0
Re: [PATCH 1/8] ieee802154 socket: Return EMSGSIZE from raw_sendmsg() if packet too big.
Quoted 6 lines · Lennert Buytenhek
The proper return code for trying to send a packet that exceeds the outgoing interface's MTU is EMSGSIZE, not EINVAL, so patch ieee802154's
raw_sendmsg()to do the right thing. (Itsdgram_sendmsg()was already returning EMSGSIZE for this case.)Signed-off-by Lennert Buytenhek <[email protected]>
Nice, I never looked into the socket code deeper. But I think there are several issues (from that what I read from the mailinglist.) I also put it the opentasks section in wpan.cakelab.org that the socket code needs a big rework/cleanup.
- Alex
PATCH 2/8 Documentation/networking/ieee802154.txt: fix various inaccuracies.
In reply to a message not in the archive* Update the linux-zigbee git:// repository URL.
* The IEEE 802.15.4 MLME based netlink operations are documented in include/linux/nl802154.h, not in include/net/nl802154.h.
* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in drivers/net/ieee802154/, not in drivers/ieee802154/.
* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in net/6lowpan/.
--- Documentation/networking/ieee802154.txt | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
Documentation/networking/ieee802154.txt +12 -13
@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0); The address family, socket addresses etc. are defined in the 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). +in our userspace package (see either linux-zigbee sourceforge download +page or git tree at git://git.code.sf.net/p/linux-zigbee/linux-zigbee). One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
@@ -53,7 +53,7 @@ MLME - MAC Level Management ============================ Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands. -See the include/net/nl802154.h header. Our userspace tools package +See the include/linux/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.
@@ -75,8 +75,6 @@ net_device with a pointer to struct ieee802154_mlme_ops instance. The fields assoc_req, assoc_resp, disassoc_req, start_req, and scan_req are optional. All other fields are required. -We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c - SoftMAC =======
@@ -89,7 +87,8 @@ stack interface for network sniffers (e.g. WireShark). This layer is going to be extended soon. -See header include/net/mac802154.h and several drivers in drivers/ieee802154/. +See header include/net/mac802154.h and several drivers in +drivers/net/ieee802154/. Device drivers API
@@ -114,18 +113,17 @@ Moreover IEEE 802.15.4 device operations structure should be filled. Fake drivers ============ -In addition there are two drivers available which simulate real devices with -HardMAC (fakehard) and SoftMAC (fakelb - IEEE 802.15.4 loopback driver) -interfaces. This option provides possibility to test and debug stack without -usage of real hardware. +In addition there is a driver available which simulates a real device with +SoftMAC (fakelb - IEEE 802.15.4 loopback driver) interface. This option +provides possibility to test and debug stack without usage of real hardware. -See sources in drivers/ieee802154 folder for more details. +See sources in drivers/net/ieee802154 folder for more details. 6LoWPAN Linux implementation ============================ -The IEEE 802.15.4 standard specifies an MTU of 128 bytes, yielding about 80 +The IEEE 802.15.4 standard specifies an MTU of 127 bytes, yielding about 80 octets of actual MAC payload once security is turned on, on a wireless link with a link throughput of 250 kbps or less. The 6LoWPAN adaptation format [RFC4944] was specified to carry IPv6 datagrams over such constrained links,
@@ -140,7 +138,8 @@ In Semptember 2011 the standard update was published - [RFC6282]. It deprecates HC1 and HC2 compression and defines IPHC encoding format which is used in this Linux implementation. -All the code related to 6lowpan you may find in files: net/ieee802154/6lowpan.* +All the code related to 6lowpan you may find in files: net/6lowpan/* +and net/ieee802154/6lowpan/* To setup 6lowpan interface you need (busybox release > 1.17.0): 1. Add IEEE802.15.4 interface and initialize PANid;
Signature · 1 line
2.1.0
Re: [PATCH 2/8] Documentation/networking/ieee802154.txt: fix various inaccuracies.
Hi Lennert,
Quoted 27 lines
* Update the linux-zigbee
git://repository URL.* The IEEE 802.15.4 MLME based netlink operations are documented in
include/linux/nl802154.h, not ininclude/net/nl802154.h.* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in
drivers/net/ieee802154/, not indrivers/ieee802154/.* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in
net/6lowpan/.Signed-off-by Lennert Buytenhek <[email protected]>---
Documentation/networking/ieee802154.txt| 25 ++++++++++++-------------1 file changed, 12 insertions(+), 13 deletions(-)Documentation/networking/ieee802154.txt +0
-0@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);The address family, socket addresses etc. are defined in the
include/net/af_ieee802154.hheader or in the special header
Documentation/networking/ieee802154.txt int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0); · line 34
Quoted 4 lines
Documentation/networking/ieee802154.txt +2
-2-in our userspace package (see either linux-zigbee sourceforge download page -or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee). +in our userspace package (see either linux-zigbee sourceforge download +page or git tree at git://git.code.sf.net/p/linux-zigbee/linux-zigbee).
I assumed Alex created a linux-wpan userspace repository. I think if we update the text here, we should reference that one.
Regards
Marcel
Re: [PATCH 2/8] Documentation/networking/ieee802154.txt: fix various inaccuracies.
Quoted 1 line · Marcel Holtmann
Hi Lennert,
Hi Marcel,
Quoted 25 lines
Quoted 25 lines
* Update the linux-zigbee
git://repository URL.* The IEEE 802.15.4 MLME based netlink operations are documented in
include/linux/nl802154.h, not ininclude/net/nl802154.h.* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in
drivers/net/ieee802154/, not indrivers/ieee802154/.* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in
net/6lowpan/.Signed-off-by Lennert Buytenhek <[email protected]>---
Documentation/networking/ieee802154.txt| 25 ++++++++++++-------------1 file changed, 12 insertions(+), 13 deletions(-)Documentation/networking/ieee802154.txt +0
-0@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
Quoted 9 lines
Documentation/networking/ieee802154.txt
Quoted 6 lines
The address family, socket addresses etc. are defined in the
include/net/af_ieee802154.hheader or in the special headerDocumentation/networking/ieee802154.txt +2
-2-in our userspace package (see either linux-zigbee sourceforge download page -or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee). +in our userspace package (see either linux-zigbee sourceforge download +page or git tree at git://git.code.sf.net/p/linux-zigbee/linux-zigbee).I assumed Alex created a linux-wpan userspace repository. I think if we update the text here, we should reference that one.
OK, how about this patch instead? (Want me to resubmit the series?)
commit fdac3f4b45ad283bf98367d0af4d55e7704d07b5
Author: Lennert Buytenhek <[email protected]> Date: Sun May 17 10:53:21 2015 +0300
Documentation/networking/ieee802154.txt: fix various inaccuracies.
* Update the linux-zigbee git:// repository URL.
* The IEEE 802.15.4 MLME based netlink operations are documented in include/linux/nl802154.h, not in include/net/nl802154.h.
* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in drivers/net/ieee802154/, not in drivers/ieee802154/.
* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in net/6lowpan/.
Documentation/networking/ieee802154.txt +12 -13
@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0); The address family, socket addresses etc. are defined in the 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). +in the userspace package (see either http://wpan.cakelab.org/ or the +git tree at https://github.com/linux-wpan/wpan-tools). One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
@@ -53,7 +53,7 @@ MLME - MAC Level Management ============================ Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands. -See the include/net/nl802154.h header. Our userspace tools package +See the include/linux/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.
@@ -75,8 +75,6 @@ net_device with a pointer to struct ieee802154_mlme_ops instance. The fields assoc_req, assoc_resp, disassoc_req, start_req, and scan_req are optional. All other fields are required. -We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c - SoftMAC =======
@@ -89,7 +87,8 @@ stack interface for network sniffers (e.g. WireShark). This layer is going to be extended soon. -See header include/net/mac802154.h and several drivers in drivers/ieee802154/. +See header include/net/mac802154.h and several drivers in +drivers/net/ieee802154/. Device drivers API
@@ -114,18 +113,17 @@ Moreover IEEE 802.15.4 device operations structure should be filled. Fake drivers ============ -In addition there are two drivers available which simulate real devices with -HardMAC (fakehard) and SoftMAC (fakelb - IEEE 802.15.4 loopback driver) -interfaces. This option provides possibility to test and debug stack without -usage of real hardware. +In addition there is a driver available which simulates a real device with +SoftMAC (fakelb - IEEE 802.15.4 loopback driver) interface. This option +provides possibility to test and debug stack without usage of real hardware. -See sources in drivers/ieee802154 folder for more details. +See sources in drivers/net/ieee802154 folder for more details. 6LoWPAN Linux implementation ============================ -The IEEE 802.15.4 standard specifies an MTU of 128 bytes, yielding about 80 +The IEEE 802.15.4 standard specifies an MTU of 127 bytes, yielding about 80 octets of actual MAC payload once security is turned on, on a wireless link with a link throughput of 250 kbps or less. The 6LoWPAN adaptation format [RFC4944] was specified to carry IPv6 datagrams over such constrained links,
@@ -140,7 +138,8 @@ In Semptember 2011 the standard update was published - [RFC6282]. It deprecates HC1 and HC2 compression and defines IPHC encoding format which is used in this Linux implementation. -All the code related to 6lowpan you may find in files: net/ieee802154/6lowpan.* +All the code related to 6lowpan you may find in files: net/6lowpan/* +and net/ieee802154/6lowpan/* To setup 6lowpan interface you need (busybox release > 1.17.0): 1. Add IEEE802.15.4 interface and initialize PANid;
Stefan Schmidt
Reviewed-byRe: [PATCH 2/8] Documentation/networking/ieee802154.txt: fix various inaccuracies.
Hello.
Quoted 142 lines · Lennert Buytenhek
Quoted 1 line · Marcel Holtmann
Hi Lennert,
Hi Marcel,
Quoted 25 lines
Quoted 25 lines
* Update the linux-zigbee
git://repository URL.* The IEEE 802.15.4 MLME based netlink operations are documented in
include/linux/nl802154.h, not ininclude/net/nl802154.h.* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in
drivers/net/ieee802154/, not indrivers/ieee802154/.* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in
net/6lowpan/.Signed-off-by Lennert Buytenhek <[email protected]>---
Documentation/networking/ieee802154.txt| 25 ++++++++++++-------------1 file changed, 12 insertions(+), 13 deletions(-)Documentation/networking/ieee802154.txt +0
-0@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);Quoted 8 lines
Documentation/networking/ieee802154.txt int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
Quoted 6 lines
The address family, socket addresses etc. are defined in the
include/net/af_ieee802154.hheader or in the special headerDocumentation/networking/ieee802154.txt +2
-2-in our userspace package (see either linux-zigbee sourceforge download page -or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee). +in our userspace package (see either linux-zigbee sourceforge download +page or git tree at git://git.code.sf.net/p/linux-zigbee/linux-zigbee).I assumed Alex created a linux-wpan userspace repository. I think if we update the text here, we should reference that one.
OK, how about this patch instead? (Want me to resubmit the series?)
commit
fdac3f4b45ad283bf98367d0af4d55e7704d07b5Author: Lennert Buytenhek <[email protected]> Date: Sun May 17 10:53:21 2015 +0300
Documentation/networking/ieee802154.txt: fix various inaccuracies.* Update the linux-zigbee
git://repository URL.* The IEEE 802.15.4 MLME based netlink operations are documented in
include/linux/nl802154.h, not ininclude/net/nl802154.h.* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in
drivers/net/ieee802154/, not indrivers/ieee802154/.* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in
net/6lowpan/.Signed-off-by Lennert Buytenhek <[email protected]>Documentation/networking/ieee802154.txt +12
-14@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0); The address family, socket addresses etc. are defined in the 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). +in the userspace package (see either http://wpan.cakelab.org/ or the +git tree at https://github.com/linux-wpan/wpan-tools). One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.@@ -53,7 +53,7 @@ MLME - MAC Level Management ============================ Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands. -See the include/net/nl802154.h header. Our userspace tools package +See the include/linux/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.@@ -75,8 +75,6 @@ net_device with a pointer to struct ieee802154_mlme_ops instance. The fields assoc_req, assoc_resp, disassoc_req, start_req, and scan_req are optional. All other fields are required. -We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c - SoftMAC =======@@ -89,7 +87,8 @@ stack interface for network sniffers (e.g. WireShark). This layer is going to be extended soon. -See header include/net/mac802154.h and several drivers in drivers/ieee802154/. +See header include/net/mac802154.h and several drivers in +drivers/net/ieee802154/. Device drivers API@@ -114,18 +113,17 @@ Moreover IEEE 802.15.4 device operations structure should be filled. Fake drivers ============ -In addition there are two drivers available which simulate real devices with -HardMAC (fakehard) and SoftMAC (fakelb - IEEE 802.15.4 loopback driver) -interfaces. This option provides possibility to test and debug stack without -usage of real hardware. +In addition there is a driver available which simulates a real device with +SoftMAC (fakelb - IEEE 802.15.4 loopback driver) interface. This option +provides possibility to test and debug stack without usage of real hardware. -See sources in drivers/ieee802154 folder for more details. +See sources in drivers/net/ieee802154 folder for more details. 6LoWPAN Linux implementation ============================ -The IEEE 802.15.4 standard specifies an MTU of 128 bytes, yielding about 80 +The IEEE 802.15.4 standard specifies an MTU of 127 bytes, yielding about 80 octets of actual MAC payload once security is turned on, on a wireless link with a link throughput of 250 kbps or less. The 6LoWPAN adaptation format [RFC4944] was specified to carry IPv6 datagrams over such constrained links,@@ -140,7 +138,8 @@ In Semptember 2011 the standard update was published - [RFC6282]. It deprecates HC1 and HC2 compression and defines IPHC encoding format which is used in this Linux implementation. -All the code related to 6lowpan you may find in files: net/ieee802154/6lowpan.* +All the code related to 6lowpan you may find in files: net/6lowpan/* +and net/ieee802154/6lowpan/* To setup 6lowpan interface you need (busybox release > 1.17.0): 1. Add IEEE802.15.4 interface and initialize PANid; --
Quoted 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
This addresses the comments I just send already. :)
regards
Stefan Schmidt
Alexander Aring
maintainerRe: [PATCH 2/8] Documentation/networking/ieee802154.txt: fix various inaccuracies.
In reply to Lennert BuytenhekHi Lennert,
Quoted 72 lines · Lennert Buytenhek
Quoted 1 line · Marcel Holtmann
Hi Lennert,
Hi Marcel,
Quoted 25 lines
Quoted 25 lines
* Update the linux-zigbee
git://repository URL.* The IEEE 802.15.4 MLME based netlink operations are documented in
include/linux/nl802154.h, not ininclude/net/nl802154.h.* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in
drivers/net/ieee802154/, not indrivers/ieee802154/.* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in
net/6lowpan/.Signed-off-by Lennert Buytenhek <[email protected]>---
Documentation/networking/ieee802154.txt| 25 ++++++++++++-------------1 file changed, 12 insertions(+), 13 deletions(-)Documentation/networking/ieee802154.txt +0
-0@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);Quoted 9 lines
Documentation/networking/ieee802154.txt int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
Quoted 6 lines
The address family, socket addresses etc. are defined in the
include/net/af_ieee802154.hheader or in the special headerDocumentation/networking/ieee802154.txt +2
-2-in our userspace package (see either linux-zigbee sourceforge download page -or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee). +in our userspace package (see either linux-zigbee sourceforge download +page or git tree at git://git.code.sf.net/p/linux-zigbee/linux-zigbee).I assumed Alex created a linux-wpan userspace repository. I think if we update the text here, we should reference that one.
OK, how about this patch instead? (Want me to resubmit the series?)
commit
fdac3f4b45ad283bf98367d0af4d55e7704d07b5Author: Lennert Buytenhek <[email protected]> Date: Sun May 17 10:53:21 2015 +0300
Documentation/networking/ieee802154.txt: fix various inaccuracies.* Update the linux-zigbee
git://repository URL.* The IEEE 802.15.4 MLME based netlink operations are documented in
include/linux/nl802154.h, not ininclude/net/nl802154.h.* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in
drivers/net/ieee802154/, not indrivers/ieee802154/.* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in
net/6lowpan/.Signed-off-by Lennert Buytenhek <[email protected]>Documentation/networking/ieee802154.txt +0
-0
Documentation/networking/ieee802154.txt int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0); · line 35
Quoted 8 lines
Documentation/networking/ieee802154.txt +2
-2@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0); The address family, socket addresses etc. are defined in the 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). +in the userspace package (see either http://wpan.cakelab.org/ or the +git tree at https://github.com/linux-wpan/wpan-tools).
ack.
Documentation/networking/ieee802154.txt MLME - MAC Level Management · line 56
Quoted 8 lines
Documentation/networking/ieee802154.txt +1
-1One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.@@ -53,7 +53,7 @@ MLME - MAC Level Management ============================ Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands. -See the include/net/nl802154.h header. Our userspace tools package +See the include/linux/nl802154.h header. Our userspace tools package
nack. There is no MLME functionality at the moment and there was never a MLME functionality mainline. What I supposed how this header with these defines cames mainline, here is the story:
The previous maintainers had implement an netlink _interface_ only and had run it on _real_ HardMAC transceivers. This was on the sourceforge kernel which was never be full merged into mainline. So there was some things which was missing at mainline and doesn't had any functionality.
The point is they never implement MLME ops for SoftMAC transceivers and to implement an interface only is much easier than implement the logic behind. Nevertheless at mainline was the fake HardMAC driver which only notice with some debug messages that this interface was called. It was just for mlme interface testing.
At the moment this is the deprecated interface and we plan to look into wireless how they implement MLME ops and such things which have similar paradigms with SoftMAC and HardMAC transceivers. So I would remove the whole section about MLME functionality... because we don't support it.
I generally would not care about anything in the old netlink interface, this should be removed in the next releases.
Documentation/networking/ieee802154.txt net_device with a pointer to struct ieee802154_mlme_ops instance. The fields · line 78
Quoted 10 lines
Documentation/networking/ieee802154.txt +0
-2(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.@@ -75,8 +75,6 @@ net_device with a pointer to struct ieee802154_mlme_ops instance. The fields assoc_req, assoc_resp, disassoc_req, start_req, and scan_req are optional. All other fields are required. -We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c -
ack.
Documentation/networking/ieee802154.txt stack interface for network sniffers (e.g. WireShark). · line 92
Quoted 10 lines
Documentation/networking/ieee802154.txt +2
-1SoftMAC =======@@ -89,7 +87,8 @@ stack interface for network sniffers (e.g. WireShark). This layer is going to be extended soon. -See header include/net/mac802154.h and several drivers in drivers/ieee802154/. +See header include/net/mac802154.h and several drivers in +drivers/net/ieee802154/.
ack.
Quoted 7 lines
Documentation/networking/ieee802154.txt +0
-1Device drivers API@@ -114,18 +113,17 @@ Moreover IEEE 802.15.4 device operations structure should be filled. Fake drivers ============ -In addition there are two drivers available which simulate real devices with
Documentation/networking/ieee802154.txt Moreover IEEE 802.15.4 device operations structure should be filled. · line 121
Quoted 10 lines
Documentation/networking/ieee802154.txt +4
-4-HardMAC (fakehard) and SoftMAC (fakelb - IEEE 802.15.4 loopback driver) -interfaces. This option provides possibility to test and debug stack without -usage of real hardware. +In addition there is a driver available which simulates a real device with +SoftMAC (fakelb - IEEE 802.15.4 loopback driver) interface. This option +provides possibility to test and debug stack without usage of real hardware. -See sources in drivers/ieee802154 folder for more details. +See sources in drivers/net/ieee802154 folder for more details.
ack.
Documentation/networking/ieee802154.txt Moreover IEEE 802.15.4 device operations structure should be filled. · line 126
Quoted 6 lines
Documentation/networking/ieee802154.txt +1
-16LoWPAN Linux implementation ============================ -The IEEE 802.15.4 standard specifies an MTU of 128 bytes, yielding about 80 +The IEEE 802.15.4 standard specifies an MTU of 127 bytes, yielding about 80
ack.
Documentation/networking/ieee802154.txt In Semptember 2011 the standard update was published - [RFC6282]. · line 143
Quoted 11 lines
Documentation/networking/ieee802154.txt +2
-1octets of actual MAC payload once security is turned on, on a wireless link with a link throughput of 250 kbps or less. The 6LoWPAN adaptation format [RFC4944] was specified to carry IPv6 datagrams over such constrained links,@@ -140,7 +138,8 @@ In Semptember 2011 the standard update was published - [RFC6282]. It deprecates HC1 and HC2 compression and defines IPHC encoding format which is used in this Linux implementation. -All the code related to 6lowpan you may find in files: net/ieee802154/6lowpan.* +All the code related to 6lowpan you may find in files: net/6lowpan/* +and net/ieee802154/6lowpan/*
ack.
- Alex
Re: [PATCH 2/8] Documentation/networking/ieee802154.txt: fix various inaccuracies.
Quoted 1 line · Alexander Aring
Hi Lennert,
Hi Alexander,
Quoted 22 lines
Review MLME - MAC Level Management · line 56
Quoted 6 lines
(quoted diff) +1
-1@@ -53,7 +53,7 @@ MLME - MAC Level Management ============================ Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands. -See the include/net/nl802154.h header. Our userspace tools package +See the include/linux/nl802154.h header. Our userspace tools packagenack. There is no MLME functionality at the moment and there was never a MLME functionality mainline. What I supposed how this header with these defines cames mainline, here is the story:
The previous maintainers had implement an netlink _interface_ only and had run it on _real_ HardMAC transceivers. This was on the sourceforge kernel which was never be full merged into mainline. So there was some things which was missing at mainline and doesn't had any functionality.
The point is they never implement MLME ops for SoftMAC transceivers and to implement an interface only is much easier than implement the logic behind. Nevertheless at mainline was the fake HardMAC driver which only notice with some debug messages that this interface was called. It was just for mlme interface testing.
Quoted 7 lines
At the moment this is the deprecated interface and we plan to look into wireless how they implement MLME ops and such things which have similar paradigms with SoftMAC and HardMAC transceivers. So I would remove the whole section about MLME functionality... because we don't support it.
I generally would not care about anything in the old netlink interface, this should be removed in the next releases.
OK, how about this:
commit ce417db95a1d671991f8a2541e7162b856ddbd41
Author: Lennert Buytenhek <[email protected]> Date: Sun May 17 10:53:21 2015 +0300
Documentation/networking/ieee802154.txt: fix various inaccuracies.
* Update the linux-zigbee git:// repository URL.
* Remove the MLME section as the current kernel does not provide a full 802.15.4 MLME implementation.
* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in drivers/net/ieee802154/, not in drivers/ieee802154/.
* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in net/6lowpan/.
Documentation/networking/ieee802154.txt +11 -21
@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0); The address family, socket addresses etc. are defined in the 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). +in the userspace package (see either http://wpan.cakelab.org/ or the +git tree at https://github.com/linux-wpan/wpan-tools). One can use SOCK_RAW for passing raw data towards device xmit function. YMMV.
@@ -49,15 +49,6 @@ Like with WiFi, there are several types of devices implementing IEEE 802.15.4. Those types of devices require different approach to be hooked into Linux kernel. -MLME - MAC Level Management -============================ - -Most of IEEE 802.15.4 MLME interfaces are directly mapped on netlink commands. -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. - - HardMAC =======
@@ -75,8 +66,6 @@ net_device with a pointer to struct ieee802154_mlme_ops instance. The fields assoc_req, assoc_resp, disassoc_req, start_req, and scan_req are optional. All other fields are required. -We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c - SoftMAC =======
@@ -89,7 +78,8 @@ stack interface for network sniffers (e.g. WireShark). This layer is going to be extended soon. -See header include/net/mac802154.h and several drivers in drivers/ieee802154/. +See header include/net/mac802154.h and several drivers in +drivers/net/ieee802154/. Device drivers API
@@ -114,18 +104,17 @@ Moreover IEEE 802.15.4 device operations structure should be filled. Fake drivers ============ -In addition there are two drivers available which simulate real devices with -HardMAC (fakehard) and SoftMAC (fakelb - IEEE 802.15.4 loopback driver) -interfaces. This option provides possibility to test and debug stack without -usage of real hardware. +In addition there is a driver available which simulates a real device with +SoftMAC (fakelb - IEEE 802.15.4 loopback driver) interface. This option +provides possibility to test and debug stack without usage of real hardware. -See sources in drivers/ieee802154 folder for more details. +See sources in drivers/net/ieee802154 folder for more details. 6LoWPAN Linux implementation ============================ -The IEEE 802.15.4 standard specifies an MTU of 128 bytes, yielding about 80 +The IEEE 802.15.4 standard specifies an MTU of 127 bytes, yielding about 80 octets of actual MAC payload once security is turned on, on a wireless link with a link throughput of 250 kbps or less. The 6LoWPAN adaptation format [RFC4944] was specified to carry IPv6 datagrams over such constrained links,
@@ -140,7 +129,8 @@ In Semptember 2011 the standard update was published - [RFC6282]. It deprecates HC1 and HC2 compression and defines IPHC encoding format which is used in this Linux implementation. -All the code related to 6lowpan you may find in files: net/ieee802154/6lowpan.* +All the code related to 6lowpan you may find in files: net/6lowpan/* +and net/ieee802154/6lowpan/* To setup 6lowpan interface you need (busybox release > 1.17.0): 1. Add IEEE802.15.4 interface and initialize PANid;
Re: [PATCH 2/8] Documentation/networking/ieee802154.txt: fix various inaccuracies.
In reply to Lennert BuytenhekHi Lennert,
Quoted 35 lines
Quoted 25 lines
Quoted 25 lines
* Update the linux-zigbee
git://repository URL.* The IEEE 802.15.4 MLME based netlink operations are documented in
include/linux/nl802154.h, not ininclude/net/nl802154.h.* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in
drivers/net/ieee802154/, not indrivers/ieee802154/.* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in
net/6lowpan/.Signed-off-by Lennert Buytenhek <[email protected]>---
Documentation/networking/ieee802154.txt| 25 ++++++++++++-------------1 file changed, 12 insertions(+), 13 deletions(-)Documentation/networking/ieee802154.txt +0
-0@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);Quoted 9 lines
Documentation/networking/ieee802154.txt int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
Quoted 6 lines
The address family, socket addresses etc. are defined in the
include/net/af_ieee802154.hheader or in the special headerDocumentation/networking/ieee802154.txt +2
-2-in our userspace package (see either linux-zigbee sourceforge download page -or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee). +in our userspace package (see either linux-zigbee sourceforge download +page or git tree at git://git.code.sf.net/p/linux-zigbee/linux-zigbee).I assumed Alex created a linux-wpan userspace repository. I think if we update the text here, we should reference that one.
Quoted 1 line
OK, how about this patch instead? (Want me to resubmit the series?)
just send a v2 of the complete series when Alex ACKed it. I ran basic tests with v1 and looks good to me.
Regards
Marcel
Re: [PATCH 2/8] Documentation/networking/ieee802154.txt: fix various inaccuracies.
In reply to Marcel HoltmannHello.
Quoted 27 lines · Marcel Holtmann
Hi Lennert,
Quoted 25 lines
* Update the linux-zigbee
git://repository URL.* The IEEE 802.15.4 MLME based netlink operations are documented in
include/linux/nl802154.h, not ininclude/net/nl802154.h.* The hardmac example driver 'fakehard' was removed some time ago.
* The IEEE 802.15.4 device drivers live in
drivers/net/ieee802154/, not indrivers/ieee802154/.* The IEEE 802.15.4 MTU is 127 bytes, not 128 bytes.
* Some of the 6LoWPAN code lives in
net/6lowpan/.Signed-off-by Lennert Buytenhek <[email protected]>---
Documentation/networking/ieee802154.txt| 25 ++++++++++++-------------1 file changed, 12 insertions(+), 13 deletions(-)Documentation/networking/ieee802154.txt +0
-0@@ -30,8 +30,8 @@ int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0);
Quoted 8 lines
Documentation/networking/ieee802154.txt int sd = socket(PF_IEEE802154, SOCK_DGRAM, 0); · line 34
Quoted 6 lines
The address family, socket addresses etc. are defined in the
include/net/af_ieee802154.hheader or in the special headerDocumentation/networking/ieee802154.txt +2
-2-in our userspace package (see either linux-zigbee sourceforge download page -or git tree at git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee). +in our userspace package (see either linux-zigbee sourceforge download +page or git tree at git://git.code.sf.net/p/linux-zigbee/linux-zigbee).I assumed Alex created a linux-wpan userspace repository. I think if we update the text here, we should reference that one.
Indeed. Additionally we should also remove the ZigBee references as the linux-wpan stack only cares about 802.15.4 and 6LoWPAN.
Maybe mention the new project homepage (http://wpan.cakelab.org/) and new userspace utils wpan-tools as well.
regards
Stefan Schmidt
PATCH 3/8 ieee802154: Remove ieee802154_reduced_mlme_ops references.
In reply to a message not in the archiveAs there doesn't seem to be a definition of it or any users of it.
--- include/net/ieee802154_netdev.h | 6 ------ 1 file changed, 6 deletions(-)
include/net/ieee802154_netdev.h +0 -6
@@ -443,10 +443,4 @@ ieee802154_mlme_ops(const struct net_device *dev) return dev->ml_priv; } -static inline struct ieee802154_reduced_mlme_ops * -ieee802154_reduced_mlme_ops (const struct net_device *dev) -{ -return dev->ml_priv; -} -#endif
Signature · 1 line
2.1.0
Quoted 3 lines · Lennert Buytenhek
As there doesn't seem to be a definition of it or any users of it.
Signed-off-by Lennert Buytenhek <[email protected]>
PATCH 4/8 ieee802154: Remove 802.15.4/6LoWPAN checks for interface MTU.
In reply to a message not in the archiveIn the past, 802.15.4 interfaces and 6LoWPAN interfaces used the same dev->type (ARPHRD_IEEE802154), and 802.15.4 interfaces were distinguished from 6LoWPAN interfaces by their differing dev->mtu.
6LoWPAN interfaces have their own ARPHRD type now, so there is no longer any need to check dev->mtu to distinguish 802.15.4 devices from 6LoWPAN devices.
--- net/ieee802154/nl-mac.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
net/ieee802154/nl-mac.c +3 -14
@@ -166,10 +166,7 @@ static struct net_device *ieee802154_nl_get_dev(struct genl_info *info)if (!dev)return NULL ; -/* Check on mtu is currently a hacked solution because lowpan -* and wpan have the same ARPHRD type. -*/ -if (dev->type !=ARPHRD_IEEE802154 || dev->mtu !=IEEE802154_MTU ) { +if (dev->type !=ARPHRD_IEEE802154 ) {dev_put (dev);return NULL ; }
@@ -449,11 +446,7 @@ int ieee802154_dump_iface(struct sk_buff *skb, struct netlink_callback *cb) idx =0 ;for_each_netdev (net, dev) { -/* Check on mtu is currently a hacked solution because lowpan -* and wpan have the same ARPHRD type. -*/ -if (idx < s_idx || dev->type !=ARPHRD_IEEE802154 || - dev->mtu !=IEEE802154_MTU ) +if (idx < s_idx || dev->type !=ARPHRD_IEEE802154 ) goto cont; if (ieee802154_nl_fill_iface(skb, NETLINK_CB(cb->skb).portid,
@@ -783,11 +776,7 @@ ieee802154_llsec_dump_table(struct sk_buff *skb, struct netlink_callback *cb,int rc;for_each_netdev (net, dev) { -/* Check on mtu is currently a hacked solution because lowpan -* and wpan have the same ARPHRD type. -*/ -if (idx < first_dev || dev->type !=ARPHRD_IEEE802154 || - dev->mtu !=IEEE802154_MTU ) +if (idx < first_dev || dev->type !=ARPHRD_IEEE802154 ) goto skip; data.ops =ieee802154_mlme_ops (dev);
Signature · 1 line
2.1.0
Re: [PATCH 4/8] ieee802154: Remove 802.15.4/6LoWPAN checks for interface MTU.
Quoted 9 lines · Lennert Buytenhek
In the past, 802.15.4 interfaces and 6LoWPAN interfaces used the same
dev->type(ARPHRD_IEEE802154), and 802.15.4 interfaces were distinguished from 6LoWPAN interfaces by their differingdev->mtu.6LoWPAN interfaces have their own ARPHRD type now, so there is no longer any need to check
dev->mtuto distinguish 802.15.4 devices from 6LoWPAN devices.Signed-off-by Lennert Buytenhek <[email protected]>
btw: the reason why I introduced this was that I had really fear to change the lowpan ARPHRD, because there exists already a huge of software which support this and somebody told me that when he delete a lowpan interface with the iz tool then the whole kernel was crashed. This was indeed true because it had freed some resources which was allocated on a wpan interface only.
But we don't need this anymore, yes. I changed the ARPHRD and nobody screamed that his/her software doesn't work anymore.
- Alex
PATCH 5/8 ieee802154 6lowpan: Don't implement ieee802154_mlme_ops.
In reply to a message not in the archiveieee802154_mlme_ops are implemented only by ARPHRD_IEEE802154 devices.
--- net/ieee802154/6lowpan/core.c | 28 ---------------------------- net/ieee802154/6lowpan/tx.c | 7 ++++--- 2 files changed, 4 insertions(+), 31 deletions(-)
net/ieee802154/6lowpan/core.c +0 -28
@@ -55,27 +55,6 @@LIST_HEAD (lowpan_devices);static int lowpan_open_count; -static __le16 lowpan_get_pan_id (const struct net_device *dev) -{ -struct net_device *real_dev =lowpan_dev_info (dev)->real_dev; - -return ieee802154_mlme_ops (real_dev)->get_pan_id (real_dev); -} - -static __le16 lowpan_get_short_addr (const struct net_device *dev) -{ -struct net_device *real_dev =lowpan_dev_info (dev)->real_dev; - -return ieee802154_mlme_ops (real_dev)->get_short_addr (real_dev); -} - -static u8 lowpan_get_dsn (const struct net_device *dev) -{ -struct net_device *real_dev =lowpan_dev_info (dev)->real_dev; - -return ieee802154_mlme_ops (real_dev)->get_dsn (real_dev); -} -static struct header_ops lowpan_header_ops = { .create = lowpan_header_create, };
@@ -103,12 +82,6 @@ static const struct net_device_ops lowpan_netdev_ops = { .ndo_start_xmit = lowpan_xmit, }; -static struct ieee802154_mlme_ops lowpan_mlme = { - .get_pan_id = lowpan_get_pan_id, - .get_short_addr = lowpan_get_short_addr, - .get_dsn = lowpan_get_dsn, -}; -static void lowpan_setup (struct net_device *dev) { dev->addr_len =IEEE802154_ADDR_LEN ;
@@ -124,7 +97,6 @@ static void lowpan_setup(struct net_device *dev) dev->netdev_ops = &lowpan_netdev_ops; dev->header_ops = &lowpan_header_ops; - dev->ml_priv = &lowpan_mlme; dev->destructor = free_netdev; dev->features |=NETIF_F_NETNS_LOCAL ; }
net/ieee802154/6lowpan/tx.c +4 -3
@@ -190,6 +190,7 @@ err:static int lowpan_header (struct sk_buff *skb,struct net_device *dev) { +struct net_device *real_dev =lowpan_dev_info (dev)->real_dev;struct ieee802154_addr sa, da;struct ieee802154_mac_cb *cb =mac_cb_init (skb);struct lowpan_addr_info info;
@@ -207,7 +208,7 @@ static int lowpan_header(struct sk_buff *skb, struct net_device *dev)/* prepare wpan address data */ sa.mode =IEEE802154_ADDR_LONG ; - sa.pan_id =ieee802154_mlme_ops (dev)->get_pan_id (dev); + sa.pan_id =ieee802154_mlme_ops (real_dev)->get_pan_id (real_dev); sa.extended_addr =ieee802154_devaddr_from_raw (saddr);/* intra-PAN communications */
@@ -226,8 +227,8 @@ static int lowpan_header(struct sk_buff *skb, struct net_device *dev) cb->ackreq = true; } -return dev_hard_header (skb,lowpan_dev_info (dev)->real_dev, -ETH_P_IPV6 , (void *)&da, (void *)&sa,0 ); +return dev_hard_header (skb, real_dev,ETH_P_IPV6 , + (void *)&da, (void *)&sa,0 ); }netdev_tx_t lowpan_xmit (struct sk_buff *skb,struct net_device *dev)
Signature · 1 line
2.1.0
Alexander Aring
maintainerRe: [PATCH 5/8] ieee802154 6lowpan: Don't implement ieee802154_mlme_ops.
Quoted 3 lines · Lennert Buytenhek
ieee802154_mlme_opsare implemented only byARPHRD_IEEE802154devices.
Yes, this patch is correct. I did that also for the removal the mib lock which makes the callbacks for getting some mib values unnecessary. It depends on context if we need to hold a lock or not (depends on if wpan interface is up). See patch [0].
And the lowpan rx/tx functionality can't run when the wpan interface is down.
Why I am waiting with this patch?
I thought about to send [1] to bluetooth/stable, but now I think more it's not necessary to support some ioctl which should be deprecated and I think that's whats Marcel also told me that I don't need to care about this little warning and a missed rtnl lock.
- Alex
[0] http://www.spinics.net/lists/linux-wpan/msg01899.html
[1] http://www.spinics.net/lists/linux-wpan/msg01897.html
Re: [PATCH 5/8] ieee802154 6lowpan: Don't implement ieee802154_mlme_ops.
Quoted 7 lines · Alexander Aring
Quoted 2 lines
ieee802154_mlme_opsare implemented only byARPHRD_IEEE802154devices.Yes, this patch is correct. I did that also for the removal the mib lock which makes the callbacks for getting some mib values unnecessary. It depends on context if we need to hold a lock or not (depends on if wpan interface is up). See patch [0].
Ah, OK, I hadn't noticed that patch, sorry! I rebased against bt-next and this patch of mine is indeed obsolete now, so I've dropped it from the series.
PATCH 6/8 ieee802154 socket: No need to check for ARPHRD_IEEE802154 in raw_bind().
In reply to a message not in the archiveieee802154_get_dev() only returns devices that have dev->type == ARPHRD_IEEE802154, therefore, there is no need to check this again in raw_bind().
--- net/ieee802154/socket.c | 6 ------ 1 file changed, 6 deletions(-)
net/ieee802154/socket.c +0 -6
@@ -228,15 +228,9 @@ static int raw_bind(struct sock *sk, struct sockaddr *_uaddr, int len) goto out; } -if (dev->type !=ARPHRD_IEEE802154 ) { - err = -ENODEV ; - goto out_put; - } - sk->sk_bound_dev_if = dev->ifindex;sk_dst_reset (sk); -out_put:dev_put (dev); out:release_sock (sk);
Signature · 1 line
2.1.0
Re: [PATCH 6/8] ieee802154 socket: No need to check for ARPHRD_IEEE802154 in raw_bind().
Quoted 5 lines · Lennert Buytenhek
ieee802154_get_dev()only returns devices that havedev->type==ARPHRD_IEEE802154, therefore, there is no need to check this again inraw_bind().Signed-off-by Lennert Buytenhek <[email protected]>
PATCH 7/8 mac802154: mac802154_header_create() optimisation.
In reply to a message not in the archivemac802154_header_create() calls ieee802154_mlme_ops(dev)->get_dsn(dev), but 'dev' is always a mac802154 device, therefore we can just call mac802154_dev_get_dsn() instead directly.
--- net/mac802154/iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac802154/iface.c +1 -1
@@ -374,7 +374,7 @@ static int mac802154_header_create(struct sk_buff *skb, hdr.fc.type = cb->type; hdr.fc.security_enabled = cb->secen; hdr.fc.ack_request = cb->ackreq; - hdr.seq =ieee802154_mlme_ops (dev)->get_dsn (dev); + hdr.seq =mac802154_dev_get_dsn (dev);if (mac802154_set_header_security (sdata, &hdr, cb) <0 )return -EINVAL ;
Signature · 1 line
2.1.0
Alexander Aring
maintainerRe: [PATCH 7/8] mac802154: mac802154_header_create() optimisation.
Quoted 4 lines · Lennert Buytenhek
mac802154_header_create()calls ieee802154_mlme_ops(dev)->get_dsn(dev), but 'dev' is always a mac802154 device, therefore we can just callmac802154_dev_get_dsn()instead directly.
this is correct, but this code has currently more issues. Several days I posted a draft about to handle the dsn value as atomic_t [0].
This depends on removal of pib and mib lock. The pib lock is a mutex and mib lock a spinlock currently. See patch [1].
I think I need to explain something about the locking handling:
There exists now a new locking mechanism which protects all pib/mib values with the rtnl mutex. The mib values are special now, we use them while frame parsing and generation. For easy handling these values we hold the rtnl lock and check if the interface is up. If the interface is up we don't allow changes at mostly mib attributes. This means when a interface is up we don't need to care about locking, because these attributes are readonly and in the most hotpath we can remove the locks.
The mib values which are readonly depends "mostly" also on phy registers, that are some mac operations which doing the phy. These registers will set when we do a interface up (ndo_do_open). E.g. the address filter settings, if the phy has the possibilty to set them.
btw: phy settings like channels/cca mode/cca ed level we allow by doing this while interface up.
Now back to the dsn value, that's a mib setting which is writeable while ifup and currently we don't have any locks there, but we need locks because upper layers generates mac headers and they call dev_queue_xmit and this can be occur at the same time.
btw:
The dev_hard_header call. (Also at the moment it's ugly to set all parameters through the skb->cb, we should insert our own dev_hard_dataheader, dev_hard_beaconheader, dev_hard_cmdheader and have header_ops callbacks in the wpan_dev structure. To do this over skb->cb will also broke very generic af families like af_packet, which also call the dev_hard_header without doing specific 802.15.4 handling inside skb-cb. Then simple let this pointer to NULL so we don't support this and all 802.15.4 upper layers call the wpan_dev header creations. Then af_packet will don't call this, the current behaviour is broken and I believe af_packet works without it.
Sorry, I don't ack this patch. We need to handle this correct with an atomic_t and we can remove the mib/pib locks because we have a better locking handling now which follows some strategie.
- Alex
[0] http://www.spinics.net/lists/linux-wpan/msg01920.html
[1] http://www.spinics.net/lists/linux-wpan/msg01896.html
PATCH 8/8 mac802154: mac802154_mlme_start_req() optimisation.
In reply to a message not in the archivemac802154_mlme_start_req() calls ieee802154_mlme_ops(dev)->llsec->set_params() on the net_device passed into it, however, this net_device will always be a mac802154 net_device, so just call mac802154_set_params() directly instead.
--- net/mac802154/mac_cmd.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-)
net/mac802154/mac_cmd.c +11 -18
@@ -36,8 +36,8 @@ static int mac802154_mlme_start_req(struct net_device *dev, u8 pan_coord, u8 blx, u8 coord_realign) { - struct ieee802154_mlme_ops *ops = ieee802154_mlme_ops(dev); -int rc =0 ; + struct ieee802154_llsec_params params; +int changed =0 ;ASSERT_RTNL ();
@@ -47,26 +47,19 @@ static int mac802154_mlme_start_req(struct net_device *dev,mac802154_dev_set_short_addr (dev, addr->short_addr);mac802154_dev_set_page_channel (dev, page, channel); -if (ops->llsec) { -struct ieee802154_llsec_params params; -int changed =0 ; + params.pan_id = addr->pan_id; + changed |=IEEE802154_LLSEC_PARAM_PAN_ID ; - params.coord_shortaddr = addr->short_addr; - changed |=IEEE802154_LLSEC_PARAM_COORD_SHORTADDR ; + params.hwaddr =ieee802154_devaddr_from_raw (dev->dev_addr); + changed |=IEEE802154_LLSEC_PARAM_HWADDR ; - params.pan_id = addr->pan_id; - changed |=IEEE802154_LLSEC_PARAM_PAN_ID ; + params.coord_hwaddr = params.hwaddr; + changed |=IEEE802154_LLSEC_PARAM_COORD_HWADDR ; - params.hwaddr =ieee802154_devaddr_from_raw (dev->dev_addr); - changed |=IEEE802154_LLSEC_PARAM_HWADDR ; + params.coord_shortaddr = addr->short_addr; + changed |=IEEE802154_LLSEC_PARAM_COORD_SHORTADDR ; - params.coord_hwaddr = params.hwaddr; - changed |=IEEE802154_LLSEC_PARAM_COORD_HWADDR ; - - rc = ops->llsec->set_params (dev, ¶ms, changed); - } - -return rc; +return mac802154_set_params (dev, ¶ms, changed); } static int mac802154_set_mac_params(struct net_device *dev,
Signature · 1 line
2.1.0
Re: [PATCH 8/8] mac802154: mac802154_mlme_start_req() optimisation.
Quoted 6 lines · Lennert Buytenhek
mac802154_mlme_start_req()calls ieee802154_mlme_ops(dev)->llsec->set_params() on thenet_devicepassed into it, however, thisnet_devicewill always be a mac802154net_device, so just callmac802154_set_params()directly instead.Signed-off-by Lennert Buytenhek <[email protected]>