1. 10 6月, 2015 1 次提交
    • J
      mac80211: convert HW flags to unsigned long bitmap · 30686bf7
      Johannes Berg 提交于
      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: NJohannes Berg <johannes.berg@intel.com>
      30686bf7
  2. 02 4月, 2015 1 次提交
    • F
      mac80211: add an intermediate software queue implementation · ba8c3d6f
      Felix Fietkau 提交于
      This allows drivers to request per-vif and per-sta-tid queues from which
      they can pull frames. This makes it easier to keep the hardware queues
      short, and to improve fairness between clients and vifs.
      
      The task of scheduling packet transmission is left up to the driver -
      queueing is controlled by mac80211. Drivers can only dequeue packets by
      calling ieee80211_tx_dequeue. This makes it possible to add active queue
      management later without changing drivers using this code.
      
      This can also be used as a starting point to implement A-MSDU
      aggregation in a way that does not add artificially induced latency.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      [resolved minor context conflict, minor changes, endian annotations]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      ba8c3d6f
  3. 30 3月, 2015 2 次提交
    • J
      mac80211: reject aggregation sessions with non-HT peers · 8f9c77fc
      Johannes Berg 提交于
      If a peer or some local agent (rate control, ...) decides to start
      an aggregation session but doesn't support HT (which also implies
      QoS), reject it.
      
      This is mostly a corner case as such peers normally won't try to
      use block-ack sessions and rate control wouldn't start them, but
      technically QoS stations could request it according to the spec.
      
      However, since drivers don't really support such non-HT sessions
      it's better to reject them.
      
      Also, while at it, move the tracing for TX sessions earlier so it
      captures the error cases as well.
      Reviewed-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      8f9c77fc
    • J
      mac80211: agg-tx: avoid sending DelBA with sta->lock held · 2c158887
      Johannes Berg 提交于
      The rate control locking caused a potential deadlock here due to the
      locks being acquired in different orders, so that change cannot yet
      be applied. However, there's no fundamental reason for this code to
      hold the sta->lock while transmitting frames.
      
      Clearly it's better not to hold the lock for longer periods of time,
      which can happen here since we call all the way down to the driver.
      Change the code a bit to not hold it while doing that.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      2c158887
  4. 20 11月, 2014 1 次提交
  5. 22 10月, 2014 1 次提交
    • J
      mac80211: add WMM admission control support · 02219b3a
      Johannes Berg 提交于
      Use the currently existing APIs between mac80211 and the low
      level driver to implement WMM admission control.
      
      The low level driver needs to report the media time used by
      each transmitted packet in ieee80211_tx_status. Based on that
      information, mac80211 will modify the QoS parameters of the
      admission controlled Access Category when the limit is
      reached. Once the original QoS parameters can be restored,
      mac80211 will do so.
      
      One issue with this approach is that management frames will
      also erroneously be downgraded, but the upside is that the
      implementation is simple. In the future, it can be extended
      to driver- or device-based implementations that are better.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      02219b3a
  6. 23 6月, 2014 1 次提交
  7. 05 2月, 2014 1 次提交
    • K
      mac80211: send {ADD,DEL}BA on AC_VO like other mgmt frames, as per spec · c6e13327
      Karl Beldan 提交于
      ATM, {ADD,DEL}BA and BAR frames are sent on the AC matching the TID of
      the BA parameters. In the discussion [1] about this patch, Johannes
      recalled that it fixed some races with the DELBA and indeed this
      behavior was introduced in [2].
      While [2] is right for the BARs, the part queueing the {ADD,DEL}BAs on
      their BA params TID AC violates the spec and is more a workaround for
      some drivers. Helmut expressed some concerns wrt such drivers, in
      particular DELBAs in rt2x00.
      
      ATM, DELBAs are sent after a driver has called (hence "purposely")
      ieee80211_start_tx_ba_cb_irqsafe and Johannes and Emmanuel gave some
      details wrt intentions behind the split of the IEEE80211_AMPDU_TX_STOP_*
      given to the driver ampdu_action supposed to call this function, which
      could prove handy to people trying to do the right thing in faulty
      drivers (if their fw/hw don't get in their way).
      
      [1] http://mid.gmane.org/1390391564-18481-1-git-send-email-karl.beldan@gmail.com
      [2] Commit: cf6bb79a ("mac80211: Use appropriate TID for sending BAR, ADDBA and DELBA frames")
      Signed-off-by: NKarl Beldan <karl.beldan@rivierawaves.com>
      Cc: Helmut Schaa <helmut.schaa@googlemail.com>
      Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      c6e13327
  8. 24 1月, 2013 1 次提交
    • J
      mac80211: fix aggregation state with current drivers · 8147dc7f
      Johannes Berg 提交于
      For drivers that don't actually flush their queues when
      aggregation stop with the IEEE80211_AMPDU_TX_STOP_FLUSH
      or IEEE80211_AMPDU_TX_STOP_FLUSH_CONT reasons is done,
      like iwlwifi or iwlegacy, mac80211 can then transmit on
      a TID that the driver still considers busy. This happens
      in the following way:
      
       - IEEE80211_AMPDU_TX_STOP_FLUSH requested
       - driver marks TID as emptying
       - mac80211 removes tid_tx data, this can copy packets
         to the TX pending queues and also let new packets
         through to the driver
       - driver gets unexpected TX as it wasn't completely
         converted to the new API
      
      In iwlwifi, this lead to the following warning:
      
      WARNING: at drivers/net/wireless/iwlwifi/dvm/tx.c:442 iwlagn_tx_skb+0xc47/0xce0
      Tx while agg.state = 4
      Modules linked in: [...]
      Pid: 0, comm: kworker/0:0 Tainted: G        W   3.1.0 #1
      Call Trace:
       [<c1046e42>] warn_slowpath_common+0x72/0xa0
       [<c1046f13>] warn_slowpath_fmt+0x33/0x40
       [<fddffa17>] iwlagn_tx_skb+0xc47/0xce0 [iwldvm]
       [<fddfcaa3>] iwlagn_mac_tx+0x23/0x40 [iwldvm]
       [<fd8c98b6>] __ieee80211_tx+0xf6/0x3c0 [mac80211]
       [<fd8cbe00>] ieee80211_tx+0xd0/0x100 [mac80211]
       [<fd8cc176>] ieee80211_xmit+0x96/0xe0 [mac80211]
       [<fd8cc578>] ieee80211_subif_start_xmit+0x348/0xc80 [mac80211]
       [<c1445207>] dev_hard_start_xmit+0x337/0x6d0
       [<c145eee9>] sch_direct_xmit+0xa9/0x210
       [<c14462c0>] dev_queue_xmit+0x1b0/0x8e0
      
      Fortunately, solving this problem is easy as the station
      is being destroyed, so such transmit packets can only
      happen due to races. Instead of trying to close the race
      just let the race not reach the drivers by making two
      changes:
       1) remove the explicit aggregation session teardown in
          the managed mode code, the same thing will be done
          when the station is removed, in __sta_info_destroy.
       2) When aggregation stop with AGG_STOP_DESTROY_STA is
          requested, leave the tid_tx data around as stopped.
          It will be cleared and freed in cleanup_single_sta
          later, but until then any racy packets will be put
          onto the tid_tx pending queue instead of transmitted
          which is fine since the station is being removed.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      8147dc7f
  9. 19 1月, 2013 1 次提交
  10. 03 1月, 2013 4 次提交
    • J
      mac80211: split TX aggregation stop action · 18b559d5
      Johannes Berg 提交于
      When TX aggregation is stopped, there are a few
      different cases:
       - connection with the peer was dropped
       - session stop was requested locally
       - session stop was requested by the peer
       - connection was dropped while a session is stopping
      
      The behaviour in these cases should be different, if
      the connection is dropped then the driver should drop
      all frames, otherwise the frames may continue to be
      transmitted, aggregated in the case of a locally
      requested session stop or unaggregated in the case of
      the peer requesting session stop.
      
      Split these different cases so that the driver can
      act accordingly; however, treat local and remote stop
      the same way and ask the driver to not send frames as
      aggregated packets any more.
      
      In the case of connection drop, the stop callback the
      driver is otherwise supposed to call is no longer
      required.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      18b559d5
    • J
      mac80211: move ieee80211_remove_tid_tx function · 30bf5f1f
      Johannes Berg 提交于
      To call it from ___ieee80211_stop_tx_ba_session,
      move the function and dependencies up.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      30bf5f1f
    • J
      mac80211: split out aggregation TX removal · faec12ee
      Johannes Berg 提交于
      Create the function ieee80211_remove_tid_tx to call
      it from ___ieee80211_stop_tx_ba_session later.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      faec12ee
    • J
      mac80211: split aggregation stop by reason · c82c4a80
      Johannes Berg 提交于
      The initiator/tx doesn't really identify why an
      aggregation session is stopped, give a reason
      for stopping that more clearly identifies what's
      going on. This will help tell the driver clearly
      what is expected of it.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      c82c4a80
  11. 07 12月, 2012 1 次提交
  12. 19 11月, 2012 1 次提交
  13. 21 9月, 2012 1 次提交
  14. 08 7月, 2012 1 次提交
  15. 24 6月, 2012 1 次提交
    • J
      mac80211: clean up debugging · bdcbd8e0
      Johannes Berg 提交于
      There are a few things that make the logging and
      debugging in mac80211 less useful than it should
      be right now:
       * a lot of messages should be pr_info, not pr_debug
       * wholesale use of pr_debug makes it require *both*
         Kconfig and dynamic configuration
       * there are still a lot of ifdefs
       * the style is very inconsistent, sometimes the
         sdata->name is printed in front
      
      Clean up everything, introducing new macros and
      separating out the station MLME debugging into
      a new Kconfig symbol.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      bdcbd8e0
  16. 06 6月, 2012 2 次提交
  17. 17 5月, 2012 1 次提交
  18. 12 4月, 2012 1 次提交
    • J
      mac80211: add improved HW queue control · 3a25a8c8
      Johannes Berg 提交于
      mac80211 currently only supports one hardware queue
      per AC. This is already problematic for off-channel
      uses since if we go off channel while the BE queue
      is full and then try to send an off-channel frame
      the frame will never go out. This will become worse
      when we support multi-channel since then a queue on
      one channel might be full, but we have to stop the
      software queue for all channels. That is obviously
      not desirable.
      
      To address this problem allow drivers to register
      more hardware queues, and allow them to map them to
      virtual interfaces. When they stop a hardware queue
      the corresponding AC software queues on the correct
      interfaces will be stopped as well. Additionally,
      there's an off-channel queue to solve that problem
      and a per-interface after-DTIM beacon queue. This
      allows drivers to manage software queues closer to
      how the hardware works.
      
      Currently, there's a limit of 16 hardware queues.
      This may or may not be sufficient, we can adjust it
      as needed.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3a25a8c8
  19. 10 4月, 2012 1 次提交
    • F
      mac80211: optimize aggregation session timeout handling · 12d3952f
      Felix Fietkau 提交于
      Calling mod_timer from the rx/tx hotpath is somewhat expensive, and the
      timeout doesn't need to be so precise.
      
      Switch to a different strategy: Schedule the timer initially, store jiffies
      of all last rx/tx activity which would previously modify the timer, and
      let the timer re-arm itself after checking the last rx/tx timestamp.
      Make the session timers deferrable to avoid causing extra wakeups on systems
      running on battery.
      This visibly reduces CPU load under high network load on small embedded
      systems.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      12d3952f
  20. 20 12月, 2011 1 次提交
    • N
      mac80211: split addba retries in time · 84381b4e
      Nikolay Martynov 提交于
        Currently code allows three (HT_AGG_MAX_RETRIES) unanswered addba
      requests. When this limit is reached aggregation is turned off for
      given TID permanently. This doesn't seem right: three requests is
      not that much, some 'blackout' can happen, but effect of it affects
      whole connection indefinitely.
        This patch increases number of retries to 15. Also, when there have
      been 3 or more retries it splits further retries apart by 15 seconds
      instead of sending them in very short period of time.
      Signed-off-by: NNikolay Martynov <mar.kolya@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      84381b4e
  21. 16 12月, 2011 1 次提交
  22. 14 12月, 2011 1 次提交
    • Y
      mac80211: Purge A-MPDU TX queues before station destructions · 42624d49
      Yogesh Ashok Powar 提交于
      When a station leaves suddenly while ampdu traffic to that station is still
      running, there is a possibility that the ampdu pending queues are not freed due
      to a race condition leading to memory leaks. In '__sta_info_destroy' when we
      attempt to destroy the ampdu sessions in 'ieee80211_sta_tear_down_BA_sessions',
      the driver calls 'ieee80211_stop_tx_ba_cb_irqsafe' to delete the ampdu
      structures (tid_tx) and splice the pending queues and this job gets queued in
      sdata workqueue. However, the sta entry can get destroyed before the above work
      gets scheduled and hence the race.
      
      Purging the queues and freeing the tid_tx to avoid the leak. The better solution
      would be to fix the race, but that can be taken up in a separate patch.
      Signed-off-by: NNishant Sarmukadam <nishants@marvell.com>
      Signed-off-by: NYogesh Ashok Powar <yogeshp@marvell.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      42624d49
  23. 08 12月, 2011 1 次提交
    • J
      mac80211: fix another race in aggregation start · 15062e6a
      Johannes Berg 提交于
      Emmanuel noticed that when mac80211 stops the queues
      for aggregation that can leave a packet pending. This
      packet will be given to the driver after the AMPDU
      callback, but as a non-aggregated packet which messes
      up the sequence number etc.
      
      I also noticed by looking at the code that if packets
      are being processed while we clear the WANT_START bit,
      they might see it cleared already and queue up on
      tid_tx->pending. If the driver then rejects the new
      aggregation session we leak the packet.
      
      Fix both of these issues by changing this code to not
      stop the queues at all. Instead, let packets queue up
      on the tid_tx->pending queue instead of letting them
      get to the driver, and add code to recover properly
      in case the driver rejects the session.
      
      (The patch looks large because it has to move two
      functions to before their new use.)
      
      Cc: stable@vger.kernel.org
      Reported-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      15062e6a
  24. 07 12月, 2011 2 次提交
  25. 29 11月, 2011 5 次提交
  26. 09 11月, 2011 1 次提交
  27. 01 11月, 2011 1 次提交
  28. 01 10月, 2011 1 次提交
    • J
      mac80211: optimise station flags · c2c98fde
      Johannes Berg 提交于
      The flaglock in struct sta_info has long been
      something that I wanted to get rid of, this
      finally does the conversion to atomic bitops.
      
      The conversion itself is straight-forward in
      most places, a few things needed to change a
      bit since we can no longer use multiple bits
      at the same time.
      
      On x86-64, this is a fairly significant code
      size reduction:
         text	   data	    bss	    dec	    hex
       427861	  23648	   1008	 452517	  6e7a5	before
       425383	  23648	    976	 450007	  6ddd7	after
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c2c98fde
  29. 15 9月, 2011 1 次提交
  30. 14 9月, 2011 1 次提交