08 Apr, 2011

1 commit


31 Mar, 2011

1 commit


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
     

16 Mar, 2011

1 commit


12 Mar, 2011

2 commits


10 Mar, 2011

1 commit

  • Regulatory devices issue change uevents to inform userspace of a need
    to call the crda tool; however these can often be sent before udevd is
    running, and were not previously included in the results of
    udevadm trigger (which requests a new change event using the /uevent
    attribute of the sysfs object).

    Add a uevent function to the device type which includes the COUNTRY
    information from the last request if it has yet to be processed, the
    case of multiple requests is already handled in the code by checking
    whether an unprocessed one is queued in the same manner and refusing
    to queue a new one.

    The existing udev rule continues to work as before.

    Signed-off-by: Scott James Remnant
    Acked-By: Kay Sievers
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: John W. Linville

    Scott James Remnant
     

05 Mar, 2011

2 commits


04 Mar, 2011

1 commit


02 Mar, 2011

1 commit


23 Feb, 2011

1 commit


22 Feb, 2011

1 commit

  • I previously managed to reproduce a hang while scanning wireless
    channels (reproducible with airodump-ng hopping channels); subsequent
    lockdep instrumentation revealed a lock ordering issue.

    Without knowing the design intent, it looks like the locks should be
    taken in reverse order; please comment.

    =======================================================
    [ INFO: possible circular locking dependency detected ]
    2.6.38-rc5-341cd #4
    -------------------------------------------------------
    airodump-ng/15445 is trying to acquire lock:
    (&rdev->devlist_mtx){+.+.+.}, at: []
    cfg80211_wext_siwfreq+0xc6/0x100

    but task is already holding lock:
    (&wdev->mtx){+.+.+.}, at: [] cfg80211_wext_siwfreq+0xbc/0x100

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #1 (&wdev->mtx){+.+.+.}:
    [] lock_acquire+0xc6/0x280
    [] mutex_lock_nested+0x6e/0x4b0
    [] cfg80211_netdev_notifier_call+0x430/0x5f0
    [] notifier_call_chain+0x8b/0x100
    [] raw_notifier_call_chain+0x11/0x20
    [] call_netdevice_notifiers+0x32/0x60
    [] __dev_notify_flags+0x34/0x80
    [] dev_change_flags+0x40/0x70
    [] do_setlink+0x1fc/0x8d0
    [] rtnl_setlink+0xf2/0x140
    [] rtnetlink_rcv_msg+0x163/0x270
    [] netlink_rcv_skb+0xa1/0xd0
    [] rtnetlink_rcv+0x20/0x30
    [] netlink_unicast+0x2ba/0x300
    [] netlink_sendmsg+0x267/0x3e0
    [] sock_sendmsg+0xe4/0x110
    [] sys_sendmsg+0x253/0x3b0
    [] system_call_fastpath+0x16/0x1b

    -> #0 (&rdev->devlist_mtx){+.+.+.}:
    [] __lock_acquire+0x1622/0x1d10
    [] lock_acquire+0xc6/0x280
    [] mutex_lock_nested+0x6e/0x4b0
    [] cfg80211_wext_siwfreq+0xc6/0x100
    [] ioctl_standard_call+0x5d/0xd0
    [] T.808+0x163/0x170
    [] wext_handle_ioctl+0x3a/0x90
    [] dev_ioctl+0x6f2/0x830
    [] sock_ioctl+0xfd/0x290
    [] do_vfs_ioctl+0x9d/0x590
    [] sys_ioctl+0x4a/0x80
    [] system_call_fastpath+0x16/0x1b

    other info that might help us debug this:

    2 locks held by airodump-ng/15445:
    #0: (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x12/0x20
    #1: (&wdev->mtx){+.+.+.}, at: []
    cfg80211_wext_siwfreq+0xbc/0x100

    stack backtrace:
    Pid: 15445, comm: airodump-ng Not tainted 2.6.38-rc5-341cd #4
    Call Trace:
    [] ? print_circular_bug+0xfa/0x100
    [] ? __lock_acquire+0x1622/0x1d10
    [] ? trace_hardirqs_off_caller+0x29/0xc0
    [] ? lock_acquire+0xc6/0x280
    [] ? cfg80211_wext_siwfreq+0xc6/0x100
    [] ? mark_held_locks+0x67/0x90
    [] ? mutex_lock_nested+0x6e/0x4b0
    [] ? cfg80211_wext_siwfreq+0xc6/0x100
    [] ? mark_held_locks+0x67/0x90
    [] ? cfg80211_wext_siwfreq+0xc6/0x100
    [] ? cfg80211_wext_siwfreq+0xc6/0x100
    [] ? ioctl_standard_call+0x5d/0xd0
    [] ? __dev_get_by_name+0x9b/0xc0
    [] ? ioctl_standard_call+0x0/0xd0
    [] ? T.808+0x163/0x170
    [] ? might_fault+0x72/0xd0
    [] ? wext_handle_ioctl+0x3a/0x90
    [] ? might_fault+0xbb/0xd0
    [] ? dev_ioctl+0x6f2/0x830
    [] ? put_lock_stats+0xe/0x40
    [] ? lock_release_holdtime+0xac/0x150
    [] ? sock_ioctl+0xfd/0x290
    [] ? do_vfs_ioctl+0x9d/0x590
    [] ? fget_light+0x1df/0x3c0
    [] ? sys_ioctl+0x4a/0x80
    [] ? system_call_fastpath+0x16/0x1b

    Signed-off-by: Daniel J Blueman
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Daniel J Blueman
     

