27 Aug, 2020

2 commits


14 Jul, 2020

1 commit


01 Oct, 2019

1 commit

  • In a few places we don't properly initialize on-stack chandefs,
    resulting in EDMG data to be non-zero, which broke things.

    Additionally, in a few places we rely on the driver to init the
    data completely, but perhaps we shouldn't as non-EDMG drivers
    may not initialize the EDMG data, also initialize it there.

    Cc: stable@vger.kernel.org
    Fixes: 2a38075cd0be ("nl80211: Add support for EDMG channels")
    Reported-by: Dmitry Osipenko
    Tested-by: Dmitry Osipenko
    Link: https://lore.kernel.org/r/1569239475-I2dcce394ecf873376c386a78f31c2ec8b538fa25@changeid
    Signed-off-by: Johannes Berg

    Johannes Berg
     

11 Sep, 2019

1 commit

  • When the RFKILL subsystem isn't available, then rfkill_blocked()
    always returns false. In the case of hardware rfkill this will
    be wrong though, as if the hardware reported being killed then
    it cannot operate any longer.

    Since we only ever call the rfkill_sync work in this case, just
    rename it to rfkill_block and always pass "true" for the blocked
    parameter, rather than passing rfkill_blocked().

    We rely on the underlying driver to still reject any new attempt
    to bring up the device by itself.

    Signed-off-by: Johannes Berg
    Signed-off-by: Luca Coelho
    Link: https://lore.kernel.org/r/20190830112451.21655-2-luca@coelho.fi
    Signed-off-by: Johannes Berg

    Johannes Berg
     

26 Apr, 2019

1 commit


25 Jan, 2019

1 commit

  • In preparation to enabling -Wimplicit-fallthrough, mark switch cases
    where we are expecting to fall through.

    This patch fixes the following warnings:

    net/wireless/wext-compat.c:1327:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
    net/wireless/wext-compat.c:1341:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

    Warning level 3 was used: -Wimplicit-fallthrough=3

    This patch is part of the ongoing efforts to enabling
    -Wimplicit-fallthrough

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Johannes Berg

    Gustavo A. R. Silva
     

01 Oct, 2018

1 commit

  • cfg80211_wext_giwrate and sinfo.pertid might allocate sinfo.pertid via
    rdev_get_station(), but never release it. Fix that.

    Fixes: 8689c051a201 ("cfg80211: dynamically allocate per-tid stats for station info")
    Signed-off-by: Stefan Seyfried
    [johannes: fix error path, use cfg80211_sinfo_release_content(), add Fixes]
    Signed-off-by: Johannes Berg

    Stefan Seyfried
     

29 Jun, 2018

1 commit

  • The BIT macro uses unsigned long which some architectures handle as 32 bit
    and therefore might cause macro's shift to overflow when used on a value
    equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards).

    Since 'filled' member in station_info changed to u64, BIT_ULL macro
    should be used with all NL80211_STA_INFO_* attribute types instead of BIT
    to prevent future possible bugs when one will use BIT macro for higher
    attributes by mistake.

    This commit cleans up all usages of BIT macro with the above field
    in cfg80211 by changing it to BIT_ULL instead. In addition, there are
    some places which don't use BIT nor BIT_ULL macros so align those as well.

    Signed-off-by: Omer Efrat
    Signed-off-by: Johannes Berg

    Omer Efrat
     

19 Jan, 2018

1 commit

  • Fix two places where the structure isn't initialized to zero,
    and thus can't be filled properly by the driver.

    Fixes: 4a4b8169501b ("cfg80211: Accept multiple RSSI thresholds for CQM")
    Fixes: 9930380f0bd8 ("cfg80211: implement IWRATE")
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    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
     

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
     

30 Sep, 2016

1 commit


29 Sep, 2016

1 commit

  • Jouni reported that during (repeated) wext_pmf test runs (from the
    wpa_supplicant hwsim test suite) the kernel crashes. The reason is
    that after the key is set, the wext code still unnecessarily stores
    it into the key cache. Despite smatch pointing out an overflow, I
    failed to identify the possibility for this in the code and missed
    it during development of the earlier patch series.

    In order to fix this, simply check that we never store anything but
    WEP keys into the cache, adding a comment as to why that's enough.

    Also, since the cache is still allocated early even if it won't be
    used in many cases, add a comment explaining why - otherwise we'd
    have to roll back key settings to the driver in case of allocation
    failures, which is far more difficult.

    Fixes: 89b706fb28e4 ("cfg80211: reduce connect key caching struct size")
    Reported-by: Jouni Malinen
    Bisected-by: Jouni Malinen
    Signed-off-by: Johannes Berg

    Johannes Berg
     

14 Sep, 2016

2 commits


03 May, 2016

1 commit

  • Since a/b/g/n no longer exist as spec amendements and VHT (ex 802.11ac)
    wasn't handled at all, it's better to just remove the amendment strings
    to avoid confusion.

    Signed-off-by: Johannes Berg
    Reviewed-by: Luca Coelho
    Signed-off-by: Johannes Berg

    Johannes Berg
     

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
     

10 Jun, 2015

1 commit

  • Until recently, mac80211 overwrote all the statistics it could
    provide when getting called, but it now relies on the struct
    having been zeroed by the caller. This was always the case in
    nl80211, but wext used a static struct which could even cause
    values from one device leak to another.

    Using a static struct is OK (as even documented in a comment)
    since the whole usage of this function and its return value is
    always locked under RTNL. Not clearing the struct for calling
    the driver has always been wrong though, since drivers were
    free to only fill values they could report, so calling this
    for one device and then for another would always have leaked
    values from one to the other.

    Fix this by initializing the structure in question before the
    driver method call.

    This fixes https://bugzilla.kernel.org/show_bug.cgi?id=99691

    Cc: stable@vger.kernel.org
    Reported-by: Gerrit Renker
    Reported-by: Alexander Kaltsas
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

