1. 05 8月, 2009 4 次提交
    • 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: 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
    • 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
    • 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
  2. 30 7月, 2009 1 次提交
  3. 28 7月, 2009 1 次提交
    • J
      cfg80211: make aware of net namespaces · 463d0183
      Johannes Berg 提交于
      In order to make cfg80211/nl80211 aware of network namespaces,
      we have to do the following things:
      
       * del_virtual_intf method takes an interface index rather
         than a netdev pointer - simply change this
      
       * nl80211 uses init_net a lot, it changes to use the sender's
         network namespace
      
       * scan requests use the interface index, hold a netdev pointer
         and reference instead
      
       * we want a wiphy and its associated virtual interfaces to be
         in one netns together, so
          - we need to be able to change ns for a given interface, so
            export dev_change_net_namespace()
          - for each virtual interface set the NETIF_F_NETNS_LOCAL
            flag, and clear that flag only when the wiphy changes ns,
            to disallow breaking this invariant
      
       * when a network namespace goes away, we need to reparent the
         wiphy to init_net
      
       * cfg80211 users that support creating virtual interfaces must
         create them in the wiphy's namespace, currently this affects
         only mac80211
      
      The end result is that you can now switch an entire wiphy into
      a different network namespace with the new command
      	iw phy#<idx> set netns <pid>
      and all virtual interfaces will follow (or the operation fails).
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      463d0183
  4. 25 7月, 2009 2 次提交
    • J
      cfg80211: fix unregistration · 6682588a
      Johannes Berg 提交于
      The work that we cancel there requires the cfg80211_mutex,
      so we can't cancel it under the mutex, which is fine, we
      can just move it to after the locked section.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      6682588a
    • J
      cfg80211: rework key operation · fffd0934
      Johannes Berg 提交于
      This reworks the key operation in cfg80211, and now only
      allows, from userspace, configuring keys (via nl80211)
      after the connection has been established (in managed
      mode), the IBSS been joined (in IBSS mode), at any time
      (in AP[_VLAN] modes) or never for all the other modes.
      
      In order to do shared key authentication correctly, it
      is now possible to give a WEP key to the AUTH command.
      To configure static WEP keys, these are given to the
      CONNECT or IBSS_JOIN command directly, for a userspace
      SME it is assumed it will configure it properly after
      the connection has been established.
      
      Since mac80211 used to check the default key in IBSS
      mode to see whether or not the network is protected,
      it needs an update in that area, as well as an update
      to make use of the WEP key passed to auth() for shared
      key authentication.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      fffd0934
  5. 11 7月, 2009 13 次提交
  6. 11 6月, 2009 1 次提交
  7. 04 6月, 2009 1 次提交
  8. 21 5月, 2009 2 次提交
  9. 14 5月, 2009 1 次提交
    • J
      cfg80211: implement wext key handling · 08645126
      Johannes Berg 提交于
      Move key handling wireless extension ioctls from mac80211 to cfg80211
      so that all drivers that implement the cfg80211 operations get wext
      compatibility.
      
      Note that this drops the SIOCGIWENCODE ioctl support for getting
      IW_ENCODE_RESTRICTED/IW_ENCODE_OPEN. This means that iwconfig will
      no longer report "Security mode:open" or "Security mode:restricted"
      for mac80211. However, what we displayed there (the authentication
      algo used) was actually wrong -- linux/wireless.h states that this
      setting is meant to differentiate between "Refuse non-encoded packets"
      and "Accept non-encoded packets".
      
      (Combined with "cfg80211: fix a couple of bugs with key ioctls". -- JWL)
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      08645126
  10. 12 5月, 2009 1 次提交
  11. 23 4月, 2009 4 次提交
    • J
      cfg80211: clear WEXT SSID when clearing IBSS · 9d308429
      Johannes Berg 提交于
      When we leave an IBSS, we should clear the SSID and not just the
      BSSID, but since WEXT allows configuring while the interface is
      down we must not clear it when leaving due to taking the iface
      down, so some complications are needed.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      9d308429
    • J
      nl80211: Add set/get for frag/rts threshold and retry limits · b9a5f8ca
      Jouni Malinen 提交于
      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: NJouni Malinen <j@w1.fi>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      b9a5f8ca
    • J
      cfg80211: clean up includes · d3236553
      Johannes Berg 提交于
      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: NJohannes Berg <johannes@sipsolutions.net>
      Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d3236553
    • J
      cfg80211/nl80211: add IBSS API · 04a773ad
      Johannes Berg 提交于
      This adds IBSS API along with (preliminary) wext handlers.
      The wext handlers can only do IBSS so you need to call them
      from your own wext handlers if the mode is IBSS.
      
      The nl80211 API requires
       * an SSID
       * a channel (frequency) for the case that a new IBSS
         has to be created
      
      It optionally supports
       * a flag to fix the channel
       * a fixed BSSID
      
      The cfg80211 code also takes care to leave the IBSS before
      the netdev is set down. If wireless extensions are used, it
      also caches values when the interface is down and instructs
      the driver to join when the interface is set up.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      04a773ad
  12. 28 3月, 2009 1 次提交
  13. 17 3月, 2009 2 次提交
  14. 28 2月, 2009 6 次提交