28 Sep, 2020

1 commit


27 Aug, 2020

1 commit


05 Jun, 2020

1 commit

  • Lockdep reports that we may deadlock because we take the RTNL on
    the work struct, but flush it under RTNL. Clearly, it's correct.
    In practice, this can happen when doing rfkill on an active device.

    Fix this by moving the work struct to the wiphy (registered dev)
    layer, and iterate over all the wdevs inside there. This then
    means we need to track which one of them has work to do, so we
    don't update to the driver for all wdevs all the time.

    Also fix a locking bug I noticed while working on this - the
    registrations list is iterated as if it was an RCU list, but it
    isn't handle that way - and we need to lock now for the update
    flag anyway, so remove the RCU.

    Fixes: 6cd536fe62ef ("cfg80211: change internal management frame registration API")
    Reported-by: Markus Theil
    Reported-and-tested-by: Kenneth R. Crudup
    Signed-off-by: Johannes Berg
    Link: https://lore.kernel.org/r/20200604120420.b1dc540a7e26.I55dcca56bb5bdc5d7ad66a36a0b42afd7034d8be@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     

27 May, 2020

1 commit

  • Drivers may wish to report the RX frequency in units of
    KHz. Provide cfg80211_rx_mgmt_khz() and wrap it with
    cfg80211_rx_mgmt() so exisiting drivers which can't report
    KHz anyway don't need to change. Add a similar wrapper for
    cfg80211_report_obss_beacon() so the frequency units stay
    somewhat consistent.

    This doesn't actually change the nl80211 API yet.

    Signed-off-by: Thomas Pedersen
    Link: https://lore.kernel.org/r/20200430172554.18383-2-thomas@adapt-ip.com
    [fix mac80211 calling the non-khz version of obss beacon report,
    drop trace point name changes]
    Signed-off-by: Johannes Berg

    Thomas Pedersen
     

24 Apr, 2020

2 commits

  • For DPP, there's a need to receive multicast action frames,
    but many drivers need a special filter configuration for this.

    Support announcing from userspace in the management registration
    that multicast RX is required, with an extended feature flag if
    the driver handles this.

    Signed-off-by: Johannes Berg
    Reviewed-by: Sergey Matyukevich
    Link: https://lore.kernel.org/r/20200417124013.c46238801048.Ib041d437ce0bff28a0c6d5dc915f68f1d8591002@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Almost all drivers below cfg80211 get the API wrong (except for
    cfg80211) and are unable to cope with multiple registrations for
    the same frame type, which is valid due to the match filter.
    This seems to indicate the API is wrong, and we should maintain
    the full information in cfg80211 instead of the drivers.

    Change the API to no longer inform the driver about individual
    registrations and unregistrations, but rather every time about
    the entire state of the entire wiphy and single wdev, whenever
    it may have changed. This also simplifies the code in cfg80211
    as it no longer has to track exactly what was unregistered and
    can free things immediately.

    Signed-off-by: Johannes Berg
    Acked-by: Arend van Spriel
    Reviewed-by: Sergey Matyukevich
    Link: https://lore.kernel.org/r/20200417124300.f47f3828afc8.I7f81ef59c2c5a340d7075fb3c6d0e08e8aeffe07@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     

07 Feb, 2020

1 commit

  • To support Pre Association Security Negotiation (PASN) while already
    associated to one AP, allow user space to register to Rx
    authentication frames, so that the user space logic would be able to
    receive/handle authentication frames from a different AP as part of
    PASN.

    Note that it is expected that user space would intelligently register
    for Rx authentication frames, i.e., only when PASN is used and
    configure a match filter only for PASN authentication algorithm, as
    otherwise the MLME functionality of mac80211 would be broken.

    Additionally, since some versions of the user space daemons wrongly
    register to all types of authentication frames (which might result in
    unexpected behavior) allow such registration if the request is for a
    specific authentication algorithm number.

    Signed-off-by: Ilan Peer
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20200131114529.894206-1-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Ilan Peer
     

22 Feb, 2019

1 commit

  • This extends the NL80211_CMD_ASSOCIATE event case to report
    NL80211_ATTR_REQ_IE similarly to what is already done with the
    NL80211_CMD_CONNECT events if the driver provides this information. In
    practice, this adds (Re)Association Request frame information element
    reporting to mac80211 drivers for the cases where user space SME is
    used.

    This provides more information for user space to figure out which
    capabilities were negotiated for the association. For example, this can
    be used to determine whether HT, VHT, or HE is used.

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

    Jouni Malinen
     

09 Nov, 2018

1 commit


29 Mar, 2018

1 commit


21 Mar, 2018

1 commit


11 Dec, 2017

1 commit

  • Both cfg80211_rx_mgmt and cfg80211_report_obss_beacon functions send
    reports to userspace using NL80211_ATTR_RX_SIGNAL_DBM attribute w/o
    any processing of their input signal values. Which means that in
    order to match userspace tools expectations, input signal values
    for those functions are supposed to be in dBm units.

    This patch cleans up comments, variable names, and trace reports
    for those functions, replacing confusing 'mBm' by 'dBm'.

    Signed-off-by: Sergey Matyukevich
    Signed-off-by: Johannes Berg

    Sergey Matyukevich
     

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
     

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

2 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
     

13 Jan, 2017