01 Mar, 2015

1 commit

  • When a fully converted cfg80211 driver needs cfg80211-wext for
    userspace API purposes, the symbols need not be exported. When
    other drivers (orinoco/hermes or ipw2200) are enabled, they do
    need the symbols exported as they use them directly.

    Make those drivers select a new CFG80211_WEXT_EXPORT Kconfig
    symbol (instead of just CFG80211_WEXT) and export the functions
    only if requested - this saves about 1/2k due to the size of
    EXPORT_SYMBOL() itself.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

08 Jan, 2015

1 commit

  • This is really just duplicating the list of information that's
    already available in the nl80211 attribute, so remove the list.
    Two small changes are needed:
    * remove STATION_INFO_ASSOC_REQ_IES complete, but the length
    (assoc_req_ies_len) can be used instead
    * add NL80211_STA_INFO_RX_DROP_MISC which exists internally
    but not in nl80211 yet

    This gets rid of the duplicate maintenance of the two lists.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

11 Sep, 2014

1 commit


25 Apr, 2014

1 commit


10 Apr, 2014

1 commit


10 Jan, 2014

1 commit


07 Jan, 2014

1 commit

  • While getting the retry limit, wext-compat returns the value
    without updating the flag for retry->flags is 0. Also in this
    case, it updates long retry flag when short and long retry
    value are unequal.

    So, iwconfig never showing "Retry short limit" and showing
    "Retry long limit" when both values are unequal.

    Updated the flags and corrected the condition properly.

    Signed-off-by: Ujjal Roy
    Signed-off-by: Johannes Berg

    Ujjal Roy
     

25 May, 2013

1 commit

  • Virtually all code paths in cfg80211 already (need to) hold
    the RTNL. As such, there's little point in having another
    four mutexes for various parts of the code, they just cause
    lock ordering issues (and much of the time, the RTNL and a
    few of the others need thus be held.)

    Simplify all this by getting rid of the extra four mutexes
    and just use the RTNL throughout. Only a few code changes
    were needed to do this and we can get rid of a work struct
    for bonus points.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

07 Dec, 2012

1 commit


26 Nov, 2012

2 commits

  • Change nl80211 to support specifying a VHT (or HT)
    using the control channel frequency (as before) and
    new attributes for the channel width and first and
    second center frequency. The old channel type is of
    course still supported for HT.

    Also change the cfg80211 channel definition struct
    to support these by adding the relevant fields to
    it (and removing the _type field.)

    This also adds new helper functions:
    - cfg80211_chandef_create to create a channel def
    struct given the control channel and channel type,
    - cfg80211_chandef_identical to check if two channel
    definitions are identical
    - cfg80211_chandef_compatible to check if the given
    channel definitions are compatible, and return the
    wider of the two

    This isn't entirely complete, but that doesn't matter
    until we have a driver using it. In particular, it's
    missing
    - regulatory checks on the usable bandwidth (if that
    even makes sense)
    - regulatory TX power (database can't deal with it)
    - a proper channel compatibility calculation for the
    new channel types

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Instead of passing a channel pointer and channel type
    to all functions and driver methods, pass a new channel
    definition struct. Right now, this struct contains just
    the control channel and channel type, but for VHT this
    will change.

    Also, add a small inline cfg80211_get_chandef_type() so
    that drivers don't need to use the _type field of the
    new structure all the time, which will change.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

30 Oct, 2012

1 commit

  • The TX power setting is currently per wiphy (hardware
    device) but with multi-channel capabilities that doesn't
    make much sense any more.

    Allow drivers (and mac80211) to advertise support for
    per-interface TX power configuration. When the TX power
    is configured for the wiphy, the wdev will be NULL and
    the driver can still handle that, but when a wdev is
    given the TX power can be set only for that wdev now.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

18 Oct, 2012

1 commit


13 Jul, 2012

1 commit

  • This essentially reverts commit 2e165b818456 but
    introduces the get_channel operation with a new
    wireless_dev argument so that you can retrieve
    the channel per interface. This is necessary as
    even though we can track all interface channels
    (except monitor) we can't track the channel type
    used.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

29 Jun, 2012

1 commit


07 Jun, 2012

1 commit

  • Now that we've removed all uses of the set_channel
    API except for the monitor channel and in libertas,
    clarify this. Split the libertas mesh use into a
    new libertas_set_mesh_channel() operation, just to
    keep backward compatibility, and rename the normal
    set_channel() to set_monitor_channel().

    Also describe the desired set_monitor_channel()
    semantics more clearly.

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

    Johannes Berg
     

06 Jun, 2012

2 commits

  • Just like the AP mode patch, instead of setting
    the channel and then joining the mesh network,
    provide the channel to join the network on to
    the join_mesh() function.

    Like in AP mode, you can also give the channel
    to the join-mesh nl80211 command now.

    Unlike AP mode, it picks a default channel if
    none was given.

    As libertas uses mesh mode interfaces but has
    no join_mesh callback and we can't simply break
    it, keep some compatibility code for that case
    and configure the channel directly for it.

    In the non-libertas case, where we store the
    channel until join, allow setting it while the
    interface is down.

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

    Johannes Berg
     
  • If it worked (Felix says it doesn't right now), the
    typical use-case for WDS interfaces would be to be
    slaved to AP mode interfaces. Therefore, it isn't
    necessary to set the channel on WDS interfaces. As
    they don't support powersave or anything like that,
    they also couldn't use a different channel anyway.

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

    Johannes Berg
     

14 Apr, 2012

1 commit


18 Nov, 2011

1 commit


12 Nov, 2011

1 commit