1. 12 11月, 2009 1 次提交
  2. 03 11月, 2009 1 次提交
    • J
      cfg80211: validate scan channels · 584991dc
      Johannes Berg 提交于
      Currently it is possible to request a scan on only
      disabled channels, which could be problematic for
      some drivers. Reject such scans, and also ignore
      disabled channels that are given. This resuls in
      the scan begin/end event only including channels
      that are actually used.
      
      This makes the mac80211 check for disabled channels
      superfluous. At the same time, remove the no-IBSS
      check from mac80211 -- nothing says that we should
      not find any networks on channels that cannot be
      used for an IBSS, even when operating in IBSS mode.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      584991dc
  3. 09 10月, 2009 1 次提交
  4. 08 10月, 2009 2 次提交
  5. 29 8月, 2009 2 次提交
  6. 14 8月, 2009 4 次提交
  7. 30 7月, 2009 3 次提交
    • J
      cfg80211: combine iwfreq implementations · 0e82ffe3
      Johannes Berg 提交于
      Until now we implemented iwfreq for managed mode, we
      needed to keep the implementations separate, but now
      that we have all versions implemented we can combine
      them and export just one handler.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0e82ffe3
    • J
      nl80211: add missing parameter clearing · c0b2bbd8
      Johannes Berg 提交于
      Jouni and Maxim reported an oops when using wpa_supplicant -Dnl80211,
      which seems to be due to random data being contained in the crypto
      settings for the assoc() command. This seems to be due to the missing
      memset here, so add it -- it's certainly missing but I'm not 100%
      certain that it will fix the problem.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c0b2bbd8
    • J
      cfg80211: fix circular lock dependency (1) · bc43b28c
      Johannes Berg 提交于
      Luis reported this lockdep complaint, that he had also
      reported earlier but when trying to analyse I had been
      locking at the wrong code, and never saw the problem:
      
      (slightly abridged)
      =======================================================
      [ INFO: possible circular locking dependency detected ]
      2.6.31-rc4-wl #6
      -------------------------------------------------------
      wpa_supplicant/3799 is trying to acquire lock:
       (cfg80211_mutex){+.+.+.}, at: [<ffffffffa009246a>] cfg80211_get_dev_from_ifindex+0x1a/0x90 [cfg80211]
      
      but task is already holding lock:
       (rtnl_mutex){+.+.+.}, at: [<ffffffff81400ff2>] rtnl_lock+0x12/0x20
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (rtnl_mutex){+.+.+.}:
             [<ffffffff810857b6>] __lock_acquire+0xd76/0x12b0
             [<ffffffff81085dd3>] lock_acquire+0xe3/0x120
             [<ffffffff814ee7a4>] mutex_lock_nested+0x44/0x350
             [<ffffffff81400ff2>] rtnl_lock+0x12/0x20
             [<ffffffffa009f6a5>] nl80211_send_reg_change_event+0x1f5/0x2a0 [cfg80211]
             [<ffffffffa009529e>] set_regdom+0x28e/0x4c0 [cfg80211]
      
      -> #0 (cfg80211_mutex){+.+.+.}:
             [<ffffffff8108587b>] __lock_acquire+0xe3b/0x12b0
             [<ffffffff81085dd3>] lock_acquire+0xe3/0x120
             [<ffffffff814ee7a4>] mutex_lock_nested+0x44/0x350
             [<ffffffffa009246a>] cfg80211_get_dev_from_ifindex+0x1a/0x90 [cfg80211]
             [<ffffffffa009813f>] get_rdev_dev_by_info_ifindex+0x6f/0xa0 [cfg80211]
             [<ffffffffa009b12b>] nl80211_set_interface+0x3b/0x260 [cfg80211]
      
      When looking at the correct code, the problem is quite
      obvious. I'm not entirely sure which code paths lead
      here, so until I can analyse it better let's just use
      RCU to avoid the problem.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      bc43b28c
  8. 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
  9. 25 7月, 2009 4 次提交
    • J
      nl80211: report BSS status · 48ab905d
      Johannes Berg 提交于
      When connected to a BSS, or joined to an IBSS, we'll want
      to know in userspace without using wireless extensions, so
      report the BSS status in the BSS list. Userspace can query
      the BSS list, display all the information and retrieve the
      station information as well.
      
      For example (from hwsim):
      
      $ iw dev wlan1 scan dump
      BSS 02:00:00:00:00:00 (on wlan1) -- associated
      	freq: 2462
      	beacon interval: 100
      	capability: ESS ShortSlotTime (0x0401)
      	signal: -50.00 dBm
      	SSID: j
      	Supported rates: 1.0* 2.0* 5.5* 11.0* 6.0 9.0 12.0 18.0
      	DS Paramater set: channel 11
      	ERP: <no flags>
      	Extended supported rates: 24.0 36.0 48.0 54.0
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      48ab905d
    • 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
    • J
      nl80211: introduce new key attributes · b9454e83
      Johannes Berg 提交于
      We will soon want to nest key attributes into
      some new attribute for configuring static WEP
      keys at connect() and ibss_join() time, so we
      need nested attributes for that. However, key
      attributes right now are 'global'. This patch
      thus introduces new nested attributes for the
      key settings and functions for parsing them.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      b9454e83
    • J
      cfg80211: fix two buglets · 4bde0f7d
      Johannes Berg 提交于
      This fixes two small bugs:
       1) the connect variable is already initialised, and the
          assignment to auth_type overwrites the previous setting
          with a wrong value
       2) when all authentication attempts fail, we need to report
          that we couldn't connect
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4bde0f7d
  10. 22 7月, 2009 1 次提交
  11. 13 7月, 2009 1 次提交
    • J
      genetlink: make netns aware · 134e6375
      Johannes Berg 提交于
      This makes generic netlink network namespace aware. No
      generic netlink families except for the controller family
      are made namespace aware, they need to be checked one by
      one and then set the family->netnsok member to true.
      
      A new function genlmsg_multicast_netns() is introduced to
      allow sending a multicast message in a given namespace,
      for example when it applies to an object that lives in
      that namespace, a new function genlmsg_multicast_allns()
      to send a message to all network namespaces (for objects
      that do not have an associated netns).
      
      The function genlmsg_multicast() is changed to multicast
      the message in just init_net, which is currently correct
      for all generic netlink families since they only work in
      init_net right now. Some will later want to work in all
      net namespaces because they do not care about the netns
      at all -- those will have to be converted to use one of
      the new functions genlmsg_multicast_allns() or
      genlmsg_multicast_netns() whenever they are made netns
      aware in some way.
      
      After this patch families can easily decide whether or
      not they should be available in all net namespaces. Many
      genl families us it for objects not related to networking
      and should therefore be available in all namespaces, but
      that will have to be done on a per family basis.
      
      Note that this doesn't touch on the checkpoint/restart
      problem where network namespaces could be used, genl
      families and multicast groups are numbered globally and
      I see no easy way of changing that, especially since it
      must be possible to multicast to all network namespaces
      for those families that do not care about netns.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      134e6375
  12. 11 7月, 2009 15 次提交
  13. 08 7月, 2009 1 次提交
  14. 19 6月, 2009 3 次提交