1. 13 1月, 2010 3 次提交
    • K
      mac80211: add U-APSD client support · ab13315a
      Kalle Valo 提交于
      Add Unscheduled Automatic Power-Save Delivery (U-APSD) client support. The
      idea is that the data frames from the client trigger AP to send the buffered
      frames with ACs which have U-APSD enabled. This decreases latency and makes it
      possible to save even more power.
      
      Driver needs to use IEEE80211_HW_UAPSD to enable the feature. The current
      implementation assumes that firmware takes care of the wakeup and
      hardware needing IEEE80211_HW_PS_NULLFUNC_STACK is not yet supported.
      
      Tested with wl1251 on a Nokia N900 and Cisco Aironet 1231G AP and running
      various test traffic with ping.
      Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      ab13315a
    • L
      mac80211: flush workqueue before calling driver ->stop() method · 678f415f
      Lennert Buytenhek 提交于
      Since commit "mwl8k: handle station database update for AP's sta entry
      via ->sta_notify()", mwl8k every now and then gets a command timeout
      when ifconfig'ing a STA interface down.  This turns out to be due to
      mwl8k_stop() being called while the work queue item that was scheduled
      by mwl8k_sta_notify() to remove the STA entry for the associated AP is
      still queued, and the former disables interrupts so that when the
      latter eventually runs, a command completion interrupt is never seen.
      
      Fix this by changing ieee80211_stop_device() so that the workqueue is
      flushed before drv_stop() is called, instead of doing it the other way
      around as is done now.  (As ->stop() is allowed to sleep, there isn't
      any reason for drivers to queue work from within it.)
      Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      678f415f
    • K
      mac80211: use Probe Request template when sending a direct scan · 7c12ce8b
      Kalle Valo 提交于
      As mac80211 now has a separate function for creating Probe Request templates,
      better to use it when sending direct Probe Requests to an AP. Only the
      bssid needs to be updated in the template before sending it.
      Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7c12ce8b
  2. 06 1月, 2010 2 次提交
  3. 05 1月, 2010 1 次提交
  4. 29 12月, 2009 4 次提交
  5. 23 12月, 2009 2 次提交
  6. 22 12月, 2009 2 次提交
  7. 08 12月, 2009 1 次提交
  8. 20 11月, 2009 1 次提交
    • J
      mac80211: fix resume · ceb99fe0
      Johannes Berg 提交于
      When mac80211 resumes, it currently first sets suspended
      to false so the driver can start doing things and we can
      receive frames.
      
      However, if we actually receive frames then it can end
      up starting some work which adds timers and then later
      runs into a BUG_ON in the timer code because it tries
      add_timer() on a pending timer.
      
      Fix this by keeping track of the resuming process by
      introducing a new variable 'resuming' which gets set to
      true early on instead of setting 'suspended' to false,
      and allow queueing work but not receiving frames while
      resuming.
      Reported-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      ceb99fe0
  9. 19 11月, 2009 2 次提交
  10. 14 11月, 2009 1 次提交
  11. 31 10月, 2009 1 次提交
    • J
      mac80211: split hardware scan by band · 4d36ec58
      Johannes Berg 提交于
      There's currently a very odd bug in mac80211 -- a
      hardware scan that is done while the hardware is
      really operating on 2.4 GHz will include CCK rates
      in the probe request frame, even on 5 GHz (if the
      driver uses the mac80211 IEs). Vice versa, if the
      hardware is operating on 5 GHz the 2.4 GHz probe
      requests will not include CCK rates even though
      they should.
      
      Fix this by splitting up cfg80211 scan requests by
      band -- recalculating the IEs every time -- and
      requesting only per-band scans from the driver.
      
      Apparently this bug hasn't been a problem yet, but
      it is imaginable that some older access points get
      confused if confronted with such behaviour.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4d36ec58
  12. 08 10月, 2009 1 次提交
  13. 29 8月, 2009 1 次提交
  14. 20 8月, 2009 1 次提交
    • J
      mac80211: allow configure_filter callback to sleep · 3ac64bee
      Johannes Berg 提交于
      Over time, a whole bunch of drivers have come up
      with their own scheme to delay the configure_filter
      operation to a workqueue. To be able to simplify
      things, allow configure_filter to sleep, and add
      a new prepare_multicast callback that drivers that
      need the multicast address list implement. This new
      callback must be atomic, but most drivers either
      don't care or just calculate a hash which can be
      done atomically and then uploaded to the hardware
      non-atomically.
      
      A cursory look suggests that at76c50x-usb, ar9170,
      mwl8k (which is actually very broken now), rt2x00,
      wl1251, wl1271 and zd1211 should make use of this
      new capability.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3ac64bee
  15. 05 8月, 2009 1 次提交
    • 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
  16. 30 7月, 2009 1 次提交
    • J
      mac80211: verify info->control.vif is not NULL · a7bc376c
      Johannes Berg 提交于
      When enqueuing packets on the internal packet queue, we
      need to ensure that we have a valid vif pointer since
      that is required since the net namespace work. Add some
      assertions to verify this, but also don't crash is for
      some reason we don't end up with a vif pointer -- warn
      and drop the packet in all these cases.
      
      Since this code touches a number of hotpaths, it is
      intended to be temporary, or maybe configurable in the
      future, at least the bit that is in the path that gets
      hit for every packet, ieee80211_tx_pending().
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a7bc376c
  17. 25 7月, 2009 2 次提交
    • J
      mac80211: remove master netdev · 3b8d81e0
      Johannes Berg 提交于
      With the internal 'pending' queue system in place, we can simply
      put packets there instead of pushing them off to the master dev,
      getting rid of the master interface completely.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3b8d81e0
    • J
      cfg80211: rework key operation · fffd0934
      Johannes Berg 提交于
      This reworks the key operation in cfg80211, and now only
      allows, from userspace, configuring keys (via nl80211)
      after the connection has been established (in managed
      mode), the IBSS been joined (in IBSS mode), at any time
      (in AP[_VLAN] modes) or never for all the other modes.
      
      In order to do shared key authentication correctly, it
      is now possible to give a WEP key to the AUTH command.
      To configure static WEP keys, these are given to the
      CONNECT or IBSS_JOIN command directly, for a userspace
      SME it is assumed it will configure it properly after
      the connection has been established.
      
      Since mac80211 used to check the default key in IBSS
      mode to see whether or not the network is protected,
      it needs an update in that area, as well as an update
      to make use of the WEP key passed to auth() for shared
      key authentication.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      fffd0934
  18. 16 6月, 2009 1 次提交
    • J
      mac80211: disconnect when user changes channel · 7e9debe9
      Johannes Berg 提交于
      If we do not disconnect when a channel switch is requested,
      we end up eventually detection beacon loss from the AP and
      then disconnecting, without ever really telling the AP, so
      we might just as well disconnect right away.
      
      Additionally, this fixes a problem with iwlwifi where the
      driver will clear some internal state on channel changes
      like this and then get confused when we actually go clear
      that state from mac80211.
      
      It may look like this patch drops the no-IBSS check, but
      that is already handled by cfg80211 in the wext handler it
      provides for IBSS (cfg80211_ibss_wext_siwfreq).
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7e9debe9
  19. 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
  20. 04 6月, 2009 2 次提交
  21. 23 5月, 2009 1 次提交
  22. 21 5月, 2009 1 次提交
    • J
      mac80211: cancel/restart all timers across suspend/resume · 5bb644a0
      Johannes Berg 提交于
      We forgot to cancel all timers in mac80211 when suspending.
      In particular we forgot to deal with some things that can
      cause hardware reconfiguration -- while it is down.
      
      While at it we go ahead and add a warning in ieee80211_sta_work()
      if its run while the suspend->resume cycle is in effect. This
      should not happen and if it does it would indicate there is
      a bug lurking in either mac80211 or mac80211 drivers.
      
      With this now wpa_supplicant doesn't blink when I go to suspend
      and resume where as before there where issues with some timers
      running during the suspend->resume cycle. This caused a lot of
      incorrect assumptions and would at times bring back the device
      in an incoherent, but mostly recoverable, state.
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5bb644a0
  23. 12 5月, 2009 1 次提交
  24. 07 5月, 2009 2 次提交
  25. 23 4月, 2009 4 次提交
    • J
      mac80211: validate TIM IE length (redux) · e7ec86f5
      Johannes Berg 提交于
      The TIM IE must not be shorter than 4 bytes, so verify that
      when parsing it and use the proper type. To ease that adjust
      struct ieee80211_tim_ie to have a virtual bitmap of size
      at least 1.
      
      Also check that the TIM IE is actually present before trying
      to parse it!
      
      Because other people may need the function, make it a static
      inline in ieee80211.h.
      
      (The original "mac80211: validate TIM IE length" was a minimal fix for
      2.6.30.  This purports to be the full, correct fix. -- JWL)
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e7ec86f5
    • J
      nl80211: Add set/get for frag/rts threshold and retry limits · b9a5f8ca
      Jouni Malinen 提交于
      Add new nl80211 attributes that can be used with NL80211_CMD_SET_WIPHY
      and NL80211_CMD_GET_WIPHY to manage fragmentation/RTS threshold and
      retry limits.
      
      Since these values are stored in struct wiphy, remove the local copy
      from mac80211 where feasible (frag & rts threshold). The retry limits
      are currently needed in struct ieee80211_conf, but these could be
      eventually removed since the driver should have access to the values
      in struct wiphy.
      Signed-off-by: NJouni Malinen <j@w1.fi>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      b9a5f8ca
    • J
      mac80211: implement beacon filtering in software · d91f36db
      Johannes Berg 提交于
      Regardless of whether the hardware implements beacon filtering,
      there's no need to process all beacons in software all the time
      throughout the stack (mac80211 does a lot, then cfg80211, then
      in the future possibly userspace).
      
      This patch implements the "best possible" beacon filtering in
      mac80211. "Best possible" means that it can look for changes in
      all requested information elements, and distinguish vendor IEs
      by their OUI.
      
      In the future, we will add nl80211 API for userspace to request
      information elements and vendor IE OUIs to watch -- drivers can
      then implement the best they can do while software implements
      it fully.
      
      It is unclear whether or not this actually saves CPU time, but
      the data is all in the cache already so it should be fairly
      cheap. The additional _testing_, however, has great benefit;
      Without this, and on hardware that doesn't implement beacon
      filtering, wrong assumptions about, for example, scan result
      updates could quickly creep into code.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d91f36db
    • J
      mac80211: add hardware restart function · f2753ddb
      Johannes Berg 提交于
      Some hardware defects may require the hardware to be re-initialised
      completely from scratch. Drivers would need much information (for
      instance the current MAC address, crypto keys, beaconing information,
      etc.) stored duplicated from mac80211 to be able to do this, so let
      mac80211 help them.
      
      The new ieee80211_restart_hw() function requires the same code as
      resuming, so move that code into a new ieee80211_reconfig() function
      in util.c and leave only the suspend code in pm.c.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f2753ddb