25 Feb, 2018

1 commit

  • commit 51a1aaa631c90223888d8beac4d649dc11d2ca55 upstream.

    When creating a new radio on the fly, hwsim allows this
    to be done with an arbitrary number of channels, but
    cfg80211 only supports a limited number of simultaneous
    channels, leading to a warning.

    Fix this by validating the number - this requires moving
    the define for the maximum out to a visible header file.

    Reported-by: syzbot+8dd9051ff19940290931@syzkaller.appspotmail.com
    Fixes: b59ec8dd4394 ("mac80211_hwsim: fix number of channels in interface combinations")
    Signed-off-by: Johannes Berg
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

28 Apr, 2017

2 commits

  • Have proper request id filled in the SCHED_SCAN_RESULTS and
    SCHED_SCAN_STOPPED notifications toward user-space by having the
    driver provide it through the api.

    Reviewed-by: Hante Meuleman
    Reviewed-by: Pieter-Paul Giesberts
    Reviewed-by: Franky Lin
    Signed-off-by: Arend van Spriel
    Signed-off-by: Johannes Berg

    Arend Van Spriel
     
  • cfg80211_roamed() and cfg80211_roamed_bss() take the same arguments
    except that cfg80211_roamed() requires the BSSID and
    cfg80211_roamed_bss() requires the bss entry.

    Unify the two functions by using a struct for driver initiated
    roaming information so that either the BSSID or the bss entry can be
    passed as an argument to the unified function.

    Signed-off-by: Avraham Stern
    [modified the ath6k, brcm80211, rndis and wlan-ng drivers accordingly]
    Signed-off-by: Luca Coelho
    [modify brcmfmac to remove the useless cast, spotted by Arend]
    Signed-off-by: Johannes Berg

    Avraham Stern
     

27 Apr, 2017

2 commits

  • This patch implements the idea to have multiple scheduled scan requests
    running concurrently. It mainly illustrates how to deal with the incoming
    request from user-space in terms of backward compatibility. In order to
    use multiple scheduled scans user-space needs to provide a flag attribute
    NL80211_ATTR_SCHED_SCAN_MULTI to indicate support. If not the request is
    treated as a legacy scan.

    Drivers currently supporting scheduled scan are now indicating they support
    a single scheduled scan request. This obsoletes WIPHY_FLAG_SUPPORTS_SCHED_SCAN.

    Reviewed-by: Hante Meuleman
    Reviewed-by: Pieter-Paul Giesberts
    Reviewed-by: Franky Lin
    Signed-off-by: Arend van Spriel
    [clean up netlink destroy path to avoid allocations, code cleanups]
    Signed-off-by: Johannes Berg

    Arend Van Spriel
     
  • There's no need to allocate a portid structure and then, for
    each of those, walk the interfaces - we can just add a flag
    to each interface and walk those directly. Due to padding in
    the struct, we can even do it without any memory cost, and
    it even simplifies the code.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

13 Apr, 2017

1 commit

  • Instead passing both flags, which can be NULL, and vif_params,
    which are never NULL, move the flags into the vif_params and
    use BIT(0), which is invalid from userspace, to indicate that
    the flags were changed.

    While updating all drivers, fix a small bug in wil6210 where
    it was setting the flags to 0 instead of leaving them unchanged.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

31 Mar, 2017

1 commit

  • Currently the connect event from driver takes all the connection
    response parameters as arguments. With support for new features these
    response parameters can grow. Use a structure to pass these parameters
    rather than passing them as function arguments.

    Signed-off-by: Vidyullatha Kanchanapally
    Signed-off-by: Jouni Malinen
    [add to documentation]
    Signed-off-by: Johannes Berg

    Vidyullatha Kanchanapally
     

06 Mar, 2017

