02 Mar, 2017

1 commit

  • Declaring the factor is counter-intuitive, and people are prone
    to using small(-ish) values even when that makes no sense.

    Change the DECLARE_EWMA() macro to take the fractional precision,
    in bits, rather than a factor, and update all users.

    While at it, add some more documentation.

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

    Johannes Berg
     

15 Jan, 2017

1 commit

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

    Johannes Berg says:

    ====================
    For 4.11, we seem to have more than in the past few releases:
    * socket owner support for connections, so when the wifi
    manager (e.g. wpa_supplicant) is killed, connections are
    torn down - wpa_supplicant is critical to managing certain
    operations, and can opt in to this where applicable
    * minstrel & minstrel_ht updates to be more efficient (time and space)
    * set wifi_acked/wifi_acked_valid for skb->destructor use in the
    kernel, which was already available to userspace
    * don't indicate new mesh peers that might be used if there's no
    room to add them
    * multicast-to-unicast support in mac80211, for better medium usage
    (since unicast frames can use *much* higher rates, by ~3 orders of
    magnitude)
    * add API to read channel (frequency) limitations from DT
    * add infrastructure to allow randomizing public action frames for
    MAC address privacy (still requires driver support)
    * many cleanups and small improvements/fixes across the board
    ====================

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

    David S. Miller
     

16 Dec, 2016

1 commit

  • __bitwise__ used to mean "yes, please enable sparse checks
    unconditionally", but now that we dropped __CHECK_ENDIAN__
    __bitwise is exactly the same.
    There aren't many users, replace it by __bitwise everywhere.

    Signed-off-by: Michael S. Tsirkin
    Acked-by: Greg Kroah-Hartman
    Acked-by: Stefan Schmidt
    Acked-by: Krzysztof Kozlowski
    Akced-by: Lee Duncan

    Michael S. Tsirkin
     

13 Dec, 2016

3 commits

  • These functions drifts TSF timers, not TBTT.

    Signed-off-by: Masashi Honma
    Signed-off-by: Johannes Berg

    Masashi Honma
     
  • mesh_sync_offset_adjust_tbtt() implements Extensible synchronization
    framework ([1] 13.13.2 Extensible synchronization framework). It shall
    not operate the flag "TBTT Adjusting subfield" ([1] 8.4.2.100.8 Mesh
    Capability), since it is used only for MBCA ([1] 13.13.4 Mesh beacon
    collision avoidance, see 13.13.4.4.3 TBTT scanning and adjustment
    procedures for detail). So this patch remove the flag operations.

    [1] IEEE Std 802.11 2012

    Signed-off-by: Masashi Honma
    [remove adjusting_tbtt entirely, since it's now unused]
    Signed-off-by: Johannes Berg

    Masashi Honma
     
  • Add the ability for an AP (and associated VLANs) to perform
    multicast-to-unicast conversion for ARP, IPv4 and IPv6 frames
    (possibly within 802.1Q). If enabled, such frames are to be sent
    to each station separately, with the DA replaced by their own
    MAC address rather than the group address.

    Note that this may break certain expectations of the receiver,
    such as the ability to drop unicast IP packets received within
    multicast L2 frames, or the ability to not send ICMP destination
    unreachable messages for packets received in L2 multicast (which
    is required, but the receiver can't tell the difference if this
    new option is enabled.)

    This also doesn't implement the 802.11 DMS (directed multicast
    service).

    Signed-off-by: Michael Braun
    [use true/false, rename label to the correct "multicast",
    use __be16 for ethertype and network order for constants]
    Signed-off-by: Johannes Berg

    Michael Braun
     

27 Oct, 2016

1 commit


19 Oct, 2016

1 commit

  • The uapsd_queue field is in QoS IE order and not in
    IEEE80211_AC_*'s order.
    This means that mac80211 would get confused between
    BK and BE which is certainly not such a big deal but
    needs to be fixed.

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

    Emmanuel Grumbach
     

17 Oct, 2016

1 commit

  • According to IEEE 802.11-2012 section 8.3.2 table 8-19, the outer SA/DA
    of A-MSDU frames need to be changed depending on FromDS/ToDS values.

    Signed-off-by: Michael Braun
    [use ether_addr_copy and add alignment annotations]
    Signed-off-by: Johannes Berg

    Michael Braun
     

12 Oct, 2016

