Skip to content
Permalink
Christian-Lamp…
Switch branches/tags

Commits on Oct 15, 2021

  1. ath10k: fetch (pre-)calibration data via nvmem subsystem

    On most embedded ath10k devices (like range extenders,
    routers, accesspoints, ...) the calibration data is
    stored in a easily accessible MTD partitions named
    "ART", "caldata", "calibration", etc...
    
    Since commit 4b361cf ("mtd: core: add OTP nvmem provider support"):
    MTD partitions and portions of them can be specified
    as potential nvmem-cells which are accessible through
    the nvmem subsystem.
    
    This feature - together with an nvmem cell definition either
    in the platform data or via device-tree allows drivers to get
    the (pre-)calibration data which is required for initializing
    the WIFI.
    
    Tested with Netgear EX6150v2 (IPQ4018)
    
    Cc: Robert Marko <robimarko@gmail.com>
    Cc: Thibaut Varène <hacks@slashdirt.org>
    Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
    chunkeey authored and intel-lab-lkp committed Oct 15, 2021

Commits on Oct 13, 2021

  1. ath10k: fix max antenna gain unit

    Most of the txpower for the ath10k firmware is stored as twicepower (0.5 dB
    steps). This isn't the case for max_antenna_gain - which is still expected
    by the firmware as dB.
    
    The firmware is converting it from dB to the internal (twicepower)
    representation when it calculates the limits of a channel. This can be seen
    in tpc_stats when configuring "12" as max_antenna_gain. Instead of the
    expected 12 (6 dB), the tpc_stats shows 24 (12 dB).
    
    Tested on QCA9888 and IPQ4019 with firmware 10.4-3.5.3-00057.
    
    Fixes: 0225693 ("ath10k: use proper tx power unit")
    Signed-off-by: Sven Eckelmann <seckelmann@datto.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20190611172131.6064-1-sven@narfation.org
    Sven Eckelmann authored and Kalle Valo committed Oct 13, 2021
  2. ath9k: fix an IS_ERR() vs NULL check

    The devm_kmemdup() function doesn't return error pointers, it returns
    NULL on error.
    
    Fixes: eb3a97a ("ath9k: fetch calibration data via nvmem subsystem")
    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211011123533.GA15188@kili
    error27 authored and Kalle Valo committed Oct 13, 2021
  3. ath11k: Identify DFS channel when sending scan channel list command

    WMI_CHAN_INFO_DFS flag should be set when configuring a DFS channel
    included in scan channel list. Without it, firmware will not send a
    probe request frame which is needed in connection to an AP configured
    with hidden SSID/network_id. So fix this to allow probe request frames
    to be sent in cases where a beacon frame has been seen on the channel
    first.
    
    Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
    
    Signed-off-by: Baochen Qiang <bqiang@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211011054919.77071-1-bqiang@codeaurora.org
    Baochen Qiang authored and Kalle Valo committed Oct 13, 2021
  4. ath9k: support DT ieee80211-freq-limit property to limit channels

    The common DT property can be used to limit the available channels
    but ath9k has to manually call wiphy_read_of_freq_limits().
    
    I would have put this into ath9k_of_init(). But it didn't work there.
    The reason is that in ath9k_of_init() the channels and bands are not yet
    registered in the wiphy struct. So there isn't any channel to flag as
    disabled.
    
    Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211009212847.1781986-1-chunkeey@gmail.com
    chunkeey authored and Kalle Valo committed Oct 13, 2021

