21 May, 2014

1 commit


25 Apr, 2014

1 commit

  • Current code checks if the 20MHz bandwidth is allowed for
    particular channel -- if it is not, the channel is disabled.
    Since we need to use 5/10 MHz channels, this code is modified in
    the way that the default bandwidth to check is 5MHz. If the
    maximum bandwidth allowed by the channel is smaller than 5MHz,
    the channel is disabled. Otherwise the channel is used and the
    flags are set according to the bandwidth allowed by the channel.

    Signed-off-by: Rostislav Lisovy
    Signed-off-by: Johannes Berg

    Rostislav Lisovy
     

22 Apr, 2014

2 commits

  • This allows processing of the last regulatory request when
    we determine its still pending. Without this if a regulatory
    request failed to get processed by userspace we wouldn't
    be able to re-process it later. An example situation that can
    lead to an unprocessed last_request is enabling cfg80211 to
    be built-in to the kernel, not enabling CFG80211_INTERNAL_REGDB
    and the CRDA binary not being available at the time the udev
    rule that kicks of CRDA triggers.

    In such a situation we want to let some cfg80211 triggers
    eventually kick CRDA for us again. Without this if the first
    cycle attempt to kick off CRDA failed we'd be stuck without
    the ability to change process any further regulatory domains.

    cfg80211 will trigger re-processing of the regulatory queue
    whenever schedule_work(®_work) is called, currently this
    happens when:

    * suspend / resume
    * disconnect
    * a beacon hint gets triggered (non DFS 5 GHz AP found)
    * a regulatory request gets added to the queue

    We don't have any specific opportunistic late boot triggers
    to address a late mount of where CRDA resides though, adding
    that should be done separately through another patch.
    Without an opportunistic fix then this fix relies at least
    one of the triggeres above to happen.

    Reported-by: Sander Eikelenboom
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • Avoid freeing the last request while it is being processed. This can
    happen in some cases if reg_work is kicked for some reason while the
    currently pending request is in flight.

    Cc: Sander Eikelenboom
    Tested-by: Eliad Peller
    Tested-by: Colleen Twitty
    Signed-off-by: Arik Nemtsov
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Arik Nemtsov
     

11 Apr, 2014

1 commit


09 Apr, 2014

6 commits

  • Allow GO operation on a channel marked with IEEE80211_CHAN_INDOOR_ONLY
    iff there is a user hint indicating that the platform is operating in
    an indoor environment, i.e., the platform is a printer or media center
    device.

    Signed-off-by: Ilan Peer
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • Add the option to hint the wireless core that it is operating in an indoor
    environment.

    Signed-off-by: Ilan Peer
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • Allow GO operation on a channel marked with IEEE80211_CHAN_GO_CONCURRENT
    iff there is an active station interface that is associated to
    an AP operating on the same channel in the 2 GHz band or the same UNII band
    (in the 5 GHz band). This relaxation is not allowed if the channel is
    marked with IEEE80211_CHAN_RADAR.

    Note that this is a permissive approach to the FCC definitions,
    that require a clear assessment that the device operating the AP is
    an authorized master, i.e., with radar detection and DFS capabilities.

    It is assumed that such restrictions are enforced by user space.
    Furthermore, it is assumed, that if the conditions that allowed for
    the operation of the GO on such a channel change, i.e., the station
    interface disconnected from the AP, it is the responsibility of user
    space to evacuate the GO from the channel.

    Signed-off-by: Ilan Peer
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • Move the regulatory cellular base station hints support under
    a specific configuration option and make the option depend
    on CFG80211_CERTIFICATION_ONUS.

    Signed-off-by: Ilan Peer
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • The FCC are clarifying some soft configuration requirements,
    which among other include the following:

    1. Indoor operation, where a device can use channels requiring indoor
    operation, subject to that it can guarantee indoor operation,
    i.e., the device is connected to AC Power or the device is under
    the control of a local master that is acting as an AP and is
    connected to AC Power.
    2. Concurrent GO operation, where devices may instantiate a P2P GO
    while they are under the guidance of an authorized master. For example,
    on a channel on which a BSS is connected to an authorized master, i.e.,
    with DFS and radar detection capability in the UNII band.

    See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122

    Add support for advertising Indoor-only and GO-Concurrent channel
    properties.

    Signed-off-by: David Spinadel
    Signed-off-by: Ilan Peer
    Signed-off-by: Johannes Berg

    David Spinadel
     
  • rcu_assign_pointer() ensures that the initialization of a structure is
    carried out before storing a pointer to that structure. However, in the
    case that NULL is assigned there's no structure to initialize so using
    RCU_INIT_POINTER instead is safe and more efficient.

    Signed-off-by: Monam Agarwal
    [rewrite commit log]
    Signed-off-by: Johannes Berg

    Monam Agarwal
     

20 Mar, 2014

1 commit


05 Mar, 2014

1 commit


03 Mar, 2014