1 commit

  • This patch adds filtering for multicast data packets on AP_VLAN
    interfaces that have no authorized station connected and changes
    filtering on AP interfaces to not count stations assigned to
    AP_VLAN interfaces.

    This saves airtime and avoids waking up other stations currently
    authorized in this BSS. When using WPA, the packets dropped could
    not be decrypted by any station.

    The behaviour when there are no AP_VLAN interfaces is left unchanged.

    When there are AP_VLAN interfaces, this patch
    1. adds filtering multicast data packets sent on AP_VLAN interfaces
    that have no authorized station connected.
    No filtering happens on 4addr AP_VLAN interfaces.
    2. makes filtering of multicast data packets sent on AP interfaces
    depend on the number of authorized stations in this bss not
    assigned to an AP_VLAN interface.

    Therefore, a new num_mcast_sta counter is added for AP_VLAN interfaces.
    The existing one for AP interfaces is altered to not track stations
    assigned to an AP_VLAN interface.

    The new counter is exposed in debugfs.

    Signed-off-by: Michael Braun
    [reformat commit message a bit, unline ieee80211_vif_{inc,dec}_num_mcast]
    Signed-off-by: Johannes Berg

    Michael Braun
     

04 Oct, 2016

1 commit

  • Resolve the merge conflict between Felix's/my and Toke's patches
    coming into the tree through net and mac80211-next respectively.
    Most of Felix's changes go away due to Toke's new infrastructure
    work, my patch changes to "goto begin" (the label wasn't there
    before) instead of returning NULL so flow control towards drivers
    is preserved better.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

30 Sep, 2016

3 commits

  • The TXQ intermediate queues can cause packet reordering when more than
    one flow is active to a single station. Since some of the wifi-specific
    packet handling (notably sequence number and encryption handling) is
    sensitive to re-ordering, things break if they are applied before the
    TXQ.

    This splits up the TX handlers and fast_xmit logic into two parts: An
    early part and a late part. The former is applied before TXQ enqueue,
    and the latter after dequeue. The non-TXQ path just applies both parts
    at once.

    Because fragments shouldn't be split up or reordered, the fragmentation
    handler is run after dequeue. Any fragments are then kept in the TXQ and
    on subsequent dequeues they take precedence over dequeueing from the FQ
    structure.

    This approach avoids having to scatter special cases all over the place
    for when TXQ is enabled, at the cost of making the fast_xmit and TX
    handler code slightly more complex.

    Signed-off-by: Toke Høiland-Jørgensen
    [fix a few code-style nits, make ieee80211_xmit_fast_finish void,
    remove a useless txq->sta check]
    Signed-off-by: Johannes Berg

    Toke Høiland-Jørgensen
     
  • Implement add/rm_nan_func functions and handle NAN function
    termination notifications. Handle instance_id allocation for
    NAN functions and implement the reconfig flow.

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

    Ayala Beker
     
  • Implement nan_change_conf callback which allows to change current
    NAN configuration (master preference and dual band operation).
    Store the current NAN configuration in sdata, so it can be used
    both to provide the driver the updated configuration with changes
    and also it will be used in hw reconfig flows in next patches.

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

    Ayala Beker
     

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
     

13 Sep, 2016

1 commit

  • Currently the 'aqm' stats in mac80211 only keeps overlimit drop stats,
    not CoDel stats. This moves the CoDel stats into the txqi structure to
    keep them per txq in order to show them in debugfs.

    In addition, the aqm debugfs output is restructured by splitting it up
    into three files: One global per phy, one per netdev and one per
    station, in the appropriate directories. The files are all called aqm,
    and are only created if the driver supports the wake_tx_queue op (rather
    than emitting an error on open as previously).

    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Johannes Berg

    Toke Høiland-Jørgensen
     

12 Sep, 2016

2 commits

  • add support to MU-MIMO air sniffer according groupID:
    in monitor mode, use a given MU-MIMO groupID to monitor stations
    that belongs to that group using MU-MIMO.

    add support for following a station according to its MAC address
    using VHT MU-MIMO sniffer:
    the monitors wait until they get an action MU-MIMO notification
    frame, then parses it in order to find the groupID that corresponds
    to the given MAC address and monitors packets destined to that
    groupID using VHT MU-MIMO.

    Signed-off-by: Aviya Erenfeld
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Aviya Erenfeld
     
  • Insert the u32 monitor flags variable in a new structure
    that represents a monitor interface.
    This will allow to add more configuration variables to
    that structure which will happen in an upcoming change.

    Signed-off-by: Aviya Erenfeld
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Aviya Erenfeld
     

06 Jul, 2016

1 commit

  • Add the following to support beacon report radio measurement
    with the measurement mode field set to passive or active:
    1. Propagate the required scan duration to the device
    2. Report the scan start time (in terms of TSF)
    3. Report each BSS's detection time (also in terms of TSF)

    TSF times refer to the BSS that the interface that requested the
    scan is connected to.

    Signed-off-by: Assaf Krauss
    Signed-off-by: Avraham Stern
    [changed ath9k/10k, at76c59x-usb, iwlegacy, wl1251 and wlcore to match
    the new API]
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Avraham Stern
     

