05 Jan, 2012

4 commits

  • Following the tradition we have had with ath5k, ath9k, CRDA,
    wireless-regdb I'd like to license this code under the permissive ISC
    license for the code sharing purposes with other OSes, it'd sure be nice
    to help the landscape in this area. Although I am %82.89 owner of the
    regulatory code I have asked every contributor to the regulatory code
    and have receieved positive Acked-bys from everyone except two deceased
    entities:

    o Frans Pop RIP 2010 [0]
    - Frans Pop
    - Frans Pop
    o Nokia RIP February, 11, 2011 [1], [2]
    - ext-yuri.ershov@nokia.com
    - kalle.valo@nokia.com

    Frans Pop's contribution was a simple patch 55f98938, titled,
    "wireless: remove trailing space in messages" which just add a \n
    to some printk lines. I'm going to treat these additions as
    uncopyrightable.

    As for the contributions made by employees on behalf of Nokia
    my contact point was Petri Karhula but
    after one month he noted he had not been able to get traction from the
    legal department on this request, as such it I proceeded by replacing
    their contributions in previous patches.

    The end goal is to help a clean rewrite that starts in userspace
    that is shared under ISC license which currently is taking place with
    the regulatory simulator [3].

    [0] http://lists.debian.org/debian-devel/2011/12/msg00263.html
    [1] http://press.nokia.com/2011/02/11/nokia-outlines-new-strategy-introduces-new-leadership-operational-structure/
    [2] http://NokiaPlanB.com
    [3] git://github.com/mcgrof/regsim.git

    Acked-by: Thadeu Lima de Souza Cascardo
    Acked-by: Dan Carpenter
    Acked-by: Mihai Moldovan
    Acked-by: Uwe Kleine-König
    Acked-by: Sven Neumann
    Acked-by: Johannes Berg
    Acked-by: Tomas Winkler
    Acked-by: Tony Vroon
    Acked-by: Pavel Roskin
    Acked-by: Bob Copeland
    Acked-by: Lucas De Marchi
    Acked-by: Pat Erley
    Acked-by: Tejun Heo
    Acked-by: John W. Linville
    Acked-by: Chris Wright
    Acked-by: Joe Perches
    Acked-by: Paul Gortmaker
    Acked-by: John Gordon
    Acked-by: Simon Barber
    Acked-by: Rajkumar Manoharan
    Acked-by: Jiri Benc
    Acked-by: Bruno Randolf
    Acked-by: Scott James Remnant
    Acked-by: Roel Kluin
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • Nokia hasn't gotten back to me in over 1 month for a relicense
    change request. There are only a few changes that they contributed,
    so just reverting their changes but replacing with another set.
    This change replaces this commit:

    commit 269ac5fd2d75b118d76a2291e28796527db2f3f8
    Author: Kalle Valo
    Date: Tue Dec 1 10:47:15 2009 +0200

    cfg80211: indent regulatory messages with spaces

    The regulatory messages in syslog look weird:

    kernel: cfg80211: Regulatory domain: US
    kernel: ^I(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    kernel: ^I(2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
    kernel: ^I(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
    kernel: ^I(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
    kernel: ^I(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
    kernel: ^I(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
    kernel: ^I(5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)

    Indent them with four spaces instead of the tab character to get prettier
    output.

    Signed-off-by: Kalle Valo
    Acked: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Cc: Petri Karhula
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • Nokia hasn't gotten back to me in over 1 month for a relicense
    change request. There are only a few changes that they contributed,
    so just reverting their changes but replacing with another set.
    This change replaces this commit:

    commit c4c322941ce0d7e2b7b8794ad70683123d9cb26a
    Author: Yuri Ershov
    Date: Tue Jun 29 15:08:08 2010 +0400

    cfg80211: Update of regulatory request initiator handling

    In some cases there could be possible dereferencing freed pointer. The
    update is intended to avoid this issue.

    Signed-off-by: Yuri Ershov
    Signed-off-by: John W. Linville

    Cc: Petri Karhula
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • Signed-off-by: Dmitry Shmidt
    Signed-off-by: John W. Linville

    Dmitry Shmidt
     

16 Dec, 2011

2 commits

  • When we restore regulatory settings the world regulatory domain
    is properly reset on cfg80211 (or user prefered regulatory domain)
    but we were never setting back channel values for drivers that use
    WIPHY_FLAG_CUSTOM_REGULATORY. Set these values up again by using
    the orig_ channel parameters.

    This fixes restoring custom regulatory settings upon disconnect
    events.

    Cc: compat@orbit-lab.org
    Cc: Paul Stewart
    Cc: Rajkumar Manoharan
    Cc: Senthilkumar Balasubramanian
    Signed-off-by: Rajkumar Manoharan
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Rajkumar Manoharan
     
  • By definition WIPHY_FLAG_STRICT_REGULATORY was intended to allow the
    wiphy to adjust itself to the country IE power information if the
    card had no regulatory data but we had no way to tell cfg80211 that if
    the card also had its own custom regulatory domain (these are typically
    custom world regulatory domains) that we want to follow the country IE's
    noted values for power for each channel. We add support for this and
    document it.

    This is not a critical fix but a performance optimization for cards
    with custom regulatory domains that associate to an AP with sends
    out country IEs with a higher EIRP than the one on the custom
    regulatory domain. In practice the only driver affected right now
    are the Atheros drivers as they are the only drivers using both
    WIPHY_FLAG_STRICT_REGULATORY and WIPHY_FLAG_CUSTOM_REGULATORY --
    used on cards that have an Atheros world regulatory domain. Cards
    that have been programmed to follow a country specifically will not
    follow the country IE power. So although not a stable fix distributions
    should consider cherry picking this.

    Cc: compat@orbit-lab.org
    Cc: Paul Stewart
    Cc: Rajkumar Manoharan
    Cc: Senthilkumar Balasubramanian
    Reported-by: Rajkumar Manoharan
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     

14 Dec, 2011

1 commit


03 Dec, 2011

1 commit


01 Dec, 2011

2 commits

  • Johannes' patch for "cfg80211: fix regulatory NULL dereference"
    broke user regulaotry hints and it did not address the fact that
    last_request was left populated even if the previous regulatory
    hint was stale due to the wiphy disappearing.

    Fix user reguluatory hints by only bailing out if for those
    regulatory hints where a request_wiphy is expected. The stale last_request
    considerations are addressed through the previous fixes on last_request
    where we reset the last_request to a static world regdom request upon
    reset_regdomains(). In this case though we further enhance the effect
    by simply restoring reguluatory settings completely.

    Cc: stable@vger.kernel.org
    Cc: Johannes Berg
    Signed-off-by: Luis R. Rodriguez
    Reviewed-by: Johannes Berg
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • There is a theoretical race that if hit will trigger
    a crash. The race is between when we issue the first
    regulatory hint, regulatory_hint_core(), gets processed
    by the workqueue and between when the first device
    gets registered to the wireless core. This is not easy
    to reproduce but it was easy to do so through the
    regulatory simulator I have been working on. This
    is a port of the fix I implemented there [1].

    [1] https://github.com/mcgrof/regsim/commit/a246ccf81f059cb662eee288aa13100f631e4cc8

    Cc: stable@vger.kernel.org
    Cc: Johannes Berg
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     

23 Nov, 2011

1 commit


22 Nov, 2011

3 commits


10 Nov, 2011

1 commit

  • Commit 4d9d88d1 by Scott James Remnant added
    the .uevent() callback for the regulatory device used during
    the platform device registration. The change was done to account
    for queuing up udev change requests through udevadm triggers.
    The change also meant that upon regulatory core exit we will now
    send a uevent() but the uevent() callback, reg_device_uevent(),
    also accessed last_request. Right before commiting device suicide
    we free'd last_request but never set it to NULL so
    platform_device_unregister() would lead to bogus kernel paging
    request. Fix this and also simply supress uevents right before
    we commit suicide as they are pointless.

    This fix is required for kernels >= v2.6.39

    $ git describe --contains 4d9d88d1
    v2.6.39-rc1~468^2~25^2^2~21

    The impact of not having this present is that a bogus paging
    access may occur (only read) upon cfg80211 unload time. You
    may also get this BUG complaint below. Although Johannes
    could not reproduce the issue this fix is theoretically correct.

    mac80211_hwsim: unregister radios
    mac80211_hwsim: closing netlink
    BUG: unable to handle kernel paging request at ffff88001a06b5ab
    IP: [] reg_device_uevent+0x1a/0x50 [cfg80211]
    PGD 1836063 PUD 183a063 PMD 1ffcb067 PTE 1a06b160
    Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
    CPU 0
    Modules linked in: cfg80211(-) [last unloaded: mac80211]

    Pid: 2279, comm: rmmod Tainted: G W 3.1.0-wl+ #663 Bochs Bochs
    RIP: 0010:[] [] reg_device_uevent+0x1a/0x50 [cfg80211]
    RSP: 0000:ffff88001c5f9d58 EFLAGS: 00010286
    RAX: 0000000000000000 RBX: ffff88001d2eda88 RCX: ffff88001c7468fc
    RDX: ffff88001a06b5a0 RSI: ffff88001c7467b0 RDI: ffff88001c7467b0
    RBP: ffff88001c5f9d58 R08: 000000000000ffff R09: 000000000000ffff
    R10: 0000000000000000 R11: 0000000000000001 R12: ffff88001c7467b0
    R13: ffff88001d2eda78 R14: ffffffff8164a840 R15: 0000000000000001
    FS: 00007f8a91d8a6e0(0000) GS:ffff88001fc00000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: ffff88001a06b5ab CR3: 000000001c62e000 CR4: 00000000000006f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process rmmod (pid: 2279, threadinfo ffff88001c5f8000, task ffff88000023c780)
    Stack:
    ffff88001c5f9d98 ffffffff812ff7e5 ffffffff8176ab3d ffff88001c7468c2
    000000000000ffff ffff88001d2eda88 ffff88001c7467b0 ffff880000114820
    ffff88001c5f9e38 ffffffff81241dc7 ffff88001c5f9db8 ffffffff81040189
    Call Trace:
    [] dev_uevent+0xc5/0x170
    [] kobject_uevent_env+0x1f7/0x490
    [] ? sub_preempt_count+0x29/0x60
    [] ? _raw_spin_unlock_irqrestore+0x4a/0x90
    [] ? devres_release_all+0x27/0x60
    [] kobject_uevent+0xb/0x10
    [] device_del+0x157/0x1b0
    [] platform_device_del+0x1d/0x90
    [] platform_device_unregister+0x16/0x30
    [] regulatory_exit+0x5d/0x180 [cfg80211]
    [] cfg80211_exit+0x2b/0x45 [cfg80211]
    [] sys_delete_module+0x16c/0x220
    [] ? trace_hardirqs_on_caller+0x7e/0x120
    [] system_call_fastpath+0x16/0x1b
    Code:
    RIP [] reg_device_uevent+0x1a/0x50 [cfg80211]
    RSP
    CR2: ffff88001a06b5ab
    ---[ end trace 147c5099a411e8c0 ]---

    Reported-by: Johannes Berg
    Cc: Scott James Remnant
    Cc: stable@vger.kernel.org
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     

01 Nov, 2011

2 commits


22 Sep, 2011

1 commit

  • Conflicts:
    MAINTAINERS
    drivers/net/Kconfig
    drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
    drivers/net/ethernet/broadcom/tg3.c
    drivers/net/wireless/iwlwifi/iwl-pci.c
    drivers/net/wireless/iwlwifi/iwl-trans-tx-pcie.c
    drivers/net/wireless/rt2x00/rt2800usb.c
    drivers/net/wireless/wl12xx/main.c

    David S. Miller
     

17 Sep, 2011

1 commit

  • During the association, the regulatory is updated by country IE
    that reaps the previously found beacons. The impact is that
    after a STA disconnects *or* when for any reason a regulatory
    domain change happens the beacon hint flag is not cleared
    therefore preventing future beacon hints to be learned.
    This is important as a regulatory domain change or a restore
    of regulatory settings would set back the passive scan and no-ibss
    flags on the channel. This is the right place to do this given that
    it covers any regulatory domain change.

    Cc: stable@kernel.org
    Reviewed-by: Luis R. Rodriguez
    Signed-off-by: Rajkumar Manoharan
    Acked-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Rajkumar Manoharan
     

15 Sep, 2011

2 commits

  • Reorder functions to remove the need for a forward declaration
    introduced by the last commit.

    Signed-off-by: Sven Neumann
    Cc: John W. Linville
    Cc: Luis R. Rodriguez
    Cc: Daniel Mack
    Cc: linux-wireless@vger.kernel.org
    Acked-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Sven Neumann
     
  • The function wiphy_update_regulatory() uses the static variable
    last_request and thus needs to be called with reg_mutex held.
    This is the case for all users in reg.c, but the function was
    exported for use by wiphy_register(), from where it is called
    without the lock being held.

    Fix this by making wiphy_update_regulatory() private and introducing
    regulatory_update() as a wrapper that acquires and holds the lock.

    Signed-off-by: Sven Neumann
    Cc: John W. Linville
    Cc: Luis R. Rodriguez
    Cc: Daniel Mack
    Cc: linux-wireless@vger.kernel.org
    Acked-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Sven Neumann
     

14 Sep, 2011

1 commit


10 Aug, 2011

1 commit


27 Jul, 2011

2 commits

  • Just a typo fix changing regulaotry to regulatory.

    Signed-off-by: Mihai Moldovan
    CC: John W. Linville
    CC: Mohammed Shafi
    Signed-off-by: John W. Linville

    Mihai Moldovan
     
  • At the beginning of wiphy_update_regulatory() a check is performed
    whether the request is to be ignored. Then the request is sent to
    the driver nevertheless. This happens even if last_request points
    to NULL, leading to a crash in the driver:

    [] (lbs_set_11d_domain_info+0x28/0x1e4 [libertas]) from [] (wiphy_update_regulatory+0x4d0/0x4f4)
    [] (wiphy_update_regulatory+0x4d0/0x4f4) from [] (wiphy_register+0x354/0x420)
    [] (wiphy_register+0x354/0x420) from [] (lbs_cfg_register+0x80/0x164 [libertas])
    [] (lbs_cfg_register+0x80/0x164 [libertas]) from [] (lbs_start_card+0x20/0x88 [libertas])
    [] (lbs_start_card+0x20/0x88 [libertas]) from [] (if_sdio_probe+0x898/0x9c0 [libertas_sdio])

    Fix this by returning early. Also remove the out: label as it is
    not any longer needed.

    Signed-off-by: Sven Neumann
    Cc: linux-wireless@vger.kernel.org
    Cc: Johannes Berg
    Cc: Daniel Mack
    Cc: stable@kernel.org
    Signed-off-by: John W. Linville

    Sven Neumann
     

17 May, 2011

1 commit


11 May, 2011

1 commit

  • These warnings are exposed by gcc 4.6.
    net/wireless/reg.c: In function 'freq_reg_info_regd':
    net/wireless/reg.c:675:38: warning: variable 'pr' set but not used
    [-Wunused-but-set-variable]
    net/wireless/lib80211_crypt_wep.c: In function 'lib80211_wep_build_iv':
    net/wireless/lib80211_crypt_wep.c:99:12: warning: variable 'len' set but
    not used [-Wunused-but-set-variable]

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

    Rajkumar Manoharan
     

06 May, 2011

1 commit


27 Apr, 2011

1 commit

  • The patch "cfg80211: add a timer for invalid user reg hints"
    introduced a regression for the case where a secondary identical
    regulatory hint from a user is sent. What would happen is the
    second hint would schedule delayed work in to catch a timeout
    but since we are never processing it given that the hint was already
    applied we'd always hit the timeout and and restore regulatory
    settings back to world regulatory domain. This is fixed by simply
    avoiding sheduling work if the hint was already applied.

    Tested-by: Felix Fietkau
    Reported-by: Felix Fietkau
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     

13 Apr, 2011

1 commit


08 Apr, 2011

2 commits

  • We have no other option but to inform userspace that we
    have queued up their regulatory hint request when we are
    given one given that nl80211 operates atomically on user
    requests. The best we can do is accept the request, and
    add a delayed work item for processing failure and cancel it
    if we succeeed. Upon failure we restore the regulatory
    settings and ignore the user input.

    This fixes this reported bug:

    https://bugzilla.kernel.org/show_bug.cgi?id=28112

    Reported-by: gregoryx.alagnou@intel.com
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • When we restore regulatory settings its possible CRDA
    will not reply because of a bogus user entry. In this
    case the bogus entry will prevent any further processing
    on cfg80211 for regulatory domains even if we restore
    regulatory settings.

    To prevent this we suck out all pending requests when
    restoring regulatory settings and add them back into the
    queue after we have queued up the reset work.

    The impact of not having this applied is that a user
    with privileges can issue a userspace regulatory hint
    while we are disasocciating and this would prevent any
    further processing of regulatory domains.

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

    Luis R. Rodriguez
     

31 Mar, 2011

1 commit


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
     

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
     

05 Jan, 2011

1 commit


17 Dec, 2010

1 commit

  • 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
     

25 Nov, 2010

1 commit


23 Nov, 2010

2 commits

  • When two cards are connected with the same regulatory domain
    if CRDA had a delayed response then cfg80211's own set regulatory
    domain would still be the world regulatory domain. There was a bug
    on cfg80211's logic such that it assumed that once you pegged a
    request as the last request it was already the currently set
    regulatory domain. This would mean we would race setting a stale
    regulatory domain to secondary cards which had the same regulatory
    domain since the alpha2 would match.

    We fix this by processing each regulatory request atomically,
    and only move on to the next one once we get it fully processed.
    In the case CRDA is not present we will simply world roam.

    This issue is only present when you have a slow system and the
    CRDA processing is delayed. Because of this it is not a known
    regression.

    Without this fix when a delay is present with CRDA the second card
    would end up with an intersected regulatory domain and not allow it
    to use the channels it really is designed for. When two cards with
    two different regulatory domains were inserted you'd end up
    rejecting the second card's regulatory domain request.
    This fails with mac80211_hswim's regtest=2 (two requests, same alpha2)
    and regtest=3 (two requests, different alpha2) module parameter
    options.

    This was reproduced and tested against mac80211_hwsim using this
    CRDA delayer:

    #!/bin/bash
    echo $COUNTRY >> /tmp/log
    sleep 2
    /sbin/crda.orig

    And these regulatory tests:

    modprobe mac80211_hwsim regtest=2
    modprobe mac80211_hwsim regtest=3

    Reported-by: Mark Mentovai
    Signed-off-by: Luis R. Rodriguez
    Tested-by: Mark Mentovai
    Tested-by: Bruno Randolf
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • This will be required in the next patch and it makes the
    next patch easier to review.

    Signed-off-by: Luis R. Rodriguez
    Tested-by: Mark Mentovai
    Tested-by: Bruno Randolf
    Signed-off-by: John W. Linville

    Luis R. Rodriguez