1 commit

  • In certain situations we want to trigger reprocessing
    of the last regulatory hint. One situation in which
    this makes sense is the case where the cfg80211 was
    built-in to the kernel, CFG80211_INTERNAL_REGDB was not
    enabled and the CRDA binary is on a partition not availble
    during early boot. In such a case we want to be able to
    re-process the same request at some other point.

    When we are asked to re-process the same request we need
    to be careful to not kfree it, addresses that.

    Reported-by: Sander Eikelenboom
    Signed-off-by: Luis R. Rodriguez
    [rename function]
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     

26 Feb, 2014

1 commit

  • Introduce DFS CAC time as a regd param, configured per REG_RULE and
    set per channel in cfg80211. DFS CAC time is close connected with
    regulatory database configuration. Instead of using hardcoded values,
    get DFS CAC time form regulatory database. Pass DFS CAC time to user
    mode (mainly for iw reg get, iw list, iw info). Allow setting DFS CAC
    time via CRDA. Add support for internal regulatory database.

    Signed-off-by: Janusz Dziedzic
    [rewrap commit log]
    Signed-off-by: Johannes Berg

    Janusz Dziedzic
     

25 Feb, 2014

3 commits


21 Feb, 2014

1 commit

  • Introduce NL80211_RRF_AUTO_BW rule flag. If this flag set
    maximum available bandwidth should be calculated base on
    contiguous rules and wider channels will be allowed to cross
    multiple contiguous/overlapping frequency ranges.

    In case of old kernels maximum bandwidth from regulatory
    rule will be used, while there is no NL80211_RRF_AUTO_BW flag.

    This fixes the previous commit 9752482083066af7ac18a5ca376f
    ("cfg80211: regulatory introduce maximum bandwidth calculation")
    which was found to be a problem for userspace API compatibility.

    Signed-off-by: Janusz Dziedzic
    [edit commit log, use sizeof()]
    Signed-off-by: Johannes Berg

    Signed-off-by: Johannes Berg

    Janusz Dziedzic
     

19 Feb, 2014

1 commit


05 Feb, 2014

5 commits

  • In case we will get regulatory request with rule
    where max_bandwidth_khz is set to 0 handle this
    case as a special one.

    If max_bandwidth_khz == 0 we should calculate maximum
    available bandwidth base on all frequency contiguous rules.
    In case we need auto calculation we just have to set:

    country PL: DFS-ETSI
    (2402 - 2482 @ 40), (N/A, 20)
    (5170 - 5250 @ AUTO), (N/A, 20)
    (5250 - 5330 @ AUTO), (N/A, 20), DFS
    (5490 - 5710 @ 80), (N/A, 27), DFS

    This mean we will calculate maximum bw for rules where
    AUTO (N/A) were set, 160MHz (5330 - 5170) in example above.
    So we will get:
    (5170 - 5250 @ 160), (N/A, 20)
    (5250 - 5330 @ 160), (N/A, 20), DFS

    In other case:
    country FR: DFS-ETSI
    (2402 - 2482 @ 40), (N/A, 20)
    (5170 - 5250 @ AUTO), (N/A, 20)
    (5250 - 5330 @ 80), (N/A, 20), DFS
    (5490 - 5710 @ 80), (N/A, 27), DFS

    We will get 80MHz (5250 - 5170):
    (5170 - 5250 @ 80), (N/A, 20)
    (5250 - 5330 @ 80), (N/A, 20), DFS

    Base on this calculations we will set correct channel
    bandwidth flags (eg. IEEE80211_CHAN_NO_80MHZ).

    We don't need any changes in CRDA or internal regulatory.

    Signed-off-by: Janusz Dziedzic
    [extend nl80211 description a bit, fix typo]
    Signed-off-by: Johannes Berg

    Janusz Dziedzic
     
  • For better use of CPU idle time, allow the scheduler to select the CPU
    on which the timeout work of regulatory settings would be executed.
    This extends CPU idle residency time and saves power.

    This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.

    Cc: "John W. Linville"
    Cc: "David S. Miller"
    Signed-off-by: Shaibal Dutta
    [zoran.markovic@linaro.org: Rebased to latest kernel. Added commit message.]
    Signed-off-by: Zoran Markovic
    Signed-off-by: Johannes Berg

    Shaibal Dutta
     
  • Add helper function that will return regdomain.
    Follow the driver's regulatory domain, if present,
    unless a country IE has been processed or a user
    wants to help compliance further.

    Signed-off-by: Janusz Dziedzic
    [remove useless reg variable]
    Signed-off-by: Johannes Berg

    Janusz Dziedzic
     
  • Instances of struct device_type are never modified, make them const.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Fix the following issues in reg_process_hint():

    1. Add verification that wiphy is valid before processing
    NL80211_REGDOMAIN_SET_BY_COUNTRY_IE.
    2. Free the request in case of invalid initiator.
    3. Remove WARN_ON check on reg_request->alpha2 as it is not a
    pointer.

    Signed-off-by: Ilan Peer
    Signed-off-by: Johannes Berg

    Ilan Peer
     

14 Jan, 2014

