History log of /net/mac802154/wpan.c
Revision Date Author Comments
9b13494c916dc0bf93802d7426b477cc0130fb48 06-Aug-2014 Masanari Iida <standby24x7@gmail.com> treewide: Fix typo in printk

This patch fix spelling typo in printk within vairous
part of the code.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
6e361d6ffee322fcd092d97720e05032ffb98ae6 19-Aug-2014 Martin Townsend <martin.townsend@xsilon.com> ieee802154: mac802154: handle the reserved dest mode by dropping the packet

If received frame contains the reserved destination address mode. The
frame should be dropped and free the skb.

Signed-off-by: Martin Townsend <martin.townsend@xsilon.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
7629d1eaf33672c9d35ba1e2ad12b459d56ca3b1 19-Aug-2014 Martin Townsend <martin.townsend@xsilon.com> mac802154: fixed potential skb leak with mac802154_parse_frame_start

This patch fix a memory leak if received frame was not able to parse.

Signed-off-by: Martin Townsend <martin.townsend@xsilon.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
b288a4963f09459c29cca240d3352cc7915710fc 11-Aug-2014 Varka Bhadram <varkab@cdac.in> mac802154: common error path

By introducing label fail, making the common error path for
mac802154_llsec_decrypt() and packet type default case.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2d3b5b0a90e5370ad13ca98d95519c3e41d2c925 11-Jun-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> mac802154: don't deliver packets to devices that are down

Only one WPAN devices can be active at any given time, so only deliver
packets to that one interface that is actually up. Multiple monitors may
be up at any given time, but we don't have to deliver to monitors that
are down either.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
a374eeb5e5b35c877a890dce5d3f7cca5a3e33f6 11-Jun-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> mac802154: properly free incoming skbs on decryption failure

mac802154 RX did not free skbs on decryption failure, assuming that the
caller would when the local rx handler returned _DROP. This was false.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9b0bb4a83f27cd9b05d709cdeee86edc174db100 16-May-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> mac802154: propagate device address changes to llsec

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
f30be4d53cada48598dab0983866ae4b16af46dc 16-May-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> mac802154: integrate llsec with wpan devices

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
6ef0023a2e55b82fc0cd8b420788e55f2e32b64b 14-May-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> mac802154: make mac802154_wpan_open static

This function is only used within the same translation unit, so mark it
static.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
32edc40ae65cf84e1ab69f6f8316ce81559e115d 14-May-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> ieee802154: change _cb handling slightly

The current mac_cb handling of ieee802154 is rather awkward and limited.
Decompose the single flags field into multiple fields with the meanings
of each subfield of the flags field to make future extensions (for
example, link-layer security) easier. Also don't set the frame sequence
number in upper layers, since that's a thing the MAC is supposed to set
on frame transmit - we set it on header creation, but assuming that
upper layers do not blindly duplicate our headers, this is fine.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
8c84296fd2867118944399ab7e9051515a70d60d 14-May-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> mac802154: account for all header parts during wpan header creationg

The current WPAN header creation code checks for EMSGSIZE conditions,
but does not account for the MIC field that link layer security may add
at the end of the frame. Now that we can accurately calculate the
maximum payload size of packets, use that to check for EMSGSIZE
conditions.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
e462ded699aa2cca04b68fbf203ea4675d4c44d4 31-Mar-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> mac802154: make csma/cca parameters per-wpan

Commit 9b2777d6089bcd (ieee802154: add TX power control to wpan_phy)
and following erroneously added CSMA and CCA parameters for 802.15.4
devices as PHY parameters, while they are actually MAC parameters and
can differ for any two WPAN instances. Since it is now sensible to have
multiple WPAN devices with differing CSMA/CCA parameters, make these
parameters MAC parameters instead.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
d1d7358e9f032a43bd48d56a623943b7bee7dce0 14-Mar-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> ieee802154: add proper length checks to header creations

Have mac802154 header_ops.create fail with -EMSGSIZE if the length
passed will be too large to fit a frame. Since 6lowpan will ensure that
no packet payload will be too large, pass a length of 0 there. 802.15.4
dgram sockets will also return -EMSGSIZE on payloads larger than the
device MTU instead of -EINVAL.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
ae531b9475f62c5e1863508604cd6b3faf362d56 14-Mar-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> ieee802154: use ieee802154_addr instead of *_sa variants

Change all internal uses of ieee802154_addr_sa to ieee802154_addr,
except for those instances that communicate directly with userspace.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
e6278d92005e9d6e374f269b4ce39c908a68ad5d 14-Mar-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> mac802154: use header operations to create/parse headers

Use the operations on 802.15.4 header structs introduced in a previous
patch to create and parse all headers in the mac802154 stack. This patch
reduces code duplication between different parts of the mac802154 stack
that needed information from headers, and also fixes a few bugs that
seem to have gone unnoticed until now:

