02 Apr, 2014

1 commit

  • 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
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     

21 Mar, 2014

2 commits

  • This patch is only a cleanup to use the right define for a panid field.
    The broadcast address and panid broadcast is still the same value.

    Signed-off-by: Alexander Aring
    Cc: Phoebe Buckheister
    Signed-off-by: David S. Miller

    Alexander Aring
     
  • This patch fixes an issue which was introduced by commit
    b70ab2e87f17176d18f67ef331064441a032b5f3 ("ieee802154: enforce
    consistent endianness in the 802.15.4 stack").

    The correct behaviour should be a check on the broadcast address field
    which is 0xffff.

    Signed-off-by: Alexander Aring
    Reported-by: Jan Luebbe
    Cc: Phoebe Buckheister
    Signed-off-by: David S. Miller

    Alexander Aring
     

19 Mar, 2014

1 commit

  • ieee802154 sockets do not properly unshare received skbs, which leads to
    panics (at least) when they are used in conjunction with 6lowpan, so
    run skb_share_check on received skbs.
    6lowpan also contains a use-after-free, which is trivially fixed by
    replacing the inlined skb_share_check with the explicit call.

    Signed-off-by: Phoebe Buckheister
    Tested-by: Alexander Aring
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     

15 Mar, 2014

7 commits

  • 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
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • Fragmentation and reassembly information for 6lowpan is independent from
    the 802.15.4 stack and used only by the 6lowpan reassembly process. Move
    the ieee802154_frag_info struct to a private are, it needn't be in the
    802.15.4 skb control block.

    Signed-off-by: Phoebe Buckheister
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • 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
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • 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
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • This patch provides a set of structures to represent 802.15.4 MAC
    headers, and a set of operations to push/pull/peek these structs from
    skbs. We cannot simply pointer-cast the skb MAC header pointer to these
    structs, because 802.15.4 headers are wildly variable - depending on the
    first three bytes, virtually all other fields of the header may be
    present or not, and be present with different lengths.

    The new header creation/parsing routines also support 802.15.4 security
    headers, which are currently not supported by the mac802154
    implementation of the protocol.

    Signed-off-by: Phoebe Buckheister
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • 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
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • 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
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     

14 Mar, 2014

1 commit


13 Mar, 2014

1 commit


11 Mar, 2014

1 commit


08 Mar, 2014

1 commit


07 Mar, 2014

2 commits


05 Mar, 2014

1 commit


03 Mar, 2014

3 commits


01 Mar, 2014

6 commits

  • This patch drops the current way of 6lowpan fragmentation on receiving
    side and replace it with a implementation which use the inet_frag api.
    The old fragmentation handling has some race conditions and isn't
    rfc4944 compatible. Also adding support to match fragments on
    destination address, source address, tag value and datagram_size
    which is missing in the current implementation.

    Signed-off-by: Alexander Aring
    Signed-off-by: David S. Miller

    Alexander Aring
     
  • Detected with:

    ./scripts/checkpatch.pl --strict -f net/ieee802154/6lowpan_rtnl.c

    Signed-off-by: Alexander Aring
    Signed-off-by: David S. Miller

    Alexander Aring
     
  • We have a 6lowpan.c file and 6lowpan.ko file. To avoid confusing we
    should move 6lowpan.c to 6lowpan_rtnl.c. Then we can support multiple
    source files for 6lowpan module.

    Signed-off-by: Alexander Aring
    Signed-off-by: David S. Miller

    Alexander Aring
     
  • Signed-off-by: Alexander Aring
    Signed-off-by: David S. Miller

    Alexander Aring
     
  • This patch fix the fragmentation on sending side according to rfc4944.

    Also add improvement to use the full payload of a PDU which calculate
    the nearest divided to 8 payload length for the fragmentation datagram
    size attribute.

    The main issue is that the datagram size of fragmentation header use the
    ipv6 payload length, but rfc4944 says it's the ipv6 payload length inclusive
    network header size (and transport header size if compressed).

    Signed-off-by: Alexander Aring
    Signed-off-by: David S. Miller

    Alexander Aring
     
  • This patch add a lookup function for uncompressed 6LoWPAN header
    size. This is needed to estimate the real size after uncompress the
    6LoWPAN header.

    Signed-off-by: Alexander Aring
    Signed-off-by: David S. Miller

    Alexander Aring
     

19 Feb, 2014

1 commit

  • phy_set_csma_params has a redundant (and impossible) check for
    "retries", found by smatch. The check was supposed to be for
    frame_retries, but wasn't moved during development when
    phy_set_frame_retries was introduced. Also, maxBE >= 3 as required by
    the standard is not enforced.

    Remove the redundant check, assure max_be >= 3 and check -1
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     

18 Feb, 2014

5 commits

  • Introduce new netlink attributes for SET_PHY_ATTRS:
    * CSMA minimal backoff exponent
    * CSMA maximal backoff exponent
    * CSMA retry limit
    * frame retransmission limit

    The CSMA attributes shall correspond to minBE, maxBE and maxCSMABackoffs of
    802.15.4, respectively. The frame retransmission shall correspond to
    maxFrameRetries of 802.15.4, unless given as -1: then the old behaviour
    of the stack shall apply. For RF2xy, the old behaviour is to not do
    channel sensing at all and simply send *right now*, which is not
    intended behaviour for most applications and actually prohibited for
    some channel/page combinations.

    For all values except frame retransmission limit, the defaults of
    802.15.4 apply. Frame retransmission limits are set to -1 to indicate
    backward-compatible behaviour.

    Signed-off-by: Phoebe Buckheister
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • Since three of the four clear channel assesment modes make use of energy
    detection, provide an API to set the energy detection threshold.
    Driver support for this is available in at86rf230 for the RF212 chips.
    Since for these chips the minimal energy detection threshold depends on
    page and channel used, add a field to struct at86rf230_local that stores
    the minimal threshold. Actual ED thresholds are configured as offsets
    from this value.

    For RF212, setting the ED threshold will not work before a channel/page
    has been set due to the dependency of energy detection in the chip and
    the actual channel/page selected.

    Signed-off-by: Phoebe Buckheister
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • The standard describes four modes of clear channel assesment: "energy
    above threshold", "carrier found", and the logical and/or of these two.
    Support for CCA mode setting is included in the at86rf230 driver,
    predicated for RF212 chips.

    Signed-off-by: Phoebe Buckheister
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • Listen-before-talk is an alternative to CSMA in uncoordinated networks
    and prescribed by european regulations if one wants to have a device
    with radio duty cycles above 10% (or less in some bands). Add a phy
    property to enable/disable LBT in the phy, including support in the
    at86rf230 driver for RF212 chips.

    Signed-off-by: Phoebe Buckheister
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     
  • Replace the current u8 transmit_power in wpan_phy with s8 transmit_power.
    The u8 field contained the actual tx power and a tolerance field,
    which no physical radio every used. Adjust sysfs entries to keep
    compatibility with userspace, give tolerances of +-1dB statically there.

    This patch only adds support for this in the at86rf230 driver and the
    RF212 chip. Configuration calculation for RF212 is also somewhat basic,
    but does the job - the RF212 datasheet gives a large table with
    suggested values for combinations of TX power and page/channel, if this
    does not work well, we might have to copy the whole table.

    Signed-off-by: Phoebe Buckheister
    Signed-off-by: David S. Miller

    Phoebe Buckheister
     

11 Feb, 2014

1 commit

  • When a device ndo_start_xmit() calls again dev_queue_xmit(),
    lockdep can complain because dev_queue_xmit() is re-entered and the
    spinlocks protecting tx queues share a common lockdep class.

    Same issue was fixed for bonding/l2tp/ppp in commits

    0daa2303028a6 ("[PATCH] bonding: lockdep annotation")
    49ee49202b4ac ("bonding: set qdisc_tx_busylock to avoid LOCKDEP splat")
    23d3b8bfb8eb2 ("net: qdisc busylock needs lockdep annotations ")
    303c07db487be ("ppp: set qdisc_tx_busylock to avoid LOCKDEP splat ")

    Reported-by: Alexander Aring
    Signed-off-by: Eric Dumazet
    Tested-by: Alexander Aring
    Signed-off-by: David S. Miller

    Eric Dumazet
     

10 Feb, 2014

1 commit


28 Jan, 2014

1 commit


23 Jan, 2014

1 commit

  • Since commit 8df8c56a5abc, 6lowpan_iphc is a module of its own.

    Unfortunately, it lacks some infrastructure to behave like a
    good kernel citizen:

    kernel: 6lowpan_iphc: module license 'unspecified' taints kernel.
    kernel: Disabling lock debugging due to kernel taint

    This patch adds the basic MODULE_LICENSE(); with GPL license:
    the code was copied from net/ieee802154/6lowpan.c which is GPL
    and the module exports symbol with EXPORT_SYMBOL_GPL();.

    Cc: Jukka Rissanen
    Cc: Alexander Aring
    Cc: Marcel Holtmann
    Signed-off-by: Yann Droneaud
    Acked-by: Marcel Holtmann
    Signed-off-by: David S. Miller

    Yann Droneaud
     

19 Jan, 2014

1 commit

  • This is a follow-up patch to f3d3342602f8bc ("net: rework recvmsg
    handler msg_name and msg_namelen logic").

    DECLARE_SOCKADDR validates that the structure we use for writing the
    name information to is not larger than the buffer which is reserved
    for msg->msg_name (which is 128 bytes). Also use DECLARE_SOCKADDR
    consistently in sendmsg code paths.

    Signed-off-by: Steffen Hurrle
    Suggested-by: Hannes Frederic Sowa
    Acked-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Steffen Hurrle
     

18 Jan, 2014

1 commit


16 Jan, 2014

1 commit

  • IEEE 802.15.4 and Bluetooth networking stacks share 6lowpan compression
    code. Instead of introducing Makefile/Kconfig hacks, build this code as
    a separate module referenced from both ieee802154 and bluetooth modules.

    This fixes the following build error observed in some kernel
    configurations:

    net/built-in.o: In function `header_create': 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
    net/built-in.o: In function `bt_6lowpan_recv': (.text+0x166b3c): undefined reference to `lowpan_process_data'

    Reported-by: Randy Dunlap
    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: David S. Miller

    Dmitry Eremin-Solenikov