An error occurred fetching the project authors.
  1. 10 Jul, 2009 3 commits
  2. 15 Jun, 2009 2 commits
    • Johannes Berg's avatar
      mac80211: disconnect when user changes channel · 7e9debe9
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      7e9debe9
    • Johannes Berg's avatar
      mac80211: add queue debugfs file · db2e6bd4
      Johannes Berg authored
      I suspect that some driver bugs can cause queues to be
      stopped while they shouldn't be, but it's hard to find
      out whether that is the case or not without having any
      visible information about the queues. This adds a file
      to debugfs that allows us to see the queues' statuses.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      db2e6bd4
  3. 10 Jun, 2009 1 commit
    • Johannes Berg's avatar
      mac80211: do not pass PS frames out of mac80211 again · 8f77f384
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      8f77f384
  4. 22 May, 2009 1 commit
  5. 20 May, 2009 3 commits
  6. 13 May, 2009 2 commits
  7. 11 May, 2009 1 commit
  8. 06 May, 2009 4 commits
    • Johannes Berg's avatar
      mac80211: tell driver when idle · 5cff20e6
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      5cff20e6
    • Johannes Berg's avatar
      mac80211: fix probe response processing · 16cf438a
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      16cf438a
    • Johannes Berg's avatar
      mac80211: unify config_interface and bss_info_changed · 2d0ddec5
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      2d0ddec5
    • Johannes Berg's avatar
      mac80211: fix scan races and rework scanning · f3b85252
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      f3b85252
  9. 22 Apr, 2009 11 commits
    • Johannes Berg's avatar
      mac80211: validate TIM IE length (redux) · e7ec86f5
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      e7ec86f5
    • Jouni Malinen's avatar
      nl80211: Add set/get for frag/rts threshold and retry limits · b9a5f8ca
      Jouni Malinen authored
      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: default avatarJouni Malinen <j@w1.fi>
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      b9a5f8ca
    • Johannes Berg's avatar
      cfg80211: clean up includes · d3236553
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      d3236553
    • Johannes Berg's avatar
      mac80211: convert to cfg80211 IBSS API · af8cdcd8
      Johannes Berg authored
      This converts mac80211 to the new cfg80211 IBSS API, the
      wext handling functions are called where appropriate.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      af8cdcd8
    • Johannes Berg's avatar
      mac80211: implement beacon filtering in software · d91f36db
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      d91f36db
    • Johannes Berg's avatar
      mac80211: disable powersave if pm_qos asks for low latency · 10f644a4
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      10f644a4
    • Johannes Berg's avatar
      mac80211: improve powersave implementation · 965bedad
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      965bedad
    • Johannes Berg's avatar
      mac80211: add hardware restart function · f2753ddb
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      f2753ddb
    • Johannes Berg's avatar
      mac80211: pass all probe request IEs to driver · de95a54b
      Johannes Berg authored
      Instead of just passing the cfg80211-requested IEs, pass
      the locally generated ones as well.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      de95a54b
    • Johannes Berg's avatar
      mac80211: move ieee80211_enable_ht function to mlme.c · d5522e03
      Johannes Berg authored
      It really belongs into that file since it is only relevant
      for managed mode. Move 1:1, not even whitespace changes,
      but make it static and remove from header file.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      d5522e03
    • Jouni Malinen's avatar
      nl80211: Add Michael MIC failure event · a3b8b056
      Jouni Malinen authored
      Define a new nl80211 event, NL80211_CMD_MICHAEL_MIC_FAILURE, to be
      used to notify user space about locally detected Michael MIC failures.
      This matches with the MLME-MICHAELMICFAILURE.indication() primitive.
      
      Since we do not actually have TSC in the skb anymore when
      mac80211_ev_michael_mic_failure() is called, that function is changed
      to take in the TSC as an optional parameter instead of as a
      requirement to include the TSC after the hdr field (which we did not
      really follow). For now, TSC is not included in the events from
      mac80211, but it could be added at some point.
      Signed-off-by: default avatarJouni Malinen <j@w1.fi>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      a3b8b056
  10. 28 Mar, 2009 12 commits
    • Johannes Berg's avatar
      mac80211/iwlwifi: move virtual A-MDPU queue bookkeeping to iwlwifi · e4e72fb4
      Johannes Berg authored
      This patch removes all the virtual A-MPDU-queue bookkeeping from
      mac80211. Curiously, iwlwifi already does its own bookkeeping, so
      it doesn't require much changes except where it needs to handle
      starting and stopping the queues in mac80211.
      
      To handle the queue stop/wake properly, we rewrite the software
      queue number for aggregation frames and internally to iwlwifi keep
      track of the queues that map into the same AC queue, and only talk
      to mac80211 about the AC queue. The implementation requires calling
      two new functions, iwl_stop_queue and iwl_wake_queue instead of the
      mac80211 counterparts.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: Reinette Chattre <reinette.chatre@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      e4e72fb4
    • Johannes Berg's avatar
      mac80211: fix aggregation to not require queue stop · cd8ffc80
      Johannes Berg authored
      Instead of stopping the entire AC queue when enabling aggregation
      (which was only done for hardware with aggregation queues) buffer
      the packets for each station, and release them to the pending skb
      queue once aggregation is turned on successfully.
      
      We get a little more code, but it becomes conceptually simpler and
      we can remove the entire virtual queue mechanism from mac80211 in
      a follow-up patch.
      
      This changes how mac80211 behaves towards drivers that support
      aggregation but have no hardware queues -- those drivers will now
      not be handed packets while the aggregation session is being
      established, but only after it has been fully established.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      cd8ffc80
    • Johannes Berg's avatar
      mac80211: rework the pending packets code · 2a577d98
      Johannes Berg authored
      The pending packets code is quite incomprehensible, uses memory barriers
      nobody really understands, etc. This patch reworks it entirely, using
      the queue spinlock, proper stop bits and the skb queues themselves to
      indicate whether packets are pending or not (rather than a separate
      variable like before).
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Reviewed-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      2a577d98
    • Johannes Berg's avatar
      mac80211: rewrite fragmentation · 2de8e0d9
      Johannes Berg authored
      Fragmentation currently uses an allocated array to store the
      fragment skbs, and then keeps track of which have been sent
      and which are still pending etc. This is rather complicated;
      make it simpler by just chaining the fragments into skb->next
      and removing from that list when sent. Also simplifies all
      code that needs to touch fragments, since it now only needs
      to walk the skb->next list.
      
      This is a prerequisite for fixing the stored packet code,
      which I need to do for proper aggregation packet storing.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Reviewed-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      2de8e0d9
    • Kalle Valo's avatar
      mac80211: add beacon filtering support · 04de8381
      Kalle Valo authored
      Add IEEE80211_HW_BEACON_FILTERING flag so that driver inform that it supports
      beacon filtering. Drivers need to call the new function
      ieee80211_beacon_loss() to notify about beacon loss.
      Signed-off-by: default avatarKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      04de8381
    • Kalle Valo's avatar
      mac80211: track beacons separately from the rx path activity · 15b7b062
      Kalle Valo authored
      Separate beacon and rx path tracking in preparation for the beacon filtering
      support. At the same time change ieee80211_associated() to look a bit simpler.
      
      Probe requests are now sent only after IEEE80211_PROBE_IDLE_TIME, which
      is now set to 60 seconds.
      Signed-off-by: default avatarKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      15b7b062
    • Kalle Valo's avatar
      mac80211: decrease execution of the associated timer · 3cf335d5
      Kalle Valo authored
      Currently the timer is triggering every two seconds
      (IEEE80211_MONITORING_INTERVAL). Decrease the timer to only trigger during
      data idle periods to avoid waking up CPU unnecessary. The timer will
      still trigger during idle periods, that needs to be fixed later.
      
      There's also a functional change that probe requests are sent only when the
      data path is idle, earlier they were sent also while there was activity
      on the data path.
      
      This is also preparation for the beacon filtering support. Thanks to
      Johannes Berg for the idea.
      Signed-off-by: default avatarKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      3cf335d5
    • Johannes Berg's avatar
      mac80211: remove mixed-cell and userspace MLME code · 7986cf95
      Johannes Berg authored
      Neither can currently be set from userspace, so there's no
      regression potential, and neither will be supported from
      userspace since the new userspace APIs allow the SME, which
      is in userspace, to control all we need.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      7986cf95
    • Jouni Malinen's avatar
      nl80211: Remove NL80211_CMD_SET_MGMT_EXTRA_IE · 65fc73ac
      Jouni Malinen authored
      The functionality that NL80211_CMD_SET_MGMT_EXTRA_IE provided can now
      be achieved with cleaner design by adding IE(s) into
      NL80211_CMD_TRIGGER_SCAN, NL80211_CMD_AUTHENTICATE,
      NL80211_CMD_ASSOCIATE, NL80211_CMD_DEAUTHENTICATE, and
      NL80211_CMD_DISASSOCIATE.
      
      Since this is a very recently added command and there are no known (or
      known planned) applications using NL80211_CMD_SET_MGMT_EXTRA_IE and
      taken into account how much extra complexity it adds to the IE
      processing we have now (and need to add in the future to fix IE order
      in couple of frames), it looks like the best option is to just remove
      the implementation of this command for now. The enum values themselves
      are left to avoid changing the nl80211 command or attribute numbers.
      Signed-off-by: default avatarJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      65fc73ac
    • Johannes Berg's avatar
      mac80211: resume properly, add suspend/resume test · 827b1fb4
      Johannes Berg authored
      When mac80211 resumes, it currently doesn't reconfigure the interfaces
      entirely and also doesn't reconfigure BSS information -- fix this.
      
      Also, to be able to test this, add a debugfs file that just calls
      the suspend/resume code to see what happens when we go through that,
      without needing the time-consuming suspend/resume cycle.
      
      (Original version broke the build for CONFIG_PM=n.  Define alternative
      functions for that situation. -- JWL)
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      827b1fb4
    • Jouni Malinen's avatar
      nl80211: Add MLME primitives to support external SME · 636a5d36
      Jouni Malinen authored
      This patch adds new nl80211 commands to allow user space to request
      authentication and association (and also deauthentication and
      disassociation). The commands are structured to allow separate
      authentication and association steps, i.e., the interface between
      kernel and user space is similar to the MLME SAP interface in IEEE
      802.11 standard and an user space application takes the role of the
      SME.
      
      The patch introduces MLME-AUTHENTICATE.request,
      MLME-{,RE}ASSOCIATE.request, MLME-DEAUTHENTICATE.request, and
      MLME-DISASSOCIATE.request primitives. The authentication and
      association commands request the actual operations in two steps
      (assuming the driver supports this; if not, separate authentication
      step is skipped; this could end up being a separate "connect"
      command).
      
      The initial implementation for mac80211 uses the current
      net/mac80211/mlme.c for actual sending and processing of management
      frames and the new nl80211 commands will just stop the current state
      machine from moving automatically from authentication to association.
      Future cleanup may move more of the MLME operations into cfg80211.
      
      The goal of this design is to provide more control of authentication and
      association process to user space without having to move the full MLME
      implementation. This should be enough to allow IEEE 802.11r FT protocol
      and 802.11s SAE authentication to be implemented. Obviously, this will
      also bring the extra benefit of not having to use WEXT for association
      requests with mac80211. An example implementation of a user space SME
      using the new nl80211 commands is available for wpa_supplicant.
      
      This patch is enough to get IEEE 802.11r FT protocol working with
      over-the-air mechanism (over-the-DS will need additional MLME
      primitives for handling the FT Action frames).
      Signed-off-by: default avatarJouni Malinen <j@w1.fi>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      636a5d36
    • Johannes Berg's avatar
      mac80211: stop queues across suspend/resume · 25420604
      Johannes Berg authored
      Even though userland probably cannot submit packets, there might
      still be some coming, and that's no good when the driver doesn't
      expect them. Stop the queues across suspend/resume.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      25420604