1. 05 8月, 2009 3 次提交
    • 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
    • M
      mac80211: Retry probe request few times · a43abf29
      Maxim Levitsky 提交于
      Retry 5 times  (chosen arbitary ), before assuming
      that station is out of range.
      
      Fixes frequent disassociations while connected to weak,
      and sometimes even strong access points.
      Signed-off-by: NMaxim Levitky <maximlevitsky@gmail.com>
      Acked-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a43abf29
    • 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
  2. 30 7月, 2009 1 次提交
  3. 28 7月, 2009 4 次提交
  4. 25 7月, 2009 3 次提交
    • 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
      mac80211: monitor the connection · b291ba11
      Johannes Berg 提交于
      With the recent MLME rework I accidentally removed the connection
      monitoring code. In order to add it back, this patch will add new
      code to monitor both for beacon loss and for the connection actually
      working, with possibly separate triggers.
      
      When no unicast frames have been received from the AP for (currently)
      two seconds, we will send the AP a probe request. Also, when we don't
      see beacons from the AP for two seconds, we do the same (but those
      times need not be the same due to the way the code is now written).
      
      Additionally, clean up the parameters to the ieee80211_set_disassoc()
      function that I need here, those are all useless except sdata.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      b291ba11
    • 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
  5. 11 7月, 2009 8 次提交
  6. 16 6月, 2009 2 次提交
  7. 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
  8. 23 5月, 2009 1 次提交
  9. 21 5月, 2009 3 次提交
  10. 14 5月, 2009 2 次提交
  11. 12 5月, 2009 1 次提交
  12. 07 5月, 2009 4 次提交
    • 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
      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: 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
  13. 23 4月, 2009 7 次提交
    • 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
      cfg80211: clean up includes · d3236553
      Johannes Berg 提交于
      Trying to separate header files into net/wireless.h and
      net/cfg80211.h has been a source of confusion. Remove
      net/wireless.h (because there also is the linux/wireless.h)
      and subsume everything into net/cfg80211.h -- except the
      definitions for regulatory structures which get moved to
      a new header net/regulatory.h.
      
      The "new" net/cfg80211.h is now divided into sections.
      
      There are no real changes in this patch but code shuffling
      and some very minor documentation fixes.
      
      I have also, to make things reflect reality, put in a
      copyright line for Luis to net/regulatory.h since that
      is probably exclusively written by him but was formerly
      in a file that only had my copyright line.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d3236553
    • J
      mac80211: convert to cfg80211 IBSS API · af8cdcd8
      Johannes Berg 提交于
      This converts mac80211 to the new cfg80211 IBSS API, the
      wext handling functions are called where appropriate.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      af8cdcd8
    • 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: disable powersave if pm_qos asks for low latency · 10f644a4
      Johannes Berg 提交于
      When an application asks for a latency lower than the beacon interval
      there's nothing we can do -- we need to stay awake and not have the
      AP buffer frames for us. Add code to automatically calculate this
      constraint in mac80211 so drivers need not concern themselves with it.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      10f644a4
    • J
      mac80211: improve powersave implementation · 965bedad
      Johannes Berg 提交于
      When you have multiple virtual interfaces the current
      implementation requires setting them up properly from
      userspace, which is undesirable when we want to default
      to power save mode. Keep track of powersave requested
      from userspace per managed mode interface, and only
      enable powersave globally when exactly one managed mode
      interface is active and has powersave turned on.
      
      Second, only start the dynPS timer when PS is turned
      on, and properly turn it off when PS is turned off.
      
      Third, fix the scan_sdata abuse in the dynps code.
      
      Finally, also reorder the code and refactor the code
      that enables PS or the dynps timer instead of having
      it copied in two places.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      965bedad