31 Dec, 2019

1 commit

  • [ Upstream commit 08a5bdde3812993cb8eb7aa9124703df0de28e4b ]

    Commit 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing")
    let STAs send QoS Null frames as PS triggers if the AP was
    a QoS STA. However, the mac80211 PS stack relies on an
    interface flag IEEE80211_STA_NULLFUNC_ACKED for
    determining trigger frame ACK, which was not being set for
    acked non-QoS Null frames. The effect is an inability to
    trigger hardware sleep via IEEE80211_CONF_PS since the QoS
    Null frame was seemingly never acked.

    This bug only applies to drivers which set both
    IEEE80211_HW_REPORTS_TX_ACK_STATUS and
    IEEE80211_HW_PS_NULLFUNC_STACK.

    Detect the acked QoS Null frame to restore STA power save.

    Fixes: 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing")
    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20191119053538.25979-4-thomas@adapt-ip.com
    Signed-off-by: Johannes Berg
    Signed-off-by: Sasha Levin

    Thomas Pedersen
     

21 Aug, 2019

5 commits

  • 802.11ay specification defines Enhanced Directional Multi-Gigabit
    (EDMG) STA and AP which allow channel bonding of 2 channels and more.

    Introduce new NL attributes that are needed for enabling and
    configuring EDMG support.

    Two new attributes are used by kernel to publish driver's EDMG
    capabilities to the userspace:
    NL80211_BAND_ATTR_EDMG_CHANNELS - bitmap field that indicates the 2.16
    GHz channel(s) that are supported by the driver.
    When this attribute is not set it means driver does not support EDMG.
    NL80211_BAND_ATTR_EDMG_BW_CONFIG - represent the channel bandwidth
    configurations supported by the driver.

    Additional two new attributes are used by the userspace for connect
    command and for AP configuration:
    NL80211_ATTR_WIPHY_EDMG_CHANNELS
    NL80211_ATTR_WIPHY_EDMG_BW_CONFIG

    New rate info flag - RATE_INFO_FLAGS_EDMG, can be reported from driver
    and used for bitrate calculation that will take into account EDMG
    according to the 802.11ay specification.

    Signed-off-by: Alexei Avshalom Lazar
    Link: https://lore.kernel.org/r/1566138918-3823-2-git-send-email-ailizaro@codeaurora.org
    Signed-off-by: Johannes Berg

    Alexei Avshalom Lazar
     
  • The code generating the Tx Radiotap header when using tx_status_ext was
    missing a field increment after setting the VHT bandwidth.

    Fixes: 3d07ffcaf320 ("mac80211: add struct ieee80211_tx_status support to ieee80211_add_tx_radiotap_header")
    Signed-off-by: John Crispin
    Link: https://lore.kernel.org/r/20190807075949.32414-4-john@phrozen.org
    Signed-off-by: Johannes Berg

    John Crispin
     
  • When reporting 80MHz, we need to set 4 and not 2 inside the corresponding
    field inside the Tx Radiotap header.

    Fixes: 3d07ffcaf320 ("mac80211: add struct ieee80211_tx_status support to ieee80211_add_tx_radiotap_header")
    Signed-off-by: John Crispin
    Link: https://lore.kernel.org/r/20190807075949.32414-3-john@phrozen.org
    Signed-off-by: Johannes Berg

    John Crispin
     
  • When reporting legacy rates inside the TX Radiotap header we need to split
    the check between "uses tx_statua_ext" and "is legacy rate". Not doing so
    would make the code drop into the !tx_status_ext path.

    Fixes: 3d07ffcaf320 ("mac80211: add struct ieee80211_tx_status support to ieee80211_add_tx_radiotap_header")
    Signed-off-by: John Crispin
    Link: https://lore.kernel.org/r/20190807075949.32414-2-john@phrozen.org
    Signed-off-by: Johannes Berg

    John Crispin
     
  • The RX Radiotap header length was not calculated properly when reporting
    legacy rates using tx_status_ext.

    Fixes: 3d07ffcaf320 ("mac80211: add struct ieee80211_tx_status support to ieee80211_add_tx_radiotap_header")
    Signed-off-by: John Crispin
    Link: https://lore.kernel.org/r/20190807075949.32414-1-john@phrozen.org
    Signed-off-by: Johannes Berg

    John Crispin
     

26 Jul, 2019

2 commits


19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

19 Jan, 2019

