20 Dec, 2011

2 commits

  • If station info contains a beacon loss count, return
    it to userspace.

    Signed-off-by: Paul Stewart
    Signed-off-by: John W. Linville

    Paul Stewart
     
  • Currently code allows three (HT_AGG_MAX_RETRIES) unanswered addba
    requests. When this limit is reached aggregation is turned off for
    given TID permanently. This doesn't seem right: three requests is
    not that much, some 'blackout' can happen, but effect of it affects
    whole connection indefinitely.
    This patch increases number of retries to 15. Also, when there have
    been 3 or more retries it splits further retries apart by 15 seconds
    instead of sending them in very short period of time.

    Signed-off-by: Nikolay Martynov
    Signed-off-by: John W. Linville

    Nikolay Martynov
     

16 Dec, 2011

2 commits

  • No real changes, just note that they are const.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Station entries can have various states, the most
    important ones being auth, assoc and authorized.
    This patch prepares us for telling the driver about
    these states, we don't want to confuse drivers with
    strange transitions, so with this we enforce that
    they move in the right order between them (back and
    forth); some transitions might happen before the
    driver even knows about the station, but at least
    runtime transitions will be ordered correctly.

    As a consequence, IBSS and MESH stations will now
    have the ASSOC flag set (so they can transition to
    AUTHORIZED), and we can get rid of a special case
    in TX processing.

    When freeing a station, unwind the state so that
    other parts of the code (or drivers later) can rely
    on the transitions.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

01 Dec, 2011

1 commit


29 Nov, 2011

1 commit

  • Currently tx aggregation is not being timed out even if timeout is
    specified when aggregation is opened. Tx tid stays active until delba
    arrives from recipient (i.e. recipient times out tid when it is
    inactive).
    The problem with this approach is that delba can get lost in the air
    and tx tid will stay perpetually opened on the originator while closed
    on recipient thus all data sent via this tid will be lost.
    This patch implements tx tid timeouting in way very similar to rx tid
    timeouting.

    Signed-off-by: Nikolay Martynov
    Signed-off-by: John W. Linville

    Nikolay Martynov
     

22 Nov, 2011

1 commit


10 Nov, 2011

1 commit

  • Implement the cfg80211 notification but only send
    one event per associated station to avoid having
    tons of events if the station thinks it should be
    allowed to use 4addr frames but it isn't.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

01 Oct, 2011

7 commits

  • The flaglock in struct sta_info has long been
    something that I wanted to get rid of, this
    finally does the conversion to atomic bitops.

    The conversion itself is straight-forward in
    most places, a few things needed to change a
    bit since we can no longer use multiple bits
    at the same time.

    On x86-64, this is a fairly significant code
    size reduction:
    text data bss dec hex
    427861 23648 1008 452517 6e7a5 before
    425383 23648 976 450007 6ddd7 after

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • If a PS-poll frame is retried (but was received)
    there is no way to detect that since it has no
    sequence number. As a consequence, the standard
    asks us to not react to PS-poll frames until the
    response to one made it out (was ACKed or lost).

    Implement this by using the WLAN_STA_SP flags to
    also indicate a PS-Poll "service period" and the
    IEEE80211_TX_STATUS_EOSP flag for the response
    packet to indicate the end of the "SP" as usual.

    We could use separate flags, but that will most
    likely completely confuse drivers, and while the
    standard doesn't exclude simultaneously polling
    using uAPSD and PS-Poll, doing that seems quite
    problematic.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Add uAPSD support to mac80211. This is probably not
    possible with all devices, so advertising it with
    the cfg80211 flag will be left up to drivers that
    want it.

    Due to my previous patches it is now a fairly
    straight-forward extension. Drivers need to have
    accurate TX status reporting for the EOSP frame.
    For drivers that buffer themselves, the provided
    APIs allow releasing the right number of frames,
    but then drivers need to set EOSP and more-data
    themselves. This is documented in more detail in
    the new code itself.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • For uAPSD support we'll need to have per-AC PS
    buffers. As this is a major undertaking, split
    the buffers before really adding support for
    uAPSD. This already makes some reference to the
    uapsd_queues variable, but for now that will
    never be non-zero.

    Since book-keeping is complicated, also change
    the logic for keeping a maximum of frames only
    and allow 64 frames per AC (up from 128 for a
    station).

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Currently, the TIM bit for a given station is set
    and cleared all over the place. Since the logic to
    set/clear it will become much more complex when we
    add uAPSD support, as a first step let's collect
    the entire logic in one place. This requires a few
    small adjustments to other places.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Mark the STA entries of enabled TDLS peers with a new "peer authorized"
    flag.

    During link setup, allow special TDLS setup frames through the AP, but
    otherwise drop all packets destined to the peer. This is required by the
    TDLS (802.11z) specification in order to prevent reordering of MSDUs
    between the AP and direct paths.

    When setup completes and the peer is authorized, send data directly,
    bypassing the AP.

    In the Rx path, allow data to be received directly from TDLS peers.

    Signed-off-by: Arik Nemtsov
    Cc: Kalyan C Gaddam
    Signed-off-by: John W. Linville

    Arik Nemtsov
     
  • When adding a TDLS peer STA, mark it with a new flag in both nl80211 and
    mac80211. Before adding a peer, make sure the wiphy supports TDLS and
    our operating mode is appropriate (managed).

    In addition, make sure all peers are removed on disassociation.

    A TDLS peer is first added just before link setup is initiated. In later
    setup stages we have more info about peer supported rates, capabilities,
    etc. This info is reported via nl80211_set_station().

    Signed-off-by: Arik Nemtsov
    Cc: Kalyan C Gaddam
    Signed-off-by: John W. Linville

    Arik Nemtsov
     