09 Jun, 2016

3 commits

  • There is no other limit other than a global
    packet count limit when using software queuing.
    This means a single flow queue can grow insanely
    long. This is particularly bad for TCP congestion
    algorithms which requires a little more
    sophisticated frame dropping scheme than a mere
    headdrop on limit overflow.

    Hence apply (a slighly modified, to fit the knobs)
    CoDel5 on flow queues. This improves TCP
    convergence and stability when combined with
    wireless driver which keeps its own tx queue/fifo
    at a minimum fill level for given link conditions.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     
  • mac80211's software queues were designed to work
    very closely with device tx queues. They are
    required to make use of 802.11 packet aggregation
    easily and efficiently.

    Due to the way 802.11 aggregation is designed it
    only makes sense to keep fair queuing as close to
    hardware as possible to reduce induced latency and
    inertia and provide the best flow responsiveness.

    This change doesn't translate directly to
    immediate and significant gains. End result
    depends on driver's induced latency. Best results
    can be achieved if driver keeps its own tx
    queue/fifo fill level to a minimum.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     
  • Qdiscs are designed with no regard to 802.11
    aggregation requirements and hand out
    packet-by-packet with no guarantee they are
    destined to the same tid. This does more bad than
    good no matter how fairly a given qdisc may behave
    on an ethernet interface.

    Software queuing used per-AC netdev subqueue
    congestion control whenever a global AC limit was
    hit. This meant in practice a single station or
    tid queue could starve others rather easily. This
    could resonate with qdiscs in a bad way or could
    just end up with poor aggregation performance.
    Increasing the AC limit would increase induced
    latency which is also bad.

    Disabling qdiscs by default and performing
    taildrop instead of netdev subqueue congestion
    control on the other hand makes it possible for
    tid queues to fill up "in the meantime" while
    preventing stations starving each other.

    This increases aggregation opportunities and
    should allow software queuing based drivers
    achieve better performance by utilizing airtime
    more efficiently with big aggregates.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     

12 Apr, 2016

1 commit

  • This enum is already perfectly aliased to enum nl80211_band, and
    the only reason for it is that we get IEEE80211_NUM_BANDS out of
    it. There's no really good reason to not declare the number of
    bands in nl80211 though, so do that and remove the cfg80211 one.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

10 Apr, 2016

1 commit


06 Apr, 2016

2 commits

  • Requires software tx queueing and fast-xmit support. For good
    performance, drivers need frag_list support as well. This avoids the
    need for copying data of aggregated frames. Running without it is only
    supported for debugging purposes.

    To avoid performance and packet size issues, the rate control module or
    driver needs to limit the maximum A-MSDU size by setting
    max_rc_amsdu_len in struct ieee80211_sta.

    Signed-off-by: Felix Fietkau
    [fix locking issue]
    Signed-off-by: Johannes Berg

    Felix Fietkau
     
  • The regular RX path has a lot of code, but with a few
    assumptions on the hardware it's possible to reduce the
    amount of code significantly. Currently the assumptions
    on the driver are the following:
    * hardware/driver reordering buffer (if supporting aggregation)
    * hardware/driver decryption & PN checking (if using encryption)
    * hardware/driver did de-duplication
    * hardware/driver did A-MSDU deaggregation
    * AP_LINK_PS is used (in AP mode)
    * no client powersave handling in mac80211 (in client mode)

    of which some are actually checked per packet:
    * de-duplication
    * PN checking
    * decryption
    and additionally packets must
    * not be A-MSDU (have been deaggregated by driver/device)
    * be data packets
    * not be fragmented
    * be unicast
    * have RFC 1042 header

    Additionally dynamically we assume:
    * no encryption or CCMP/GCMP, TKIP/WEP/other not allowed
    * station must be authorized
    * 4-addr format not enabled

    Some data needed for the RX path is cached in a new per-station
    "fast_rx" structure, so that we only need to look at this and
    the packet, no other memory when processing packets on the fast
    RX path.

    After doing the above per-packet checks, the data path collapses
    down to a pretty simple conversion function taking advantage of
    the data cached in the small fast_rx struct.

    This should speed up the RX processing, and will make it easier
    to reason about parallelizing RX (for which statistics will need
    to be per-CPU still.)

    Signed-off-by: Johannes Berg

    Johannes Berg
     

05 Apr, 2016