1 commit

  • This adds airtime accounting and scheduling to the mac80211 TXQ
    scheduler. A new callback, ieee80211_sta_register_airtime(), is added
    that drivers can call to report airtime usage for stations.

    When airtime information is present, mac80211 will schedule TXQs
    (through ieee80211_next_txq()) in a way that enforces airtime fairness
    between active stations. This scheduling works the same way as the ath9k
    in-driver airtime fairness scheduling. If no airtime usage is reported
    by the driver, the scheduler will default to round-robin scheduling.

    For drivers that don't control TXQ scheduling in software, a new API
    function, ieee80211_txq_may_transmit(), is added which the driver can use
    to check if the TXQ is eligible for transmission, or should be throttled to
    enforce fairness. Calls to this function must also be enclosed in
    ieee80211_txq_schedule_{start,end}() calls to ensure proper locking.

    The API ieee80211_txq_may_transmit() also ensures that TXQ list will be
    aligned aginst driver's own round-robin scheduler list. i.e it rotates
    the TXQ list till it makes the requested node becomes the first entry
    in TXQ list. Thus both the TXQ list and driver's list are in sync.

    Co-developed-by: Rajkumar Manoharan
    Signed-off-by: Louie Lu
    [added debugfs write op to reset airtime counter]
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Rajkumar Manoharan
    Signed-off-by: Johannes Berg

    Toke Høiland-Jørgensen
     

19 Dec, 2018

1 commit

  • mac80211 uses the frag list to build AMSDU. When freeing
    the skb, it may not be really freed, since someone is still
    holding a reference to it.
    In that case, when TCP skb is being retransmitted, the
    pointer to the frag list is being reused, while the data
    in there is no longer valid.
    Since we will never get frag list from the network stack,
    as mac80211 doesn't advertise the capability, we can safely
    free and nullify it before releasing the SKB.

    Signed-off-by: Sara Sharon
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Sara Sharon
     

05 Dec, 2018

1 commit


12 Oct, 2018

1 commit

  • Current mac80211 has provision to update tx status through
    ieee80211_tx_status() and ieee80211_tx_status_ext(). But
    drivers like ath10k updates the tx status from the skb except
    txrate, txrate will be updated from a different path, peer stats.

    Using ieee80211_tx_status_ext() in two different paths
    (one for the stats, one for the tx rate) would duplicate
    the stats instead.

    To avoid this stats duplication, ieee80211_tx_rate_update()
    is implemented.

    Signed-off-by: Anilkumar Kolli
    [minor commit message editing, use initializers in code]
    Signed-off-by: Johannes Berg

    Anilkumar Kolli
     

10 Sep, 2018

1 commit

  • TX status reporting to ieee80211s is through ieee80211s_update_metric.
    There are two problems about ieee80211s_update_metric:

    1. The purpose is to estimate the fail probability
    to a specific link. No need to restrict to data frame.

    2. Current implementation does not work if wireless driver does not
    pass tx_status with skb.

    Fix this by removing ieee80211_is_data condition, passing
    ieee80211_tx_status directly to ieee80211s_update_metric, and
    putting it in both __ieee80211_tx_status and ieee80211_tx_status_ext.

    Signed-off-by: Yuan-Chi Pang
    Signed-off-by: Johannes Berg

    Yuan-Chi Pang
     

05 Sep, 2018

1 commit

  • If a frame is dropped for any reason, mac80211 wouldn't report the TX
    status back to user space.

    As the user space may rely on the TX_STATUS to kick its state
    machines, resends etc, it's better to just report this frame as not
    acked instead.

    Signed-off-by: Andrei Otcheretianski
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Andrei Otcheretianski
     

08 May, 2018

1 commit


19 Feb, 2018

2 commits


16 Jun, 2017

1 commit

  • It seems like a historic accident that these return unsigned char *,
    and in many places that means casts are required, more often than not.

    Make these functions return void * and remove all the casts across
    the tree, adding a (u8 *) cast only where the unsigned char pointer
    was used directly, all done with the following spatch:

    @@
    expression SKB, LEN;
    typedef u8;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - *(fn(SKB, LEN))
    + *(u8 *)fn(SKB, LEN)

    @@
    expression E, SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    type T;
    @@
    - E = ((T *)(fn(SKB, LEN)))
    + E = fn(SKB, LEN)

    @@
    expression SKB, LEN;
    identifier fn = { skb_push, __skb_push, skb_push_rcsum };
    @@
    - fn(SKB, LEN)[0]
    + *(u8 *)fn(SKB, LEN)

    Note that the last part there converts from push(...)[0] to the
    more idiomatic *(u8 *)push(...).

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

30 May, 2017

1 commit

  • ieee80211_tx_status() is only one of the possible ways a driver can
    report a handled packet, some drivers call this for every packet while
    others calls it rarely or never.

    In order to invoke the TX LED in the non-status reporting cases this
    patch pushes the call to ieee80211_led_tx() into
    ieee80211_report_used_skb(), which is shared between the various code
    paths.

    Signed-off-by: Bjorn Andersson
    Signed-off-by: Johannes Berg

    Bjorn Andersson
     

