15 May, 2012

1 commit


10 May, 2012

1 commit

  • Use the new bool function ether_addr_equal to add
    some clarity and reduce the likelihood for misuse
    of compare_ether_addr for sorting.

    I removed a conversion from scan.c/cmp_bss_core
    that appears to be a sorting function.

    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: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

09 May, 2012

1 commit

  • Since the BSS table is organized in a RB tree, the BSSs need to be
    comparable. This means that we must define a < and > operator to
    the BSS object.
    compare_ethr_addr isn't enough since it returns only a binary value.

    Since Felix's

    cfg80211: use compare_ether_addr on MAC addresses instead of memcmp

    Because of the constant size and guaranteed 16 bit alignment, the inline
    compare_ether_addr function is much cheaper than calling memcmp.

    Signed-off-by: Felix Fietkau
    Signed-off-by: John W. Linville

    The BSS table is corrupted: rb_find_bss can't find the bss.
    As a result BSSes are duplicated in the BSS table, and we get stuck
    while probing an AP before associating (in STA mode).

    Change-Id: I85928756f4328028230832c1565ece7f412f3843
    CC: Felix Fietkau
    Signed-off-by: Emmanuel Grumbach
    Acked-by: Felix Fietkau
    Signed-off-by: John W. Linville

    Emmanuel Grumbach
     

17 Apr, 2012

1 commit

  • The background scan completion takes more time when the station is
    having heavy uplink traffic. The scan state machine decides to fall
    back to home channel on every off-channel visit when there are pending
    frames in tx queue. bgscan completion took ~30sec on dual band US
    regulatory card.

    scan period = (20 active channels * probe timeout) +
    (12 passive channels * passive probe timeout) +
    (32 * timeout on home channel) +
    (32 * flush timeout)

    Signed-off-by: Rajkumar Manoharan
    Signed-off-by: John W. Linville

    Rajkumar Manoharan
     

10 Apr, 2012

1 commit


14 Mar, 2012

1 commit


07 Feb, 2012

1 commit

  • This is needed by mac80211 to keep a reference
    to a BSS alive for the auth process. Remove the
    old version of cfg80211_ref_bss() since it's
    not actually used.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

12 Nov, 2011

1 commit

  • The problem with PSM when a hidden SSID was used was originally
    reported by Juuso Oikarinen.

    - When generally scanning, the AP is getting a bss entry with
    a zero SSID.
    - When associating, a probe-req is sent to the AP with the SSID,
    and as a result a probe-response is received with the hidden
    SSID in place. As a consequence, a second bss entry is created
    for the AP, now with the real SSID.
    - After association, mac80211 executes ieee80211_recalc_ps(),
    but does not switch to powersave because the beacon-ies are missing.

    As result, the STA does not ever enter PSM.

    The patch merges in beacon ies of hidden bss from beacon to the probe
    response, creating a consistent set of ies in place.

    Patch is depended on "cfg80211: fix cmp_ies" made by Johannes.

    Signed-off-by: Dmitry Tarnyagin
    Signed-off-by: John W. Linville

    Dmitry Tarnyagin
     

08 Nov, 2011

1 commit

  • When comparing two items by IE, the sort order
    wasn't stable, which could lead to issues in the
    rbtree. Make it stable by making a missing IE
    sort before a present IE.

    Also sort by length first if it differs and then
    by contents.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

20 Sep, 2011

1 commit


09 Aug, 2011

1 commit


21 Jul, 2011

1 commit

  • commit 58389c69150e6032504dfcd3edca6b1975c8b5bc
    Author: Johannes Berg
    Date: Mon Jul 18 18:08:35 2011 +0200

    cfg80211: allow userspace to control supported rates in scan

    made single-band cards crash since it would always
    access all wiphy->bands[]. Fix this and reject any
    attempts in the new helper ieee80211_get_ratemask()
    to do the same, rejecting rates configuration for
    unsupported bands.

    Reported-by: Pavel Roskin
    Tested-by: Pavel Roskin
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

20 Jul, 2011

1 commit

  • Some P2P scans are not allowed to advertise
    11b rates, but that is a rather special case
    so instead of having that, allow userspace
    to request the rate sets (per band) that are
    advertised in scan probe request frames.

    Since it's needed in two places now, factor
    out some common code parsing a rate array.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

12 Jul, 2011

1 commit


08 Jul, 2011

1 commit


06 Jul, 2011

