1. 24 6月, 2012 1 次提交
    • J
      mac80211: clean up debugging · bdcbd8e0
      Johannes Berg 提交于
      There are a few things that make the logging and
      debugging in mac80211 less useful than it should
      be right now:
       * a lot of messages should be pr_info, not pr_debug
       * wholesale use of pr_debug makes it require *both*
         Kconfig and dynamic configuration
       * there are still a lot of ifdefs
       * the style is very inconsistent, sometimes the
         sdata->name is printed in front
      
      Clean up everything, introducing new macros and
      separating out the station MLME debugging into
      a new Kconfig symbol.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      bdcbd8e0
  2. 20 6月, 2012 1 次提交
  3. 07 6月, 2012 2 次提交
    • J
      mac80211: unify SW/offload remain-on-channel · 2eb278e0
      Johannes Berg 提交于
      Redesign all the off-channel code, getting rid of
      the generic off-channel work concept, replacing
      it with a simple remain-on-channel list.
      
      This fixes a number of small issues with the ROC
      implementation:
       * offloaded remain-on-channel couldn't be queued,
         now we can queue it as well, if needed
       * in iwlwifi (the only user) offloaded ROC is
         mutually exclusive with scanning, use the new
         queue to handle that case -- I expect that it
         will later depend on a HW flag
      
      The bigger issue though is that there's a bad bug
      in the current implementation: if we get a mgmt
      TX request while HW roc is active, and this new
      request has a wait time, we actually schedule a
      software ROC instead since we can't guarantee the
      existing offloaded ROC will still be that long.
      To fix this, the queuing mechanism was needed.
      
      The queuing mechanism for offloaded ROC isn't yet
      optimal, ideally we should add API to have the HW
      extend the ROC if needed. We could add that later
      but for now use a software implementation.
      
      Overall, this unifies the behaviour between the
      offloaded and software-implemented case as much
      as possible.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      2eb278e0
    • J
      mac80211: do remain-on-channel while idle · 196ac1c1
      Johannes Berg 提交于
      The IDLE handling in HW off-channel is broken right
      now since we turn off IDLE only when the off-channel
      period already started. Therefore, all drivers that
      use it today (only iwlwifi!) must support off-channel
      while idle, so playing with idle isn't needed at all.
      
      Off-channel in general, since it's no longer used for
      authentication/association, shouldn't affect PS, so
      also remove that logic.
      
      Also document a small caveat for reporting TX status
      from off-channel frames in HW remain-on-channel.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      196ac1c1
  4. 06 6月, 2012 2 次提交
  5. 05 6月, 2012 1 次提交
  6. 17 5月, 2012 1 次提交
  7. 10 5月, 2012 1 次提交
    • J
      mac80211: Convert compare_ether_addr to ether_addr_equal · b203ca39
      Joe Perches 提交于
      Use the new bool function ether_addr_equal to add
      some clarity and reduce the likelihood for misuse
      of compare_ether_addr for sorting.
      
      Done via cocci script:
      
      $ cat compare_ether_addr.cocci
      @@
      expression a,b;
      @@
      -	!compare_ether_addr(a, b)
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	compare_ether_addr(a, b)
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!ether_addr_equal(a, b) == 0
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!ether_addr_equal(a, b) != 0
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	ether_addr_equal(a, b) == 0
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	ether_addr_equal(a, b) != 0
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!!ether_addr_equal(a, b)
      +	ether_addr_equal(a, b)
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b203ca39
  8. 25 4月, 2012 2 次提交
    • A
      mac80211: Adds clean sdata helper · 94c514fe
      Andrei Emeltchenko 提交于
      Adds hepler to clean sdata ieee80211_clean_sdata similar way as
      ieee80211_setup_sdata is implemented. The function will be used by other
      interfaces later.
      Signed-off-by: NAndrei Emeltchenko <andrei.emeltchenko@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      94c514fe
    • E
      mac80211: call ieee80211_mgd_stop() on interface stop · afa762f6
      Eliad Peller 提交于
      ieee80211_mgd_teardown() is called on netdev removal, which
      occurs after the vif was already removed from the low-level
      driver, resulting in the following warning:
      
      [ 4809.014734] ------------[ cut here ]------------
      [ 4809.019861] WARNING: at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x200/0x2c8 [mac80211]()
      [ 4809.030388] wlan0:  Failed check-sdata-in-driver check, flags: 0x4
      [ 4809.036862] Modules linked in: wlcore_sdio(-) wl12xx wlcore mac80211 cfg80211 [last unloaded: cfg80211]
      [ 4809.046849] [<c001bd4c>] (unwind_backtrace+0x0/0x12c)
      [ 4809.055937] [<c047cf1c>] (dump_stack+0x20/0x24)
      [ 4809.065385] [<c003e334>] (warn_slowpath_common+0x5c/0x74)
      [ 4809.075589] [<c003e408>] (warn_slowpath_fmt+0x40/0x48)
      [ 4809.088291] [<bf033630>] (ieee80211_bss_info_change_notify+0x200/0x2c8 [mac80211])
      [ 4809.102844] [<bf067f84>] (ieee80211_destroy_auth_data+0x80/0xa4 [mac80211])
      [ 4809.116276] [<bf068004>] (ieee80211_mgd_teardown+0x5c/0x74 [mac80211])
      [ 4809.129331] [<bf043f18>] (ieee80211_teardown_sdata+0xb0/0xd8 [mac80211])
      [ 4809.141595] [<c03b5e58>] (rollback_registered_many+0x228/0x2f0)
      [ 4809.153056] [<c03b5f48>] (unregister_netdevice_many+0x28/0x50)
      [ 4809.165696] [<bf041ea8>] (ieee80211_remove_interfaces+0xb4/0xdc [mac80211])
      [ 4809.179151] [<bf032174>] (ieee80211_unregister_hw+0x50/0xf0 [mac80211])
      [ 4809.191043] [<bf0bebb4>] (wlcore_remove+0x5c/0x7c [wlcore])
      [ 4809.201491] [<c02c6918>] (platform_drv_remove+0x24/0x28)
      [ 4809.212029] [<c02c4d50>] (__device_release_driver+0x8c/0xcc)
      [ 4809.222738] [<c02c4e84>] (device_release_driver+0x30/0x3c)
      [ 4809.233099] [<c02c4258>] (bus_remove_device+0x10c/0x128)
      [ 4809.242620] [<c02c26f8>] (device_del+0x11c/0x17c)
      [ 4809.252150] [<c02c6de0>] (platform_device_del+0x28/0x68)
      [ 4809.263051] [<bf0df49c>] (wl1271_remove+0x3c/0x50 [wlcore_sdio])
      [ 4809.273590] [<c03806b0>] (sdio_bus_remove+0x48/0xf8)
      [ 4809.283754] [<c02c4d50>] (__device_release_driver+0x8c/0xcc)
      [ 4809.293729] [<c02c4e2c>] (driver_detach+0x9c/0xc4)
      [ 4809.303163] [<c02c3d7c>] (bus_remove_driver+0xc4/0xf4)
      [ 4809.312973] [<c02c5a98>] (driver_unregister+0x70/0x7c)
      [ 4809.323220] [<c03809c4>] (sdio_unregister_driver+0x24/0x2c)
      [ 4809.334213] [<bf0df458>] (wl1271_exit+0x14/0x1c [wlcore_sdio])
      [ 4809.344930] [<c009b1a4>] (sys_delete_module+0x228/0x2a8)
      [ 4809.354734] ---[ end trace 515290ccf5feb522 ]---
      
      Rename ieee80211_mgd_teardown() to ieee80211_mgd_stop(),
      and call it on ieee80211_do_stop().
      Signed-off-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      afa762f6
  9. 17 4月, 2012 1 次提交
  10. 12 4月, 2012 4 次提交
    • J
      mac80211: clean up an ieee80211_do_open error path · 4d6c36fa
      Johannes Berg 提交于
      Eliad's comment prompted me to look closer at
      the error paths in ieee80211_do_open() and I
      found one that should use the error labels.
      
      Also add a comment about the clear_bit since
      in many error cases the bit hasn't been set.
      
      Cc: Eliad Peller <eliad@wizery.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4d6c36fa
    • J
      mac80211: add improved HW queue control · 3a25a8c8
      Johannes Berg 提交于
      mac80211 currently only supports one hardware queue
      per AC. This is already problematic for off-channel
      uses since if we go off channel while the BE queue
      is full and then try to send an off-channel frame
      the frame will never go out. This will become worse
      when we support multi-channel since then a queue on
      one channel might be full, but we have to stop the
      software queue for all channels. That is obviously
      not desirable.
      
      To address this problem allow drivers to register
      more hardware queues, and allow them to map them to
      virtual interfaces. When they stop a hardware queue
      the corresponding AC software queues on the correct
      interfaces will be stopped as well. Additionally,
      there's an off-channel queue to solve that problem
      and a per-interface after-DTIM beacon queue. This
      allows drivers to manage software queues closer to
      how the hardware works.
      
      Currently, there's a limit of 16 hardware queues.
      This may or may not be sufficient, we can adjust it
      as needed.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3a25a8c8
    • J
      mac80211: add explicit monitor interface if needed · 4b6f1dd6
      Johannes Berg 提交于
      The queue mapping redesign that I'm planning to do
      will break pure injection unless we handle monitor
      interfaces explicitly. One possible option would
      be to have the driver tell mac80211 about monitor
      mode queues etc., but that would duplicate the API
      since we already need to have queue assignments
      handled per virtual interface.
      
      So in order to solve this, have a virtual monitor
      interface that is added whenever all active vifs
      are monitors. We could also use the state of one
      of the monitor interfaces, but managing that would
      be complicated, so allocate separate state.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4b6f1dd6
    • J
      mac80211: manage AP netdev carrier state · 3edaf3e6
      Johannes Berg 提交于
      The AP netdev is really only active when beaconing, so
      manage the carrier state accordingly. Also do that for
      VLAN interfaces enslaved to a given AP interface.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3edaf3e6
  11. 11 4月, 2012 2 次提交
  12. 06 3月, 2012 1 次提交
  13. 28 2月, 2012 1 次提交
  14. 22 2月, 2012 1 次提交
    • M
      mac80211: Fix a warning on changing to monitor mode from STA · 0dee0068
      Mohammed Shafi Shajakhan 提交于
      nothing needs to be done for monitor/AP_VLAN mode on calling
      ieee80211_bss_info_change_notify -> drv_bss_info_changed with the change
      flag 'BSS_CHANGED_IDLE'. 'wl1271' seems to use BSS_CHANGED_IDLE only for
      STA and IBSS mode. further the non-idle state of the monitor mode is
      taken care by the 'count' variable which counts non-idle interfaces.
      ieee80211_idle_off(local, "in use") will be called.
      this fixes the following WARNING when we have initially STA mode
      (network manager running) and not associated, and change it to monitor
      mode with network manager disabled and bringing up the monitor mode.
      this changes the idle state from 'true' (STA unassociated) to 'false'
      (MONITOR mode)
      exposed by the commit 405385f8
      "mac80211: set bss_conf.idle when vif is connected"
      
      	WARNING: net/mac80211/main.c:212
      	ieee80211_bss_info_change_notify+0x1cf/0x330 [mac80211]()
      	Hardware name: 64756D6
      	Pid: 3835, comm: ifconfig Tainted: G           O
      	3.3.0-rc3-wl #9
      	Call Trace:
      	  [<c0133b02>] warn_slowpath_common+0x72/0xa0
      	  [<fc8e8c3f>] ?
      	  ieee80211_bss_info_change_notify+0x1cf/0x330 [mac80211]
      	  [<fc8e8c3f>] ?
      	  ieee80211_bss_info_change_notify+0x1cf/0x330 [mac80211]
      	  [<c0133b52>] warn_slowpath_null+0x22/0x30
      	  [<fc8e8c3f>]
      	  ieee80211_bss_info_change_notify+0x1cf/0x330 [mac80211]
      	  [<fc8f9de3>] __ieee80211_recalc_idle+0x113/0x430
      	  [mac80211]
      	  [<fc8fabc6>] ieee80211_do_open+0x156/0x7e0 [mac80211]
      	  [<fc8f8a25>] ?
      	  ieee80211_check_concurrent_iface+0x25/0x180 [mac80211]
      	  [<c015dd9f>] ? raw_notifier_call_chain+0x1f/0x30
      	  [<fc8fb290>] ieee80211_open+0x40/0x80 [mac80211]
      	  [<c05894f6>] __dev_open+0x96/0xe0
      	  [<c068fba5>] ? _raw_spin_unlock_bh+0x35/0x40
      	  [<c05881d9>] __dev_change_flags+0x109/0x170
      	  [<c0589423>] dev_change_flags+0x23/0x60
      	  [<c05f3770>] devinet_ioctl+0x6a0/0x770
      
       ieee80211 phy0: device no longer idle - in use
      
      Cc: Eliad Peller <eliad@wizery.com>
      Signed-off-by: NMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0dee0068
  15. 07 2月, 2012 2 次提交
    • E
      mac80211: support hw scan while idle · 885bd8ec
      Eliad Peller 提交于
      Currently, mac80211 goes to idle-off before starting a scan.
      However, some devices that implement hw scan might not
      need going idle-off in order to perform a hw scan, and
      thus saving some energy and simplifying their state machine.
      
      (Note that this is also the case for sched scan - it
      currently doesn't make mac80211 go idle-off)
      
      Add a new flag to indicate support for hw scan while idle.
      Signed-off-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      885bd8ec
    • J
      mac80211: redesign auth/assoc · 66e67e41
      Johannes Berg 提交于
      This is the second part of the auth/assoc redesign,
      the mac80211 part. This moves the auth/assoc code
      out of the work abstraction and into the MLME, so
      that we don't flip channels all the time etc.
      
      The only downside is that when we are associated,
      we need to drop the association in order to create
      a connection to another AP, but for most drivers
      this is actually desirable and the ability to do
      was never used by any applications. If we want to
      implement resource reservation with FT-OTA, we'd
      probably best do it with explicit R-O-C in wpa_s.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      66e67e41
  16. 31 1月, 2012 2 次提交
  17. 25 1月, 2012 1 次提交
  18. 16 12月, 2011 1 次提交
    • J
      mac80211: refactor station state transitions · d9a7ddb0
      Johannes Berg 提交于
      Station entries can have various states, the most
      important ones being auth, assoc and authorized.
      This patch prepares us for telling the driver about
      these states, we don't want to confuse drivers with
      strange transitions, so with this we enforce that
      they move in the right order between them (back and
      forth); some transitions might happen before the
      driver even knows about the station, but at least
      runtime transitions will be ordered correctly.
      
      As a consequence, IBSS and MESH stations will now
      have the ASSOC flag set (so they can transition to
      AUTHORIZED), and we can get rid of a special case
      in TX processing.
      
      When freeing a station, unwind the state so that
      other parts of the code (or drivers later) can rely
      on the transitions.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d9a7ddb0
  19. 29 11月, 2011 2 次提交
  20. 18 11月, 2011 1 次提交
  21. 12 11月, 2011 2 次提交
  22. 10 11月, 2011 2 次提交
  23. 09 11月, 2011 1 次提交
  24. 01 10月, 2011 1 次提交
    • J
      mac80211: optimise station flags · c2c98fde
      Johannes Berg 提交于
      The flaglock in struct sta_info has long been
      something that I wanted to get rid of, this
      finally does the conversion to atomic bitops.
      
      The conversion itself is straight-forward in
      most places, a few things needed to change a
      bit since we can no longer use multiple bits
      at the same time.
      
      On x86-64, this is a fairly significant code
      size reduction:
         text	   data	    bss	    dec	    hex
       427861	  23648	   1008	 452517	  6e7a5	before
       425383	  23648	    976	 450007	  6ddd7	after
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c2c98fde
  25. 22 9月, 2011 1 次提交
  26. 14 9月, 2011 1 次提交
  27. 18 8月, 2011 1 次提交
  28. 02 8月, 2011 1 次提交