* 802.15.4 dgram sockets would return a slightly incorrect value for
the SIOCINQ ioctl
* mac802154 would not drop frames with the "security enabled" bit set,
even though it does not support security, in violation of the
standard

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
b70ab2e87f17176d18f67ef331064441a032b5f3 14-Mar-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> ieee802154: enforce consistent endianness in the 802.15.4 stack

Enable sparse warnings about endianness, replace the remaining fields
regarding network operations without explicit endianness annotations
with such that are annotated, and propagate this through the entire
stack.

Uses of ieee802154_addr_sa are not changed yet, this patch is only
concerned with all other fields (such as address filters, operation
parameters and the likes).

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
376b7bd3558eaf12d3e5c24aa71d0c162d2701fd 14-Mar-2014 Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de> ieee802154: rename struct ieee802154_addr to *_sa

The struct as currently defined uses host byte order for some fields,
and most big endian/EUI display byte order for other fields. Inside the
stack, endianness should ideally match network byte order where possible
to minimize the number of byteswaps done in critical paths, but this
patch does not address this; it is only preparatory.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2cc33c7e319c10b4e169050b3e21908531b09bf9 19-Dec-2013 Weilong Chen <chenweilong@huawei.com> mac802154: fix following checkpath.pl warning Prefer pr_warn(... to pr_warning(...

This patch fixes checkpath.pl:
WARNING: Prefer pr_warn(... to pr_warning(...
#447: FILE: ./wpan.c:447:

Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3e69162ea4a9e927cb3619b96c86aae4ded60112 30-Oct-2013 Alexander Aring <alex.aring@gmail.com> 6lowpan: set and use mac_len for mac header length

Set the mac header length while creating the 802.15.4 mac header.

Drop the function for recalculate mac header length in upper layers
which was static and works for intra pan communication only.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Werner Almesberger <werner@almesberger.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
e937f583ec3a40cccd480b40d8c6d54751781587 03-Apr-2013 Alan Ott <alan@signal11.us> mac802154: Increase tx_buffer_len

Increase the buffer length from 10 to 300 packets. Consider that traffic on
mac802154 devices will often be 6LoWPAN, and a full-length (1280 octet)
IPv6 packet will fragment into 15 6LoWPAN fragments (because the MTU of
IEEE 802.15.4 is 127). A 300-packet queue is really 20 full-length IPv6
packets.

With a queue length of 10, an entire IPv6 packet was unable to get queued
at one time, causing fragments to be dropped, and making reassembly
impossible.

Signed-off-by: Alan Ott <alan@signal11.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
cf692061d0d575f1b9b614555ca392d8b8eabab3 25-Mar-2013 Tony Cheneau <tony.cheneau@amnesiak.org> mac802154: turn on ACK when enabled by the upper layers

Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
25060d8f3f2c21daadb4fc1fb0e37ce2c992e30b 05-Feb-2013 Alexander Aring <alex.aring@gmail.com> wpan: use stack buffer instead of heap

head buffer is only temporary available in mac802154_header_create.
So it's not necessary to put it on the heap.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
f458c647ea5cdd956f8055a4178072be460559f1 05-Feb-2013 Alexander Aring <alex.aring@gmail.com> wpan: whitespace fix

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5ff3fec6d3fc848753c2fa30b18607358f89a202 02-Jan-2013 Alexander Aring <alex.aring@googlemail.com> mac802154: fix NOHZ local_softirq_pending 08 warning

When using nanosleep() in an userspace application we get a
ratelimit warning

NOHZ: local_softirq_pending 08

for 10 times.

This patch replaces netif_rx() with netif_rx_ni() which has
to be used from process/softirq context.
The process/softirq context will be called from fakelb driver.

See linux-kernel commit 481a819 for similar fix.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
fcefbe9fcb3b0d72c91629f7fcf7ea09a46ab2c1 29-Nov-2012 Alan Ott <alan@signal11.us> mac802154: fix memory leaks

kfree_skb() was not getting called in the case of some failures.
This was pointed out by Eric Dumazet.

Signed-off-by: Alan Ott <alan@signal11.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
32bad7e30f113a8a5cebe4704bf6519ab4383e1b 26-Jun-2012 alex.bluesman.smirnov@gmail.com <alex.bluesman.smirnov@gmail.com> mac802154: add wpan device-class support

Every real 802.15.4 transceiver, which works with software MAC layer,
can be classified as a wpan device in this stack. So the wpan device
implementation provides missing link in datapath between the device
drivers and the Linux network queue.

According to the IEEE 802.15.4 standard each packet can be one of the
following types:
- beacon
- MAC layer command
- ACK
- data

This patch adds support for the data packet-type only, but this is
enough to perform data transmission and receiving over radio.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>