09 Feb, 2011

1 commit


04 Feb, 2011

2 commits


29 Jan, 2011

2 commits

  • genlmsg_cancel subtracts some constants from its second argument before
    calling nlmsg_cancel. nlmsg_cancel then calls nlmsg_trim on the same
    arguments. nlmsg_trim tests for NULL before doing any computation, but a
    NULL second argument to genlmsg_cancel is no longer NULL due to the initial
    subtraction. Nothing else happens in this execution, so the call to
    genlmsg_cancel is simply unnecessary in this case.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression data;
    @@

    if (data == NULL) { ...
    * genlmsg_cancel(..., data);
    ...
    return ...;
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: John W. Linville

    Julia Lawall
     
  • Some vendor specific cipher suites require non-zero key indexes for pairwise
    keys, but as of currently, the cfg80211 does not allow it.

    As validating they cipher parameters for vendor specific cipher suites is the
    job of the driver or hardware/firmware, change the cfg80211 to allow also
    non-zero pairwise key indexes for vendor specific ciphers.

    Signed-off-by: Juuso Oikarinen
    Signed-off-by: John W. Linville

    Juuso Oikarinen
     

28 Jan, 2011

1 commit


22 Jan, 2011

1 commit

  • Extend channel to frequency mapping for 802.11j Japan 4.9GHz band, according to
    IEEE802.11 section 17.3.8.3.2 and Annex J. Because there are now overlapping
    channel numbers in the 2GHz and 5GHz band we can't map from channel to
    frequency without knowing the band. This is no problem as in most contexts we
    know the band. In places where we don't know the band (and WEXT compatibility)
    we assume the 2GHz band for channels below 14.

    This patch does not implement all channel to frequency mappings defined in
    802.11, it's just an extension for 802.11j 20MHz channels. 5MHz and 10MHz
    channels as well as 802.11y channels have been omitted.

    The following drivers have been updated to reflect the API changes:
    iwl-3945, iwl-agn, iwmc3200wifi, libertas, mwl8k, rt2x00, wl1251, wl12xx.
    The drivers have been compile-tested only.

    Signed-off-by: Bruno Randolf
    Signed-off-by: Brian Prodoehl
    Acked-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Bruno Randolf
     

21 Jan, 2011

1 commit

  • The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
    is used to configure any non-standard kernel with a much larger scope than
    only small devices.

    This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
    references to the option throughout the kernel. A new CONFIG_EMBEDDED
    option is added that automatically selects CONFIG_EXPERT when enabled and
    can be used in the future to isolate options that should only be
    considered for embedded systems (RISC architectures, SLOB, etc).

    Calling the option "EXPERT" more accurately represents its intention: only
    expert users who understand the impact of the configuration changes they
    are making should enable it.

    Reviewed-by: Ingo Molnar
    Acked-by: David Woodhouse
    Signed-off-by: David Rientjes
    Cc: Greg KH
    Cc: "David S. Miller"
    Cc: Jens Axboe
    Cc: Arnd Bergmann
    Cc: Robin Holt
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

05 Jan, 2011

1 commit


21 Dec, 2010

5 commits


17 Dec, 2010

2 commits

  • Once we moved the core regulatory request to the queue and let
    the scheduler process it last_request will have been left NULL
    until the schedular decides to process the first request. When
    this happens and we are loading a driver with a custom regulatory
    request like all Atheros drivers we end up with a NULL pointer
    dereference. We fix this by checking if the request was a
    custom one.

    BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
    IP: [] freq_reg_info_regd.clone.2+0x27/0x130 [cfg80211]
    PGD 71f91067 PUD 712b2067 PMD 0
    Oops: 0000 [#1] PREEMPT SMP
    last sysfs file: /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/firmware/2-1/loading
    CPU 0
    Modules linked in: ath9k_htc(+) ath9k_common ath9k_hw ath
    Pid: 3094, comm: insmod Tainted: G W 2.6.37-rc5-wl #16 INVALID/28427ZQ
    RIP: 0010:[] [] freq_reg_info_regd.clone.2+0x27/0x130 [cfg80211]
    RSP: 0018:ffff88007045db78 EFLAGS: 00010282
    RAX: 0000000000000000 RBX: ffffffffa047d9a0 RCX: ffff88007045dbd0
    RDX: 0000000000004e20 RSI: 000000000024cde0 RDI: ffff8800700483e0
    RBP: ffff88007045db98 R08: ffffffffa02f5b40 R09: 0000000000000001
    R10: 000000000000000e R11: 0000000000000001 R12: 0000000000000000
    R13: ffff88007004e3b0 R14: 0000000000000000 R15: ffff880070048340
    FS: 00007f635a707700(0000) GS:ffff880077400000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000004 CR3: 00000000708a9000 CR4: 00000000000006f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process insmod (pid: 3094, threadinfo ffff88007045c000, task ffff8800713e3ec0)
    Stack:
    ffffffffa047d9a0 0000000000000000 ffff88007004e3b0 0000000000000000
    ffff88007045dc08 ffffffffa016e147 000000007045dc08 0000000000000002
    ffff8800700483e0 ffffffffa02f5b40 ffff88007045dbd8 0000000000000000
    Call Trace:
    [] wiphy_apply_custom_regulatory+0x137/0x1d0 [cfg80211]
    [] ? ath9k_reg_notifier+0x0/0x50 [ath9k_htc]
    [] ath_regd_init+0x347/0x430 [ath]
    [] ath9k_htc_probe_device+0x6c5/0x960 [ath9k_htc]
    [] ath9k_htc_hw_init+0xc/0x30 [ath9k_htc]
    [] ath9k_hif_usb_probe+0x216/0x3b0 [ath9k_htc]
    [] usb_probe_interface+0x10c/0x210 [usbcore]
    [] driver_probe_device+0x96/0x1c0
    [] __driver_attach+0xa3/0xb0
    [] ? __driver_attach+0x0/0xb0
    [] bus_for_each_dev+0x5e/0x90
    [] driver_attach+0x19/0x20
    [] bus_add_driver+0x168/0x320
    [] driver_register+0x71/0x140
    [] ? __raw_spin_lock_init+0x38/0x70
    [] usb_register_driver+0xdc/0x190 [usbcore]
    [] ? ath9k_htc_init+0x0/0x4f [ath9k_htc]
    [] ath9k_hif_usb_init+0x1e/0x20 [ath9k_htc]
    [] ath9k_htc_init+0x2b/0x4f [ath9k_htc]
    [] do_one_initcall+0x3f/0x180
    [] sys_init_module+0xbb/0x200
    [] system_call_fastpath+0x16/0x1b
    Code:
    RIP [] freq_reg_info_regd.clone.2+0x27/0x130 [cfg80211]
    RSP
    CR2: 0000000000000004
    ---[ end trace 79e4193601c8b713 ]---

    Reported-by: Sujith Manoharan
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • Add a new notification to indicate that a received, unprotected
    Deauthentication or Disassociation frame was dropped due to
    management frame protection being in use. This notification is
    needed to allow user space (e.g., wpa_supplicant) to implement
    SA Query procedure to recover from association state mismatch
    between an AP and STA.

    This is needed to avoid getting stuck in non-working state when MFP
    (IEEE 802.11w) is used and a protected Deauthentication or
    Disassociation frame is dropped for any reason. After that, the
    station would silently discard any unprotected Deauthentication or
    Disassociation frame that could be indicating that the AP does not
    have association for the STA (when the Reason Code would be 6 or 7).
    IEEE Std 802.11w-2009, 11.13 describes this recovery mechanism.

    Signed-off-by: Jouni Malinen
    Signed-off-by: John W. Linville

    Jouni Malinen
     

16 Dec, 2010

1 commit


14 Dec, 2010

3 commits

  • Allow userspace to specify that a given key
    is default only for unicast and/or multicast
    transmissions. Only WEP keys are for both,
    WPA/RSN keys set here are GTKs for multicast
    only. For more future flexibility, allow to
    specify all combiations.

    Wireless extensions can only set both so use
    nl80211; WEP keys (connect keys) must be set
    as default for both (but 802.1X WEP is still
    possible).

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

    Johannes Berg
     
  • 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
     
  • Add a field to wiphy for the hardware to report the availble antennas for
    configuration. Only if this is set to something bigger than zero, will the
    anntenna configuration ops be executed.

    Allthough this could be a simple number of antennas, I defined it as a bitmap
    of antennas which are available for configuration, since it's more consistent
    with the rest of the antenna API and there could be cases where the
    hardware allows only configuration of certain antennas. As it does not make
    much of a difference in size or normal usage, I think it's better to be able to
    support this, in case the need arises.

    The antenna configuration is now also checked against the availabe antennas and
    rejected if it does not match.

    Signed-off-by: Bruno Randolf

    --
    v3: always apply available antenna mask (for "all" antennas case).

    v2: reject antenna configurations which don't match the available antennas
    Signed-off-by: John W. Linville

    Bruno Randolf
     

09 Dec, 2010

1 commit


08 Dec, 2010

1 commit

  • Extend nl80211 to report an exponential weighted moving average (EWMA) of the
    signal value. Since the signal value usually fluctuates between different
    packets, an average can be more useful than the value of the last packet.

    This uses the recently added generic EWMA library function.

    --
    v2: fix ABI breakage and change factor to be a power of 2.

    Signed-off-by: Bruno Randolf
    Signed-off-by: John W. Linville

    Bruno Randolf
     

07 Dec, 2010

4 commits

  • Instead of tying mesh activity to interface up,
    add join and leave commands for mesh. Since we
    must be backward compatible, let cfg80211 handle
    joining a mesh if a mesh ID was pre-configured
    when the device goes up.

    Note that this therefore must modify mac80211 as
    well since mac80211 needs to lose the logic to
    start the mesh on interface up.

    We now allow querying mesh parameters before the
    mesh is connected, which simply returns defaults.
    Setting them (internally renamed to "update") is
    only allowed while connected. Specify them with
    the new mesh join command instead where needed.

    In mac80211, beaconing must now also follow the
    mesh enabled/not enabled state, which is done
    by testing the mesh ID.

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

    Johannes Berg
     
  • I'm going to need this in a new place later.

    Tested-by: Javier Cardona
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • cfg80211 used to do all its bookkeeping in
    the notifier, but some new stuff will have
    to use local variables so make the callback
    return the netdev pointer.

    Tested-by: Javier Cardona
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • The TTL in path selection information elements is different from
    the mesh ttl used in mesh data frames. Version 7.03 of the 11s
    draft calls this ttl 'Element TTL'.

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

    Javier Cardona