28 Apr, 2017

3 commits


27 Apr, 2017

1 commit

  • ieee80211_frame_acked is called when a frame is acked by
    the peer. In case this is a management frame, we check
    if this an SMPS frame, in which case we can update our
    antenna configuration.

    When we parse the management frame we look at the category
    in case it is an action frame. That byte sits after the IV
    in case the frame was encrypted. This means that if the
    frame was encrypted, we basically look at the IV instead
    of looking at the category. It is then theorically
    possible that we think that an SMPS action frame was acked
    where really we had another frame that was encrypted.

    Since the only management frame whose ack needs to be
    tracked is the SMPS action frame, and that frame is not
    a robust management frame, it will never be encrypted.
    The easiest way to fix this problem is then to not look
    at frames that were encrypted.

    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Emmanuel Grumbach
     

02 Mar, 2017

1 commit

  • …kernel/git/jberg/mac80211

    Johannes Berg says:

    ====================
    First round of fixes - details in the commits:
    * use a valid hrtimer clock ID in mac80211_hwsim
    * don't reorder frames prior to BA session
    * flush a delayed work at suspend so the state is all valid before
    suspend/resume
    * fix packet statistics in fast-RX, the RX packets
    counter increment was simply missing
    * don't try to re-transmit filtered frames in an aggregation session
    * shorten (for tracing) a debug message
    * typo fix in another debug message
    * fix nul-termination with HWSIM_ATTR_RADIO_NAME in hwsim
    * fix mgmt RX processing when station is looked up by driver/device
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     

01 Mar, 2017

1 commit

  • Pull IDR rewrite from Matthew Wilcox:
    "The most significant part of the following is the patch to rewrite the
    IDR & IDA to be clients of the radix tree. But there's much more,
    including an enhancement of the IDA to be significantly more space
    efficient, an IDR & IDA test suite, some improvements to the IDR API
    (and driver changes to take advantage of those improvements), several
    improvements to the radix tree test suite and RCU annotations.

    The IDR & IDA rewrite had a good spin in linux-next and Andrew's tree
    for most of the last cycle. Coupled with the IDR test suite, I feel
    pretty confident that any remaining bugs are quite hard to hit. 0-day
    did a great job of watching my git tree and pointing out problems; as
    it hit them, I added new test-cases to be sure not to be caught the
    same way twice"

    Willy goes on to expand a bit on the IDR rewrite rationale:
    "The radix tree and the IDR use very similar data structures.

    Merging the two codebases lets us share the memory allocation pools,
    and results in a net deletion of 500 lines of code. It also opens up
    the possibility of exposing more of the features of the radix tree to
    users of the IDR (and I have some interesting patches along those
    lines waiting for 4.12)

    It also shrinks the size of the 'struct idr' from 40 bytes to 24 which
    will shrink a fair few data structures that embed an IDR"

    * 'idr-4.11' of git://git.infradead.org/users/willy/linux-dax: (32 commits)
    radix tree test suite: Add config option for map shift
    idr: Add missing __rcu annotations
    radix-tree: Fix __rcu annotations
    radix-tree: Add rcu_dereference and rcu_assign_pointer calls
    radix tree test suite: Run iteration tests for longer
    radix tree test suite: Fix split/join memory leaks
    radix tree test suite: Fix leaks in regression2.c
    radix tree test suite: Fix leaky tests
    radix tree test suite: Enable address sanitizer
    radix_tree_iter_resume: Fix out of bounds error
    radix-tree: Store a pointer to the root in each node
    radix-tree: Chain preallocated nodes through ->parent
    radix tree test suite: Dial down verbosity with -v
    radix tree test suite: Introduce kmalloc_verbose
    idr: Return the deleted entry from idr_remove
    radix tree test suite: Build separate binaries for some tests
    ida: Use exceptional entries for small IDAs
    ida: Move ida_bitmap to a percpu variable
    Reimplement IDR and IDA using the radix tree
    radix-tree: Add radix_tree_iter_delete
    ...

    Linus Torvalds
     

27 Feb, 2017

1 commit

  • When running a BA session, the driver (or the hardware) already takes
    care of retransmitting failed frames, since it has to keep the receiver
    reorder window in sync.

    Adding another layer of retransmit around that does not improve
    anything. In fact, it can only lead to some strong reordering with huge
    latency.

    Cc: stable@vger.kernel.org
    Signed-off-by: Felix Fietkau
    Signed-off-by: Johannes Berg

    Felix Fietkau
     

14 Feb, 2017

1 commit

  • It is a relatively common idiom (8 instances) to first look up an IDR
    entry, and then remove it from the tree if it is found, possibly doing
    further operations upon the entry afterwards. If we change idr_remove()
    to return the removed object, all of these users can save themselves a
    walk of the IDR tree.

    Signed-off-by: Matthew Wilcox

    Matthew Wilcox
     