3 commits

  • In the time since the mesh path table was implemented as an
    RCU-traversable, dynamically growing hash table, a generic RCU
    hashtable implementation was added to the kernel.

    Switch the mesh path table over to rhashtable to remove some code
    and also gain some features like automatic shrinking.

    Cc: Thomas Graf
    Cc: netdev@vger.kernel.org
    Signed-off-by: Bob Copeland
    Signed-off-by: Johannes Berg

    Bob Copeland
     
  • The mesh path and mesh gate hashtables are global, containing
    all of the mpaths for every mesh interface, but the paths are
    all tied logically to a single interface. The common case is
    just a single mesh interface, so optimize for that by moving
    the global hashtable into the per-interface struct.

    Doing so allows us to drop sdata pointer comparisons inside
    the lookups and also saves a few bytes of BSS and data.

    Signed-off-by: Bob Copeland
    Signed-off-by: Johannes Berg

    Bob Copeland
     
  • The previous approach simply ignored chandef restrictions when calculating
    the appropriate peer BW for a WIDER_BW peer. This could result in a
    regulatory violation if both peers indicated 80MHz support, but the
    regdomain forbade it.

    Change the approach to setting a WIDER_BW peer's BW. Don't exempt it from
    the chandef width at first. If during TDLS negotiation the chandef width
    is upgraded, update the peer's BW to match.

    Fixes: 0fabfaafec3a ("mac80211: upgrade BW of TDLS peers when possible")
    Signed-off-by: Arik Nemtsov
    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Johannes Berg

    Arik Nemtsov
     

09 Mar, 2016

1 commit


01 Mar, 2016

1 commit

  • Just like for CCMP we need to check that for GCMP the fragments
    have PNs that increment by one; the spec was updated to fix this
    security issue and now has the following text:

    The receiver shall discard MSDUs and MMPDUs whose constituent
    MPDU PN values are not incrementing in steps of 1.

    Adapt the code for CCMP to work for GCMP as well, luckily the
    relevant fields already alias each other so no code duplication
    is needed (just check the aliasing with BUILD_BUG_ON.)

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

    Johannes Berg
     

24 Feb, 2016

5 commits

  • Drivers may need to track which vif is using VHT MU-MIMO.
    Move the flag indicationg the ownership of MU_MIMO to
    ieee80211_vif.

    Signed-off-by: Sara Sharon
    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Johannes Berg

    Sara Sharon
     
  • Clean up ieee80211_rx_reorder_ready() callers by passing the RX
    TID struct and the index, instead of the frames list. This will
    make it more extensible as well.

    While at it, move the inline to rx.c as it's only used there.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • This will allow drivers to make more educated
    decisions whether to defer transmission or not.

    Relying on wake_tx_queue() call count implicitly
    was not possible because it could be called
    without queued frame count actually changing on
    software tx aggregation start/stop code paths.

    It was also not possible to know how long
    byte-wise queue was without dequeueing.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     
  • The timestamp given by iwlwifi is at the beginning of the
    frame over the air, at (or during) the SYNC field. Allow
    such timestamps to be given to mac80211, at least (for now)
    for frames with non-HT/VHT preambles.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • The station MLME and IBSS/mesh ones use entirely different
    code for interpreting HT and VHT operation elements. Change
    the code that interprets them a bit - it now modifies an
    existing chandef - and use it also in the MLME code.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

14 Jan, 2016

1 commit

  • The Group ID Management frame is an Action frame of
    category VHT. It is transmitted by the AP to assign
    or change the user position of a STA for one or more
    group IDs.
    Process and save the group membership data. Notify
    underlying driver of changes.

    Signed-off-by: Sara Sharon
    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Johannes Berg

    Sara Sharon
     

18 Dec, 2015

1 commit


15 Dec, 2015

1 commit


04 Dec, 2015

1 commit

  • Jouni found a bug in the remain-on-channel logic: when a short item
    is queued, a long item is combined with it extending the original
    one, and then the long item is deleted, the timeout doesn't go back
    to the short one, and the short item ends up taking a long time. In
    this case, this showed as blocking scan when running two test cases
    back to back - the scan from the second was delayed even though all
    the remain-on-channel items should long have been gone.

    Fixing this with the current data structures turns out to be a bit
    complicated, we just remove the long item from the dependents list
    right now and don't recalculate the timeouts.

    There's a somewhat similar bug where we delete the short item and
    all the dependents go with it; to fix this we'd have to move them
    from the dependents to the real list.

    Instead of trying to do that, rewrite the code to not have all this
    complexity in the data structures: use a single list and allow more
    than one entry in it being marked as started. This makes the code a
    bit more complex, the worker needs to understand that it might need
    to just remove one of the started items, while keeping the device
    off-channel, but that's not more complicated than the nested data
    structures.

    This then fixes both issues described, and makes it easier to also
    limit the overall off-channel time when combining.

    TODO: as before, with hardware remain-on-channel, deleting an item
    after combining results in cancelling them all - we can keep track
    of the time elapsed and only cancel after that to fix this.

    Signed-off-by: Johannes Berg

    Johannes Berg