Commits on Oct 11, 2021

  1. ath11k: Change number of TCL rings to one for QCA6390

    Some targets, QCA6390 for example, use only one TCL ring, it is better to
    initialize only one ring and leave others untouched for such targets.
    
    This is a theoretical fix found during code review, no visible impact.
    
    Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
    
    Signed-off-by: Baochen Qiang <bqiang@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210914163726.38604-1-jouni@codeaurora.org
    Baochen Qiang authored and Kalle Valo committed Oct 11, 2021
  2. ath11k: Handle MSI enablement during rmmod and SSR

    When doing "rmmod ath11k_pci", ath11k performs global SOC reset
    and MHI reset, where 0 address access is captured by IOMMU. See
    log below:
    
    ...
    [  133.953860] ath11k_pci 0000:02:00.0: setting mhi state: DEINIT(1)
    [  133.959714] ath11k_pci 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
    [  133.973854] ath11k_pci 0000:02:00.0: MHISTATUS 0xff04
    [  133.974095] ath11k_pci 0000:02:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x000a address=0x0 flags=0x0020]
    ...
    
    This issue is also observed in SSR process, cause a similar
    sequence as above is performed.
    
    Such an invalid access occurs because, during rmmod or SSR, MSI
    address is cleared but HW MSI functionality not disabled, thus HW
    target is able to raise an MSI transaction with 0 as MSI address.
    
    So it can be fixed by simply disabling MSI before reset. For SSR,
    since MSI functionality is still needed after target is brought
    back, we need to reenable it.
    
    Also change naming of some interfaces related.
    
    Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
    Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
    
    Signed-off-by: Baochen Qiang <bqiang@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210913180246.193388-5-jouni@codeaurora.org
    Baochen Qiang authored and Kalle Valo committed Oct 11, 2021
  3. ath: dfs_pattern_detector: Fix possible null-pointer dereference in c…

    …hannel_detector_create()
    
    kzalloc() is used to allocate memory for cd->detectors, and if it fails,
    channel_detector_exit() behind the label fail will be called:
      channel_detector_exit(dpd, cd);
    
    In channel_detector_exit(), cd->detectors is dereferenced through:
      struct pri_detector *de = cd->detectors[i];
    
    To fix this possible null-pointer dereference, check cd->detectors before
    the for loop to dereference cd->detectors.
    
    Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
    Signed-off-by: Tuo Li <islituo@gmail.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210805153854.154066-1-islituo@gmail.com
    lituo1996 authored and Kalle Valo committed Oct 11, 2021
  4. ath11k: Use kcalloc() instead of kzalloc()

    Use 2-factor multiplication argument form kcalloc() instead
    of kzalloc().
    
    Link: KSPP#162
    Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211006181204.GA913553@embeddedor
    GustavoARSilva authored and Kalle Valo committed Oct 11, 2021
  5. ath11k: Remove redundant assignment to variable fw_size

    Variable fw_size is being assigned a value that is never read and
    being re-assigned a new value in the next statement. The assignment
    is redundant and can be removed.
    
    Addresses-Coverity: ("Unused value")
    Fixes: 336e7b5 ("ath11k: clean up BDF download functions")
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211006105529.1011239-1-colin.king@canonical.com
    Colin Ian King authored and Kalle Valo committed Oct 11, 2021

Commits on Oct 7, 2021

  1. ath11k: Fix spelling mistake "incompaitiblity" -> "incompatibility"

    There is a spelling mistake in an ath11k_warn message. Fix it.
    
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211006083217.349596-1-colin.king@canonical.com
    Colin Ian King authored and Kalle Valo committed Oct 7, 2021

