1. 05 8月, 2009 18 次提交
    • 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
    • J
      cfg80211: clear SSID on disconnect/no connection · 8dadadb7
      Johannes Berg 提交于
      The SME state machine in cfg80211 uses the SSID stored
      in struct wireless_dev internally, but fails to clear
      it in multiple places (when giving up on a connection
      attempt and when disconnecting). This doesn't matter to
      the SME state machine, but does matter for IBSS. Thus,
      in those cases, clear the SSID to avoid messing up the
      IBSS state machine.
      Reported-by: NJoerg Albert <jal2@gmx.de>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8dadadb7
    • T
      rfkill: add the GPS radio type · 3ad20149
      Tomas Winkler 提交于
      Althoug GPS is a technology w/o transmitting radio
      and thus not a primary candidate for rfkill switch,
      rfkill gives unified interface point for devices with
      wireless technology.
      
      The input key is not supplied as it is too be deprecated.
      
      Cc: johannes@sipsolutions.net
      Signed-off-by: NTomas Winkler <tomas.winkler@intel.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3ad20149
    • M
      mac80211: Increase timeouts for station polling · d1c5091f
      Maxim Levitsky 提交于
      Do a probe request every 30 seconds, and wait for probe response,
      half a second This should lower the traffic that card sends, thus save
      power Wainting longer for response makes probe more robust against
      'slow' access points
      Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Acked-by: NJohannes Berg <johannes@sipsolutions.net>
      Tested-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d1c5091f
    • 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
    • J
      cfg80211: lower dynamic PS timeout to 100ms · 75e6c3b7
      Johannes Berg 提交于
      The default of 500ms is pretty high, and leads
      to the device being awake at least 50% of the
      time under such light traffic conditions as a
      simple 1 second interval ping. Reduce to just
      100ms -- it should have a similar effect while
      providing a better sleep time.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Reviewed-by: NKalle Valo <kalle.valo@iki.fi>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      75e6c3b7
    • L
      cfg80211: enable country IE support to all cfg80211 drivers · 8b19e6ca
      Luis R. Rodriguez 提交于
      Since the bss is always set now once we are connected, if the
      bss has its own information element we refer to it and pass that
      instead of relying on mac80211's parsing.
      
      Now all cfg80211 drivers get country IE support, automatically and
      we reduce the call overhead that we had on mac80211 which called this
      upon every beacon and instead now call this only upon a successfull
      connection by a STA on cfg80211.
      Acked-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8b19e6ca
    • L
      cfg80211: decouple regulatory variables from cfg80211_mutex · abc7381b
      Luis R. Rodriguez 提交于
      We change regulatory code to be protected by its own regulatory
      mutex and alleviate cfg80211_mutex to only be used to protect
      cfg80211_rdev_list, the registered device list.
      
      By doing this we will be able to work on regulatory core components
      without having to have hog up the cfg80211_mutex. An example here is
      we no longer need to use the cfg80211_mutex during driver specific
      wiphy_apply_custom_regulatory(). We also no longer need it for the
      the country IE regulatory hint; by doing so we end up curing this
      new lockdep warning:
      
      =======================================================
      [ INFO: possible circular locking dependency detected ]
      2.6.31-rc4-wl #12
      -------------------------------------------------------
      phy1/1709 is trying to acquire lock:
       (cfg80211_mutex){+.+.+.}, at: [<ffffffffa00af852>] regulatory_hint_11d+0x32/0x3f0 [cfg80211]
      
      but task is already holding lock:
       (&ifmgd->mtx){+.+.+.}, at: [<ffffffffa0144228>] ieee80211_sta_work+0x108/0x10f0 [mac80211]
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #3 (&ifmgd->mtx){+.+.+.}:
             [<ffffffff810857b6>] __lock_acquire+0xd76/0x12b0
             [<ffffffff81085dd3>] lock_acquire+0xe3/0x120
             [<ffffffff814eeae4>] mutex_lock_nested+0x44/0x350
             [<ffffffffa0141bb8>] ieee80211_mgd_auth+0x108/0x1f0 [mac80211]
             [<ffffffffa0148563>] ieee80211_auth+0x13/0x20 [mac80211]
             [<ffffffffa00bc3a1>] __cfg80211_mlme_auth+0x1b1/0x2a0 [cfg80211]
             [<ffffffffa00bc516>] cfg80211_mlme_auth+0x86/0xc0 [cfg80211]
             [<ffffffffa00b368d>] nl80211_authenticate+0x21d/0x230 [cfg80211]
             [<ffffffff81416ba6>] genl_rcv_msg+0x1b6/0x1f0
             [<ffffffff81415c39>] netlink_rcv_skb+0x89/0xb0
             [<ffffffff814169d9>] genl_rcv+0x29/0x40
             [<ffffffff8141591d>] netlink_unicast+0x29d/0x2b0
             [<ffffffff81416514>] netlink_sendmsg+0x214/0x300
             [<ffffffff813e4407>] sock_sendmsg+0x107/0x130
             [<ffffffff813e45b9>] sys_sendmsg+0x189/0x320
             [<ffffffff81011f82>] system_call_fastpath+0x16/0x1b
             [<ffffffffffffffff>] 0xffffffffffffffff
      
      -> #2 (&wdev->mtx){+.+.+.}:
             [<ffffffff810857b6>] __lock_acquire+0xd76/0x12b0
             [<ffffffff81085dd3>] lock_acquire+0xe3/0x120
             [<ffffffff814eeae4>] mutex_lock_nested+0x44/0x350
             [<ffffffffa00ab304>] cfg80211_netdev_notifier_call+0x1a4/0x390 [cfg80211]
             [<ffffffff814f3dff>] notifier_call_chain+0x3f/0x80
             [<ffffffff81075a91>] raw_notifier_call_chain+0x11/0x20
             [<ffffffff813f665a>] dev_open+0x10a/0x120
             [<ffffffff813f59bd>] dev_change_flags+0x9d/0x1e0
             [<ffffffff8144eb6e>] devinet_ioctl+0x6fe/0x760
             [<ffffffff81450204>] inet_ioctl+0x94/0xc0
             [<ffffffff813e25fa>] sock_ioctl+0x6a/0x290
             [<ffffffff8111e911>] vfs_ioctl+0x31/0xa0
             [<ffffffff8111ea9a>] do_vfs_ioctl+0x8a/0x5c0
             [<ffffffff8111f069>] sys_ioctl+0x99/0xa0
             [<ffffffff81011f82>] system_call_fastpath+0x16/0x1b
             [<ffffffffffffffff>] 0xffffffffffffffff
      
      -> #1 (&rdev->mtx){+.+.+.}:
             [<ffffffff810857b6>] __lock_acquire+0xd76/0x12b0
             [<ffffffff81085dd3>] lock_acquire+0xe3/0x120
             [<ffffffff814eeae4>] mutex_lock_nested+0x44/0x350
             [<ffffffffa00ac4d0>] cfg80211_get_dev_from_ifindex+0x60/0x90 [cfg80211]
             [<ffffffffa00b21ff>] get_rdev_dev_by_info_ifindex+0x6f/0xa0 [cfg80211]
             [<ffffffffa00b51eb>] nl80211_set_interface+0x3b/0x260 [cfg80211]
             [<ffffffff81416ba6>] genl_rcv_msg+0x1b6/0x1f0
             [<ffffffff81415c39>] netlink_rcv_skb+0x89/0xb0
             [<ffffffff814169d9>] genl_rcv+0x29/0x40
             [<ffffffff8141591d>] netlink_unicast+0x29d/0x2b0
             [<ffffffff81416514>] netlink_sendmsg+0x214/0x300
             [<ffffffff813e4407>] sock_sendmsg+0x107/0x130
             [<ffffffff813e45b9>] sys_sendmsg+0x189/0x320
             [<ffffffff81011f82>] system_call_fastpath+0x16/0x1b
             [<ffffffffffffffff>] 0xffffffffffffffff
      
      other info that might help us debug this:
      
      3 locks held by phy1/1709:
       #0:  ((wiphy_name(local->hw.wiphy))){+.+.+.}, at: [<ffffffff8106b45d>] worker_thread+0x19d/0x340
       #1:  (&ifmgd->work){+.+.+.}, at: [<ffffffff8106b45d>] worker_thread+0x19d/0x340
       #2:  (&ifmgd->mtx){+.+.+.}, at: [<ffffffffa0144228>] ieee80211_sta_work+0x108/0x10f0 [mac80211]
      Reported-by: NReinette Chatre <reinette.chatre@intel.com>
      Acked-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      abc7381b
    • L
      cfg80211: do not iterate over rdev list on country IE hint · 4b44c8bc
      Luis R. Rodriguez 提交于
      Simplify the country IE hint code by just bailing out if
      a previous country IE has been issued. We currently just trust
      the first AP we connect to on any card. The idea was to perform
      conflict resolution within this routine but since we can no longer
      iterate over the registered device list here we leave conflict
      resolution to be dealt with at a later time on the workqueue.
      
      This code has no functional changes other than saving us an
      interation over the registered device list when a second card
      is connected, or you unplug and connect the same one, and a
      country IE is received. This would have been done upon every
      beacon received.
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4b44c8bc
    • L
      cfg80211: use goto out on country IE reg hint failure · 9828b017
      Luis R. Rodriguez 提交于
      This has no functional changes.
      Acked-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      9828b017
    • J
      mac80211: fix powersave · 056508dc
      Johannes Berg 提交于
      Some of the recent MLME rework I did broke powersave
      because the ps_sdata isn't assigned at the right time,
      and the work item wasn't removed from the list before
      calling ieee80211_recalc_ps(). To be more specific,
      this broke the case where you'd enabled PS before
      associating, either automatically or with iwconfig.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      056508dc
    • J
      cfg80211: fix NETDEV_UNREGISTER notifier · e40cbdac
      Johannes Berg 提交于
      It's possible to get the NETDEV_UNREGISTER callback multiple
      times (see net/core/dev.c:netdev_wait_allrefs) and this will
      completely mess up our cleanup code. To avoid that, clean up
      only when the interface is still on the wiphy interface list
      from which it's removed on the first NETDEV_UNREGISTER call.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e40cbdac
    • 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
    • J
      mac80211: fix sparse warnings/errors · 57c9fff3
      Johannes Berg 提交于
      sparse complains about a shadowed variable, which
      we can just rename, and lots of stuff if the API
      tracer is enabled, so kick out the tracer code in
      a sparse run -- the macros just confuse it.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      57c9fff3
    • J
      cfg80211: keep track of current_bss for userspace SME · df7fc0f9
      Johannes Berg 提交于
      When a userspace SME is active, we're currently not
      keeping track of the BSS properly for reporting the
      current link and for internal use. Additionally, it
      looks like there is a possible BSS leak in that the
      BSS never gets removed from auth_bsses[]. To fix it,
      pass the BSS struct to __cfg80211_connect_result in
      this case.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      df7fc0f9
    • B
      mac80211: disable beacons before removing the associated interface · 97af7432
      Bob Copeland 提交于
      When downing interfaces, it's a good idea to tell the driver to
      stop sending beacons; that way the driver doesn't need special
      code in ops->remove_interface() when it should already handle the
      case in bss_info_changed().
      
      This fixes a potential crash with at least ath5k since the vif
      pointer will be nullified while beacon interrupts are still active.
      Signed-off-by: NBob Copeland <me@bobcopeland.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      97af7432
    • L
    • J
      mac80211: disable software retry for now · 4da163ab
      Johannes Berg 提交于
      Pavel Roskin reported a problem that seems to be due to
      software retry of already transmitted frames. It turns
      out that we've never done that correctly, but due to
      some recent changes it now crashes in the TX code. I've
      added a comment in the patch that explains the problem
      better and also points to possible solutions -- which
      I can't implement right now.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4da163ab
  2. 03 8月, 2009 3 次提交
  3. 31 7月, 2009 5 次提交
  4. 30 7月, 2009 11 次提交
  5. 28 7月, 2009 3 次提交
    • L
      mac80211: fix oops due to missing private data · 21f5fc75
      Luis R. Rodriguez 提交于
      This was caused by patch:
      
      "mac80211: cooperate more with network namespaces"
      
      The version of the patch applied doesn't match Johannes' latest:
      
      http://johannes.sipsolutions.net/patches/kernel/all/LATEST/NNN-mac80211-netns.patch
      
      The skb->cb virtual interface data wasn't being reset for
      reuse so ath9k pooped out when trying to dereference the
      private rate control info from the skb.
      
      BUG: unable to handle kernel NULL pointer dereference
      RIP: 0010:[<ffffffffa0258173>] ath_tx_rc_status+0x33/0x150 [ath9k]
      <-- snip etc -->
      Reported-by: NDavide Pesavento <davidepesa@gmail.com>
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      21f5fc75
    • J
      mac80211: fix PS-poll response, race · 3fa52056
      Johannes Berg 提交于
      When a station queries us for a PS-poll response, we wrongly
      queue the frame on the virtual interface's queue rather than
      the pending queue.
      
      Additionally, fix a race condition where we could potentially
      send multiple frames to the sleeping station due to using a
      station flag rather than a packet flag. When converting to a
      packet flag, we can also convert p54 and remove the filter
      clearing we added for it.
      
      (Also remove a now dead function)
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Reported-by: NBob Copeland <me@bobcopeland.com>
      Tested-by: NBob Copeland <me@bobcopeland.com>
      Cc: Christian Lamparter <chunkeey@web.de>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3fa52056
    • L
      mac80211: fix MLME issuing of probe requests while scanning · 91a3bd76
      Luis R. Rodriguez 提交于
      We were issuing probe requests to the associated AP on the wrong
      band by having our beacon timer loss trigger while we are scanning.
      When we would scan the timer could hit and force us to send a
      probe request to the AP but with a chance we'd be on the wrong band.
      
      This leads to finding no usable bitrate but we should not get so
      far on the xmit path. We should not be trying to send these probe
      request frames so prevent ieee80211_mgd_probe_ap() from sending
      these.
      
      As it turns out all callers of ieee80211_mgd_probe_ap() need this
      check so we just move the scan check there. This means we can remove
      the recenlty added check during ieee80211_sta_monitor_work().
      
      Additionally we now fix a race condition added by the patch
      "mac80211: do not monitor the connection while scanning" which
      had the same check in ieee80211_sta_conn_mon_timer(). The race
      happens because the timer routine *does* a valid check for
      scanning but after it queues work into the mac80211 workqueue
      the work callback can kick off with scanning enabled and cause
      the same issue we were trying to avoid.
      
      The more appropriate solution would be to disable the respective
      timers during scan and re-enable them after scan but requires more
      complex code and testing.
      
      Cc: Christian Lamparter <chunkeey@web.de>
      Cc: Larry Finger <Larry.Finger@lwfinger.net>
      Reported-by: NFabio Rossi <rossi.f@inwind.it>
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      91a3bd76