14 Sep, 2011

1 commit

  • Unfortunately failed BAR tx attempts happen more frequently than I
    expected, and the resulting aggregation teardowns cause performance
    issues, as the aggregation session does not always get re-established
    properly.
    Instead of tearing down the entire aggr session, we can simply store the
    SSN of the last failed BAR tx attempt, wait for the first successful
    tx status event, and then send another BAR with the same SSN.

    Signed-off-by: Felix Fietkau
    Cc: Helmut Schaa
    Signed-off-by: John W. Linville

    Felix Fietkau
     

26 Aug, 2011

1 commit

  • When associating to an AP, the station might miss the first EAP
    packet that the AP sends due to a race condition between the association
    success procedure and the rx flow in mac80211.
    In such cases, the packet might fall in ieee80211_rx_h_check due to
    the fact that the relevant rx->sta wasn't allocated yet.
    Allocation of the relevant station info struct before actually
    sending the association request and setting it with a new
    dummy_sta flag solve this problem.
    The station will accept only EAP packets from the AP while it
    is in the pre-association/dummy state.
    This dummy station entry is not seen by normal sta_info_get()
    calls, only by sta_info_get_bss_rx().
    The driver is not notified for the first insertion of the
    dummy station. The driver is notified only after the association
    is complete and the dummy flag is removed from the station entry.
    That way, all the rest of the code flow should be untouched by
    this change.

    Signed-off-by: Guy Eilam
    Signed-off-by: John W. Linville

    Guy Eilam
     

08 Jul, 2011

1 commit

  • The current rx->queue value is slightly confusing.
    It is set to 16 on non-QoS frames, including data,
    and then used for sequence number and PN/IV checks.
    Until recently, we had a TKIP IV checking bug that
    had been introduced in 2008 to fix a seqno issue.
    Before that, we always used TID 0 for checking the
    PN or IV on non-QoS packets.

    Go back to the old status for PN/IV checks using
    the TID 0 counter for non-QoS by splitting up the
    rx->queue value into "seqno_idx" and "security_idx"
    in order to avoid confusion in the future. They
    each have special rules on the value used for non-
    QoS data frames.

    Since the handling is now unified, also revert the
    special TKIP handling from my patch
    "mac80211: fix TKIP replay vulnerability".

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

08 Jun, 2011

1 commit

  • Some devices support BT/WLAN co-existence algorigthms.
    In order not to harm the system performance and user experience, the device
    requests not to allow any RX BA session and tear down existing RX BA sessions
    based on system constraints such as periodic BT activity that needs to limit
    WLAN activity (eg.SCO or A2DP).
    In such cases, the intention is to limit the duration of the RX PPDU and
    therefore prevent the peer device to use A-MPDU aggregation.

    Adding ieee80211_stop_rx_ba_session() callback
    that can be used by the driver to stop existing BA sessions.

    Signed-off-by: Shahar Levi
    Signed-off-by: John W. Linville

    Shahar Levi
     

17 May, 2011

3 commits

  • These definitions need to be exposed now that we can set the peer link
    states via NL80211_ATTR_STA_PLINK_STATE. They were already being
    (opaquely) reported by NL80211_STA_INFO_PLINK_STATE.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     
  • This adds sparse RCU annotations to most of
    mac80211, only the mesh code remains to be
    done.

    Due the the previous patches, the annotations
    are pretty simple. The only thing that this
    actually changes is removing the RCU usage of
    key->sta in debugfs since this pointer isn't
    actually an RCU-managed pointer (it only has
    a single assignment done before the key even
    goes live). As that is otherwise harmless, I
    decided to make it part of this patch.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • During my quest to make mac80211 not have any RCU
    warnings from sparse, I came across the a-MPDU code
    again and it wasn't quite clear why it isn't racy.
    So instead of assigning the tid_tx array with just
    the spinlock held in ieee80211_start_tx_ba_session
    use a separate temporary array protected only by
    the spinlock and protect all assignments to the
    "live" array by both the spinlock and the mutex so
    that other code is easily verified to be correct.

    Due to pointer assignment atomicity I don't think
    this is a real issue, but I'm not sure, especially
    on Alpha the current code might be problematic.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

12 May, 2011

1 commit


20 Apr, 2011

1 commit

  • This allows a driver to buffer frames for a PS station and tell mac80211
    to wake it up even though mac80211 does not have any buffered frames for
    it.
    This is necessary for properly handling aggregation related buffering,
    in ath9k, because the driver needs to keep its frames in order to keep
    track of the Block-ACK window.

    Signed-off-by: Felix Fietkau
    Signed-off-by: John W. Linville

    Felix Fietkau
     

