Skip to content
Snippets Groups Projects
  1. Jul 26, 2019
  2. Jun 19, 2019
  3. Jan 19, 2019
    • Toke Høiland-Jørgensen's avatar
      mac80211: Add airtime accounting and scheduling to TXQs · b4809e94
      Toke Høiland-Jørgensen authored
      
      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: default avatarRajkumar Manoharan <rmanohar@codeaurora.org>
      Signed-off-by: default avatarLouie Lu <git@louie.lu>
      [added debugfs write op to reset airtime counter]
      Signed-off-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: default avatarRajkumar Manoharan <rmanohar@codeaurora.org>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      b4809e94
  4. Dec 19, 2018
  5. Dec 05, 2018
  6. Oct 12, 2018
    • Anilkumar Kolli's avatar
      mac80211: implement ieee80211_tx_rate_update to update rate · f8252e7b
      Anilkumar Kolli authored
      
      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: default avatarAnilkumar Kolli <akolli@codeaurora.org>
      [minor commit message editing, use initializers in code]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      f8252e7b
  7. Sep 10, 2018
    • Yuan-Chi Pang's avatar
      mac80211: fix TX status reporting for ieee80211s · c4205510
      Yuan-Chi Pang authored
      
      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: default avatarYuan-Chi Pang <fu3mo6goo@gmail.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      c4205510
  8. Sep 05, 2018
  9. May 07, 2018
  10. Feb 19, 2018
  11. Dec 19, 2017
  12. Dec 11, 2017
    • Toke Høiland-Jørgensen's avatar
      mac80211: Add airtime account and scheduling to TXQs · b0d52ad8
      Toke Høiland-Jørgensen authored
      
      This adds airtime accounting and scheduling to the mac80211 TXQ
      scheduler. A new hardware flag, AIRTIME_ACCOUNTING, is added that
      drivers can set if they support reporting airtime usage of
      transmissions. When this flag is set, mac80211 will expect the actual
      airtime usage to be reported in the tx_time and rx_time fields of the
      respective status structs.
      
      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.
      
      Signed-off-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      b0d52ad8
  13. Jun 16, 2017
    • Johannes Berg's avatar
      networking: make skb_push & __skb_push return void pointers · d58ff351
      Johannes Berg authored
      
      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: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d58ff351
  14. May 30, 2017
  15. Apr 28, 2017
  16. Apr 26, 2017
    • Emmanuel Grumbach's avatar
      mac80211: don't parse encrypted management frames in ieee80211_frame_acked · cf147085
      Emmanuel Grumbach authored
      
      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: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      cf147085
  17. Feb 27, 2017
  18. Feb 14, 2017
  19. Jan 26, 2017
  20. Jan 12, 2017
  21. Dec 13, 2016
    • Kirtika Ruchandani's avatar
      mac80211: Remove unused 'rates_idx' variable · 872684b1
      Kirtika Ruchandani authored
      
      Commit f027c2ac 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: f027c2ac ("mac80211: add ieee80211_tx_status_noskb")
      Cc: Johannes Berg <johannes.berg@intel.com>
      Cc: Felix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarKirtika Ruchandani <kirtika@google.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      872684b1
  22. Sep 20, 2016
    • Herbert Xu's avatar
      mac80211: Use rhltable instead of rhashtable · 83e7e4ce
      Herbert Xu authored
      
      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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83e7e4ce
  23. Sep 15, 2016
  24. Sep 12, 2016
  25. Aug 05, 2016
  26. Apr 06, 2016
    • Johannes Berg's avatar
      mac80211: add separate last_ack variable · b8da6b6a
      Johannes Berg authored
      
      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: default avatarJohannes Berg <johannes.berg@intel.com>
      b8da6b6a
  27. Mar 05, 2016
  28. Jan 14, 2016
    • Helmut Schaa's avatar
      mac80211: Don't buffer non-bufferable MMPDUs · da629cf1
      Helmut Schaa authored
      
      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: default avatarHelmut Schaa <helmut.schaa@googlemail.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      da629cf1
  29. Oct 21, 2015
  30. Sep 24, 2015
  31. Sep 22, 2015
  32. Aug 13, 2015
  33. Jun 10, 2015
    • Johannes Berg's avatar
      mac80211: convert HW flags to unsigned long bitmap · 30686bf7
      Johannes Berg authored
      
      As we're running out of hardware capability flags pretty quickly,
      convert them to use the regular test_bit() style unsigned long
      bitmaps.
      
      This introduces a number of helper functions/macros to set and to
      test the bits, along with new debugfs code.
      
      The occurrences of an explicit __clear_bit() are intentional, the
      drivers were never supposed to change their supported bits on the
      fly. We should investigate changing this to be a per-frame flag.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      30686bf7
  34. Jun 02, 2015
    • Johannes Berg's avatar
      mac80211: stop using pointers as userspace cookies · 3b79af97
      Johannes Berg authored
      
      Even if the pointers are really only accessible to root and used
      pretty much only by wpa_supplicant, this is still not great; even
      for debugging it'd be easier to have something that's easier to
      read and guaranteed to never get reused.
      
      With the recent change to make mac80211 create an ack_skb for the
      mgmt-tx path this becomes possible, only the client probe method
      needs to also allocate an ack_skb, and we can store the cookie in
      that skb.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      3b79af97
    • Johannes Berg's avatar
      mac80211: copy nl80211 mgmt TX SKB for status · b2eb0ee6
      Johannes Berg authored
      
      When we return the TX status for an nl80211 mgmt TX SKB, we
      should also return the original frame with the status to
      allow userspace to match up the submission (it could also
      use the cookie but both ways are permissible.)
      
      As TX SKBs could be encrypted, at least in the case of ANQP
      while associated with the AP, copy the original SKB, store
      it with an ACK frame ID and restructure the status path to
      use that to return status with the original SKB. Otherwise,
      userspace (in particular wpa_supplicant) will get confused.
      
      Reported-by: default avatarMatti Gottlieb <matti.gottlieb@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      b2eb0ee6
Loading