1. 19 Jan, 2019 4 commits
    • Sergey Matyukevich's avatar
      mac80211: allow overriding HT STBC capabilities · d9bb4108
      Sergey Matyukevich authored
      Allow user to override STBC configuration for Rx and Tx spatial streams.
      In practice RX/TX STBC settings can be modified using appropriate
      options in wpa_supplicant configuration file:
        tx_stbc=-1..1
        rx_stbc=-1..3
      
      This functionality has been added to wpa_supplicant in commit cdeea70f59d0.
      
      In FullMAC case these STBC options are passed to drivers by cfg80211
      connect callback in fields of cfg80211_connect_params structure.
      However for mac80211 drivers, e.g. for mac80211_hwsim,
      overrides for STBC settings are ignored.
      
      The reason why RX/TX STBC capabilities are not modified for mac80211
      drivers is as follows. All drivers need to specify supported HT/VHT
      overrides explicitly: see ht_capa_mod_mask and vht_capa_mod_mask fields
      of wiphy structure. Only supported overrides will be passed to drivers by
      cfg80211_connect and cfg80211_mlme_assoc operations: see bitwise 'AND'
      performed by cfg80211_oper_and_ht_capa and cfg80211_oper_and_vht_capa.
      
      This commit adds RX/TX STBC HT capabilities to mac80211_ht_capa_mod_mask,
      allowing their modifications, as well as applies requested STBC
      modifications in function ieee80211_apply_htcap_overrides.
      Signed-off-by: default avatarSergey Matyukevich <sergey.matyukevich.os@quantenna.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      d9bb4108
    • 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
    • Toke Høiland-Jørgensen's avatar
      cfg80211: Add airtime statistics and settings · 36647055
      Toke Høiland-Jørgensen authored
      This adds TX airtime statistics to the cfg80211 station dump (to go along
      with the RX info already present), and adds a new parameter to set the
      airtime weight of each station. The latter allows userspace to implement
      policies for different stations by varying their weights.
      Signed-off-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      [rmanohar@codeaurora.org: fixed checkpatch warnings]
      Signed-off-by: default avatarRajkumar Manoharan <rmanohar@codeaurora.org>
      [move airtime weight != 0 check into policy]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      36647055
    • Toke Høiland-Jørgensen's avatar
      mac80211: Add TXQ scheduling API · 18667600
      Toke Høiland-Jørgensen authored
      This adds an API to mac80211 to handle scheduling of TXQs. The interface
      between driver and mac80211 for TXQ handling is changed by adding two new
      functions: ieee80211_next_txq(), which will return the next TXQ to schedule
      in the current round-robin rotation, and ieee80211_return_txq(), which the
      driver uses to indicate that it has finished scheduling a TXQ (which will
      then be put back in the scheduling rotation if it isn't empty).
      
      The driver must call ieee80211_txq_schedule_start() at the start of each
      scheduling session, and ieee80211_txq_schedule_end() at the end. The API
      then guarantees that the same TXQ is not returned twice in the same
      session (so a driver can loop on ieee80211_next_txq() without worrying
      about breaking the loop.
      
      Usage of the new API is optional, so drivers can be ported one at a time.
      In this patch, the actual scheduling performed by mac80211 is simple
      round-robin, but a subsequent commit adds airtime fairness awareness to the
      scheduler.
      Signed-off-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      [minor kernel-doc fix, propagate sparse locking checks out]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      18667600
  2. 18 Jan, 2019 36 commits