1. 28 8月, 2010 4 次提交
  2. 26 8月, 2010 1 次提交
  3. 25 8月, 2010 1 次提交
  4. 17 8月, 2010 2 次提交
  5. 21 7月, 2010 2 次提交
  6. 15 6月, 2010 10 次提交
    • J
      mac80211: Fix circular locking dependency in ARP filter handling · 68542962
      Juuso Oikarinen 提交于
      There is a circular locking dependency when configuring the
      hardware ARP filters on association, occurring when flushing the mac80211
      workqueue. This is what happens:
      
      [   92.026800] =======================================================
      [   92.030507] [ INFO: possible circular locking dependency detected ]
      [   92.030507] 2.6.34-04781-g2b2c009e #85
      [   92.030507] -------------------------------------------------------
      [   92.030507] modprobe/5225 is trying to acquire lock:
      [   92.030507]  ((wiphy_name(local->hw.wiphy))){+.+.+.}, at: [<ffffffff8105b5c0>] flush_workq
      ueue+0x0/0xb0
      [   92.030507]
      [   92.030507] but task is already holding lock:
      [   92.030507]  (rtnl_mutex){+.+.+.}, at: [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20
      [   92.030507]
      [   92.030507] which lock already depends on the new lock.
      [   92.030507]
      [   92.030507]
      [   92.030507] the existing dependency chain (in reverse order) is:
      [   92.030507]
      [   92.030507] -> #2 (rtnl_mutex){+.+.+.}:
      [   92.030507]        [<ffffffff810761fb>] lock_acquire+0xdb/0x110
      [   92.030507]        [<ffffffff81341754>] mutex_lock_nested+0x44/0x300
      [   92.030507]        [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20
      [   92.030507]        [<ffffffffa022d47c>] ieee80211_assoc_done+0x6c/0xe0 [mac80211]
      [   92.030507]        [<ffffffffa022f2ad>] ieee80211_work_work+0x31d/0x1280 [mac80211]
      
      [   92.030507] -> #1 ((&local->work_work)){+.+.+.}:
      [   92.030507]        [<ffffffff810761fb>] lock_acquire+0xdb/0x110
      [   92.030507]        [<ffffffff8105a51a>] worker_thread+0x22a/0x370
      [   92.030507]        [<ffffffff8105ecc6>] kthread+0x96/0xb0
      [   92.030507]        [<ffffffff81003a94>] kernel_thread_helper+0x4/0x10
      [   92.030507]
      [   92.030507] -> #0 ((wiphy_name(local->hw.wiphy))){+.+.+.}:
      [   92.030507]        [<ffffffff81075fdc>] __lock_acquire+0x1c0c/0x1d50
      [   92.030507]        [<ffffffff810761fb>] lock_acquire+0xdb/0x110
      [   92.030507]        [<ffffffff8105b60e>] flush_workqueue+0x4e/0xb0
      [   92.030507]        [<ffffffffa023ff7b>] ieee80211_stop_device+0x2b/0xb0 [mac80211]
      [   92.030507]        [<ffffffffa0231635>] ieee80211_stop+0x3e5/0x680 [mac80211]
      
      The locking in this case is quite complex. Fix the problem by rewriting the
      way the hardware ARP filter list is handled - i.e. make a copy of the address
      list to the bss_conf struct, and provide that list to the hardware driver
      when needed.
      
      The current patch will enable filtering also in promiscuous mode. This may need
      to be changed in the future.
      Reported-by: NReinette Chatre <reinette.chatre@intel.com>
      Signed-off-by: NJuuso Oikarinen <juuso.oikarinen@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      68542962
    • J
      mac80211: change RX aggregation locking · a93e3644
      Johannes Berg 提交于
      To prepare for allowing drivers to sleep in
      ampdu_action, change the locking in the RX
      aggregation code to use a mutex, so that it
      would already allow drivers to sleep. But
      explicitly disable BHs around the callback
      for now since the TX part cannot yet sleep,
      and drivers' locking might require it.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a93e3644
    • J
      mac80211: move aggregation callback processing · c1475ca9
      Johannes Berg 提交于
      This moves the aggregation callback processing
      to the per-sdata skb queue and a work function
      rather than the tasklet.
      
      Unfortunately, this means that it extends the
      pkt_type hack to that skb queue. However, it
      will enable making ampdu_action API changes
      gradually, my current plan is to get rid of
      this again by forcing drivers to only return
      from ampdu_action() when everything is done,
      thus removing the callbacks completely.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c1475ca9
    • J
      mac80211: move blockack stop due to fragmentation · 344eec67
      Johannes Berg 提交于
      There's a corner case where we receive a fragmented
      frame during a blockack session, in which case we
      will terminate that session. To simplify future work
      in this area that will culminate in allowing the
      driver callbacks for aggregation to sleep, move the
      processing of this case out of the RX path into the
      interface work.
      
      This will simplify future work because the new place
      for this code doesn't require that the function will
      always be atomic, which the RX path needs.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      344eec67
    • J
      mac80211: always process blockack action from workqueue · bed7ee6e
      Johannes Berg 提交于
      To prepare for making the ampdu_action callback
      sleep, make mac80211 always process blockack
      action frames from the skb queue. This gets rid
      of the current special case for managed mode
      interfaces as well.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      bed7ee6e
    • J
      mac80211: common work skb freeing · 36b3a628
      Johannes Berg 提交于
      All the management processing functions free the
      skb after they are done, so this can be done in
      the new common code instead.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      36b3a628
    • J
      mac80211: use common work function · 1fa57d01
      Johannes Berg 提交于
      Even with the previous patch, IBSS, managed
      and mesh modes all attach their own work
      function to the shared work struct, which
      means some duplicated code. Change that to
      only have a frame processing function and a
      further work function for each of them and
      share some common code.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1fa57d01
    • J
      mac80211: use common work struct · 64592c8f
      Johannes Berg 提交于
      IBSS, managed and mesh modes all have their
      own work struct, and in the future we want
      to also use it in other modes to process
      frames from the now common skb queue.
      
      This also makes the skb queue and work safe
      to use from other interface types.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      64592c8f
    • J
      mac80211: use common skb queue · 35f20c14
      Johannes Berg 提交于
      IBSS, managed and mesh modes all have an
      skb queue, and in the future we want to
      also use it in other modes, so make them
      all use a common skb queue already.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      35f20c14
    • J
      mac80211: simplify station/aggregation code · 2a419056
      Johannes Berg 提交于
      A number of places use RCU locking for accessing
      the station list, even though they do not need
      to. Use mutex locking instead to prepare for the
      locking changes I want to make. The mlme code is
      also using a WLAN_STA_DISASSOC flag that has the
      same meaning as WLAN_STA_BLOCK_BA, so use that.
      
      While doing so, combine places where we loop
      over stations twice, and optimise away some of
      the loops by checking if the hardware supports
      aggregation at all first.
      
      Also fix a more theoretical race condition: right
      now we could resume, set up an aggregation session,
      and right after tear it down again due to the code
      that is needed for hardware reconfiguration here.
      Also mark add a comment to that code marking it as
      a workaround.
      
      Finally, remove a pointless aggregation disabling
      loop when an interface is stopped, directly after
      that we remove all stations from it which will also
      disable all aggregation sessions that may still be
      active, and does so in a race-free way unlike the
      current loop that doesn't block new sessions.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      2a419056
  7. 04 6月, 2010 2 次提交
  8. 04 4月, 2010 1 次提交
    • J
      net: convert multicast list to list_head · 22bedad3
      Jiri Pirko 提交于
      Converts the list and the core manipulating with it to be the same as uc_list.
      
      +uses two functions for adding/removing mc address (normal and "global"
       variant) instead of a function parameter.
      +removes dev_mcast.c completely.
      +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
       manipulation with lists on a sandbox (used in bonding and 80211 drivers)
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22bedad3
  9. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  10. 24 3月, 2010 1 次提交
  11. 10 3月, 2010 1 次提交
  12. 16 2月, 2010 1 次提交
  13. 15 2月, 2010 1 次提交
    • D
      mac80211: Fix error introduced in netdev_mc_count() changes. · 228da6c2
      David S. Miller 提交于
      Commit 4cd24eaf
      ("net: use netdev_mc_count and netdev_mc_empty when appropriate")
      added this hunk to net/mac80211/iface.c:
      
       	__dev_addr_unsync(&local->mc_list, &local->mc_count,
      -			  &dev->mc_list, &dev->mc_count);
      +			  &dev->mc_list, dev->mc_count);
      
      which is definitely not correct, introduced a warning (reported
      by Stephen Rothwell):
      
      net/mac80211/iface.c: In function 'ieee80211_stop':
      net/mac80211/iface.c:416: warning: passing argument 4 of '__dev_addr_unsync' makes pointer from integer without a cast
      include/linux/netdevice.h:1967: note: expected 'int *' but argument is of type 'int'
      
      and is thus reverted here.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      228da6c2
  14. 13 2月, 2010 1 次提交
  15. 20 1月, 2010 1 次提交
  16. 13 1月, 2010 1 次提交
    • J
      cfg80211/mac80211: Use more generic bitrate mask for rate control · 37eb0b16
      Jouni Malinen 提交于
      Extend struct cfg80211_bitrate_mask to actually use a bitfield mask
      instead of just a single fixed or maximum rate index. This change
      itself does not modify the behavior (except for debugfs files), but it
      prepares cfg80211 and mac80211 for a new nl80211 command for setting
      which rates can be used in TX rate control.
      
      Since frames are now going through the rate control algorithm
      unconditionally, the internal IEEE80211_TX_INTFL_RCALGO flag can now
      be removed. The RC implementations can use the rate_idx_mask value to
      optimize their behavior if only a single rate is enabled.
      
      The old max_rate_idx in struct ieee80211_tx_rate_control is maintained
      (but commented as deprecated) for backwards compatibility with existing
      RC implementations. Once these implementations have been updated to
      use the more generic rate_idx_mask, the max_rate_idx value can be
      removed.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      37eb0b16
  17. 12 1月, 2010 1 次提交
    • F
      mac80211: fix queue selection for data frames on monitor interfaces · 193e70ef
      Felix Fietkau 提交于
      When ieee80211_monitor_select_queue encounters data frames, it selects
      the WMM AC based on skb->priority and assumes that skb->priority
      contains a valid 802.1d tag. However this assumption is incorrect, since
      ieee80211_select_queue has not been called at this point.
      If skb->priority > 7, an array overrun occurs, which could lead to
      invalid values, resulting in crashes in the tx path.
      Fix this by setting skb->priority based on the 802.11 header for QoS
      frames and using the default AC for all non-QoS frames.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      193e70ef
  18. 09 1月, 2010 2 次提交
  19. 07 1月, 2010 1 次提交
  20. 06 1月, 2010 2 次提交
    • K
      mac80211: fix ieee80211_change_mac() to use struct sockaddr · fc5f7577
      Kalle Valo 提交于
      Setting the mac address from user space was buggy. For example, when
      executing this command:
      
      ip link set wlan0 address 00:1f:df:88:cd:55
      
      mac80211 used the address 01:00:00:1f:df:88 instead. It was shifted two
      bytes.
      
      The reason was that the addr (type of void *) provided to
      ieee80211_change_mac() is actually of type struct sockaddr, not just the
      mac address array. Also the call to eth_mac_addr() expects the address to
      be struct sockaddr.
      Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      fc5f7577
    • J
      mac80211: fix skb buffering issue · cf0277e7
      Johannes Berg 提交于
      Since I removed the master netdev, we've been
      keeping internal queues only, and even before
      that we never told the networking stack above
      the virtual interfaces about congestion. This
      means that packets are queued in mac80211 and
      the upper layers never know, possibly leading
      to memory exhaustion and other problems.
      
      This patch makes all interfaces multiqueue and
      uses ndo_select_queue to put the packets into
      queues per AC. Additionally, when the driver
      stops a queue, we now stop all corresponding
      queues for the virtual interfaces as well.
      
      The injection case will use VO by default for
      non-data frames, and BE for data frames, but
      downgrade any data frames according to ACM. It
      needs to be fleshed out in the future to allow
      chosing the queue/AC in radiotap.
      Reported-by: NLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Cc: stable@kernel.org [2.6.32]
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      cf0277e7
  21. 29 12月, 2009 3 次提交
    • J
      mac80211: remove struct ieee80211_if_init_conf · 1ed32e4f
      Johannes Berg 提交于
      All its members (vif, mac_addr, type) are now available
      in the vif struct directly, so we can pass that instead
      of the conf struct. I generated this patch (except the
      mac80211 and header file changes) with this semantic
      patch:
      
      @@
      identifier conf, fn, hw;
      type tp;
      @@
      tp fn(struct ieee80211_hw *hw,
      -struct ieee80211_if_init_conf *conf)
      +struct ieee80211_vif *vif)
      {
      <...
      (
      -conf->type
      +vif->type
      |
      -conf->mac_addr
      +vif->addr
      |
      -conf->vif
      +vif
      )
      ...>
      }
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1ed32e4f
    • J
      mac80211: generalise work handling · af6b6374
      Johannes Berg 提交于
      In order to use auth/assoc for different purposes
      other than MLME, it needs to be split up. For other
      purposes, a generic work handling (potentially on
      another channel) will be useful.
      
      To achieve that, this patch moves much of the MLME
      work handling out of mlme into a new work API. The
      API can currently handle probing a specific AP,
      authentication and association. The MLME previously
      handled probe/authentication as one step and will
      continue to do so, but they are separate in the new
      work handling.
      
      Work items are RCU-managed to be able to check for
      existence of an item for a specific frame in the RX
      path, but they can be re-used which the MLME right
      now will do for its combined probe/auth step.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      af6b6374
    • J
      mac80211: introduce flush operation · a80f7c0b
      Johannes Berg 提交于
      We've long lacked a good confirmation that frames
      have really gone out, e.g. before going off-channel
      for a scan. Add a flush() operation that drivers
      can implement to provide that confirmation, and use
      it in a few places:
       * before scanning sends the nullfunc frames
       * after scanning sends the nullfunc frames, if any
       * when going idle, to send any pending frames
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a80f7c0b