3 commits

  • Sharing DFS channel state across multiple wiphys (radios) could
    be useful with multiple radios on the system. When one radio
    completes CAC and markes the channel available another radio
    can use this information and start beaconing without really doing
    CAC.

    Whenever there is a state change in dfs channel associated to
    a particular wiphy the the same state change is propagated to
    other wiphys having the same DFS reg domain configuration.
    Also when a new wiphy is created the dfs channel state of
    other existing wiphys of same DFS domain is copied.

    Signed-off-by: Vasanthakumar Thiagarajan
    Signed-off-by: Johannes Berg

    Vasanthakumar Thiagarajan
     
  • DFS requirement for ETSI domain (section 4.7.1.4 in
    ETSI EN 301 893 V1.8.1) is the only one which explicitly
    states that once DFS channel is marked as available afer
    the CAC, this channel will remain in available state even
    moving to a different operating channel. But the same is
    not explicitly stated in FCC DFS requirement. Also, Pre-CAC
    requriements are not explicitly mentioned in FCC requirement.
    Current implementation in keeping DFS channel in available
    state is same as described in ETSI domain.

    For non-ETSI DFS domain, this patch gives a grace period of 2 seconds
    since the completion of successful CAC before moving the channel's
    DFS state to 'usable' from 'available' state. The same grace period
    is checked against the channel's dfs_state_entered timestamp while
    deciding if a DFS channel is available for operation. There is a new
    radar event, NL80211_RADAR_PRE_CAC_EXPIRED, reported when DFS channel
    is moved from available to usable state after the grace period. Also
    make sure the DFS channel state is reset to usable once the beaconing
    operation on that channel is brought down (like stop_ap, leave_ibss
    and leave_mesh) in non-ETSI domain.

    Signed-off-by: Vasanthakumar Thiagarajan
    Signed-off-by: Johannes Berg

    Vasanthakumar Thiagarajan
     
  • Change the SET CQM command's RSSI threshold attribute to accept any
    number of thresholds as a sorted array. The API should be backwards
    compatible so that if one s32 threshold value is passed, the old
    mechanism is enabled. The netlink event generated is the same in both
    cases.

    cfg80211 handles an arbitrary number of RSSI thresholds but drivers have
    to provide a method (set_cqm_rssi_range_config) that configures a range
    set by a high and a low value. Drivers have to call back when the RSSI
    goes out of that range and there's no additional event for each time the
    range is reconfigured as there was with the current one-threshold API.

    This method doesn't have a hysteresis parameter because there's no
    benefit to the cfg80211 code from having the hysteresis be handled by
    hardware/driver in terms of the number of wakeups. At the same time
    it would likely be less consistent between drivers if offloaded or
    done in the drivers.

    Signed-off-by: Andrew Zaborowski
    Signed-off-by: Johannes Berg

    Andrew Zaborowski
     

13 Jan, 2017

1 commit

  • This enhances the connect timeout API to also carry the reason for the
    timeout. These reason codes for the connect time out are represented by
    enum nl80211_timeout_reason and are passed to user space through a new
    attribute NL80211_ATTR_TIMEOUT_REASON (u32).

    Signed-off-by: Purushottam Kushwaha
    Signed-off-by: Jouni Malinen
    [keep gfp_t argument last]
    Signed-off-by: Johannes Berg

    Purushottam Kushwaha
     

09 Jan, 2017

1 commit

  • Disconnect or deauthenticate when the owning socket is closed if this
    flag is supplied to CMD_CONNECT or CMD_ASSOCIATE. This may be used
    to ensure userspace daemon doesn't leave an unmanaged connection behind.

    In some situations it would be possible to account for that, to some
    degree, in the deamon restart code or in the up/down scripts without
    the use of this attribute. But there will be systems where the daemon
    can go away for varying periods without a warning due to local resource
    management.

    Signed-off-by: Andrew Zaborowski
    Signed-off-by: Johannes Berg

    Andrzej Zaborowski
     

06 Jan, 2017

1 commit


10 Dec, 2016

1 commit


09 Dec, 2016

1 commit

  • When mac80211 abandons an association attempt, it may free
    all the data structures, but inform cfg80211 and userspace
    about it only by sending the deauth frame it received, in
    which case cfg80211 has no link to the BSS struct that was
    used and will not cfg80211_unhold_bss() it.

    Fix this by providing a way to inform cfg80211 of this with
    the BSS entry passed, so that it can clean up properly, and
    use this ability in the appropriate places in mac80211.

    This isn't ideal: some code is more or less duplicated and
    tracing is missing. However, it's a fairly small change and
    it's thus easier to backport - cleanups can come later.

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

    Johannes Berg
     

23 Nov, 2016

1 commit

  • All conflicts were simple overlapping changes except perhaps
    for the Thunder driver.

    That driver has a change_mtu method explicitly for sending
    a message to the hardware. If that fails it returns an
    error.

    Normally a driver doesn't need an ndo_change_mtu method becuase those
    are usually just range changes, which are now handled generically.
    But since this extra operation is needed in the Thunder driver, it has
    to stay.

    However, if the message send fails we have to restore the original
    MTU before the change because the entire call chain expects that if
    an error is thrown by ndo_change_mtu then the MTU did not change.
    Therefore code is added to nicvf_change_mtu to remember the original
    MTU, and to restore it upon nicvf_update_hw_max_frs() failue.

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Nov, 2016