13 Apr, 2011

1 commit


05 Apr, 2011

1 commit

  • We currently run this timer exactly once when
    a new mac80211 device is registered, but that
    is completely pointless since it will have no
    work to do at all. Therefore, remove that and
    also simplify some code using the timer.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

02 Mar, 2011

1 commit


20 Jan, 2011

1 commit

  • The aggregation code currently doesn't implement the
    buffer size negotiation. It will always request a max
    buffer size (which is fine, if a little pointless, as
    the mac80211 code doesn't know and might just use 0
    instead), but if the peer requests a smaller size it
    isn't possible to honour this request.

    In order to fix this, look at the buffer size in the
    addBA response frame, keep track of it and pass it to
    the driver in the ampdu_action callback when called
    with the IEEE80211_AMPDU_TX_OPERATIONAL action. That
    way the driver can limit the number of subframes in
    aggregates appropriately.

    Note that this doesn't fix any drivers apart from the
    addition of the new argument -- they all need to be
    updated separately to use this variable!

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

16 Dec, 2010

1 commit

  • Allow drivers or rate control algorithms to specify BlockAck session
    timeout when initiating an ADDBA transaction. This is useful in cases
    where maintaining persistent BA sessions does not incur any overhead.

    The current timeout value of 5000 TUs is retained for all non ath9k/ath9k_htc
    drivers.

    Signed-off-by: Sujith Manoharan
    Reviewed-by: Johannes Berg
    Signed-off-by: John W. Linville

    Sujith Manoharan
     

08 Dec, 2010

1 commit

  • Extend nl80211 to report an exponential weighted moving average (EWMA) of the
    signal value. Since the signal value usually fluctuates between different
    packets, an average can be more useful than the value of the last packet.

    This uses the recently added generic EWMA library function.

    --
    v2: fix ABI breakage and change factor to be a power of 2.

    Signed-off-by: Bruno Randolf
    Signed-off-by: John W. Linville

    Bruno Randolf
     

30 Nov, 2010

1 commit

  • The RX aggregation locking documentation was
    wrong, which led Christian to also code the
    timer timeout handling for it somewhat wrongly.

    Fix the documentation, the two places that
    need to hold the reorder lock across accesses
    to the structure, and the debugfs code that
    should just use RCU.

    Also, remove acquiring the sta->lock across
    reorder timeouts since it isn't necessary, and
    change a few places to GFP_KERNEL because the
    code path here doesn't need atomic allocations
    as I noticed when reviewing all this.

    Signed-off-by: Johannes Berg
    Acked-by: Christian Lamparter
    Signed-off-by: John W. Linville

    Johannes Berg
     

25 Nov, 2010

2 commits


19 Nov, 2010

1 commit

  • Extend nl80211 to report an exponential weighted moving average (EWMA) of the
    signal value. Since the signal value usually fluctuates between different
    packets, an average can be more useful than the value of the last packet.

    This uses the recently added generic EWMA library function.

    Signed-off-by: Bruno Randolf
    Signed-off-by: John W. Linville

    Bruno Randolf
     

07 Oct, 2010

2 commits

  • This adds API to allow adding per-station GTKs,
    updates mac80211 to support it, and also allows
    drivers to remove a key from hwaccel again when
    this may be necessary due to multiple GTKs.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • When roaming while we have active BA session,
    we can end up transmitting delBA frames to
    the old AP while we're already on the new AP's
    channel, which can cause warnings.

    Simply avoid sending those frames, but still
    tear down the internal session state, since
    they are not really necessary anyway as we
    will implicitly disassociate when sending the
    association to the new AP.

    Signed-off-by: Johannes Berg
    Acked-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Johannes Berg
     

17 Aug, 2010

1 commit

  • This patch introduces a new timer, which will release
    queued-up MPDUs from the reorder buffer, whenever
    they've waited for more than HT_RX_REORDER_BUF_TIMEOUT
    (which is at around 100 ms).

    The advantage of having a dedicated timer, instead of
    relying on a constant stream of freshly arriving aMPDUs
    to release the old ones, is particularly observable when
    even a small fraction of MPDUs are forever lost at
    low network speeds.

    Previously under these circumstances frames would become
    stuck in the reorder buffer and the network stack of both
    HT peers throttled back, instead of revving up and
    gunning the pipes.

    Signed-off-by: Christian Lamparter
    Signed-off-by: John W. Linville

    Christian Lamparter
     

29 Jun, 2010

1 commit


15 Jun, 2010

2 commits

  • To prepare for allowing drivers to sleep in
    ampdu_action, change the locking in the RX
    aggregation code to use a mutex, so that it
    would already allow drivers to sleep. But
    explicitly disable BHs around the callback
    for now since the TX part cannot yet sleep,
    and drivers' locking might require it.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Since we want the code to be able to sleep
    in the future, it must not be called from
    the timer directly. To prepare, move it out
    into the aggregation work.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg