1. 11 7月, 2009 1 次提交
    • 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
  2. 16 6月, 2009 3 次提交
  3. 11 6月, 2009 3 次提交
  4. 23 5月, 2009 2 次提交
  5. 21 5月, 2009 8 次提交
  6. 14 5月, 2009 3 次提交
  7. 12 5月, 2009 3 次提交
  8. 07 5月, 2009 10 次提交
    • L
      mac80211: Fix sparse warning for ssid_len on ieee80211_sta_config_auth() · 6cfe62cd
      Luis R. Rodriguez 提交于
      net/mac80211/mlme.c:2079:28: warning: symbol 'ssid_len' shadows an earlier one
      net/mac80211/mlme.c:2022:12: originally declared here
      
      ssid_len is already being declared and checked above so there is
      no need for it again.
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      6cfe62cd
    • J
      mac80211: tell driver when idle · 5cff20e6
      Johannes Berg 提交于
      When we aren't doing anything in mac80211, we can turn off
      much of the hardware, depending on the driver/hw. Not doing
      anything, aka being idle, means:
      
       * no monitor interfaces
       * no AP/mesh/wds interfaces
       * any station interfaces are in DISABLED state
       * any IBSS interfaces aren't trying to be in a network
       * we aren't trying to scan
      
      By creating a new function that verifies these conditions and calling
      it at strategic points where the states of those conditions change,
      we can easily make mac80211 tell the driver when we are idle to save
      power.
      
      Additionally, this fixes a small quirk where a recalculated powersave
      state is passed to the driver even if the hardware is about to stopped
      completely.
      
      This patch intentionally doesn't touch radio_enabled because that is
      currently implemented to be a soft rfkill which is inappropriate here
      when we need to be able to wake up with low latency.
      
      One thing I'm not entirely sure about is this:
      
        phy0: device no longer idle - in use
        wlan0: direct probe to AP 00:11:24:91:07:4d try 1
        wlan0 direct probe responded
        wlan0: authenticate with AP 00:11:24:91:07:4d
        wlan0: authenticated
      > phy0: device now idle
      > phy0: device no longer idle - in use
        wlan0: associate with AP 00:11:24:91:07:4d
        wlan0: RX AssocResp from 00:11:24:91:07:4d (capab=0x401 status=0 aid=1)
        wlan0: associated
      
      Is it appropriate to go into idle state for a short time when we have
      just authenticated, but not associated yet? This happens only with the
      userspace SME, because we cannot really know how long it will wait
      before asking us to associate. Would going idle after a short timeout
      be more appropriate? We may need to revisit this, depending on what
      happens.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5cff20e6
    • J
      mac80211: fix probe response processing · 16cf438a
      Johannes Berg 提交于
      Due to the use of a _REQ_DIRECT_PROBE bit, which is
      unnecessary (and I wonder why it was done that way),
      an interesting situation can arise:
       1) we try to probe an access point
       2) the AP doesn't response in time
       3) we tell userspace that we gave up
       4) the AP suddenly responds
       5) we auth/assoc with the AP
      
      I've seen 4) happen in testing with hostapd SIGSTOPped,
      and when SIGCONTinued it processes the probe requests
      that came in and send responses. But 5) is not supposed
      to happen after we tell everybody we've given up on the
      AP.
      
      To fix this, remove the _REQ_DIRECT_PROBE request bit,
      and process probe responses when we're in the relevant
      MLME state, namely IEEE80211_STA_MLME_DIRECT_PROBE.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      16cf438a
    • J
      nl80211: Send timeout event on failed direct probe · e61f2340
      Jouni Malinen 提交于
      If the direct probe times out, we need to send the authentication
      timeout event to notify SME in the same way as we notify on timeout
      with authentication frames since the direct probe is run as part of
      the authentication attempt.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e61f2340
    • J
      mac80211: add driver ops wrappers · 24487981
      Johannes Berg 提交于
      In order to later add tracing or verifications to the driver
      calls mac80211 makes, this patch adds static inline wrappers
      for all operations.
      
      All calls are now written as
      
      	drv_<op>(local, ...);
      
      instead of
      
      	local->ops-><op>(&local->hw, ...);
      
      Where necessary, the wrappers also do existence checking and
      return default values as appropriate.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      24487981
    • J
      mac80211: unify config_interface and bss_info_changed · 2d0ddec5
      Johannes Berg 提交于
      The config_interface method is a little strange, it contains the
      BSSID and beacon updates, while bss_info_changed contains most
      other BSS information for each interface. This patch removes
      config_interface and rolls all the information it previously
      passed to drivers into bss_info_changed.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      2d0ddec5
    • J
      mac80211: clean up beacon interval settings · 57c4d7b4
      Johannes Berg 提交于
      We currently have two beacon interval configuration knobs:
      hw.conf.beacon_int and vif.bss_info.beacon_int. This is
      rather confusing, even though the former is used when we
      beacon ourselves and the latter when we are associated to
      an AP.
      
      This just deprecates the hw.conf.beacon_int setting in favour
      of always using vif.bss_info.beacon_int. Since it touches all
      the beaconing IBSS code anyway, we can also add support for
      the cfg80211 IBSS beacon interval configuration easily.
      
      NOTE: The hw.conf.beacon_int setting is retained for now due
            to drivers still using it -- I couldn't untangle all
            drivers, some are updated in this patch.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      57c4d7b4
    • J
      mac80211: fix scan races and rework scanning · f3b85252
      Johannes Berg 提交于
      There are some places marked
      	/* XXX maybe racy? */
      and they really are racy because there's no locking.
      
      This patch reworks much of the scan code, and introduces proper
      locking for the scan request as well as the internal scanning
      (which is necessary for IBSS/managed modes). Helper functions
      are added to call the scanning code whenever necessary. The
      scan deferring is changed to simply queue the scanning work
      instead of trying to start the scan in place, the scanning work
      will then take care of the rest.
      
      Also, currently when internal scans are requested for an interface
      that is trying to associate, we reject such scans. This was not
      intended, the mlme code has provisions to scan twice when it can't
      find the BSS to associate with right away; this has never worked
      properly. Fix this by not rejecting internal scan requests for an
      interface that is associating.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f3b85252
    • J
      mac80211: rename max_sleep_interval to max_sleep_period · 9ccebe61
      Johannes Berg 提交于
      Kalle points out that max_sleep_interval is somewhat confusing
      because the value is measured in beacon intervals, and not in
      TU. Rename it to max_sleep_period to be consistent with things
      like DTIM period that are also measured in beacon intervals.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      9ccebe61
    • J
      mac80211: fix PS vs. scan race · d5edaedc
      Johannes Berg 提交于
      When somebody changes the PS parameters while scanning
      is in progress, we enable PS -- during the scan. This
      is clearly not desirable, and we can just abort enabling
      PS when scanning since when the scan finishes it will
      be taken care of.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Reviewed-by: NKalle Valo <kalle.valo@iki.fi>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d5edaedc
  9. 23 4月, 2009 7 次提交
    • J
      nl80211: Add event for authentication/association timeout · 1965c853
      Jouni Malinen 提交于
      SME needs to be notified when the authentication or association
      attempt times out and MLME has stopped processing in order to allow
      the SME to decide what to do next.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1965c853
    • J
      mac80211: calculate maximum sleep interval · 04fe2037
      Johannes Berg 提交于
      The maximum sleep interval, for powersave purposes, is
      determined by the DTIM period (it may not be larger)
      and the required networking latency (it must be small
      enough to fulfil those constraints).
      
      This makes mac80211 calculate the maximum sleep interval
      based on those constraints, and pass it to the driver.
      Then the driver should instruct the device to sleep at
      most that long.
      
      Note that the device is responsible for aligning the
      maximum sleep interval between DTIMs, we make sure it's
      not longer but it needs to make sure it's between them.
      
      Also, group some powersave documentation together and
      make it more explicit that we support managed mode only,
      and no IBSS powersaving (yet).
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      04fe2037
    • J
      mac80211: fix variable truncation on 32-bit · 1d4df3a5
      Johannes Berg 提交于
      Stephen Rothwell reported these warnings from a 32-bit build:
      
        net/mac80211/mlme.c:1771: warning: left shift count >= width of type
        net/mac80211/mlme.c:1772: warning: left shift count >= width of type
        net/mac80211/mlme.c:1773: warning: left shift count >= width of type
        net/mac80211/mlme.c:1774: warning: left shift count >= width of type
        net/mac80211/mlme.c:1775: warning: left shift count >= width of type
      
      This shows a bug in my code -- BIT(X) uses just "1 << X" which means
      a 32-bit integer on 32-bit platforms, but the code here needs a u64
      on all platforms. Fix this by using "1ULL << X" instead of BIT(X).
      
      Thanks Stephen!
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1d4df3a5
    • 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
      cfg80211/mac80211: move wext SIWMLME into cfg80211 · 691597cb
      Johannes Berg 提交于
      Since we have ->deauth and ->disassoc we can support the
      wext SIWMLME call directly without driver wext handlers.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      691597cb
    • J
      mac80211: enable PS by default · bbbdff9e
      Johannes Berg 提交于
      Enable PS by default (depending on Kconfig) -- rely on drivers
      to control the level using pm_qos. Due to the previous patch
      we turn off PS when necessary due to latency requirements.
      
      This has a Kconfig symbol so people can, if they really want,
      configure the default in their kernels. We may want to keep it
      at "default y" only in wireless-testing for a while.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      bbbdff9e
    • 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