1 commit

  • It's possible to make scanning consume almost arbitrary amounts
    of memory, e.g. by sending beacon frames with random BSSIDs at
    high rates while somebody is scanning.

    Limit the number of BSS table entries we're willing to cache to
    1000, limiting maximum memory usage to maybe 4-5MB, but lower
    in practice - that would be the case for having both full-sized
    beacon and probe response frames for each entry; this seems not
    possible in practice, so a limit of 1000 entries will likely be
    closer to 0.5 MB.

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

    Johannes Berg
     

27 Oct, 2016

1 commit

  • This adds defines and nl80211 extensions to allow FILS Authentication to
    be implemented similarly to SAE. FILS does not need the special rules
    for the Authentication transaction number and Status code fields, but it
    does need to add non-IE fields. The previously used
    NL80211_ATTR_SAE_DATA can be reused for this to avoid having to
    duplicate that implementation. Rename that attribute to more generic
    NL80211_ATTR_AUTH_DATA (with backwards compatibility define for
    NL80211_SAE_DATA).

    Also document the special rules related to the Authentication
    transaction number and Status code fiels.

    Signed-off-by: Jouni Malinen
    Signed-off-by: Johannes Berg

    Jouni Malinen
     

13 Oct, 2016

1 commit

  • This commit provides a mechanism for the host drivers to advertise the
    support for different beacon intervals among the respective interface
    combinations in a group, through NL80211_IFACE_COMB_BI_MIN_GCD (u32).

    This value will be compared against GCD of all beaconing interfaces of
    matching combinations.

    If the driver doesn't advertise this value, the old behaviour where
    all beacon intervals must be identical is retained.

    If it is specified, then any beacon interval for an interface in the
    interface combination as well as the GCD of all active beacon intervals
    in the combination must be greater or equal to this value.

    Signed-off-by: Purushottam Kushwaha
    [change commit message, some variable names, small other things]
    Signed-off-by: Johannes Berg

    Purushottam Kushwaha
     

30 Sep, 2016

2 commits

  • This allows user space to start/stop NAN interface.
    A NAN interface is like P2P device in a few aspects: it
    doesn't have a netdev associated to it.
    Add the new interface type and prevent operations that
    can't be executed on NAN interface like scan.

    Define several attributes that may be configured by user space
    when starting NAN functionality (master preference and dual
    band operation)

    Signed-off-by: Andrei Otcheretianski
    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Ayala Beker
     
  • Add support for drivers that implement static WEP internally, i.e.
    expose connection keys to the driver in connect flow and don't
    upload the keys after the connection.

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

    David Spinadel
     

14 Sep, 2016

1 commit


06 Jul, 2016

1 commit

  • Beacon report radio measurement requires reporting observed BSSs
    on the channels specified in the beacon request. If the measurement
    mode is set to passive or active, it requires actually performing a
    scan (passive or active, accordingly), and reporting the time that
    the scan was started and the time each beacon/probe was received
    (both in terms of TSF of the BSS of the requesting AP). If the
    request mode is table, this information is optional.
    In addition, the radio measurement request specifies the channel
    dwell time for the measurement.

    In order to use scan for beacon report when the mode is active or
    passive, add a parameter to scan request that specifies the
    channel dwell time, and add scan start time and beacon received time
    to scan results information.

    Supporting beacon report is required for Multi Band Operation (MBO).

    Signed-off-by: Assaf Krauss
    Signed-off-by: David Spinadel
    Signed-off-by: Avraham Stern
    Signed-off-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Avraham Stern
     

31 May, 2016

1 commit

  • Previously, the status parameter to cfg80211_connect_result() was
    documented as using WLAN_STATUS_UNSPECIFIED_FAILURE (1) when the real
    status code for the failure is not known. This value can be used by an
    AP (and often is) and as such, user space cannot distinguish between
    explicitly rejected authentication/association and not being able to
    even try to associate or not receiving a response from the AP.

    Add a new inline function, cfg80211_connect_timeout(), to be used when
    the driver knows that the connection attempt failed due to a reason
    where connection could not be attempt or no response was received from
    the AP. The internal functions now allow a negative status value (-1) to
    be used as an indication of this special case. This results in the
    NL80211_ATTR_TIMED_OUT to be added to the NL80211_CMD_CONNECT event to
    allow user space to determine this case was hit. For backwards
    compatibility, NL80211_STATUS_CODE with the value
    WLAN_STATUS_UNSPECIFIED_FAILURE is still indicated in the event in such
    a case.

    Signed-off-by: Jouni Malinen
    [johannes: fix cfg80211_connect_bss() prototype to use int for status,
    add cfg80211_connect_timeout() to docbook, fix docbook]
    Signed-off-by: Johannes Berg

    Jouni Malinen
     