Commits on Oct 5, 2021

  1. ath11k: Remove unused variable in ath11k_dp_rx_mon_merg_msdus()

    Coverity complains that a constant variable guards dead code. In fact,
    mpdu_buf is set NULL and never updated.
    
    4834err_merge_fail:
        	null: At condition mpdu_buf, the value of mpdu_buf must be NULL.
        	dead_error_condition: The condition mpdu_buf cannot be true.
    CID 92162 (#1 of 1): 'Constant' variable guards dead code (DEADCODE)
    dead_error_line: Execution cannot reach the expression decap_format !=
      DP_RX_DECAP_TYPE_RAW inside this statement: if (mpdu_buf && decap_forma....
    Local variable mpdu_buf is assigned only once, to a constant value, making it
      effectively constant throughout its scope. If this is not the intent, examine
      the logic to see if there is a missing assignment that would make mpdu_buf not
      remain constant.
    4835        if (mpdu_buf && decap_format != DP_RX_DECAP_TYPE_RAW) {
    
    Fix this by removing mpdu_buf and unreachable code.
    
    Cc: Kalle Valo <kvalo@codeaurora.org>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Jakub Kicinski <kuba@kernel.org>
    Cc: ath11k@lists.infradead.org
    Cc: linux-wireless@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210927150743.19816-1-tim.gardner@canonical.com
    rtg-canonical authored and Kalle Valo committed Oct 5, 2021
  2. dt-bindings: net: wireless: qca,ath9k: convert to the json-schema

    This replaces the existing .txt binding file. Furthermore, this
    also helps with validating DTS files.
    
    Introduced binding changes:
     1. added inherited mac-address nvmem property
     2. added inherited ieee80211-freq-limit property
     3. added new calibration nvmem property
     4. added second example (taken from the Netgear WNDR3700v2)
        Reason: Setting qca,no-eeprom; takes presedence over
        nvmem-cells. I think a different example is needed,
        because the driver can only reads from one calibration
        source per device.
     5. (re-added) chip list (based on data from ath9k's pci.c)
    
    Added binding .yaml to MAINTAINERS.
    
    Reviewed-by: Rob Herring <robh@kernel.org>
    Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210924223509.52525-1-chunkeey@gmail.com
    chunkeey authored and Kalle Valo committed Oct 5, 2021
  3. ath9k: Fix potential interrupt storm on queue reset

    In tests with two Lima boards from 8devices (QCA4531 based) on OpenWrt
    19.07 we could force a silent restart of a device with no serial
    output when we were sending a high amount of UDP traffic (iperf3 at 80
    MBit/s in both directions from external hosts, saturating the wifi and
    causing a load of about 4.5 to 6) and were then triggering an
    ath9k_queue_reset().
    
    Further debugging showed that the restart was caused by the ath79
    watchdog. With disabled watchdog we could observe that the device was
    constantly going into ath_isr() interrupt handler and was returning
    early after the ATH_OP_HW_RESET flag test, without clearing any
    interrupts. Even though ath9k_queue_reset() calls
    ath9k_hw_kill_interrupts().
    
    With JTAG we could observe the following race condition:
    
    1) ath9k_queue_reset()
       ...
       -> ath9k_hw_kill_interrupts()
       -> set_bit(ATH_OP_HW_RESET, &common->op_flags);
       ...
       <- returns
    
          2) ath9k_tasklet()
             ...
             -> ath9k_hw_resume_interrupts()
             ...
             <- returns
    
                     3) loops around:
                        ...
                        handle_int()
                        -> ath_isr()
                           ...
                           -> if (test_bit(ATH_OP_HW_RESET,
                                           &common->op_flags))
                                return IRQ_HANDLED;
    
                        x) ath_reset_internal():
                           => never reached <=
    
    And in ath_isr() we would typically see the following interrupts /
    interrupt causes:
    
    * status: 0x00111030 or 0x00110030
    * async_cause: 2 (AR_INTR_MAC_IPQ)
    * sync_cause: 0
    
    So the ath9k_tasklet() reenables the ath9k interrupts
    through ath9k_hw_resume_interrupts() which ath9k_queue_reset() had just
    disabled. And ath_isr() then keeps firing because it returns IRQ_HANDLED
    without actually clearing the interrupt.
    
    To fix this IRQ storm also clear/disable the interrupts again when we
    are in reset state.
    
    Cc: Sven Eckelmann <sven@narfation.org>
    Cc: Simon Wunderlich <sw@simonwunderlich.de>
    Cc: Linus Lüssing <linus.luessing@c0d3.blue>
    Fixes: 872b5d8 ("ath9k: do not access hardware on IRQs during reset")
    Signed-off-by: Linus Lüssing <ll@simonwunderlich.de>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210914192515.9273-3-linus.luessing@c0d3.blue
    T-X authored and Kalle Valo committed Oct 5, 2021
  4. ath9k: add option to reset the wifi chip via debugfs

    Sometimes, in yet unknown cases the wifi chip stops working. To allow a
    watchdog in userspace to easily and quickly reset the wifi chip, add the
    according functionality to userspace. A reset can then be triggered
    via:
    
      $ echo 1 > /sys/kernel/debug/ieee80211/phy0/ath9k/reset
    
    The number of user resets can further be tracked in the row "User reset"
    in the same file.
    
    So far people usually used "iw scan" to fix ath9k chip hangs from
    userspace. Which triggers the ath9k_queue_reset(), too. The reset file
    however has the advantage of less overhead, which makes debugging bugs
    within ath9k_queue_reset() easier.
    
    Signed-off-by: Linus Lüssing <ll@simonwunderlich.de>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210914192515.9273-2-linus.luessing@c0d3.blue
    T-X authored and Kalle Valo committed Oct 5, 2021
  5. ath10k: Don't always treat modem stop events as crashes

    When rebooting on sc7180 Trogdor devices I see the following crash from
    the wifi driver.
    
     ath10k_snoc 18800000.wifi: firmware crashed! (guid 83493570-29a2-4e98-a83e-70048c47669c)
    
    This is because a modem stop event looks just like a firmware crash to
    the driver, the qmi connection is closed in both cases. Use the qcom ssr
    notifier block to stop treating the qmi connection close event as a
    firmware crash signal when the modem hasn't actually crashed. See
    ath10k_qmi_event_server_exit() for more details.
    
    This silences the crash message seen during every reboot.
    
    Fixes: 3f14b73 ("ath10k: Enable MSA region dump support for WCN3990")
    Cc: Youghandhar Chintala <youghand@codeaurora.org>
    Cc: Abhishek Kumar <kuabhs@chromium.org>
    Cc: Steev Klimaszewski <steev@kali.org>
    Cc: Matthias Kaehlcke <mka@chromium.org>
    Cc: Rakesh Pillai <pillair@codeaurora.org>
    Signed-off-by: Stephen Boyd <swboyd@chromium.org>
    Reviewed-by: Rakesh Pillai <pillair@codeaurora.org>
    Tested-By: Youghandhar Chintala <youghand@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210922233341.182624-1-swboyd@chromium.org
    bebarino authored and Kalle Valo committed Oct 5, 2021
  6. Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kva…

    …lo/ath.git
    
    ath.git patches for v5.16. Major changes:
    
    ath9k
    
    * load calibration data and pci init values via nvmem subsystem
    
    ath11k
    
    * include channel rx and tx time in survey dump statistics
    
    * support for setting fixed Wi-Fi 6 rates from user space
    
    * support for 80P80 and 160 MHz bandwidths
    
    * spectral scan support for QCN9074
    
    * support for calibration data files per radio
    
    * support for calibration data via eeprom
    
    * support for rx decapsulation offload (data frames in 802.3 format)
    
    * support channel 2 in 6 GHz band
    
    ath10k
    
    * include frame time stamp in beacon and probe response frames
    
    wcn36xx
    
    * enable Idle Mode Power Save (IMPS) to reduce power consumption during idle
    Kalle Valo committed Oct 5, 2021
  7. rtl8xxxu: Use lower tx rates for the ack packet

    According to the Realtek propritary driver and the rtw88 driver, the
    tx rates of the ack (includes block ack) are initialized with lower
    tx rates (no HT rates) which is set by the RRSR register value. In
    real cases, ack rate higher than current tx rate could lead to
    difficulty for the receiving end to receive management/control frames.
    The retransmission rate would be higher then expected when the driver
    is acting as receiver and the RSSI is not good.
    
    Cross out higer rates for ack packet before implementing dynamic rrsr
    configuration like the commit 4830872 ("rtw88: add dynamic rrsr
    configuration").
    
    Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
    Acked-by: Jes Sorensen <Jes.Sorensen@gmail.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211001040044.1028708-1-chris.chiu@canonical.com
    mschiu77 authored and Kalle Valo committed Oct 5, 2021
  8. bcma: drop unneeded initialization value

    Do not initialise statics to 0
    ERROR found by checkpatch.pl
    
    Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210930194920.15847-1-sohaib.amhmd@gmail.com
    smalinux authored and Kalle Valo committed Oct 5, 2021
  9. brcmfmac: Add DMI nvram filename quirk for Cyberbook T116 tablet

    The Cyberbook T116 tablet contains quite generic names in the sys_vendor
    and product_name DMI strings, without this patch brcmfmac will try to load:
    "brcmfmac43455-sdio.Default string-Default string.txt" as nvram file which
    is way too generic.
    
    The nvram file shipped on the factory Android image contains the exact
    same settings as those used on the AcePC T8 mini PC, so point the new
    DMI nvram filename quirk to the acepc-t8 nvram file.
    
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210928160633.96928-1-hdegoede@redhat.com
    jwrdegoede authored and Kalle Valo committed Oct 5, 2021
  10. rtw88: refine fw_crash debugfs to show non-zero while triggering

    The usage of fw_crash debugfs is to write 1 to it to trigger fw crash
    simulation and to read from it to check the state. When zero is read,
    it is supposed to mean fw crash/restart process is done. Then, some
    test plans can be designed for crash/restart.
    e.g.
    step 1. trigger fw crash simulation
    step 2. poll the state until zero is read
    step 3. check connection by ping test
    
    However, in certain connection cases, triggering fw crash simulation
    will take a while. If the state is queried too early before restart
    begins processing, it may mistakenly think restart process has been
    done. If some tests are started at this time, something unexpected
    might happen due to the follow-up restart process.
    
    To avoid that, let fw_crash also show non-zero when a simulation
    is still triggering.
    
    Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211001082301.4805-1-pkshih@realtek.com
    Zong-Zhe Yang authored and Kalle Valo committed Oct 5, 2021
  11. rtw88: fix RX clock gate setting while fifo dump

    When fw fifo dumps, RX clock gating should be disabled to avoid
    something unexpected. However, the register operation ran into
    a mistake. So, we fix it.
    
    Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
    Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210927111830.5354-1-pkshih@realtek.com
    Zong-Zhe Yang authored and Kalle Valo committed Oct 5, 2021

Commits on Sep 28, 2021

  1. ath10k: sdio: Add missing BH locking around napi_schdule()

    On a i.MX-based board with a QCA9377 Wifi chip, the following errors
    are seen after launching the 'hostapd' application:
    
    hostapd /etc/wifi.conf
    Configuration file: /etc/wifi.conf
    wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
    NOHZ tick-stop error: Non-RCU local softirq work is pending, handler torvalds#8!!!
    Using interface wlan0 with hwaddr 00:1f:7b:31:04:a0 and ssid "thessid"
    IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
    wlan0: interface state COUNTRY_UPDATE->ENABLED
    wlan0: AP-ENABLED
    NOHZ tick-stop error: Non-RCU local softirq work is pending, handler torvalds#8!!!
    NOHZ tick-stop error: Non-RCU local softirq work is pending, handler torvalds#8!!!
    NOHZ tick-stop error: Non-RCU local softirq work is pending, handler torvalds#8!!!
    NOHZ tick-stop error: Non-RCU local softirq work is pending, handler torvalds#8!!!
    ...
    
    Fix this problem by adding the BH locking around napi-schedule(),
    in the same way it was done in commit e63052a ("mlx5e: add
    add missing BH locking around napi_schdule()").
    
    Its commit log provides the following explanation:
    
    "It's not correct to call napi_schedule() in pure process
    context. Because we use __raise_softirq_irqoff() we require
    callers to be in a context which will eventually lead to
    softirq handling (hardirq, bh disabled, etc.).
    
    With code as is users will see:
    
    NOHZ tick-stop error: Non-RCU local softirq work is pending, handler torvalds#8!!!
    "
    
    Fixes: cfee879 ("ath10k: enable napi on RX path for sdio")
    Signed-off-by: Fabio Estevam <festevam@denx.de>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210824144339.2796122-1-festevam@denx.de
    Fabio Estevam authored and Kalle Valo committed Sep 28, 2021
  2. ath10k: Fix missing frame timestamp for beacon/probe-resp

    When receiving a beacon or probe response, we should update the
    boottime_ns field which is the timestamp the frame was received at.
    (cf mac80211.h)
    
    This fixes a scanning issue with Android since it relies on this
    timestamp to determine when the AP has been seen for the last time
    (via the nl80211 BSS_LAST_SEEN_BOOTTIME parameter).
    
    Fixes: 5e3dd15 ("ath10k: mac80211 driver for Qualcomm Atheros 802.11ac CQA98xx devices")
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1629811733-7927-1-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Sep 28, 2021
  3. ath10k: high latency fixes for beacon buffer

    Beacon buffer for high latency devices does not use DMA. other similar
    buffer allocation methods in the driver have already been modified for
    high latency path. Fix the beacon buffer allocation left out in the
    earlier high latency changes.
    
    Signed-off-by: Alagu Sankar <alagusankar@silex-india.com>
    Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
    [fabio: adapt it to use ar->bus_param.dev_type ]
    Signed-off-by: Fabio Estevam <festevam@denx.de>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210818232627.2040121-1-festevam@denx.de
    alagusankar authored and Kalle Valo committed Sep 28, 2021
  4. ath11k: Change DMA_FROM_DEVICE to DMA_TO_DEVICE when map reinjected p…

    …ackets
    
    For fragmented packets, ath11k reassembles each fragment as a normal
    packet and then reinjects it into HW ring. In this case, the DMA
    direction should be DMA_TO_DEVICE, not DMA_FROM_DEVICE, otherwise
    invalid payload will be reinjected to HW and then delivered to host.
    What is more, since arbitrary memory could be allocated to the frame, we
    don't know what kind of data is contained in the buffer reinjected.
    Thus, as a bad result, private info may be leaked.
    
    Note that this issue is only found on Intel platform.
    
    Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
    Signed-off-by: Baochen Qiang <bqiang@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210916064617.20006-1-bqiang@codeaurora.org
    Baochen Qiang authored and Kalle Valo committed Sep 28, 2021
  5. ath11k: support SMPS configuration for 6 GHz

    Parse SMPS configuration from IEs and configure. Without this,
    SMPS is not enabled for 6 GHz band.
    
    Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01386-QCAHKSWPL_SILICONZ-1
    
    Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210913175510.193005-3-jouni@codeaurora.org
    Pradeep Kumar Chitrapu authored and Kalle Valo committed Sep 28, 2021
  6. ath11k: add 6 GHz params in peer assoc command

    Currently A-MPDU aggregation parameters are not being configured
    during peer association for 6 GHz band. Hence, extract these
    parameters from station's capabilities received in association
    request and send to firmware. Without this, A-MPDU aggregation
    is not happening in 6 GHz band.
    
    Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01386-QCAHKSWPL_SILICONZ-1
    
    Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210913175510.193005-2-jouni@codeaurora.org
    Pradeep Kumar Chitrapu authored and Kalle Valo committed Sep 28, 2021
  7. ieee80211: Add new A-MPDU factor macro for HE 6 GHz peer caps

    Add IEEE80211_HE_6GHZ_MAX_AMPDU_FACTOR as per IEEE Std 802.11ax-2021,
    9.4.2.263 to use for peer max A-MPDU factor in 6 GHz band.
    
    Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Acked-by: Johannes Berg <johannes@sipsolutions.net>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210913175510.193005-1-jouni@codeaurora.org
    Pradeep Kumar Chitrapu authored and Kalle Valo committed Sep 28, 2021
  8. ath11k: indicate to mac80211 scan complete with aborted flag for ATH1…

    …1K_SCAN_STARTING state
    
    Scan failure can not be recovered from when running a loop of the
    following steps:
    1. run scan: "iw wlan scan".
    2. run command: echo assert > /sys/kernel/debug/ath11k/qca6490\ hw2.0/simulate_fw_crash
       immediately after step 1.
    
    result:
    scan failed and can not recover even when wlan recovery succeeds:
    command failed: Device or resource busy (-16)
    
    reason:
    When scan arrives, WMI_START_SCAN_CMDID is sent to the firmware and
    function ath11k_mac_op_hw_scan() returns, then simulate_fw_crash arrives
    and the scan started event does not arrive, and then it starts to do
    recovery of wlan. __ath11k_mac_scan_finish() which is called from
    ath11k_core_halt() is one step of recovery, it will not call
    ieee80211_scan_completed() by logic currently because the scan state is
    ATH11K_SCAN_STARTING. Thus it leads the scan not being completed in
    mac80211, and leads all consecutive scans failing with -EBUSY in
    nl80211_trigger_scan even after wlan recovery success.
    
    Indicate scan complete with aborted flag to mac80211 for
    ATH11K_SCAN_STARTING to allow recovery from scan failed with "Device or
    resource busy (-16)" after wlan recovery.
    
    Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
    
    Signed-off-by: Wen Gong <wgong@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210914164226.38843-3-jouni@codeaurora.org
    Wen Gong authored and Kalle Valo committed Sep 28, 2021
  9. ath11k: indicate scan complete for scan canceled when scan running

    ath11k prints "Received scan event for unknown vdev" when doing the
    following test:
    1. trigger scan
    2. wait 0.2 second
    3. iw reg set or 11d scan complete from firmware
    
    Reason: When iw reg set or 11d scan complete, the new country code will
    be set to the firmware, and the new regdomain info indicated to ath11k,
    then the new channel list will be sent to the firmware. The firmware
    will cancel the current scan after receiving WMI_SCAN_CHAN_LIST_CMDID
    which is used for the new channel list, and the state of ath11k is
    ATH11K_SCAN_RUNNING, then ath11k_get_ar_on_scan_abort() returns NULL and
    ath11k_scan_event() returns at this point and does not indicate scan
    completion to mac80211.
    
    Indicate scan completion to mac80211 and get rid of the "Received scan
    event for unknown vdev" print for the above case.
    
    Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
    
    Signed-off-by: Wen Gong <wgong@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210914164226.38843-2-jouni@codeaurora.org
    Wen Gong authored and Kalle Valo committed Sep 28, 2021
  10. ath11k: add handler for scan event WMI_SCAN_EVENT_DEQUEUED

    When wlan interface is up, 11d scan is sent to the firmware, and the
    firmware needs to spend couple of seconds to complete the 11d scan. If
    immediately a normal scan from user space arrives to ath11k, then the
    normal scan request is also sent to the firmware, but the scan started
    event will be reported to ath11k until the 11d scan complete. When timed
    out for the scan started in ath11k, ath11k stops the normal scan and the
    firmware reports WMI_SCAN_EVENT_DEQUEUED to ath11k for the normal scan.
    ath11k has no handler for the event and then timed out for the scan
    completed in ath11k_scan_stop(), and ath11k prints the following error
    message.
    
    [ 1491.604750] ath11k_pci 0000:02:00.0: failed to receive scan abort comple: timed out
    [ 1491.604756] ath11k_pci 0000:02:00.0: failed to stop scan: -110
    [ 1491.604758] ath11k_pci 0000:02:00.0: failed to start hw scan: -110
    
    Add a handler for WMI_SCAN_EVENT_DEQUEUED and then complete the scan to
    get rid of the above error message.
    
    Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
    
    Signed-off-by: Wen Gong <wgong@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210914164226.38843-1-jouni@codeaurora.org
    Wen Gong authored and Kalle Valo committed Sep 28, 2021
  11. ath11k: add HTT stats support for new stats

    Add HTT stats support for,
    
    29-ATH11K_DBG_HTT_EXT_STATS_PEER_CTRL_PATH_TXRX_STATS:
    Used to dump the control path txrx stats for each connected peer.
    Usage:
    echo 29 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type
    cat /sys/kernel/debug/ieee80211/phyx/netdev\:wlan0/stations/
    <sta mac>/htt_peer_stats.
    
    31-ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_RATE_TXBF_STATS:
    Used to dump the per pdev tx rate txbf stats.
    Usage:
    echo 31 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type
    cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats
    
    32-ATH11k_DBG_HTT_EXT_STATS_TXBF_OFDMA:
    Used to dump the TXBF ofdma stats for all ofdma users.
    Usage:
    echo 32 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type
    cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats
    
    37-ATH11K_DBG_HTT_EXT_PHY_COUNTERS_AND_PHY_STATS:
    Used to dump the mac and phy txrx counts and phy stats like per chain rssi
    and ANI level.
    Usage:
    echo 37 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type
    cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats
    
    Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00486-QCAHKSWPL_SILICONZ-1
    
    Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210913223148.208026-6-jouni@codeaurora.org
    Venkateswara Naralasetty authored and Kalle Valo committed Sep 28, 2021
  12. ath11k: Change masking and shifting in htt stats

    In debugfs_htt_stats.c, masking and shifting is done to get
    stats values. Instead use GENMASK and FIELD_GET to improve
    code readability and maintenance.
    
    Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01105-QCAHKSWPL_SILICONZ-1
    
    Signed-off-by: Seevalamuthu Mariappan <seevalam@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210913223148.208026-5-jouni@codeaurora.org
    Seevalamuthu Mariappan authored and Kalle Valo committed Sep 28, 2021
  13. ath11k: Remove htt stats fixed size array usage

    To support the HTT Stats DebugFS interface a single large buffer that
    contains the stats must be provided to the DebugFS infrastructure.
    In the current code, for each class of stats, the stats are first
    formatted in a local on-stack buffer, and then the local buffer is
    copied to the large DebugFS buffer.
    
    This logic has a problem when, for a given class, the formatted
    stats exceed the size of the on-stack buffer. When this occurs the
    stats for this class is truncated. In addition, this logic is
    inefficient since it introduces an unnecessary memory copy.
    
    To address these issues, update the logic to no longer use a local
    on-stack buffer, and instead write the formatted data directly into
    the large DebugFS buffer.
    
    Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01105-QCAHKSWPL_SILICONZ-1
    
    Signed-off-by: Seevalamuthu Mariappan <seevalam@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210913223148.208026-4-jouni@codeaurora.org
    Seevalamuthu Mariappan authored and Kalle Valo committed Sep 28, 2021
Older