1 commit

  • The REGULATORY_CUSTOM_REG can be used during early init with
    the goal of overriding the wiphy's default regulatory settings
    in case the alpha2 of the device is not known. In the case that
    the alpha2 becomes known lets avoid having drivers having to
    clear the REGULATORY_CUSTOM_REG flag by doing it for them
    when regulatory_hint() is used.

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

    Luis R. Rodriguez
     

03 Dec, 2013

1 commit

  • This can be used outside of the regulatory context for any checks
    on the DFS region. The central cfg80211 dfs_region is always used
    and if it does not match with the wiphy a debug print is issued.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     

26 Nov, 2013

13 commits

  • This lets us later reuse the more generic reg_dfs_region_str().

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • Only allow DFS to be set if the DFS regions agree.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • u8 was used in some other places, just stick to the enum,
    this forces us to express the values that are expected.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • Certain vendors may want to disable the processing of
    country IEs so that they can continue using the regulatory
    domain the driver or user has set. Currently there is no
    way to stop the core from processing country IEs, so add
    support to the core to ignore country IE hints.

    Cc: Mihir Shete
    Cc: Henri Bahini
    Cc: Tushnim Bhattacharyya
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • 802.11 cards may have different country IE parsing behavioural
    preferences and vendors may want to support these. These preferences
    were managed by the REGULATORY_CUSTOM_REG and the REGULATORY_STRICT_REG
    flags and their combination. Instead of using this existing notation,
    split out the country IE behavioural preferences as a new flag. This
    will allow us to add more customizations easily and make the code more
    maintainable.

    Cc: Mihir Shete
    Cc: Henri Bahini
    Cc: Tushnim Bhattacharyya
    Signed-off-by: Luis R. Rodriguez
    [fix up conflicts]
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • We'll expand this later, this will make it easier to
    classify and review what things are related to regulatory
    or not.

    Coccinelle only missed 4 hits, which I had to do manually,
    supplying the SmPL in case of merge conflicts.

    @@
    struct wiphy *wiphy;
    @@
    -wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY
    +wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG
    @@
    expression e;
    @@
    -e->flags |= WIPHY_FLAG_CUSTOM_REGULATORY
    +e->regulatory_flags |= REGULATORY_CUSTOM_REG
    @@
    struct wiphy *wiphy;
    @@
    -wiphy->flags &= ~WIPHY_FLAG_CUSTOM_REGULATORY
    +wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG
    @@
    struct wiphy *wiphy;
    @@
    -wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY
    +wiphy->regulatory_flags & REGULATORY_CUSTOM_REG

    @@
    struct wiphy *wiphy;
    @@
    -wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY
    +wiphy->regulatory_flags |= REGULATORY_STRICT_REG
    @@
    expression e;
    @@
    -e->flags |= WIPHY_FLAG_STRICT_REGULATORY
    +e->regulatory_flags |= REGULATORY_STRICT_REG
    @@
    struct wiphy *wiphy;
    @@
    -wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY
    +wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG
    @@
    struct wiphy *wiphy;
    @@
    -wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY
    +wiphy->regulatory_flags & REGULATORY_STRICT_REG

    @@
    struct wiphy *wiphy;
    @@
    -wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS
    +wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS
    @@
    expression e;
    @@
    -e->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS
    +e->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS
    @@
    struct wiphy *wiphy;
    @@
    -wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS
    +wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS
    @@
    struct wiphy *wiphy;
    @@
    -wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS
    +wiphy->regulatory_flags & REGULATORY_DISABLE_BEACON_HINTS

    Generated-by: Coccinelle SmPL
    Cc: Julia Lawall
    Cc: Peter Senna Tschudin
    Cc: Mihir Shete
    Cc: Henri Bahini
    Cc: Tushnim Bhattacharyya
    Signed-off-by: Luis R. Rodriguez
    [fix up whitespace damage, overly long lines]
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • This reflects that case is now completely separated.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • This splits up the driver regulatory update on its
    own, this helps simplify the reading the case.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • This splits out the user regulatory update on its
    own, this helps simplify reading the case.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • This splits up the core regulatory update to be
    set on its own helper. This should make it easier
    to read exactly what type of requests should be
    expected there. In this case its clear that
    NL80211_REGDOM_SET_BY_CORE is only used by the
    core for updating the world regulatory domain.
    This is consistant with the nl80211.h documentation.

    Signed-off-by: Luis R. Rodriguez
    [add warning to default switch case to avoid compiler warning]
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • last_request is RCU protected, since we're getting it
    on set_regdom() we might as well pass it to ensure the
    same request is being processed, otherwise there is a
    small race it could have changed. This makes processing
    of the request atomic.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • Drivers that set the WIPHY_FLAG_CUSTOM_REGULATORY skip
    the core world regulatory domain updates, but do want
    their reg_notifier() called. Move the check for this
    closer to the source of the check that detected skipped
    was required and while at it add a helper for the notifier
    calling. This has no functional changes. This brings together
    the place where we call the reg_notifier() will be called.

    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez