08 Apr, 2014

1 commit

  • The commit e6278d92005e ("mac802154: use header operations to
    create/parse headers") included the header

    net/ieee802154_netdev.h

    which had been included by the commit b70ab2e87f17 ("ieee802154:
    enforce consistent endianness in the 802.15.4 stack"). Fix this
    duplicate #include by deleting the latter one as the required header
    has already been in place.

    Signed-off-by: Jean Sacren
    Cc: Alexander Smirnov
    Cc: Dmitry Eremin-Solenikov
    Cc: Phoebe Buckheister
    Cc: linux-zigbee-devel@lists.sourceforge.net
    Signed-off-by: David S. Miller

    Jean Sacren
     

02 Apr, 2014

2 commits

  • 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
     
  • All 802.15.4 PHY devices with drivers in tree can support only one WPAN
    at any given time, yet the stack allows arbitrarily many WPAN devices to
    be created and up at the same time. This cannot work with what the
    hardware provides, and in the current implementation, provides an easy
    DoS vector to any process on the system that may call socket() and
    sendmsg().

    Thus, allow only one WPAN per PHY to be up at once, just like mac80211
    does for managed devices.

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

    Phoebe Buckheister
     

15 Mar, 2014

5 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
     
  • 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
     
  • 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
     

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
     

14 Feb, 2014

1 commit

  • One of my pet coding style peeves is the practice of
    adding extra return; at the end of function.
    Kill several instances of this in network code.

    I suppose some coccinelle wizardy could do this automatically.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

23 Dec, 2013

1 commit


31 Oct, 2013

2 commits


30 Apr, 2013

2 commits


09 Apr, 2013

1 commit

  • Two sections checked whether the current channel != the new channel
    without ever setting the current channel variables.

    1. net/mac802154/tx.c: Prevent set_channel() from getting called every
    time a packet is sent.

    2. net/mac802154/mib.c: Lock (pib_lock) accesses to current_channel and
    current_page and make sure they are updated when the channel has been
    changed.

    Signed-off-by: Alan Ott
    Signed-off-by: David S. Miller

    Alan Ott
     

08 Apr, 2013

3 commits

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

    Alan Ott
     
  • Use netif_stop_queue() and netif_wake_queue() to control the flow of
    packets to mac802154 devices. Since many IEEE 802.15.4 devices have no
    output buffer, and since the mac802154 xmit() function is designed to
    block, netif_stop_queue() is called after each packet.

    Signed-off-by: Alan Ott
    Signed-off-by: David S. Miller

    Alan Ott
     
  • When ops->xmit() fails, drop the packet. Devices which support hardware
    ack and retry (which include all devices currently supported by mainline),
    will automatically retry sending the packet (in the hardware) up to 3
    times, per the 802.15.4 spec. There is no need, and it is incorrect to
    try to do it in mac802154.

    Signed-off-by: Alan Ott
    Signed-off-by: David S. Miller

    Alan Ott
     

27 Mar, 2013

2 commits


22 Feb, 2013

1 commit

  • Pull driver core patches from Greg Kroah-Hartman:
    "Here is the big driver core merge for 3.9-rc1

    There are two major series here, both of which touch lots of drivers
    all over the kernel, and will cause you some merge conflicts:

    - add a new function called devm_ioremap_resource() to properly be
    able to check return values.

    - remove CONFIG_EXPERIMENTAL

    Other than those patches, there's not much here, some minor fixes and
    updates"

    Fix up trivial conflicts

    * tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (221 commits)
    base: memory: fix soft/hard_offline_page permissions
    drivercore: Fix ordering between deferred_probe and exiting initcalls
    backlight: fix class_find_device() arguments
    TTY: mark tty_get_device call with the proper const values
    driver-core: constify data for class_find_device()
    firmware: Ignore abort check when no user-helper is used
    firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER
    firmware: Make user-mode helper optional
    firmware: Refactoring for splitting user-mode helper code
    Driver core: treat unregistered bus_types as having no devices
    watchdog: Convert to devm_ioremap_resource()
    thermal: Convert to devm_ioremap_resource()
    spi: Convert to devm_ioremap_resource()
    power: Convert to devm_ioremap_resource()
    mtd: Convert to devm_ioremap_resource()
    mmc: Convert to devm_ioremap_resource()
    mfd: Convert to devm_ioremap_resource()
    media: Convert to devm_ioremap_resource()
    iommu: Convert to devm_ioremap_resource()
    drm: Convert to devm_ioremap_resource()
    ...

    Linus Torvalds
     

07 Feb, 2013

2 commits


12 Jan, 2013

1 commit

  • The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
    while now and is almost always enabled by default. As agreed during the
    Linux kernel summit, remove it from any "depends on" lines in Kconfigs.

    CC: Alexander Smirnov
    CC: Dmitry Eremin-Solenikov
    CC: "David S. Miller"
    Signed-off-by: Kees Cook
    Acked-by: David S. Miller

    Kees Cook
     

05 Jan, 2013

1 commit

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

    Alexander Aring
     

15 Dec, 2012

1 commit

  • mutex_destroy() must be called before wpan_phy_free(), because it puts the last
    reference and frees memory. Catched as overwritten poison in kmalloc-2048.

    Signed-off-by: Konstantin Khlebnikov
    Cc: Alexander Smirnov
    Cc: Dmitry Eremin-Solenikov
    Cc: David S. Miller
    Cc: linux-zigbee-devel@lists.sourceforge.net
    Cc: netdev@vger.kernel.org
    Signed-off-by: David S. Miller

    Konstantin Khlebnikov
     

01 Dec, 2012

2 commits


12 Jul, 2012

2 commits


29 Jun, 2012

1 commit

  • Conflicts:
    drivers/net/caif/caif_hsi.c
    drivers/net/usb/qmi_wwan.c

    The qmi_wwan merge was trivial.

    The caif_hsi.c, on the other hand, was not. It's a conflict between
    1c385f1fdf6f9c66d982802cd74349c040980b50 ("caif-hsi: Replace platform
    device with ops structure.") in the net-next tree and commit
    39abbaef19cd0a30be93794aa4773c779c3eb1f3 ("caif-hsi: Postpone init of
    HIS until open()") in the net tree.

    I did my best with that one and will ask Sjur to check it out.

    Signed-off-by: David S. Miller

    David S. Miller
     

27 Jun, 2012

4 commits