26 Jan, 2017

1 commit


12 Jan, 2017

1 commit


13 Dec, 2016

1 commit

  • Commit f027c2aca0cf introduced 'rates_idx' in
    ieee80211_tx_status_noskb but did not use it. Compiling with W=1
    gives the following warning, fix it.

    mac80211/status.c: In function ‘ieee80211_tx_status_noskb’:
    mac80211/status.c:636:6: warning: variable ‘rates_idx’ set but not used [-Wunused-but-set-variable]

    This is a harmless warning, and is only being fixed to reduce the
    noise generated with W=1.

    Fixes: f027c2aca0cf ("mac80211: add ieee80211_tx_status_noskb")
    Cc: Johannes Berg
    Cc: Felix Fietkau
    Signed-off-by: Kirtika Ruchandani
    Signed-off-by: Johannes Berg

    Kirtika Ruchandani
     

20 Sep, 2016

1 commit

  • mac80211 currently uses rhashtable with insecure_elasticity set
    to true. The latter is because of duplicate objects. What's
    more, mac80211 walks the rhashtable chains by hand which is broken
    as rhashtable may contain multiple tables due to resizing or
    rehashing.

    This patch fixes it by converting it to the newly added rhltable
    interface which is designed for use with duplicate objects.

    With rhltable a lookup returns a list of objects instead of a
    single one. This is then fed into the existing for_each_sta_info
    macro.

    This patch also deletes the sta_addr_hash function since rhashtable
    defaults to jhash.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

15 Sep, 2016

1 commit

  • Based on consecutive msdu failures, mac80211 triggers CQM packet-loss
    mechanism. Drivers like ath10k that have its own connection monitoring
    algorithm, offloaded to firmware for triggering station kickout. In case
    of station kickout, driver will report low ack status by mac80211 API
    (ieee80211_report_low_ack).

    This flag will enable the driver to completely rely on firmware events
    for station kickout and bypass mac80211 packet loss mechanism.

    Signed-off-by: Rajkumar Manoharan
    Signed-off-by: Johannes Berg

    Rajkumar Manoharan
     

12 Sep, 2016

1 commit


05 Aug, 2016

1 commit

  • If QoS frame with EOSP (end of service period) subfield=1 sent by local
    peer was not acked by remote peer, local peer did not end the MPSP. This
    prevents local peer from going to DOZE state. And if the remote peer
    goes away without closing connection, local peer continues AWAKE state
    and wastes battery.

    Signed-off-by: Masashi Honma
    Acked-by: Bob Copeland
    Signed-off-by: Johannes Berg

    Masashi Honma
     

06 Apr, 2016

1 commit

  • Instead of touching the rx_stats.last_rx from the status path, introduce
    and use a status_stats.last_ack variable. This will make rx_stats.last_rx
    indicate when the last frame was received, making it available for real
    "last_rx" and statistics gathering; statistics, when done per-CPU, will
    need to figure out which place was updated last for those items where the
    "last" value is exposed.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

05 Mar, 2016

1 commit


14 Jan, 2016

1 commit

  • Non-bufferable MMPDUs are sent out to STAs even while in PS mode
    (for example probe responses). Applying filtered frame handling for
    these doesn't seem to make much sense and will only create more
    air utilization when the STA wakes up. Hence, apply filtered frame
    handling only for bufferable MMPDUs.

    Discovered while testing an old VOIP phone that started probing
    for APs while in PS mode. The mac80211/ath9k AP where the STA is
    associated would reply with a probe response but the phone sometimes
    moved to a new channel already and couldn't ack the probe response
    anymore. In that case mac80211 applied filtered frame handling
    for the un-acked probe response.

    Signed-off-by: Helmut Schaa
    Signed-off-by: Johannes Berg

    Helmut Schaa
     

22 Oct, 2015

1 commit

  • …inux/kernel/git/jberg/mac80211-next

    Johannes Berg says:

    ====================
    Here's another set of patches for the current cycle:
    * I merged net-next back to avoid a conflict with the
    * cfg80211 scheduled scan API extensions
    * preparations for better scan result timestamping
    * regulatory cleanups
    * mac80211 statistics cleanups
    * a few other small cleanups and fixes
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     

21 Oct, 2015

1 commit

  • Group station statistics by where they're (mostly) updated
    (TX, RX and TX-status) and group them into sub-structs of
    the struct sta_info.

    Also rename the variables since the grouping now makes it
    obvious where they belong.

    This makes it easier to identify where the statistics are
    updated in the code, and thus easier to think about them.

    Signed-off-by: Johannes Berg

    Johannes Berg