12 May, 2016

2 commits


26 Apr, 2016

1 commit

  • Since cfg80211 maintains separate BSS table entries for APs if the same
    BSSID, SSID pair is seen on multiple channels, it is possible that it
    can map the current_bss to a BSS entry on the wrong channel. This
    current_bss will not get flushed unless disconnected and cfg80211
    reports a wrong channel as the associated channel.

    Fix this by introducing a new cfg80211_connect_bss() function which is
    similar to cfg80211_connect_result(), but it includes an additional
    parameter: the bss the STA is connected to. This allows drivers to
    provide the exact bss entry that matches the BSS to which the connection
    was completed.

    Reviewed-by: Jouni Malinen
    Signed-off-by: Vidyullatha Kanchanapally
    Signed-off-by: Sunil Dutt
    Signed-off-by: Johannes Berg

    Kanchanapally, Vidyullatha
     

04 Dec, 2015

1 commit


13 Oct, 2015

1 commit

  • For location and connectivity services, userspace would often like
    to know the time when the BSS was last seen. The current "last seen"
    value is calculated in a way that makes it less useful, especially
    if the system suspended in the meantime.

    Add the ability for the driver to report a real CLOCK_BOOTTIME stamp
    that can then be reported to userspace (if present).

    Drivers wishing to use this must be converted to the new API to call
    cfg80211_inform_bss_data() or cfg80211_inform_bss_frame_data(). They
    need to ensure the reported value is accurate enough even when the
    frame might have been buffered in the device (e.g. firmware.)

    Signed-off-by: Dmitry Shmidt
    [modified to use struct, inlines]
    Signed-off-by: Johannes Berg

    Dmitry Shmidt
     

17 Jul, 2015

1 commit

  • This callback is currently not allowed to sleep, which makes it more
    difficult to implement proper driver methods in mac80211 than it has
    to be. Instead of doing asynchronous work here in mac80211, make it
    possible for the callback to sleep by doing some asynchronous work
    in cfg80211. This also enables improvements to other drivers, like
    ath6kl, that would like to sleep in this callback.

    While at it, also fix the code to call the driver on the implicit
    unregistration when an interface is removed, and do that also when
    a P2P-Device wdev is destroyed (otherwise we leak the structs.)

    Signed-off-by: Johannes Berg

    Johannes Berg
     

26 May, 2015

1 commit

  • When we disconnect from the AP, drivers call cfg80211_disconnect().
    This doesn't know whether the disconnection was initiated locally
    or by the AP though, which can cause problems with the supplicant,
    for example with WPS. This issue obviously doesn't show up with any
    mac80211 based driver since mac80211 doesn't call this function.

    Fix this by requiring drivers to indicate whether the disconnect is
    locally generated or not. I've tried to update the drivers, but may
    not have gotten the values correct, and some drivers may currently
    not be able to report correct values. In case of doubt I left it at
    false, which is the current behaviour.

    For libertas, make adjustments as indicated by Dan Williams.

    Reported-by: Matthieu Mauger
    Tested-by: Matthieu Mauger
    Signed-off-by: Johannes Berg

    Johannes Berg
     

18 Dec, 2014

2 commits


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
     

20 Nov, 2014

1 commit

  • Add a new WoWLAN API to enable net-detect as a wake up trigger.
    Net-detect allows the device to scan in the background while the
    host is asleep to wake up the host system when a matching network
    is found.

    Reuse the scheduled scan attributes to specify how the scan is
    performed while suspended and the matches that will trigger a
    wake event.

    Signed-off-by: Luciano Coelho
    Signed-off-by: Johannes Berg

    Luciano Coelho
     

04 Nov, 2014

1 commit

  • This patch adds new iface type (NL80211_IFTYPE_OCB) representing
    the OCB (Outside the Context of a BSS) mode.
    When establishing a connection to the network a cfg80211_join_ocb
    function is called (particular nl80211_command is added as well).
    A mandatory parameters during the ocb_join operation are 'center
    frequency' and 'channel width (5/10 MHz)'.

    Changes done in mac80211 are minimal possible required to avoid
    many warnings (warning: enumeration value 'NL80211_IFTYPE_OCB'
    not handled in switch) during compilation. Full functionality
    (where needed) is added in the following patch.

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

    Rostislav Lisovy
     

23 Jun, 2014

1 commit


06 May, 2014

1 commit

  • This exports a new cfg80211_stop_iface() function.

    This is intended for driver internal interface
    combination management and channel switching.

    Due to locking issues (it re-enters driver) the
    call is asynchronous and uses cfg80211 event
    list/worker.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     

25 Apr, 2014

1 commit