08 Oct, 2020

1 commit

  • last_rate is initialized to zero by sta_info_alloc(), but
    this indicates legacy bitrate for the last TX rate (and
    invalid for the last RX rate). To avoid a warning when
    decoding the last rate as legacy (before a data frame
    has been sent), initialize them as S1G MCS.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20201005164522.18069-2-thomas@adapt-ip.com
    [rename to ieee80211_s1g_sta_rate_init(), seems more appropriate]
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     

28 Sep, 2020

6 commits

  • The changes required for associating in S1G are:

    - apply S1G BSS channel info before assoc
    - mark all S1G STAs as QoS STAs
    - include and parse AID request element
    - handle new Association Response format
    - don't fail assoc if supported rates element is missing

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-15-thomas@adapt-ip.com
    [pass skb to ieee80211_add_aid_request_ie(), remove unused variable 'bss']
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • S1G beacons are 802.11 Extension Frames, so the fixed
    header part differs from regular beacons.

    Add a handler to process S1G beacons and abstract out the
    fetching of BSSID and element start locations in the
    beacon body handler.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-14-thomas@adapt-ip.com
    [don't rename, small coding style cleanups]
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • S1G allows listen interval up to 2^14 * 10000 beacon
    intervals. In order to do this listen interval needs a
    scaling factor applied to the lower 14 bits. Calculate
    this and properly encode the listen interval for S1G STAs.

    See IEEE802.11ah-2016 Table 9-44a for reference.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-10-thomas@adapt-ip.com
    [move listen_int_usf into function using it]
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • This commit finds the correct offset for Information
    Elements in S1G beacon frames so they can be reported in
    scan results.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-8-thomas@adapt-ip.com
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • Include the S1G Capabilities element in an association
    request, and support the cfg80211 capability overrides.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200922022818.15855-5-thomas@adapt-ip.com
    [pass skb to ieee80211_add_s1g_capab_ie(), small code style edits]
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     
  • Because we can miss AP wakeup (beacon) while scanning other channels,
    it's better go into wakeup state and inform the AP of that upon
    returning to the operating channel, rather than staying asleep and
    waiting for the next TIM indicating traffic for us.

    This saves precious time, especially when we only have 200ms inter-
    scan period for monitoring the active connection.

    Signed-off-by: Loic Poulain
    Link: https://lore.kernel.org/r/1593420923-26668-1-git-send-email-loic.poulain@linaro.org
    [rewrite commit message a bit]
    Signed-off-by: Johannes Berg

    Loic Poulain
     

18 Sep, 2020

4 commits

  • This patch adds mac80211 support to configure unsolicited
    broadcast probe response transmission for in-band discovery in 6GHz.

    Changes include functions to store and retrieve probe response template,
    and packet interval (0 - 20 TUs).
    Setting interval to 0 disables the unsolicited broadcast probe response
    transmission.

    Signed-off-by: Aloka Dixit
    Link: https://lore.kernel.org/r/010101747a946b35-ad25858a-1f1f-48df-909e-dc7bf26d9169-000000@us-west-2.amazonses.com
    Signed-off-by: Johannes Berg

    Aloka Dixit
     
  • This patch adds mac80211 support to configure FILS discovery
    transmission.
    Changes include functions to store and retrieve FILS discovery
    template, minimum and maximum packet intervals.

    Signed-off-by: Aloka Dixit
    Link: https://lore.kernel.org/r/20200805011838.28166-3-alokad@codeaurora.org
    [remove SUPPORTS_FILS_DISCOVERY, driver can just set wiphy info]
    Link: https://lore.kernel.org/r/010101747a7b3cbb-6edaa89c-436d-4391-8765-61456d7f5f4e-000000@us-west-2.amazonses.com
    Signed-off-by: Johannes Berg

    Aloka Dixit
     
  • Calling mod_timer for every rx/tx packet can be quite expensive.
    Instead of constantly updating the timer, we can simply let it run out
    and check the timestamp of the last ACK or rx packet to re-arm it.

    Signed-off-by: Felix Fietkau
    Link: https://lore.kernel.org/r/20200908123702.88454-9-nbd@nbd.name
    Signed-off-by: Johannes Berg

    Felix Fietkau
     
  • The current API (which lets the driver turn on/off per vif directly) has a
    number of limitations:
    - it does not deal with AP_VLAN
    - conditions for enabling (no tkip, no monitor) are only checked at
    add_interface time
    - no way to indicate 4-addr support

    In order to address this, store offload flags in struct ieee80211_vif
    (easy to extend for decap offload later). mac80211 initially sets the enable
    flag, but gives the driver a chance to modify it before its settings are
    applied. In addition to the .add_interface op, a .update_vif_offload op is
    introduced, which can be used for runtime changes.

    If a driver can't disable encap offload at runtime, or if it has some extra
    limitations, it can simply override the flags within those ops.

    Support for encap offload with 4-address mode interfaces can be enabled
    by setting a flag from .add_interface or .update_vif_offload.

    Signed-off-by: Felix Fietkau
    Link: https://lore.kernel.org/r/20200908123702.88454-6-nbd@nbd.name
    [resolved conflict with commit aa2092a9bab3 ("ath11k: add raw mode and
    software crypto support")]
    Signed-off-by: Johannes Berg

    Felix Fietkau
     

27 Aug, 2020

1 commit


31 Jul, 2020

4 commits

  • This can be used to run mac80211 rx processing on a batch of frames in NAPI
    poll before passing them to the network stack in a large batch.
    This can improve icache footprint, or it can be used to pass frames via
    netif_receive_skb_list.

    Signed-off-by: Felix Fietkau
    Link: https://lore.kernel.org/r/20200726110611.46886-1-nbd@nbd.name
    Signed-off-by: Johannes Berg

    Felix Fietkau
     
  • The flags argument in transmit functions is no longer being used
    and can be removed.

    Signed-off-by: Mathy Vanhoef
    Link: https://lore.kernel.org/r/20200723100153.31631-5-Mathy.Vanhoef@kuleuven.be
    Signed-off-by: Johannes Berg

    Mathy Vanhoef
     
  • Use the IEEE80211_TX_CTRL_NO_SEQNO flag in ieee80211_tx_info to mark
    probe requests whose sequence number must not be overwritten. This
    provides consistency with the radiotap flag that can be set to indicate
    that the sequence number of an injected frame should not be overwritten.

    Signed-off-by: Mathy Vanhoef
    Link: https://lore.kernel.org/r/20200723100153.31631-4-Mathy.Vanhoef@kuleuven.be
    Signed-off-by: Johannes Berg

    Mathy Vanhoef
     
  • AQL does not take into account that most HT/VHT/HE traffic is A-MPDU aggregated.
    Because of that, the per-packet airtime overhead is vastly overestimated.
    Improve it by assuming an average aggregation length of 16 for non-legacy
    traffic if not using the VO AC queue.
    This should improve performance with high data rates, especially with multiple
    stations

    Signed-off-by: Felix Fietkau
    Link: https://lore.kernel.org/r/20200724182816.18678-1-nbd@nbd.name
    Signed-off-by: Johannes Berg

    Felix Fietkau
     

31 May, 2020

7 commits

  • On 6 GHz, the 6 GHz capabilities element should be added, do that.

    Signed-off-by: Ilan Peer
    [add commit message]
    Link: https://lore.kernel.org/r/20200528213443.8ee764f0cde0.I2b0c66b60e11818c97c9803e04a6a197c6376243@changeid
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • In order to handle 6 GHz AP side, take the HE 6 GHz band capability
    data and pass it to the driver (which needs it for A-MPDU spacing
    and A-MPDU length).

    Link: https://lore.kernel.org/r/1589399105-25472-6-git-send-email-rmanohar@codeaurora.org
    Co-developed-by: Rajkumar Manoharan
    Signed-off-by: Rajkumar Manoharan
    Link: https://lore.kernel.org/r/20200528213443.784e4890d82f.I5f1230d5ab27e84e7bbe88e3645b24ea15a0c146@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Support connecting to HE 6 GHz APs and mesh networks on 6 GHz,
    where the HT/VHT information is missing but instead the HE 6 GHz
    band capability is present, and the 6 GHz Operation information
    field is used to encode the channel configuration instead of the
    HT/VHT operation elements.

    Also add some other bits needed to connect to 6 GHz networks.

    Link: https://lore.kernel.org/r/1589399105-25472-10-git-send-email-rmanohar@codeaurora.org
    Co-developed-by: Rajkumar Manoharan
    Signed-off-by: Rajkumar Manoharan
    Link: https://lore.kernel.org/r/20200528213443.25687d2695bc.I3f9747c1147480f65445f13eda5c4a5ed4e86757@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • If the AP advertises inconsistent data, namely it has CCFS1 or CCFS2,
    but doesn't advertise support for 160/80+80 bandwidth or "Extended NSS
    BW Support", then we cannot use any MCSes in the the higher bandwidth.
    Thus, avoid connecting with higher bandwidth since it's less efficient
    that way.

    Link: https://lore.kernel.org/r/20200528213443.0e55d40c3ccc.I6fd0b4708ebd087e5e46466c3e91f6efbcbef668@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Add 6 GHz operation information (IEEE 802.11ax/D6.0, Figure 9-787k)
    while building HE operation element for non-HE AP. This field is used to
    determine channel information in the absence of HT/VHT IEs.

    Signed-off-by: Rajkumar Manoharan
    Link: https://lore.kernel.org/r/1589399105-25472-8-git-send-email-rmanohar@codeaurora.org
    [fix skb allocation size]
    Link: https://lore.kernel.org/r/20200528193455.76796-1-johannes@sipsolutions.net
    Signed-off-by: Johannes Berg

    Rajkumar Manoharan
     
  • Construct HE 6 GHz band capability element (IEEE 802.11ax/D6.0,
    9.4.2.261) for association request and mesh beacon. The 6 GHz
    capability information is passed by driver through iftypes caps.

    Signed-off-by: Rajkumar Manoharan
    Link: https://lore.kernel.org/r/1589399105-25472-7-git-send-email-rmanohar@codeaurora.org
    [handle SMPS, adjust for previous patches, reserve SKB space properly,
    change to handle SKB directly]
    Link: https://lore.kernel.org/r/20200528213443.643aa8101111.I3f9747c1147480f65445f13eda5c4a5ed4e86757@changeid
    Signed-off-by: Johannes Berg

    Rajkumar Manoharan
     
  • Handle 6 GHz band capability element parsing for association.

    Signed-off-by: Rajkumar Manoharan
    Link: https://lore.kernel.org/r/1589399105-25472-4-git-send-email-rmanohar@codeaurora.org
    [some renaming to be in line with previous patches]
    Link: https://lore.kernel.org/r/20200528213443.a13d7a0b85b0.Ia07584da4fc77aa77c4cc563248d2ce4234ffe5d@changeid
    Signed-off-by: Johannes Berg

    Rajkumar Manoharan
     

28 May, 2020

1 commit

  • Add support for TX status reporting for the control port
    TX API; this will be used by hostapd when it moves to the
    control port TX API.

    Signed-off-by: Markus Theil
    Link: https://lore.kernel.org/r/20200527160334.19224-1-markus.theil@tu-ilmenau.de
    [fix commit message, it was referring to nl80211]
    Signed-off-by: Johannes Berg

    Markus Theil
     

27 May, 2020

2 commits

  • This adds the necessary capabilities in nl80211 to allow drivers to
    assign a cookie to control port TX frames (returned via extack in
    the netlink ACK message of the command) and then later report the
    frame's status.

    Signed-off-by: Markus Theil
    Link: https://lore.kernel.org/r/20200508144202.7678-2-markus.theil@tu-ilmenau.de
    [use extack cookie instead of explicit message, recombine patches]
    Signed-off-by: Johannes Berg

    Markus Theil
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    sizeof(flexible-array-member) triggers a warning because flexible array
    members have incomplete type[1]. There are some instances of code in
    which the sizeof operator is being incorrectly/erroneously applied to
    zero-length arrays and the result is zero. Such instances may be hiding
    some bugs. So, this work (flexible-array member conversions) will also
    help to get completely rid of those sorts of issues.

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200507185907.GA15102@embeddedor
    Signed-off-by: Johannes Berg

    Gustavo A. R. Silva
     

29 Apr, 2020

1 commit

  • Use the Beacon frame specific legacy rate configuration, if specified
    for AP or mesh, instead of the generic rate mask when selecting the TX
    rate for Beacon frames.

    Signed-off-by: Jouni Malinen
    Link: https://lore.kernel.org/r/20200425155713.25687-4-jouni@codeaurora.org
    Signed-off-by: Johannes Berg

    Jouni Malinen
     

24 Apr, 2020

3 commits

  • Convert a user space registration for processing multicast Action frames
    (NL80211_CMD_REGISTER_FRAME with NL80211_ATTR_RECEIVE_MULTICAST) to a
    new enum ieee80211_filter_flags bit FIF_MCAST_ACTION so that drivers can
    update their RX filter parameters appropriately, if needed.

    Signed-off-by: Jouni Malinen
    Link: https://lore.kernel.org/r/20200421144815.19175-1-jouni@codeaurora.org
    [rename variables to rx_mcast_action_reg indicating action frames only]
    Signed-off-by: Johannes Berg

    Jouni Malinen
     
  • Almost all drivers below cfg80211 get the API wrong (except for
    cfg80211) and are unable to cope with multiple registrations for
    the same frame type, which is valid due to the match filter.
    This seems to indicate the API is wrong, and we should maintain
    the full information in cfg80211 instead of the drivers.

    Change the API to no longer inform the driver about individual
    registrations and unregistrations, but rather every time about
    the entire state of the entire wiphy and single wdev, whenever
    it may have changed. This also simplifies the code in cfg80211
    as it no longer has to track exactly what was unregistered and
    can free things immediately.

    Signed-off-by: Johannes Berg
    Acked-by: Arend van Spriel
    Reviewed-by: Sergey Matyukevich
    Link: https://lore.kernel.org/r/20200417124300.f47f3828afc8.I7f81ef59c2c5a340d7075fb3c6d0e08e8aeffe07@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Maintain the connection AID only in sdata->vif.bss_conf.aid, not
    also in sdata->u.mgd.aid.

    Keep setting that where we set ifmgd->aid before, which has the
    side effect of exposing the AID to the driver before the station
    entry (AP) is marked associated, in case it needs it then.

    Requested-by: Felix Fietkau
    Signed-off-by: Johannes Berg
    Tested-by: Lorenzo Bianconi
    Link: https://lore.kernel.org/r/20200417123802.085d4a322b0c.I2e7a2ceceea8c6880219f9e9ee4d4ac985fd295a@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     

20 Mar, 2020

1 commit

  • This patch adds support for disabling pre-auth rx over the nl80211 control
    port for mac80211.

    Signed-off-by: Markus Theil
    Link: https://lore.kernel.org/r/20200312091055.54257-3-markus.theil@tu-ilmenau.de
    [fix indentation slightly, squash feature enablement]
    Signed-off-by: Johannes Berg

    Markus Theil
     

24 Feb, 2020

2 commits

  • Extend mac80211 key configuration to support the new BIGTK with key
    index values 6 and 7. Support for actually protecting Beacon frames
    (adding the MME in AP mode and checking it in STA mode) is covered in
    separate commits.

    Signed-off-by: Jouni Malinen
    Link: https://lore.kernel.org/r/20200222132548.20835-3-jouni@codeaurora.org
    Signed-off-by: Johannes Berg

    Jouni Malinen
     
  • This reverts commit 8c3ed7aa2b9ef666195b789e9b02e28383243fa8.

    As Jouni points out, there's really no need for this, since the
    RSN pre-authentication frames are normal data frames, not port
    control frames (locally).

    We can still revert this now since it hasn't actually gone beyond
    -next.

    Fixes: 8c3ed7aa2b9e ("nl80211: add src and dst addr attributes for control port tx/rx")
    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200224101910.b746e263287a.I9eb15d6895515179d50964dec3550c9dc784bb93@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     

07 Feb, 2020

4 commits

  • When using control port over nl80211 in AP mode with
    pre-authentication, APs need to forward frames to other
    APs defined by their MAC address. Before this patch,
    pre-auth frames reaching user space over nl80211 control
    port have no longer any information about the dest attached,
    which can be used for forwarding to a controller or injecting
    the frame back to a ethernet interface over a AF_PACKET
    socket.
    Analog problems exist, when forwarding pre-auth frames from
    AP -> STA.

    This patch therefore adds the NL80211_ATTR_DST_MAC and
    NL80211_ATTR_SRC_MAC attributes to provide more context
    information when forwarding.
    The respective arguments are optional on tx and included on rx.
    Therefore unaware existing software is not affected.

    Software which wants to detect this feature, can do so
    by checking against:
    NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_MAC_ADDRS

    Signed-off-by: Markus Theil
    Link: https://lore.kernel.org/r/20200115125522.3755-1-markus.theil@tu-ilmenau.de
    [split into separate cfg80211/mac80211 patches]
    Signed-off-by: Johannes Berg

    Markus Theil
     
  • Parse also the RSN Extension IE when parsing the rest of the IEs.
    It will be used in a later patch.

    Signed-off-by: Shaul Triebitz
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131111300.891737-21-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Shaul Triebitz
     
  • The SMPS feature is defined in the specification only to be
    used by non-AP stations and not by APs, so remove the support
    for changing the AP's SMPS mode dynamically.

    Signed-off-by: Ilan Peer
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131111300.891737-20-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • Set ndev->hw_features as well as ndev->features to allow
    changing the TX-related features with ethtool.

    We cannot (yet) change RX-related features since that
    requires telling the driver about it and we have no API
    for that yet.

    Signed-off-by: Johannes Berg
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131111300.891737-10-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Johannes Berg
     

14 Dec, 2019

1 commit

  • This patch adds a new transmit path for hardware that supports 802.11
    encapsulation offloading. In those cases 802.3 frames get passed
    directly to the driver allowing the hardware to handle the encapsulation.
    Some features such as monitor mode and TKIP would break when encapsulation
    offloading is enabled. If any of these get enabled, the code will alwyas
    fallback to the normal sw encapsulation data path.

    The patch defines a secondary netdev_ops struct that the device gets
    assigned if 802.11 encap support is available and enabled. The driver
    needs to enable the support on a per vif basis if it finds that all
    pre-reqs are meet.

    Signed-off-by: Vasanthakumar Thiagarajan
    Signed-off-by: John Crispin
    Link: https://lore.kernel.org/r/20191125100438.16539-1-john@phrozen.org
    [reword comments, remove SUPPORTS_80211_ENCAP HW flag, minor cleanups]
    Signed-off-by: Johannes Berg

    John Crispin
     

22 Nov, 2019

2 commits

  • In order for the Fq_CoDel algorithm integrated in mac80211 layer to operate
    effectively to control excessive queueing latency, the CoDel algorithm
    requires an accurate measure of how long packets stays in the queue, AKA
    sojourn time. The sojourn time measured at the mac80211 layer doesn't
    include queueing latency in the lower layer (firmware/hardware) and CoDel
    expects lower layer to have a short queue. However, most 802.11ac chipsets
    offload tasks such TX aggregation to firmware or hardware, thus have a deep
    lower layer queue.

    Without a mechanism to control the lower layer queue size, packets only
    stay in mac80211 layer transiently before being sent to firmware queue.
    As a result, the sojourn time measured by CoDel in the mac80211 layer is
    almost always lower than the CoDel latency target, hence CoDel does little
    to control the latency, even when the lower layer queue causes excessive
    latency.

    The Byte Queue Limits (BQL) mechanism is commonly used to address the
    similar issue with wired network interface. However, this method cannot be
    applied directly to the wireless network interface. "Bytes" is not a
    suitable measure of queue depth in the wireless network, as the data rate
    can vary dramatically from station to station in the same network, from a
    few Mbps to over Gbps.

    This patch implements an Airtime-based Queue Limit (AQL) to make CoDel work
    effectively with wireless drivers that utilized firmware/hardware
    offloading. AQL allows each txq to release just enough packets to the lower
    layer to form 1-2 large aggregations to keep hardware fully utilized and
    retains the rest of the frames in mac80211 layer to be controlled by the
    CoDel algorithm.

    Signed-off-by: Kan Yan
    [ Toke: Keep API to set pending airtime internal, fix nits in commit msg ]
    Signed-off-by: Toke Høiland-Jørgensen
    Link: https://lore.kernel.org/r/20191119060610.76681-4-kyan@google.com
    Signed-off-by: Johannes Berg

    Kan Yan
     
  • Felix recently added code to calculate airtime of packets to the mt76
    driver. Import this into mac80211 so we can use it for airtime queue limit
    calculations.

    The airtime.c file is copied verbatim from the mt76 driver, and adjusted to
    be usable in mac80211. This involves:

    - Switching to mac80211 data structures.
    - Adding support for 160 MHz channels and HE mode.
    - Moving the symbol and duration calculations around a bit to avoid
    rounding with the higher rates and longer symbol times used for HE rates.

    The per-rate TX rate calculation is also split out to its own function so
    it can be used directly for the AQL calculations later.

    Signed-off-by: Toke Høiland-Jørgensen
    Link: https://lore.kernel.org/r/20191119060610.76681-3-kyan@google.com
    [fix HE_GROUP_IDX() to use 3 * bw, since there are 3 _gi values]
    Signed-off-by: Johannes Berg

    Toke Høiland-Jørgensen