2 commits

  • 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
     
  • Add support to use a random local address (Address 2 = TA in transmit
    and the same address in receive functionality) for Public Action frames
    in order to improve privacy of WLAN clients. Applications fill the
    random transmit address in the frame buffer in the NL80211_CMD_FRAME
    command. This can be used only with the drivers that indicate support
    for random local address by setting the new
    NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA and/or
    NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED in ext_features.

    The driver needs to configure receive behavior to accept frames to the
    specified random address during the time the frame exchange is pending
    and such frames need to be acknowledged similarly to frames sent to the
    local permanent address when this random address functionality is not
    used.

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

    vamsi krishna
     

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
     

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
     

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
     

30 Sep, 2016

1 commit

  • 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
     

14 Sep, 2016

1 commit


12 Apr, 2016

1 commit

  • This enum is already perfectly aliased to enum nl80211_band, and
    the only reason for it is that we get IEEE80211_NUM_BANDS out of
    it. There's no really good reason to not declare the number of
    bands in nl80211 though, so do that and remove the cfg80211 one.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

14 Jan, 2016

1 commit


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
     

03 Mar, 2015

1 commit

  • 802.11ad adds new a network type (PBSS) and changes the capability
    field interpretation for the DMG (60G) band.
    The same 2 bits that were interpreted as "ESS" and "IBSS" before are
    re-used as a 2-bit field with 3 valid values (and 1 reserved). Valid
    values are: "IBSS", "PBSS" (new) and "AP".

    In order to get the BSS struct for the new PBSS networks, change the
    cfg80211_get_bss() function to take a new enum ieee80211_bss_type
    argument with the valid network types, as "capa_mask" and "capa_val"
    no longer work correctly (the search must be band-aware now.)

    The remaining bits in "capa_mask" and "capa_val" are used only for
    privacy matching so replace those two with a privacy enum as well.

    Signed-off-by: Dedy Lansky
    [rewrite commit log, tiny fixes]
    Signed-off-by: Johannes Berg

    Dedy Lansky
     

11 Sep, 2014

1 commit

  • Userspace might need to know what queues are configured
    for uapsd (e.g. for setting proper default values in tspecs).

    Add this bitmap to the association event (inside wmm
    nested attribute)

    Add additional parameter to cfg80211_rx_assoc_resp,
    and update its callers.

    Signed-off-by: Eliad Peller
    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Johannes Berg

    Eliad Peller
     

26 Aug, 2014

1 commit

  • In the cfg80211_rx_mgmt(), parameter @gfp was used for the memory allocation.
    But, memory get allocated under spin_lock_bh(), this implies atomic context.
    So, one can't use GFP_KERNEL, only variants with no __GFP_WAIT. Actually, in all
    occurrences GFP_ATOMIC is used (wil6210 use GFP_KERNEL by mistake),
    and it should be this way or warning triggered in the memory allocation code.

    Remove @gfp parameter as no actual choice exist, and use hard coded
    GFP_ATOMIC for memory allocation.

    Signed-off-by: Vladimir Kondratiev
    Signed-off-by: Johannes Berg

    Vladimir Kondratiev
     

25 Apr, 2014

1 commit


09 Apr, 2014

1 commit


26 Feb, 2014

1 commit


05 Feb, 2014

1 commit

  • It was possible to break interface combinations in
    the following way:

    combo 1: iftype = AP, num_ifaces = 2, num_chans = 2,
    combo 2: iftype = AP, num_ifaces = 1, num_chans = 1, radar = HT20

    With the above interface combinations it was
    possible to:

    step 1. start AP on DFS channel by matching combo 2
    step 2. start AP on non-DFS channel by matching combo 1

    This was possible beacuse (step 2) did not consider
    if other interfaces require radar detection.

    The patch changes how cfg80211 tracks channels -
    instead of channel itself now a complete chandef
    is stored.

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

    Michal Kazior
     

02 Dec, 2013

1 commit


26 Nov, 2013

1 commit

  • To report channel width correctly we have
    to send correct channel parameters from
    mac80211 when calling cfg80211_cac_event().

    This is required in case of using channel width
    higher than 20MHz and we have to set correct
    dfs channel state after CAC (NL80211_DFS_AVAILABLE).

    Signed-off-by: Janusz Dziedzic
    Reviewed-by: Luis R. Rodriguez
    Signed-off-by: Johannes Berg

    Janusz Dziedzic
     

21 Oct, 2013

2 commits


23 Aug, 2013

1 commit

  • Add flags intended to report various auxiliary information
    and introduce the NL80211_RXMGMT_FLAG_ANSWERED flag to report
    that the frame was already answered by the device.

    Signed-off-by: Vladimir Kondratiev
    [REPLIED->ANSWERED, reword commit message]
    Signed-off-by: Johannes Berg

    Vladimir Kondratiev
     

20 Jun, 2013

2 commits

  • This fixes the potential issue that the BSS struct that we use
    and later assign to wdev->current_bss is removed from the scan
    list while associating.

    Also warn when we don't have a BSS struct in connect_result
    unless it's from a driver that only has the connect() API.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Doing so will allow us to hold the BSS (not just ref it) over the
    association process, thus ensuring that it doesn't time out and
    gets invisible to the user (e.g. in 'iw wlan0 link'.)

    This also fixes a leak in mac80211 where it doesn't always release
    the BSS struct properly in all cases where calling this function.
    This leak was reported by Ben Greear.

    Signed-off-by: Johannes Berg

    Johannes Berg