2 commits

  • If the 'driver_initiated' function argument to
    __cfg80211_stop_sched_scan() is not 0 then we'll return an
    uninitialized 'err' from the function.

    Signed-off-by: Jesper Juhl
    Signed-off-by: John W. Linville

    Jesper Juhl
     
  • There was a deadlock when rfkill-blocking a wireless interface,
    because we were locking the rdev mutex on NETDEV_GOING_DOWN to stop
    sched_scans that were eventually running. The rfkill block code was
    already holding a mutex under rdev:

    kernel: =======================================================
    kernel: [ INFO: possible circular locking dependency detected ]
    kernel: 3.0.0-rc1-00049-g1fa7b6a #57
    kernel: -------------------------------------------------------
    kernel: kworker/0:1/4525 is trying to acquire lock:
    kernel: (&rdev->mtx){+.+.+.}, at: [] cfg80211_netdev_notifier_call+0x131/0x5b0
    kernel:
    kernel: but task is already holding lock:
    kernel: (&rdev->devlist_mtx){+.+.+.}, at: [] cfg80211_rfkill_set_block+0x4f/0xa0
    kernel:
    kernel: which lock already depends on the new lock.

    To fix this, add a new mutex specifically for sched_scan, to protect
    the sched_scan_req element in the rdev struct, instead of using the
    global rdev mutex.

    Reported-by: Duane Griffin
    Signed-off-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Luciano Coelho
     

02 Jun, 2011

1 commit

  • Commit 0a35d36 ("cfg80211: Use capability info to detect mesh beacons")
    assumed that probe response with both ESS and IBSS bits cleared
    means that the frame was sent by a mesh sta.

    However, these capabilities are also being used in the p2p_find phase,
    and the mesh-validation broke it.

    Rename the WLAN_CAPABILITY_IS_MBSS macro, and verify that mesh ies
    exist before assuming this frame was sent by a mesh sta.

    Signed-off-by: Eliad Peller
    Signed-off-by: John W. Linville

    Eliad Peller
     

13 May, 2011

1 commit

  • When sched_scan_stopped was called by the driver, mac80211 calls
    cfg80211, which in turn was calling mac80211 back with a flag
    "driver_initiated". This flag was used so that mac80211 would do the
    necessary cleanup but would not call the driver. This was enough to
    prevent the bounce back between the driver and mac80211, but not
    between mac80211 and cfg80211.

    To fix this, we now do the cleanup in mac80211 before calling
    cfg80211. To help with locking issues, the workqueue was moved from
    cfg80211 to mac80211.

    Reported-by: Johannes Berg
    Signed-off-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Luciano Coelho
     

12 May, 2011

2 commits

  • Implement new functionality for scheduled scan offload. With this feature we
    can scan automatically at certain intervals.

    The idea is that the hardware can perform scan automatically and filter on
    desired results without waking up the host unnecessarily.

    Add NL80211_CMD_START_SCHED_SCAN and NL80211_CMD_STOP_SCHED_SCAN
    commands to the nl80211 interface. When results are available they are
    reported by NL80211_CMD_SCHED_SCAN_RESULTS events. The userspace is
    informed when the scheduled scan has stopped with a
    NL80211_CMD_SCHED_SCAN_STOPPED event, which can be triggered either by
    the driver or by a call to NL80211_CMD_STOP_SCHED_SCAN.

    Signed-off-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Luciano Coelho
     
  • Mesh beacons no longer use all-zeroes BSSID. Beacon frames for MBSS,
    infrastructure BSS, or IBSS are differentiated by the Capability
    Information field in the Beacon frame. A mesh STA sets the ESS and IBSS
    subfields to 0 in transmitted Beacon or Probe Response management
    frames.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     

29 Mar, 2011

2 commits

  • This patch adds to the fix "fix BSS double-unlinking"
    (commit 3207390a8b58bfc1335750f91cf6783c48ca19ca) by Johannes Berg.

    It turns out, that the double-unlinking scenario can also occur if expired
    BSS elements are removed whilst an interface is performing association.

    To work around that, replace list_del with list_del_init also in the
    "cfg80211_bss_expire" function, so that the check for whether the BSS still is
    in the list works correctly in cfg80211_unlink_bss.

    Signed-off-by: Juuso Oikarinen
    Reviewed-by: Johannes Berg
    Signed-off-by: John W. Linville

    Juuso Oikarinen
     
  • In cfg80211_inform_bss_frame() wiphy is first dereferenced on privsz
    initialisation and then it is checked for NULL. This patch fixes that.

    Signed-off-by: Mariusz Kozlowski
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Mariusz Kozlowski
     

14 Dec, 2010

1 commit

  • When a cached BSS struct is updated because a new beacon was received,
    the code replaces the cached information elements by the IEs from the
    new beacon. However it did not update the pub.information_elements
    and pub.len_information_elements fields leaving them either pointing
    to the old beacon IEs or in an inconsistent state where the data is
    replaced by the new beacon IEs but len_information_elements still has
    its value from the first beacon.

    Fix this by updating the information elements fields if they are
    pointing to beacon IEs.

    Signed-off-by: Sven Neumann
    Reviewed-by: Johannes Berg
    Signed-off-by: John W. Linville

    Sven Neumann
     

