17 Dec, 2014

1 commit

  • Add a new regulatory flag that allows a driver to manage regdomain
    changes/updates for its own wiphy.
    A self-managed wiphys only employs regulatory information obtained from
    the FW and driver and does not use other cfg80211 sources like
    beacon-hints, country-code IEs and hints from other devices on the same
    system. Conversely, a self-managed wiphy does not share its regulatory
    hints with other devices in the system. If a system contains several
    devices, one or more of which are self-managed, there might be
    contradictory regulatory settings between them. Usage of flag is
    generally discouraged. Only use it if the FW/driver is incompatible
    with non-locally originated hints.

    A new API lets the driver send a complete regdomain, to be applied on
    its wiphy only.

    After a wiphy-specific regdomain change takes place, usermode will get
    a new type of change notification. The regulatory core also takes care
    enforce regulatory restrictions, in case some interfaces are on
    forbidden channels.

    Signed-off-by: Jonathan Doron
    Signed-off-by: Arik Nemtsov
    Reviewed-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Jonathan Doron
     

28 Nov, 2014

1 commit

  • When the regulatory settings change, some channels might become invalid.
    Disconnect interfaces acting on these channels, after giving userspace
    code a grace period to leave them.

    This mode is currently opt-in, and not all interface operating modes are
    supported for regulatory-enforcement checks. A wiphy that wishes to use
    the new enforcement code must specify an appropriate regulatory flag,
    and all its supported interface modes must be supported by the checking
    code.

    Signed-off-by: Arik Nemtsov
    Reviewed-by: Luis R. Rodriguez
    [fix some indentation, typos]
    Signed-off-by: Johannes Berg

    Arik Nemtsov
     

15 Aug, 2014

1 commit

  • alpha2 is defined as 2-chars array, but is used in multiple
    places as string (e.g. with nla_put_string calls), which
    might leak kernel data.

    Solve it by simply adding an extra char for the NULL
    terminator, making such operations safe.

    Cc: stable@vger.kernel.org
    Signed-off-by: Eliad Peller
    Signed-off-by: Johannes Berg

    Eliad Peller
     

09 Apr, 2014

1 commit

  • 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
     

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
     

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
     

26 Nov, 2013

4 commits

  • 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
     

03 Jan, 2013

2 commits


17 Jul, 2012

1 commit

  • Cellular base stations can provide hints to cfg80211 about
    where they think we are. This can be done for example on
    a cell phone. To enable these hints we simply allow them
    through as user regulatory hints but we allow userspace
    to clasify the hint as either coming directly from the
    user or coming from a cellular base station. This option
    is only available when you enable
    CONFIG_CFG80211_CERTIFICATION_ONUS.

    The base station hints themselves will not be processed
    by the core unless at least one device on the system
    supports this feature.

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

    Luis R. Rodriguez
     

22 Nov, 2011

2 commits


26 Aug, 2011

1 commit


23 Nov, 2010

1 commit

  • 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
     

21 Jul, 2010

1 commit

  • The meaning and/or usage of the country IE is somewhat poorly defined.
    In practice, this means that regulatory rulesets in a country IE are
    often incomplete and might be untrustworthy. This removes the code
    associated with interpreting those rulesets while preserving respect
    for country "alpha2" codes also contained in the country IE.

    Signed-off-by: John W. Linville

    John W. Linville
     

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
     

23 Apr, 2009

1 commit

  • Trying to separate header files into net/wireless.h and
    net/cfg80211.h has been a source of confusion. Remove
    net/wireless.h (because there also is the linux/wireless.h)
    and subsume everything into net/cfg80211.h -- except the
    definitions for regulatory structures which get moved to
    a new header net/regulatory.h.

    The "new" net/cfg80211.h is now divided into sections.

    There are no real changes in this patch but code shuffling
    and some very minor documentation fixes.

    I have also, to make things reflect reality, put in a
    copyright line for Luis to net/regulatory.h since that
    is probably exclusively written by him but was formerly
    in a file that only had my copyright line.

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

    Johannes Berg