15 Sep, 2011

1 commit

  • 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
     

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
     

19 Jun, 2010

1 commit


02 Feb, 2010

1 commit

  • This adds a new regulatory hint to be used when we know all
    devices have been disconnected and idle. This can happen
    when we suspend, for instance. When we disconnect we can
    no longer assume the same regulatory rules learned from
    a country IE or beacon hints are applicable so restore
    regulatory settings to an initial state.

    Since driver hints are cached on the wiphy that called
    the hint, those hints are not reproduced onto cfg80211
    as the wiphy will respect its own wiphy->regd regardless.

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

    Luis R. Rodriguez
     

16 Jan, 2010

1 commit

  • In practice APs do not send country IE channel triplets for channels
    the AP is not operating on and if they were to do so they would have
    to use the regulatory extension which we currently do not process.
    No AP has been seen in practice that does this though so just drop
    those country IEs.

    Additionally it has been noted the first series of country IE
    channels triplets are specific to the band the AP sends. Propagate
    the band on which the country IE was found on reject the country
    IE then if the triplets are ever oustide of the band.

    Although we now won't process country IE information with multiple
    band information we leave the intersection work as is as it is
    technically possible for someone to want to eventually process these
    type of country IEs with regulatory extensions.

    Cc: Jouni Malinen
    Cc: Johannes Berg
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     

13 Aug, 2009

1 commit


05 Aug, 2009

1 commit

  • Since the bss is always set now once we are connected, if the
    bss has its own information element we refer to it and pass that
    instead of relying on mac80211's parsing.

    Now all cfg80211 drivers get country IE support, automatically and
    we reduce the call overhead that we had on mac80211 which called this
    upon every beacon and instead now call this only upon a successfull
    connection by a STA on cfg80211.

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

    Luis R. Rodriguez
     

04 Aug, 2009

1 commit

  • A regression was added through patch a4ed90d6:

    "cfg80211: respect API on orig_flags on channel for beacon hint"

    We did indeed respect _orig flags but the intention was not clearly
    stated in the commit log. This patch fixes firmware issues picked
    up by iwlwifi when we lift passive scan of beaconing restrictions
    on channels its EEPROM has been configured to always enable.

    By doing so though we also disallowed beacon hints on devices
    registering their wiphy with custom world regulatory domains
    enabled, this happens to be currently ath5k, ath9k and ar9170.
    The passive scan and beacon restrictions on those devices would
    never be lifted even if we did find a beacon and the hardware did
    support such enhancements when world roaming.

    Since Johannes indicates iwlwifi firmware cannot be changed to
    allow beacon hinting we set up a flag now to specifically allow
    drivers to disable beacon hints for devices which cannot use them.

    We enable the flag on iwlwifi to disable beacon hints and by default
    enable it for all other drivers. It should be noted beacon hints lift
    passive scan flags and beacon restrictions when we receive a beacon from
    an AP on any 5 GHz non-DFS channels, and channels 12-14 on the 2.4 GHz
    band. We don't bother with channels 1-11 as those channels are allowed
    world wide.

    This should fix world roaming for ath5k, ath9k and ar9170, thereby
    improving scan time when we receive the first beacon from any AP,
    and also enabling beaconing operation (AP/IBSS/Mesh) on cards which
    would otherwise not be allowed to do so. Drivers not using custom
    regulatory stuff (wiphy_apply_custom_regulatory()) were not affected
    by this as the orig_flags for the channels would have been cleared
    upon wiphy registration.

    I tested this with a world roaming ath5k card.

    Cc: Jouni Malinen
    Signed-off-by: Luis R. Rodriguez
    Reviewed-by: Johannes Berg
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     

28 Feb, 2009

3 commits

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

    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: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • All regulatory hints (core, driver, userspace and 11d) are now processed in
    a workqueue.

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

    Luis R. Rodriguez
     

10 Feb, 2009

1 commit


30 Jan, 2009

1 commit


26 Nov, 2008

1 commit

  • This adds country IE parsing to mac80211 and enables its usage
    within the new regulatory infrastructure in cfg80211. We parse
    the country IEs only on management beacons for the BSSID you are
    associated to and disregard the IEs when the country and environment
    (indoor, outdoor, any) matches the already processed country IE.

    To avoid following misinformed or outdated APs we build and use
    a regulatory domain out of the intersection between what the AP
    provides us on the country IE and what CRDA is aware is allowed
    on the same country.

    A secondary device is allowed to follow only the same country IE
    as it make no sense for two devices on a system to be in two
    different countries.

    In the case the AP is using country IEs for an incorrect country
    the user may help compliance further by setting the regulatory
    domain before or after the IE is parsed and in that case another
    intersection will be performed.

    CONFIG_WIRELESS_OLD_REGULATORY is supported but requires CRDA
    present.

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

    Luis R. Rodriguez
     

01 Nov, 2008

3 commits

  • The code needs to be split out and cleaned up, so as a
    first step remove the capability, to add it back in a
    subsequent patch as a separate function. Also remove the
    publically facing return value of the function and the
    wiphy argument. A number of internal functions go from
    being generic helpers to just being used for alpha2
    setting.

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

    Johannes Berg
     
  • This mutex is wrong, we use cfg80211_drv_mutex (which should
    possibly be renamed to just cfg80211_mutex) everywhere except
    in one place, fix that and get rid of the extra mutex.

    Also get rid of a spurious regulatory_requests list definition.

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

    Johannes Berg
     
  • This function requires an internal lock to be held, so it cannot
    be published to other modules in the kernel.

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

    Johannes Berg
     

25 Sep, 2008

2 commits

  • A few pointers and structures in the regulatory code are const,
    but because it wasn't done properly a whole bunch of bogus
    casts were needed to compile without warning. Mark everything
    const properly to avoid that kind of junk code.

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

    Johannes Berg
     
  • The recent code from Luis is an #ifdef hell and contains lots of
    code that's stuffed into the wrong file making a whole bunch of
    things needlessly non-static, and besides, what is it doing in
    core.c??

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

    Johannes Berg
     

16 Sep, 2008

1 commit

  • This adds the new wireless regulatory infrastructure. The
    main motiviation behind this was to centralize regulatory
    code as each driver was implementing their own regulatory solution,
    and to replace the initial centralized code we have where:

    * only 3 regulatory domains are supported: US, JP and EU
    * regulatory domains can only be changed through module parameter
    * all rules were built statically in the kernel

    We now have support for regulatory domains for many countries
    and regulatory domains are now queried through a userspace agent
    through udev allowing distributions to update regulatory rules
    without updating the kernel.

    Each driver can regulatory_hint() a regulatory domain
    based on either their EEPROM mapped regulatory domain value to a
    respective ISO/IEC 3166-1 country code or pass an internally built
    regulatory domain. We also add support to let the user set the
    regulatory domain through userspace in case of faulty EEPROMs to
    further help compliance.

    Support for world roaming will be added soon for cards capable of
    this.

    For more information see:

    http://wireless.kernel.org/en/developers/Regulatory/CRDA

    For now we leave an option to enable the old module parameter,
    ieee80211_regdom, and to build the 3 old regdomains statically
    (US, JP and EU). This option is CONFIG_WIRELESS_OLD_REGULATORY.
    These old static definitions and the module parameter is being
    scheduled for removal for 2.6.29. Note that if you use this
    you won't make use of a world regulatory domain as its pointless.
    If you leave this option enabled and if CRDA is present and you
    use US or JP we will try to ask CRDA to update us a regulatory
    domain for us.

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

    Luis R. Rodriguez