07 Oct, 2010

1 commit

  • When multiple interfaces are actively trying
    to associate with the same BSS, they may both
    find that the BSS isn't there and then try to
    unlink it. This can cause errors since the
    unlinking code can't currently deal with items
    that have already been unlinked.

    Normally this doesn't happen as most people
    don't try to use multiple station interfaces
    that associate at the same time too.

    Fix this by using the list entry as a flag to
    see if the item is still on a list.

    Cc: stable@kernel.org
    Reported-by: Ben Greear
    Tested-by: Hun-Kyi Wynn
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

15 Jul, 2010

1 commit

  • When kernel-internal users use cfg80211_get_bss()
    to get a reference to a BSS struct, they may end
    up getting one that would have been removed from
    the list if there had been any userspace access
    to the list. This leads to inconsistencies and
    problems.

    Fix it by making cfg80211_get_bss() ignore BSSes
    that cfg80211_bss_expire() would remove.

    Fixes http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2180

    Cc: stable@kernel.org
    Reported-by: Jiajia Zheng
    Tested-by: Jiajia Zheng
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

22 May, 2010

1 commit

  • signal_type is enum cfg80211_signal_type.

    This fixes the gcc warning:

    scan.c: In function `cfg80211_inform_bss':
    scan.c:518:6: warning: comparison between `enum cfg80211_signal_type' and `enum nl80211_bss'
    scan.c: In function `cfg80211_inform_bss_frame':
    scan.c:574:6: warning: comparison between `enum cfg80211_signal_type' and `enum nl80211_bss'

    Signed-off-by: Sujith
    Signed-off-by: John W. Linville

    Sujith
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

27 Jan, 2010

1 commit


13 Jan, 2010

1 commit

  • Store information elements from Beacon and Probe Response frames in
    separate buffers to allow both sets to be made available through
    nl80211. This allows user space applications to get access to IEs from
    Beacon frames even if we have received Probe Response frames from the
    BSS. Previously, the IEs from Probe Response frames would have
    overridden the IEs from Beacon frames.

    This feature is of somewhat limited use since most protocols include
    the same (or extended) information in Probe Response frames. However,
    there are couple of exceptions where the IEs from Beacon frames could
    be of some use: TIM IE is only included in Beacon frames (and it would
    be needed to figure out the DTIM period used in the BSS) and at least
    some implementations of Wireless Provisioning Services seem to include
    the full IE only in Beacon frames).

    The new BSS attribute for scan results is added to allow both the IE
    sets to be delivered. This is done in a way that maintains the
    previously used behavior for applications that are not aware of the
    new NL80211_BSS_BEACON_IES attribute.

    Signed-off-by: Jouni Malinen
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Jouni Malinen
     

29 Dec, 2009

1 commit


05 Dec, 2009

1 commit


30 Nov, 2009

1 commit


29 Nov, 2009

1 commit

  • This patch moves the works cleanup, scan and events to a cfg80211
    dedicated workqueue.

    Platform driver like eeepc-laptop ought to use works to rfkill (as
    new rfkill does lock in rfkill_unregister and the platform driver is
    called from rfkill_switch_all which also lock the same mutex).
    This raise a new issue in itself that the work scheduled by the platform
    driver to the global worqueue calls wiphy_unregister which flush_work
    scan and event works (which thus flush works on the global workqueue inside
    a work on the global workqueue) and also put on hold the wdev_cleanup_work
    (which prevents the dev_put on netdev thus indefinite Usage count error on
    wifi device).

    Signed-off-by: Johannes Berg
    Signed-off-by: Alban Browaeys
    Signed-off-by: John W. Linville

    Alban Browaeys
     

19 Nov, 2009

2 commits


03 Nov, 2009

1 commit

  • 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: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

08 Oct, 2009

1 commit

  • Refactor wext to
    * split out iwpriv handling
    * split out iwspy handling
    * split out procfs support
    * allow cfg80211 to have wireless extensions compat code
    w/o CONFIG_WIRELESS_EXT

    After this, drivers need to
    - select WIRELESS_EXT - for wext support
    - select WEXT_PRIV - for iwpriv support
    - select WEXT_SPY - for iwspy support

    except cfg80211 -- which gets new hooks in wext-core.c
    and can then get wext handlers without CONFIG_WIRELESS_EXT.

    Wireless extensions procfs support is auto-selected
    based on PROC_FS and anything that requires the wext core
    (i.e. WIRELESS_EXT or CFG80211_WEXT).

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

15 Sep, 2009

2 commits