1. 27 Mar, 2009 2 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
  2. 27 Feb, 2009 1 commit
    • Johannes Berg's avatar
      mac80211: fix aggregation for hardware with ampdu queues · 96f5e66e
      Johannes Berg authored
      
      
      Hardware with AMPDU queues currently has broken aggregation.
      
      This patch fixes it by making all A-MPDUs go over the regular AC queues,
      but keeping track of the hardware queues in mac80211. As a first rough
      version, it actually stops the AC queue for extended periods of time,
      which can be removed by adding buffering internal to mac80211, but is
      currently not a huge problem because people rarely use multiple TIDs
      that are in the same AC (and iwlwifi currently doesn't operate as AP).
      
      This is a short-term fix, my current medium-term plan, which I hope to
      execute soon as well, but am not sure can finish before .30, looks like
      this:
       1) rework the internal queuing layer in mac80211 that we use for
          fragments if the driver stopped queue in the middle of a fragmented
          frame to be able to queue more frames at once (rather than just a
          single frame with its fragments)
       2) instead of stopping the entire AC queue, queue up the frames in a
          per-station/per-TID queue during aggregation session initiation,
          when the session has come up take all those frames and put them
          onto the queue from 1)
       3) push the ampdu queue layer abstraction this patch introduces in
          mac80211 into the driver, and remove the virtual queue stuff from
          mac80211 again
      
      This plan will probably also affect ath9k in that mac80211 queues the
      frames instead of passing them down, even when there are no ampdu queues.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      96f5e66e
  3. 13 Feb, 2009 1 commit
    • Johannes Berg's avatar
      mac80211: fix aggregation timer lockups · 55687e38
      Johannes Berg authored
      
      
      As far as I can tell, there are possible lockups because both the RX
      session_timer and TX addba_resp_timer are del_timer_sync'ed under
      the sta spinlock which both timer functions take. Additionally, the
      TX agg code seems to leak memory when TX aggregation is not disabled
      before the sta_info is freed.
      
      Fix this by making the free code a little smarter in the RX agg case,
      and actually make the sta_info_destroy code free the TX agg info in
      the TX agg case. We won't notify the peer, but it'll notice something
      is wrong anyway, and normally this only happens after we've told it
      in some other way we will no longer talk to it.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      55687e38
  4. 05 Dec, 2008 1 commit
    • Shaddy Baddah's avatar
      mac80211: use unaligned safe memcmp() in-place of compare_ether_addr() · 5cf12e8d
      Shaddy Baddah authored
      
      
      After fixing zd1211rw: use unaligned safe memcmp() in-place of
      compare_ether_addr(), I started to see kernel log messages detailing
      unaligned access:
      
        Kernel unaligned access at TPC[100f7f44] sta_info_get+0x24/0x68 [mac80211]
      
      As with the aforementioned patch, the unaligned access was eminating
      from a compare_ether_addr() call. Concerned that whilst it was safe to
      assume that unalignment was the norm for the zd1211rw, and take
      preventative measures, it may not be the case or acceptable to use the
      easy fix of changing the call to memcmp().
      
      My research however indicated that it was OK to do this, as there are
      a few instances where memcmp() is the preferred mechanism for doing
      mac address comparisons throughout the module.
      Signed-off-by: default avatarShaddy Baddah <shaddy_baddah@hotmail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      5cf12e8d
  5. 31 Oct, 2008 1 commit
  6. 27 Oct, 2008 1 commit
  7. 14 Oct, 2008 1 commit
    • Johannes Berg's avatar
      mac80211: fix debugfs lockup · 63044e9f
      Johannes Berg authored
      
      
      When debugfs_create_dir fails, sta_info_debugfs_add_work will not
      terminate because it will find the same station again and again.
      This is possible whenever debugfs fails for whatever reason; one
      reason is a race condition in mac80211, unfortunately we cannot
      do much about it, so just document it, it just means some station
      may be missing from debugfs.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: Robin Holt <holt@sgi.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      63044e9f
  8. 24 Sep, 2008 1 commit
    • Johannes Berg's avatar
      mac80211: clean up rate control API · 4b7679a5
      Johannes Berg authored
      
      
      Long awaited, hard work. This patch totally cleans up the rate control
      API to remove the requirement to include internal headers outside of
      net/mac80211/.
      
      There's one internal use in the PID algorithm left for mesh networking,
      we'll have to figure out a way to clean that one up and decide how to
      do the peer link evaluation, possibly independent of the rate control
      algorithm or via new API.
      
      Additionally, ath9k is left using the cross-inclusion hack for now, we
      will add new API where necessary to make this work properly, but right
      now I'm not expert enough to do it. It's still off better than before.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      4b7679a5
  9. 15 Sep, 2008 3 commits
  10. 14 Jul, 2008 1 commit
    • Johannes Berg's avatar
      mac80211: make master netdev handling sane · 3e122be0
      Johannes Berg authored
      
      
      Currently, almost every interface type has a 'bss' pointer
      pointing to BSS information. This BSS information, however,
      is for a _local_ BSS, not for the BSS we joined, so having
      it on a STA mode interface makes little sense, but now they
      have it pointing to the master device, which is an AP mode
      virtual interface. However, except for some bitrate control
      data, this pointer is only used in AP/VLAN modes (for power
      saving stations.)
      
      Overall, it is not necessary to even have the master netdev
      be a valid virtual interface, and it doesn't have to be on
      the list of interfaces either.
      
      This patch changes the master netdev to be special, it now
       - no longer is on the list of virtual interfaces, which
         lets me remove a lot of tests for that
       - no longer has sub_if_data attached, since that isn't used
      
      Additionally, this patch changes some vlan/ap mode handling
      that is related to these 'bss' pointers described above (but
      in the VLAN case they actually make sense because there they
      point to the AP they belong to); it also adds some debugging
      code to IEEE80211_DEV_TO_SUB_IF to validate it is not called
      on the master netdev any more.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      3e122be0
  11. 08 Jul, 2008 1 commit
  12. 02 Jul, 2008 1 commit
  13. 26 Jun, 2008 1 commit
  14. 21 May, 2008 2 commits
  15. 14 May, 2008 1 commit
    • Johannes Berg's avatar
      mac80211: proper STA info locking · 07346f81
      Johannes Berg authored
      
      
      As discussed earlier, we can unify locking in struct sta_info
      and use just a single spinlock protecting all members of the
      structure that need protection. Many don't, but one of the
      especially bad ones is the 'flags' member that can currently
      be clobbered when RX and TX is being processed on different
      CPUs at the same time.
      
      Because having four spinlocks for different, mostly exclusive
      parts of a single structure is overkill, this patch also kills
      the ampdu and mesh plink spinlocks and uses just a single one
      for everything. Because none of the spinlocks are nested, this
      is safe.
      
      It remains to be seen whether or not we should make the sta
      flags use atomic bit operations instead, for now though this
      is a safe thing and using atomic operations instead will be
      very simple using the new static inline functions this patch
      introduces for accessing sta->flags.
      
      Since spin_lock_bh() is used with this lock, there shouldn't
      be any contention even if aggregation is enabled at around the
      same time as both requires frame transmission/reception which
      is in a bh context.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: Tomas Winkler <tomasw@gmail.com>
      Cc: Ron Rindjunsky <ron.rindjunsky@intel.com>
      Cc: Luis Carlos Cobo <luisca@cozybit.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      07346f81
  16. 07 May, 2008 1 commit
    • Johannes Berg's avatar
      mac80211: QoS related cleanups · e100bb64
      Johannes Berg authored
      
      
      This
       * makes the queue number passed to drivers a u16
         (as it will be with skb_get_queue_mapping)
       * removes the useless queue number defines
       * splits hw->queues into hw->queues/ampdu_queues
       * removes the debugfs files for per-queue counters
       * removes some dead QoS code
       * removes the beacon queue configuration for IBSS
         so that the drivers now never get a queue number
         bigger than (hw->queues + hw->ampdu_queues - 1)
         for tx and only in the range 0..hw->queues-1 for
         conf_tx.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      e100bb64
  17. 08 Apr, 2008 5 commits
    • Johannes Berg's avatar
      mac80211: rename files · 2c8dccc7
      Johannes Berg authored
      
      
      This patch renames all mac80211 files (except ieee80211_i.h) to get rid
      of the useless ieee80211_ prefix.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      2c8dccc7
    • Johannes Berg's avatar
      mac80211: fix key vs. sta locking problems · 3b96766f
      Johannes Berg authored
      
      
      Up to now, key manipulation is supposed to run under RTNL to
      avoid concurrent manipulations and also allow the set_key()
      hardware callback to sleep. This is not feasible because STA
      structs are rcu-protected and thus a lot of operations there
      cannot take the RTNL. Also, key references are rcu-protected
      so we cannot do things atomically.
      
      This patch changes key locking completely:
       * key operations are now atomic
       * hardware crypto offload is enabled and disabled from
         a workqueue, due to that key freeing is also delayed
       * debugfs code is also run from a workqueue
       * keys reference STAs (and vice versa!) so during STA
         unlink the STAs key reference is removed but not the
         keys STA reference, to avoid races key todo work is
         run before STA destruction.
       * fewer STA operations now need the RTNL which was
         required due to key operations
      
      This fixes the locking problems lockdep pointed out and also
      makes things more light-weight because the rtnl isn't required
      as much.
      
      Note that the key todo lock/key mutex are global locks, this
      is not required, of course, they could be per-hardware instead.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      3b96766f
    • Johannes Berg's avatar
      mac80211: fix sta-info pinning · 7d1559f1
      Johannes Berg authored
      
      
      When a STA is supposed to be unlinked but is pinned, it still needs
      to be unlinked from all structures. Only at the end of the unlink
      process should we check for pin status and invalidate the callers
      reference if it is pinned. Move the pin status check down.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      7d1559f1
    • Jiri Slaby's avatar
      mac80211: fix defined but not used · 4d6141c3
      Jiri Slaby authored
      
      
      These two symbols are used only in ifdeffed function. Move them to that
      section too.
      net/mac80211/sta_info.c:387: warning: `__sta_info_pin' defined but not used
      net/mac80211/sta_info.c:397: warning: `__sta_info_unpin' defined but not used
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Cc: Michael Wu <flamingice@sourmilk.net>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Cc: Jiri Benc <jbenc@suse.cz>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      4d6141c3
    • Johannes Berg's avatar
      mac80211: fix possible sta-debugfs work lockup · 49ec6fa2
      Johannes Berg authored
      
      
      Because we queue the sta-debugfs-adding work on our mac80211
      workqueue (which needs to be flushed under RTNL) and that work
      needs the RTNL, it can currently deadlock, thanks to Reinette
      Chatre for pointing out the lockdep warning about this.
      
      This patch fixes it by moving this work to the common kernel
      workqueue (using schedule_work) and canceling it as appropriate.
      
      It also fixes a related problem: When a STA is pinned by the
      debugfs adding work and sta_info_flush() runs concurrently
      it is not guaranteed that all STAs are removed from the driver
      before the corresponding interface is removed which may lead
      to bugs.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: Reinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      49ec6fa2
  18. 01 Apr, 2008 5 commits
  19. 27 Mar, 2008 1 commit
  20. 06 Mar, 2008 9 commits