1. 13 1月, 2010 3 次提交
    • J
      cfg80211/mac80211: Use more generic bitrate mask for rate control · 37eb0b16
      Jouni Malinen 提交于
      Extend struct cfg80211_bitrate_mask to actually use a bitfield mask
      instead of just a single fixed or maximum rate index. This change
      itself does not modify the behavior (except for debugfs files), but it
      prepares cfg80211 and mac80211 for a new nl80211 command for setting
      which rates can be used in TX rate control.
      
      Since frames are now going through the rate control algorithm
      unconditionally, the internal IEEE80211_TX_INTFL_RCALGO flag can now
      be removed. The RC implementations can use the rate_idx_mask value to
      optimize their behavior if only a single rate is enabled.
      
      The old max_rate_idx in struct ieee80211_tx_rate_control is maintained
      (but commented as deprecated) for backwards compatibility with existing
      RC implementations. Once these implementations have been updated to
      use the more generic rate_idx_mask, the max_rate_idx value can be
      removed.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      37eb0b16
    • J
      mac80211: Select lowest rate based on basic rate set in AP mode · e00cfce0
      Jouni Malinen 提交于
      If the basic rate set is configured to not include the lowest rate
      (e.g., basic rate set = 6, 12, 24 Mbps in IEEE 802.11g mode), the AP
      should not send out broadcast frames at 1 Mbps. This type of
      configuration can be used to optimize channel usage in cases where
      there is no need for backwards compatibility with IEEE 802.11b-only
      devices.
      
      In AP mode, mac80211 was unconditionally using the lowest rate for
      Beacon frames and similarly, with all rate control algorithms that use
      rate_control_send_low(), the lowest rate ended up being used for all
      broadcast frames (and all unicast frames that are sent before
      association). Change this to take into account the basic rate
      configuration in AP mode, i.e., use the lowest rate in the basic rate
      set instead of the lowest supported rate when selecting the rate.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e00cfce0
    • L
      mac80211: Add new callback set_coverage_class · 310bc676
      Lukáš Turek 提交于
      Mac80211 callback to driver set_coverage_class() sets slot time and ACK
      timeout for given IEEE 802.11 coverage class. The callback is optional,
      but it's essential for long distance links.
      Signed-off-by: NLukas Turek <8an@praha12.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      310bc676
  2. 29 12月, 2009 4 次提交
  3. 23 12月, 2009 1 次提交
  4. 22 12月, 2009 1 次提交
    • J
      mac80211: reduce reliance on netdev · 47846c9b
      Johannes Berg 提交于
      For bluetooth 3, we will most likely not have
      a netdev for a virtual interface (sdata), so
      prepare for that by reducing the reliance on
      having a netdev. This patch moves the name
      and address fields into the sdata struct and
      uses them from there all over. Some work is
      needed to keep them sync'ed, but that's not
      a lot of work and in slow paths anyway.
      
      In doing so, this also reduces the number of
      pointer dereferences in many places, because
      of things like sdata->dev->dev_addr becoming
      sdata->vif.addr.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      47846c9b
  5. 15 12月, 2009 1 次提交
  6. 01 12月, 2009 1 次提交
    • J
      mac80211: fix spurious delBA handling · 827d42c9
      Johannes Berg 提交于
      Lennert Buytenhek noticed that delBA handling in mac80211
      was broken and has remotely triggerable problems, some of
      which are due to some code shuffling I did that ended up
      changing the order in which things were done -- this was
      
        commit d75636ef
        Author: Johannes Berg <johannes@sipsolutions.net>
        Date:   Tue Feb 10 21:25:53 2009 +0100
      
          mac80211: RX aggregation: clean up stop session
      
      and other parts were already present in the original
      
        commit d92684e6
        Author: Ron Rindjunsky <ron.rindjunsky@intel.com>
        Date:   Mon Jan 28 14:07:22 2008 +0200
      
            mac80211: A-MPDU Tx add delBA from recipient support
      
      The first problem is that I moved a BUG_ON before various
      checks -- thereby making it possible to hit. As the comment
      indicates, the BUG_ON can be removed since the ampdu_action
      callback must already exist when the state is != IDLE.
      
      The second problem isn't easily exploitable but there's a
      race condition due to unconditionally setting the state to
      OPERATIONAL when a delBA frame is received, even when no
      aggregation session was ever initiated. All the drivers
      accept stopping the session even then, but that opens a
      race window where crashes could happen before the driver
      accepts it. Right now, a WARN_ON may happen with non-HT
      drivers, while the race opens only for HT drivers.
      
      For this case, there are two things necessary to fix it:
       1) don't process spurious delBA frames, and be more careful
          about the session state; don't drop the lock
      
       2) HT drivers need to be prepared to handle a session stop
          even before the session was really started -- this is
          true for all drivers (that support aggregation) but
          iwlwifi which can be fixed easily. The other HT drivers
          (ath9k and ar9170) are behaving properly already.
      Reported-by: NLennert Buytenhek <buytenh@marvell.com>
      Cc: stable@kernel.org
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      827d42c9
  7. 29 11月, 2009 1 次提交
  8. 20 11月, 2009 1 次提交
    • J
      mac80211: request TX status where needed · 7351c6bd
      Johannes Berg 提交于
      Right now all frames mac80211 hands to the driver
      have the IEEE80211_TX_CTL_REQ_TX_STATUS flag set to
      request TX status. This isn't really necessary, only
      the injected frames need TX status (the latter for
      hostapd) so move setting this flag.
      
      The rate control algorithms also need TX status, but
      they don't require it.
      
      Also, rt2x00 uses that bit for its own purposes and
      seems to require it being set for all frames, but
      that can be fixed in rt2x00.
      
      This doesn't really change anything for any drivers
      but in the future drivers using hw-rate control may
      opt to not report TX status for frames that don't
      have the IEEE80211_TX_CTL_REQ_TX_STATUS flag set.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Acked-by: Ivo van Doorn <IvDoorn@gmail.com> [rt2x00 bits]
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7351c6bd
  9. 19 11月, 2009 3 次提交
  10. 07 11月, 2009 1 次提交
    • J
      mac80211: async station powersave handling · af818581
      Johannes Berg 提交于
      Some devices require that all frames to a station
      are flushed when that station goes into powersave
      mode before being able to send frames to that
      station again when it wakes up or polls -- all in
      order to avoid reordering and too many or too few
      frames being sent to the station when it polls.
      
      Normally, this is the case unless the station
      goes to sleep and wakes up very quickly again.
      But in that case, frames for it may be pending
      on the hardware queues, and thus races could
      happen in the case of multiple hardware queues
      used for QoS/WMM. Normally this isn't a problem,
      but with the iwlwifi mechanism we need to make
      sure the race doesn't happen.
      
      This makes mac80211 able to cope with the race
      with driver help by a new WLAN_STA_PS_DRIVER
      per-station flag that can be controlled by the
      driver and tells mac80211 whether it can transmit
      frames or not. This flag must be set according to
      very specific rules outlined in the documentation
      for the function that controls it.
      
      When we buffer new frames for the station, we
      normally set the TIM bit right away, but while
      the driver has blocked transmission to that sta
      we need to avoid that as well since we cannot
      respond to the station if it wakes up due to the
      TIM bit. Once the driver unblocks, we can set
      the TIM bit.
      
      Similarly, when the station just wakes up, we
      need to wait until all other frames are flushed
      before we can transmit frames to that station,
      so the same applies here, we need to wait for
      the driver to give the OK.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      af818581
  11. 05 11月, 2009 1 次提交
  12. 31 10月, 2009 3 次提交
    • J
      mac80211: deprecate qual value · c27f2fde
      Johannes Berg 提交于
      This value is unused by mac80211, because it was only
      be used by wireless extensions, and turned out to not
      be useful there because the quality value needs to be
      comparable between scan results and the current value
      which is impossible when the qual value is calculated
      taking into account noise, for example.
      
      Since it is unused anyway, this patch deprecates it
      in the hope that drivers will remove their sometimes
      quite expensive calculations of the value.
      
      I'm open to actual uses of the value, but the best
      way of using it seems to be what the Intel drivers do
      which should probably be generalised if we have noise
      values from the hardware.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c27f2fde
    • J
      mac80211: introduce ieee80211_beacon_get_tim() · eddcbb94
      Johannes Berg 提交于
      Compared to ieee80211_beacon_get(), the new function
      ieee80211_beacon_get_tim() returns information on the
      location and length of the TIM IE, which some drivers
      need in order to generate the TIM on the device. The
      old function, ieee80211_beacon_get(), becomes a small
      static inline wrapper around the new one to not break
      all drivers.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      eddcbb94
    • J
      mac80211: remove RX_FLAG_RADIOTAP · 0869aea0
      Johannes Berg 提交于
      While there may be a case for a driver adding its
      own bits of radiotap information, none currently
      does. Also, drivers would have to copy the code
      to generate the radiotap bits that now mac80211
      generates. If some driver in the future needs to
      add some driver-specific information I'd expect
      that to be in a radiotap vendor namespace and we
      can add a different way of passing such data up
      and having mac80211 include it.
      
      Additionally, rename IEEE80211_CONF_RADIOTAP to
      IEEE80211_CONF_MONITOR since it's still used by
      b43(legacy) to obtain per-frame timestamps.
      
      The purpose of this patch is to simplify the RX
      code in mac80211 to make it easier to add paged
      skb support.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0869aea0
  13. 28 10月, 2009 1 次提交
  14. 13 10月, 2009 1 次提交
    • J
      mac80211: document ieee80211_rx() context requirement · d20ef63d
      Johannes Berg 提交于
      ieee80211_rx() must be called with softirqs disabled
      since the networking stack requires this for netif_rx()
      and some code in mac80211 can assume that it can not
      be processing its own tasklet and this call at the same
      time.
      
      It may be possible to remove this requirement after a
      careful audit of mac80211 and doing any needed locking
      improvements in it along with disabling softirqs around
      netif_rx(). An alternative might be to push all packet
      processing to process context in mac80211, instead of
      to the tasklet, and add other synchronisation.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d20ef63d
  15. 29 8月, 2009 1 次提交
  16. 20 8月, 2009 2 次提交
  17. 14 8月, 2009 3 次提交
  18. 05 8月, 2009 2 次提交
    • I
      mac80211: FIF_PSPOLL filter flag · e3b90ca2
      Igor Perminov 提交于
      When an interface is configured in the AP mode, the mac80211
      implementation doesn't inform the driver to receive PS Poll frames.
      It leads to inability to communicate with power-saving stations
      reliably.
      The FIF_CONTROL flag isn't passed by mac80211 to
      ieee80211_ops.configure_filter when an interface is in the AP mode.
      And it's ok, because we don't want to receive ACK frames and other
      control ones, but only PS Poll ones.
      
      This patch introduces the FIF_PSPOLL filter flag in addition to
      FIF_CONTROL, which means for the driver "pass PS Poll frames".
      
      This flag is passed to the driver:
      A) When an interface is configured in the AP mode.
      B) In all cases, when the FIF_CONTROL flag was passed earlier (in
      addition to it).
      Signed-off-by: NIgor Perminov <igor.perminov@inbox.ru>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e3b90ca2
    • L
      mac80211: redefine usage of the mac80211 workqueue · 42935eca
      Luis R. Rodriguez 提交于
      The mac80211 workqueue exists to enable mac80211 and drivers
      to queue their own work on a single threaded workqueue. mac80211
      takes care to flush the workqueue during suspend but we never
      really had requirements on drivers for how they should use
      the workqueue in consideration for suspend.
      
      We extend mac80211 to document how the mac80211 workqueue should
      be used, how it should not be used and finally move raw access to
      the workqueue to mac80211 only. Drivers and mac80211 use helpers
      to queue work onto the mac80211 workqueue:
      
        * ieee80211_queue_work()
        * ieee80211_queue_delayed_work()
      
      These helpers will now warn if mac80211 already completed its
      suspend cycle and someone is trying to queue work. mac80211
      flushes the mac80211 workqueue prior to suspend a few times,
      but we haven't taken the care to ensure drivers won't add more
      work after suspend. To help with this we add a warning when
      someone tries to add work and mac80211 already completed the
      suspend cycle.
      
      Drivers should ensure they cancel any work or delayed work
      in the mac80211 stop() callback.
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      42935eca
  19. 28 7月, 2009 1 次提交
  20. 25 7月, 2009 3 次提交
  21. 11 7月, 2009 2 次提交
    • J
      cfg80211: introduce nl80211 testmode command · aff89a9b
      Johannes Berg 提交于
      This introduces a new NL80211_CMD_TESTMODE for testing
      and calibration use with nl80211. There's no multiplexing
      like like iwpriv had, and the command is not available by
      default, it needs to be explicitly enabled in Kconfig and
      shouldn't be enabled in most kernels.
      
      The command requires a wiphy index or interface index to
      identify the device to operate on, and the new TESTDATA
      attribute. There also is API for sending replies to the
      command, and testmode multicast messages (on a testmode
      multicast group).
      
      I've also updated mac80211 to be able to pass through the
      command to the driver, since it itself doesn't implement
      the testmode command.
      
      Additionally, to give people an idea of how to use the
      command, I've added a little code to hwsim that makes use
      of the new command to set the powersave mode, this is
      currently done via debugfs and should remain there, and
      the testmode command only serves as an example of how to
      use this best -- with nested netlink attributes in the
      TESTDATA attribute. A hwsim testmode tool can be found at
      http://git.sipsolutions.net/hwsim.git/. This tool is BSD
      licensed so people can easily use it as a basis for their
      own internal fabrication and validation tools.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      aff89a9b
    • J
      mac80211: push rx status into skb->cb · f1d58c25
      Johannes Berg 提交于
      Within mac80211, we often need to copy the rx status into
      skb->cb. This is wasteful, as drivers could be building it
      in there to start with. This patch changes the API so that
      drivers are expected to pass the RX status in skb->cb, now
      accessible as IEEE80211_SKB_RXCB(skb). It also updates all
      drivers to pass the rx status in there, but only by making
      them memcpy() it into place before the call to the receive
      function (ieee80211_rx(_irqsafe)). Each driver can now be
      optimised on its own schedule.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f1d58c25
  22. 11 6月, 2009 1 次提交
    • J
      mac80211: do not pass PS frames out of mac80211 again · 8f77f384
      Johannes Berg 提交于
      In order to handle powersave frames properly we had needed
      to pass these out to the device queues again, and introduce
      the skb->requeue bit. This, however, also has unnecessary
      overhead by needing to 'clean up' already tried frames, and
      this clean-up code is also buggy when software encryption
      is used.
      
      Instead of sending the frames via the master netdev queue
      again, simply put them into the pending queue. This also
      fixes a problem where frames for that particular station
      could be reordered when some were still on the software
      queues and older ones are re-injected into the software
      queue after them.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8f77f384
  23. 04 6月, 2009 2 次提交