1. 14 8月, 2009 3 次提交
    • J
      cfg80211: check for and abort dangling scan requests · 36e6fea8
      Johannes Berg 提交于
      If you trigger a scan request on an interface and then
      take it down, or rmmod the module or unplug the device
      the driver might "forget" to cancel the scan request.
      That is a bug in the driver, but the current behaviour
      is that we just hang endlessly waiting for the netdev
      refcount to become 0 which it never will. To improve
      robustness, check for this situation in cfg80211, warn
      about it and clean up behind the driver. I don't just
      clean up silently because it's likely that the driver
      also has some internal state it has now leaked.
      
      Additionally, this fixes a locking bug, clearing the
      scan_req pointer should be done under the rdev lock.
      
      Finally, we also need to _wait_ for the scan work and
      not just abort it since it might be pending and wanting
      to do a cleanup.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      36e6fea8
    • J
      cfg80211: fix alignment problem in scan request · 5ba63533
      Johannes Berg 提交于
      The memory layout for scan requests was rather wrong,
      we put the scan SSIDs before the channels which could
      lead to the channel pointers being unaligned in memory.
      It turns out that using a pointer to the channel array
      isn't necessary anyway since we can embed a zero-length
      array into the struct.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5ba63533
    • J
      nl80211: add generation number to all dumps · f5ea9120
      Johannes Berg 提交于
      In order for userspace to be able to figure out whether
      it obtained a consistent snapshot of data or not when
      using netlink dumps, we need to have a generation number
      in each dump message that indicates whether the list has
      changed or not -- its value is arbitrary.
      
      This patch adds such a number to all dumps, this needs
      some mac80211 involvement to keep track of a generation
      number to start with when adding/removing mesh paths or
      stations.
      
      The wiphy and netdev lists can be fully handled within
      cfg80211, of course, but generation numbers need to be
      stored there as well.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f5ea9120
  2. 04 8月, 2009 1 次提交
  3. 30 7月, 2009 1 次提交
  4. 28 7月, 2009 2 次提交
    • H
      cfg80211: increase scan result expire time · 09f97e0f
      Helmut Schaa 提交于
      Using background scanning in mac80211 the time a scan needs to
      finish can exceed 10 seconds. Hence, increase the scan results
      expire time to 15 seconds which should be sufficient.
      Signed-off-by: NHelmut Schaa <helmut.schaa@googlemail.com>
      Acked-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      09f97e0f
    • 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
  5. 22 7月, 2009 1 次提交
    • C
      cfg80211: double free in __cfg80211_scan_done · 9e81eccf
      Christian Lamparter 提交于
      This patch fixes a double free corruption in __cfg80211_scan_done:
      
       ================================================
       BUG kmalloc-512: Object already free
       ------------------------------------------------
      
       INFO: Allocated in load_elf_binary+0x18b/0x19af age=6
       INFO: Freed in load_elf_binary+0x104e/0x19af age=5
       INFO: Slab 0xffffea0001bae4c0 objects=14 used=7
       INFO: Object 0xffff88007e8a9918 @offset=6424 fp=0xffff88007e8a9488
      
       Bytes b4 0xffff88007e8a9908:  00 00 00 00 00 00 00 00 5a 5a
       [...]
       Pid: 28705, comm: rmmod Tainted: P         C 2.6.31-rc2-wl #1
       Call Trace:
        [<ffffffff810da9f4>] print_trailer+0x14e/0x16e
        [<ffffffff810daa56>] object_err+0x42/0x61
        [<ffffffff810dbcd9>] __slab_free+0x2af/0x396
        [<ffffffffa0ec9694>] ? wiphy_unregister+0x92/0x142 [cfg80211]
        [<ffffffff810dd5e3>] kfree+0x13c/0x17a
        [<ffffffffa0ec9694>] ? wiphy_unregister+0x92/0x142 [cfg80211]
        [<ffffffffa0ec9694>] wiphy_unregister+0x92/0x142 [cfg80211]
        [<ffffffffa0eed163>] ieee80211_unregister_hw+0xc8/0xff [mac80211]
        [<ffffffffa0f3fbc8>] p54_unregister_common+0x31/0x66 [p54common]
        [...]
       FIX kmalloc-512: Object at 0xffff88007e8a9918 not freed
      
      The code path which leads to the *funny* double free:
      
             request = rdev->scan_req;
             dev = dev_get_by_index(&init_net, request->ifidx);
      	/*
      	 * the driver was unloaded recently and
      	 * therefore dev_get_by_index will return NULL!
      	 */
              if (!dev)
                      goto out;
      	[...]
      	rdev->scan_req = NULL; /* not executed... */
      	[...]
       out:
              kfree(request);
      Signed-off-by: NChristian Lamparter <chunkeey@web.de>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      9e81eccf
  6. 11 7月, 2009 5 次提交
  7. 08 7月, 2009 1 次提交
  8. 04 6月, 2009 1 次提交
  9. 07 5月, 2009 2 次提交
  10. 05 5月, 2009 1 次提交
  11. 23 4月, 2009 2 次提交
  12. 18 4月, 2009 2 次提交
  13. 28 3月, 2009 1 次提交
  14. 28 2月, 2009 4 次提交
    • L
      cfg80211: Add AP beacon regulatory hints · e38f8a7a
      Luis R. Rodriguez 提交于
      When devices are world roaming they cannot beacon or do active scan
      on 5 GHz or on channels 12, 13 and 14 on the 2 GHz band. Although
      we have a good regulatory API some cards may _always_ world roam, this
      is also true when a system does not have CRDA present. Devices doing world
      roaming can still passive scan, if they find a beacon from an AP on
      one of the world roaming frequencies we make the assumption we can do
      the same and we also remove the passive scan requirement.
      
      This adds support for providing beacon regulatory hints based on scans.
      This works for devices that do either hardware or software scanning.
      If a channel has not yet been marked as having had a beacon present
      on it we queue the beacon hint processing into the workqueue.
      
      All wireless devices will benefit from beacon regulatory hints from
      any wireless device on a system including new devices connected to
      the system at a later time.
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e38f8a7a
    • J
      cfg80211: clean up signal type · 77965c97
      Johannes Berg 提交于
      It wasn't a good idea to make the signal type a per-BSS option,
      although then it is closer to the actual value. Move it to be
      a per-wiphy setting, update mac80211 to match.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      77965c97
    • J
      cfg80211/mac80211: fill qual.qual value/adjust max_qual.qual · a77b8552
      Johannes Berg 提交于
      Due to various bugs in the software stack we end up having
      to fill qual.qual; level should be used, but wpa_supplicant
      doesn't properly ignore qual.qual, NM should use qual.level
      regardless of that because qual.qual is 0 but doesn't handle
      IW_QUAL_DBM right now.
      
      So fill qual.qual with the qual.level value clamped to
      -110..-40 dBm or just the regular 'unspecified' signal level.
      This requires a mac80211 change to properly announce the
      max_qual.qual and avg_qual.qual values.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a77b8552
    • D
      cfg80211: age scan results on resume · cb3a8eec
      Dan Williams 提交于
      Scanned BSS entries are timestamped with jiffies, which doesn't
      increment across suspend and hibernate.  On resume, every BSS in the
      scan list looks like it was scanned within the last 10 seconds,
      irregardless of how long the machine was actually asleep.  Age scan
      results on resume with the time spent during sleep so userspace has a
      clue how old they really are.
      Signed-off-by: NDan Williams <dcbw@redhat.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      cb3a8eec
  15. 14 2月, 2009 4 次提交