10 Sep, 2018

1 commit

  • commit f9c52831133050c6b82aa8b6831c92da2bbf2a0b upstream.

    This patch is necessary if case of AF_PACKET or other socket interface
    which I am aware of it and didn't allocated the necessary room.

    Reported-by: David Palma
    Reported-by: Rabi Narayan Sahoo
    Cc: stable@vger.kernel.org
    Signed-off-by: Alexander Aring
    Signed-off-by: Stefan Schmidt
    Signed-off-by: Greg Kroah-Hartman

    Alexander Aring
     

11 Dec, 2015

1 commit

  • This patch reverts 6001d52 ("mac802154: tx: don't allow if down while
    sync tx"). This has side effects with stop callback which flush the
    transmit workqueue. The stop callback will wait until the workqueue is
    flushed and holding the rtnl lock. That means it can happen that the stop
    callback waits forever because it try to lock the rtnl mutex which is
    already hold by stop callback.

    Cc: Michael Hennerich
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

30 Sep, 2015

2 commits

  • This patch changes the mtu size of 802.15.4 interfaces. The current
    setting is the meaning of the maximum transport unit with mac header,
    which is 127 bytes according 802.15.4. The linux meaning of the mtu size
    field is the maximum payload of a mac frame. Like in ethernet, which is
    1500 bytes.

    We have dynamic length of mac frames in 802.15.4, this is why we assume
    the minimum header length which is hard_header_len. This contains fc and
    sequence fields. These can evaluated by driver layer without additional
    checks. We currently don't support to set the FCS from userspace, so we
    need to subtract this from mtu size as well.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • While doing a little test with the llsec implementation I saw these
    issues. We should move decryption and encruption somewhere else,
    otherwise while capturing with wireshark the mac header shows secuirty
    fields but the payload is plaintext.

    A complete other issue is what doing with HardMAC drivers where the
    payload is always plaintext. I think we need a special handling then in
    userspace. We currently doesn't support any HardMAC transceivers, so we
    should fix the first issue for SoftMAC transceivers.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

22 Sep, 2015

2 commits

  • Sending over AF_PACKET RAW sockets we can sending frames which exceeds
    MTU size. To handling it correct we need to change things in AF_PACKET
    which knows on RAW sockets an additional FCS is set by hardware or
    mac802154 transmit functionality.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch cleanups needed_headroom, needed_tailroom and hard_header_len
    fields for wpan and lowpan interfaces.

    For wpan interfaces the worst case mac header len should be part of
    needed_headroom, currently this is set as hard_header_len, but
    hard_header_len should be set to the minimum header length which xmit
    call assumes and this is the minimum frame length of 802.15.4.
    The hard_header_len value will check inside send callbacl of AF_PACKET
    raw sockets.

    For lowpan interfaces, if fragmentation isn't needed the skb will
    call dev_hard_header for 802154 layer and queue it afterwards. This
    happens without new skb allocation, so we need the same headroom and
    tailroom lengths like 802154 inside 802154 6lowpan layer. At least we
    assume as minimum header length an ipv6 header size.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

30 Jul, 2015

1 commit

  • When transmitting a packet via a mac802154 driver that can sleep in
    its transmit function, mac802154 defers the call to the driver's
    transmit function to a per-device workqueue.

    However, mac802154 uses a single global work_struct for this, which
    means that if you have more than one registered mac802154 interface
    in the system, and you transmit on more than one of them at the same
    time, you'll very easily cause memory corruption.

    This patch moves the deferred transmit processing state from global
    variables to struct ieee802154_local, and this seems to fix the memory
    corruption issue.

    Signed-off-by: Lennert Buytenhek
    Acked-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Lennert Buytenhek
     

13 Nov, 2014

1 commit

  • This patch adds a new interframe spacing time handling into mac802154
    layer. Interframe spacing time is a time period between each transmit.
    This patch adds a high resolution timer into mac802154 and starts on
    xmit complete with corresponding interframe spacing expire time if
    ifs_handling is true. We make it variable because it depends if
    interframe spacing time is handled by transceiver or mac802154. At the
    timer complete function we wake the netdev queue again. This avoids
    new frame transmit in range of interframe spacing time.

    For synced driver we add no handling of interframe spacing time. This
    is currently a lack of support in all synced xmit drivers. I suppose
    it's working because the latency of workqueue which is needed to call
    spi_sync.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

30 Oct, 2014

1 commit

  • This patch splits the IEEE802154_HW_OMIT_CKSUM hardware flag into
    IEEE802154_HW_TX_OMIT_CKSUM and IEEE802154_HW_RX_OMIT_CKSUM. This is
    useful to deliver the received crc from the driver layer to the monitor
    interface. At the moment we can't do that without change the xmit
    handling.

    The received checksum should be visible in monitor mode only.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

29 Oct, 2014

1 commit


28 Oct, 2014

2 commits

  • This removes the call of monitor receive funktion when any interface
    type call xmit. There exist no such use case that a monitor interface
    should receive the actual sending frame. One use case could be that a
    wpan interface and monitor interface could be running at the same time
    on one phy. Then the monitor interface receives the wpan frames also.
    Furthermore we adding support for promiscous mode setting. With
    promiscous mode setting we can't run a wpan and monitor interface at the
    same time.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch replaces the memcpy with a put_unaligned_le16. The placement
    of crc inside of PSDU can also be unaligned. With memcpy this can fail
    on some architectures.

    Signed-off-by: Alexander Aring
    Reported-by: Marcel Holtmann
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

27 Oct, 2014

13 commits


26 Oct, 2014

7 commits


25 Oct, 2014

1 commit


14 Aug, 2014

1 commit


08 Jul, 2014

1 commit

  • This patch fixed the coding style issues reported by checkpatch.pl

    following issues fixed:
    CHECK: Alignment should match open parenthesis
    WARNING: line over 80 characters
    CHECK: Blank lines aren't necessary before a close brace '}'
    WARNING: networking block comments don't use an empty /* line, use /* Comment...
    WARNING: Missing a blank line after declarations
    WARNING: networking block comments start with * on subsequent lines
    CHECK: braces {} should be used on all arms of this statement

    Signed-off-by: Varka Bhadram
    Tested-by: Alexander Aring
    Signed-off-by: David S. Miller

    Varka Bhadram
     

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

2 commits

  • 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
     

01 Dec, 2012

2 commits