Skip to content
Permalink
Seevalamuthu-M…
Switch branches/tags

Commits on Nov 12, 2021

  1. ath11k: Check supported hardware version

    Read register TCSR_SOC_HW_VERSION for hardware version. This register
    is present in all hardwares. Check whether the hardware version is
    supported. Returns error if the hardware is unsupported.
    This handling is already done for QCA6390 and WCN6855.
    
    Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00729-QCAHKSWPL_SILICONZ-3
    Tested-on: IPQ6018 hw2.0 AHB WLAN.HK.2.5.0.1-00729-QCAHKSWPL_SILICONZ-3
    Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-00729-QCAHKSWPL_SILICONZ-3
    
    Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
    Seevalamuthu Mariappan authored and intel-lab-lkp committed Nov 12, 2021

Commits on Nov 10, 2021

  1. ath11k: enable 802.11 power save mode in station mode

    To reduce power consumption enable 802.11 power save mode in station mode. This
    allows both radio and CPU to sleep more.
    
    Only enable the mode on QCA6390 and WCN6855, it's unknown how other hardware
    families support this feature.
    
    To test that power save mode is running run "iw dev wls1 set power_save off",
    check there is no NULL Data frame seen by a sniffer. And run "iw dev wls1 set power_save
    on" and check there is a NULL Data frame in sniffer.
    
    Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
    
    Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211108123826.8463-2-kvalo@codeaurora.org
    Carl Huang authored and Kalle Valo committed Nov 10, 2021
  2. ath11k: convert ath11k_wmi_pdev_set_ps_mode() to use enum wmi_sta_ps_…

    …mode
    
    It's more descriptive to use the actual enum used by the firmware instead of a
    boolean so change ath11k_wmi_pdev_set_ps_mode() to use a boolean.
    
    Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
    
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211108123826.8463-1-kvalo@codeaurora.org
    Kalle Valo committed Nov 10, 2021

Commits on Nov 8, 2021

  1. wcn36xx: fix RX BD rate mapping for 5GHz legacy rates

    The linear mapping between the BD rate field and the driver's 5GHz
    legacy rates table (wcn_5ghz_rates) does not only apply for the latter
    four rates -- it applies to all eight rates.
    
    Fixes: 6ea131a ("wcn36xx: Fix warning due to bad rate_idx")
    Signed-off-by: Benjamin Li <benl@squareup.com>
    Tested-by: Loic Poulain <loic.poulain@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211104010548.1107405-3-benl@squareup.com
    bendotli authored and Kalle Valo committed Nov 8, 2021
  2. wcn36xx: populate band before determining rate on RX

    status.band is used in determination of status.rate -- for 5GHz on legacy
    rates there is a linear shift between the BD descriptor's rate field and
    the wcn36xx driver's rate table (wcn_5ghz_rates).
    
    We have a special clause to populate status.band for hardware scan offload
    frames. However, this block occurs after status.rate is already populated.
    Correctly handle this dependency by moving the band block before the rate
    block.
    
    This patch addresses kernel warnings & missing scan results for 5GHz APs
    that send their beacons/probe responses at the higher four legacy rates
    (24-54 Mbps), when using hardware scan offload:
    
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 0 at net/mac80211/rx.c:4532 ieee80211_rx_napi+0x744/0x8d8
      Modules linked in: wcn36xx [...]
      CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W         4.19.107-g73909fa #1
      Hardware name: Square, Inc. T2 (all variants) (DT)
      Call trace:
      dump_backtrace+0x0/0x148
      show_stack+0x14/0x1c
      dump_stack+0xb8/0xf0
      __warn+0x2ac/0x2d8
      warn_slowpath_null+0x44/0x54
      ieee80211_rx_napi+0x744/0x8d8
      ieee80211_tasklet_handler+0xa4/0xe0
      tasklet_action_common+0xe0/0x118
      tasklet_action+0x20/0x28
      __do_softirq+0x108/0x1ec
      irq_exit+0xd4/0xd8
      __handle_domain_irq+0x84/0xbc
      gic_handle_irq+0x4c/0xb8
      el1_irq+0xe8/0x190
      lpm_cpuidle_enter+0x220/0x260
      cpuidle_enter_state+0x114/0x1c0
      cpuidle_enter+0x34/0x48
      do_idle+0x150/0x268
      cpu_startup_entry+0x20/0x24
      rest_init+0xd4/0xe0
      start_kernel+0x398/0x430
      ---[ end trace ae28cb759352b403 ]---
    
    Fixes: 8a27ca3 ("wcn36xx: Correct band/freq reporting on RX")
    Signed-off-by: Benjamin Li <benl@squareup.com>
    Tested-by: Loic Poulain <loic.poulain@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211104010548.1107405-2-benl@squareup.com
    bendotli authored and Kalle Valo committed Nov 8, 2021
  3. wcn36xx: Put DXE block into reset before freeing memory

    When deiniting the DXE hardware we should reset the block to ensure there
    is no spurious DMA write transaction from the downstream WCNSS to upstream
    MSM at a skbuff address we will have released.
    
    Fixes: 8e84c25 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
    Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211105122152.1580542-4-bryan.odonoghue@linaro.org
    bryanodonoghue authored and Kalle Valo committed Nov 8, 2021
  4. wcn36xx: Release DMA channel descriptor allocations

    When unloading the driver we are not releasing the DMA descriptors which we
    previously allocated.
    
    Fixes: 8e84c25 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
    Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211105122152.1580542-3-bryan.odonoghue@linaro.org
    bryanodonoghue authored and Kalle Valo committed Nov 8, 2021
  5. wcn36xx: Fix DMA channel enable/disable cycle

    Right now we have a broken sequence where we enable DMA channel interrupts
    which can be left enabled and never disabled if we hit an error path.
    
    Worse still when we unload the driver, the DMA channel interrupt bits are
    left intact. About the only saving grace here is that we do remember to
    disable the wcnss interrupt when unload the driver.
    
    Fixes: 8e84c25 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
    Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211105122152.1580542-2-bryan.odonoghue@linaro.org
    bryanodonoghue authored and Kalle Valo committed Nov 8, 2021

Commits on Nov 1, 2021

  1. ath9k: use swap() to make code cleaner

    Using swap() make it more readable.
    
    Reported-by: Zeal Robot <zealci@zte.com.cn>
    Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211028010451.7754-1-yang.guang5@zte.com.cn
    Yang Guang authored and Kalle Valo committed Nov 1, 2021
  2. wcn36xx: Indicate beacon not connection loss on MISSED_BEACON_IND

    Firmware can trigger a missed beacon indication, this is not the same as a
    lost signal.
    
    Flag to Linux the missed beacon and let the WiFi stack decide for itself if
    the link is up or down by sending its own probe to determine this.
    
    We should only be signalling the link is lost when the firmware indicates
    
    Fixes: 8e84c25 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
    Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211027232529.657764-1-bryan.odonoghue@linaro.org
    bryanodonoghue authored and Kalle Valo committed Nov 1, 2021
  3. wcn36xx: ensure pairing of init_scan/finish_scan and start_scan/end_scan

    An SMD capture from the downstream prima driver on WCN3680B shows the
    following command sequence for connected scans:
    
    - init_scan_req
        - start_scan_req, channel 1
        - end_scan_req, channel 1
        - start_scan_req, channel 2
        - ...
        - end_scan_req, channel 3
    - finish_scan_req
    - init_scan_req
        - start_scan_req, channel 4
        - ...
        - end_scan_req, channel 6
    - finish_scan_req
    - ...
        - end_scan_req, channel 165
    - finish_scan_req
    
    Upstream currently never calls wcn36xx_smd_end_scan, and in some cases[1]
    still sends finish_scan_req twice in a row or before init_scan_req. A
    typical connected scan looks like this:
    
    - init_scan_req
        - start_scan_req, channel 1
    - finish_scan_req
    - init_scan_req
        - start_scan_req, channel 2
    - ...
        - start_scan_req, channel 165
    - finish_scan_req
    - finish_scan_req
    
    This patch cleans up scanning so that init/finish and start/end are always
    paired together and correctly nested.
    
    - init_scan_req
        - start_scan_req, channel 1
        - end_scan_req, channel 1
    - finish_scan_req
    - init_scan_req
        - start_scan_req, channel 2
        - end_scan_req, channel 2
    - ...
        - start_scan_req, channel 165
        - end_scan_req, channel 165
    - finish_scan_req
    
    Note that upstream will not do batching of 3 active-probe scans before
    returning to the operating channel, and this patch does not change that.
    To match downstream in this aspect, adjust IEEE80211_PROBE_DELAY and/or
    the 125ms max off-channel time in ieee80211_scan_state_decision.
    
    [1]: commit d195d7a ("wcn36xx: Ensure finish scan is not requested
    before start scan") addressed one case of finish_scan_req being sent
    without a preceding init_scan_req (the case of the operating channel
    coinciding with the first scan channel); two other cases are:
    1) if SW scan is started and aborted immediately, without scanning any
       channels, we send a finish_scan_req without ever sending init_scan_req,
       and
    2) as SW scan logic always returns us to the operating channel before
       calling wcn36xx_sw_scan_complete, finish_scan_req is always sent twice
       at the end of a SW scan
    
    Fixes: 8e84c25 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
    Signed-off-by: Benjamin Li <benl@squareup.com>
    Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211027170306.555535-4-benl@squareup.com
    bendotli authored and Kalle Valo committed Nov 1, 2021
  4. wcn36xx: implement flush op to speed up connected scan

    Without ieee80211_ops->flush implemented to empty HW queues, mac80211 will
    do a 100ms dead wait after stopping SW queues, before leaving the operating
    channel to resume a software connected scan[1].
    (see ieee80211_scan_state_resume)
    
    This wait is correctly included in the calculation for whether or not
    we've exceeded max off-channel time, as it occurs after sending the null
    frame with PS bit set. Thus, with 125 ms max off-channel time we only
    have 25 ms of scan time, which technically isn't even enough to scan one
    channel (although mac80211 always scans at least one channel per off-
    channel window).
    
    Moreover, for passive probes we end up spending at least 100 ms + 111 ms
    (IEEE80211_PASSIVE_CHANNEL_TIME) "off-channel"[2], which exceeds the listen
    interval of 200 ms that we provide in our association request frame. That's
    technically out-of-spec.
    
    [1]: Until recently, wcn36xx performed software (rather than FW-offloaded)
    scanning when 5GHz channels are requested. This apparent limitation is now
    resolved -- see commit 1395f8a6a4d5 ("wcn36xx: Enable hardware scan offload
    for 5Ghz band").
    [2]: in quotes because about 100 ms of it is still on-channel but with PS
    set
    
    Signed-off-by: Benjamin Li <benl@squareup.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211027170306.555535-3-benl@squareup.com
    bendotli authored and Kalle Valo committed Nov 1, 2021
  5. wcn36xx: add debug prints for sw_scan start/complete

    Add some MAC debug prints for more easily demarcating a software scan
    when parsing logs.
    
    Signed-off-by: Benjamin Li <benl@squareup.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211027170306.555535-2-benl@squareup.com
    bendotli authored and Kalle Valo committed Nov 1, 2021
  6. ath10k: fetch (pre-)calibration data via nvmem subsystem

    ATH10K chips are used it wide range of routers,
    accesspoints, range extenders, network appliances.
    On these embedded devices, calibration data is often
    stored on the main system's flash and was out of reach
    for the driver.
    
    To bridge this gap, ath10k is getting extended to pull
    the (pre-)calibration data through nvmem subsystem.
    To do this, a nvmem-cell containing the information can
    either be specified in the platform data or via device-tree.
    
    Tested with:
            Netgear EX6150v2 (IPQ4018 - pre-calibration method)
            TP-Link Archer C7 v2 (QCA9880v2 - old calibration method)
    
    Cc: Robert Marko <robimarko@gmail.com>
    Cc: Thibaut VARÈNE <hacks@slashdirt.org>
    Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211016234609.1568317-1-chunkeey@gmail.com
    chunkeey authored and Kalle Valo committed Nov 1, 2021
  7. ath11k: set correct NL80211_FEATURE_DYNAMIC_SMPS for WCN6855

    Commit 6f4d703 ("ath11k: support SMPS configuration for 6 GHz") changed
    "if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)" to "if (ht_cap &
    WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)" which means
    NL80211_FEATURE_DYNAMIC_SMPS is enabled for all chips which support 6 GHz.
    However, WCN6855 supports 6 GHz but it does not support feature
    NL80211_FEATURE_DYNAMIC_SMPS, and this can lead to MU-MIMO test failures for
    WCN6855.
    
    Disable NL80211_FEATURE_DYNAMIC_SMPS for WCN6855 since its ht_cap does not
    support WMI_HT_CAP_DYNAMIC_SMPS. Enable the feature only on QCN9074 as that's
    the only other device supporting 6 GHz band.
    
    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/20210914163726.38604-3-jouni@codeaurora.org
    Wen Gong authored and Kalle Valo committed Nov 1, 2021

Commits on Oct 28, 2021

  1. ath6kl: fix division by zero in send path

    Add the missing endpoint max-packet sanity check to probe() to avoid
    division by zero in ath10k_usb_hif_tx_sg() in case a malicious device
    has broken descriptors (or when doing descriptor fuzz testing).
    
    Note that USB core will reject URBs submitted for endpoints with zero
    wMaxPacketSize but that drivers doing packet-size calculations still
    need to handle this (cf. commit 2548288 ("USB: Fix: Don't skip
    endpoint descriptors with maxpacket=0")).
    
    Fixes: 9cbee35 ("ath6kl: add full USB support")
    Cc: stable@vger.kernel.org      # 3.5
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211027080819.6675-3-johan@kernel.org
    jhovold authored and Kalle Valo committed Oct 28, 2021
  2. ath10k: fix division by zero in send path

    Add the missing endpoint max-packet sanity check to probe() to avoid
    division by zero in ath10k_usb_hif_tx_sg() in case a malicious device
    has broken descriptors (or when doing descriptor fuzz testing).
    
    Note that USB core will reject URBs submitted for endpoints with zero
    wMaxPacketSize but that drivers doing packet-size calculations still
    need to handle this (cf. commit 2548288 ("USB: Fix: Don't skip
    endpoint descriptors with maxpacket=0")).
    
    Fixes: 4db6649 ("ath10k: add initial USB support")
    Cc: stable@vger.kernel.org      # 4.14
    Cc: Erik Stromdahl <erik.stromdahl@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211027080819.6675-2-johan@kernel.org
    jhovold authored and Kalle Valo committed Oct 28, 2021
  3. ath6kl: fix control-message timeout

    USB control-message timeouts are specified in milliseconds and should
    specifically not vary with CONFIG_HZ.
    
    Fixes: 241b128 ("ath6kl: add back beginnings of USB support")
    Cc: stable@vger.kernel.org      # 3.4
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211025120522.6045-3-johan@kernel.org
    jhovold authored and Kalle Valo committed Oct 28, 2021
  4. ath10k: fix control-message timeout

    USB control-message timeouts are specified in milliseconds and should
    specifically not vary with CONFIG_HZ.
    
    Fixes: 4db6649 ("ath10k: add initial USB support")
    Cc: stable@vger.kernel.org      # 4.14
    Cc: Erik Stromdahl <erik.stromdahl@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211025120522.6045-2-johan@kernel.org
    jhovold authored and Kalle Valo committed Oct 28, 2021
  5. wcn36xx: add missing 5GHz channels 136 and 144

    The official feature-complete WCN3680B driver (known as prima, open source
    but not upstream) supports channels 136 and 144.
    
    However, these channels are missing in upstream. Add them here to get
    closer to feature parity with prima.
    
    Signed-off-by: Benjamin Li <benl@squareup.com>
    Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211025175359.3591048-3-benl@squareup.com
    bendotli authored and Kalle Valo committed Oct 28, 2021
  6. wcn36xx: switch on antenna diversity feature bit

    The official feature-complete WCN3680B driver (known as prima, open source
    but not upstream) sends this feature bit.
    
    As we wish to support the antenna diversity feature in upstream, we need
    to set this bit as well.
    
    Signed-off-by: Benjamin Li <benl@squareup.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211025175359.3591048-2-benl@squareup.com
    bendotli authored and Kalle Valo committed Oct 28, 2021
  7. wcn36xx: Channel list update before hardware scan

    The channel scan list must be updated before triggering a hardware scan
    so that firmware takes into account the regulatory info for each single
    channel such as active/passive config, power, DFS, etc... Without this
    the firmware uses its own internal default channel configuration, which
    is not aligned with mac80211 regulatory rules, and misses several
    channels (e.g. 144).
    
    Fixes: 2f3bef4 ("wcn36xx: Add hardware scan offload support")
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1635175328-25642-1-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Oct 28, 2021

Commits on Oct 27, 2021

  1. Revert "wcn36xx: Enable firmware link monitoring"

    Firmware link offload monitoring can be made to work in 3/4 cases by
    switching on firmware feature bit WLANACTIVE_OFFLOAD
    
    - Secure power-save on
    - Secure power-save off
    - Open power-save on
    
    However, with an open AP if we switch off power-saving - thus never
    entering Beacon Mode Power Save - BMPS, firmware never forwards loss
    of beacon upwards.
    
    We had hoped that WLANACTIVE_OFFLOAD and some fixes for sequence numbers
    would unblock this but, it hasn't and further investigation is required.
    
    Its possible to have a complete set of Secure power-save on/off and Open
    power-save on/off provided we use Linux' link monitoring mechanism.
    
    While we debug the Open AP failure we need to fix upstream.
    
    This reverts commit c973fdad79f6eaf247d48b5fc77733e989eb01e1.
    
    Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211025093037.3966022-2-bryan.odonoghue@linaro.org
    bryanodonoghue authored and Kalle Valo committed Oct 27, 2021
  2. wcn36xx: Fix packet drop on resume

    If the system is resumed because of an incoming packet, the wcn36xx RX
    interrupts is fired before actual resuming of the wireless/mac80211
    stack, causing any received packets to be simply dropped. E.g. a ping
    request causes a system resume, but is dropped and so never forwarded
    to the IP stack.
    
    This change fixes that, disabling DMA interrupts on suspend to no pass
    packets until mac80211 is resumed and ready to handle them.
    
    Note that it's not incompatible with RX irq wake.
    
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1635150496-19290-1-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Oct 27, 2021
  3. wcn36xx: Fix discarded frames due to wrong sequence number

    The firmware is offering features such as ARP offload, for which
    firmware crafts its own (QoS)packets without waking up the host.
    Point is that the sequence numbers generated by the firmware are
    not in sync with the host mac80211 layer and can cause packets
    such as firmware ARP reponses to be dropped by the AP (too old SN).
    
    To fix this we need to let the firmware manages the sequence
    numbers by its own (except for QoS null frames). There is a SN
    counter for each QoS queue and one global/baseline counter for
    Non-QoS.
    
    Fixes: 84aff52 ("wcn36xx: Use sequence number allocated by mac80211")
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1635150336-18736-1-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Oct 27, 2021
  4. wcn36xx: add proper DMA memory barriers in rx path

    This is essentially exactly following the dma_wmb()/dma_rmb() usage
    instructions in Documentation/memory-barriers.txt.
    
    The theoretical races here are:
    
    1. DXE (the DMA Transfer Engine in the Wi-Fi subsystem) seeing the
    dxe->ctrl & WCN36xx_DXE_CTRL_VLD write before the dxe->dst_addr_l
    write, thus performing DMA into the wrong address.
    
    2. CPU reading dxe->dst_addr_l before DXE unsets dxe->ctrl &
    WCN36xx_DXE_CTRL_VLD. This should generally be harmless since DXE
    doesn't write dxe->dst_addr_l (no risk of freeing the wrong skb).
    
    Fixes: 8e84c25 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
    Signed-off-by: Benjamin Li <benl@squareup.com>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211023001528.3077822-1-benl@squareup.com
    bendotli authored and Kalle Valo committed Oct 27, 2021
  5. wcn36xx: Fix HT40 capability for 2Ghz band

    All wcn36xx controllers are supposed to support HT40 (and SGI40),
    This doubles the maximum bitrate/throughput with compatible APs.
    
    Tested with wcn3620 & wcn3680B.
    
    Cc: stable@vger.kernel.org
    Fixes: 8e84c25 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1634737133-22336-1-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Oct 27, 2021
  6. Revert "wcn36xx: Disable bmps when encryption is disabled"

    This reverts commit c6522a5.
    
    Testing on tip-of-tree shows that this is working now. Revert this and
    re-enable BMPS for Open APs.
    
    Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211022140447.2846248-3-bryan.odonoghue@linaro.org
    bryanodonoghue authored and Kalle Valo committed Oct 27, 2021
  7. wcn36xx: Treat repeated BMPS entry fail as connection loss

    On an open AP when you pull the plug on the AP, if we are not already in
    BMPS mode then the firmware will not generate a disconnection event.
    
    Instead we need to monitor for failure to enter BMPS and treat a string of
    failures as connection loss.
    
    Secure AP connections don't appear to demonstrate this behavior so the
    work-around is limited to open APs only.
    
    Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211022140447.2846248-2-bryan.odonoghue@linaro.org
    bryanodonoghue authored and Kalle Valo committed Oct 27, 2021
  8. wcn36xx: Add chained transfer support for AMSDU

    WCNSS RX DMA transfer support is limited to 3872 bytes, which is
    enough for simple MPDUs (single MSDU), but not enough for cases
    with A-MSDU (depending on max AMSDU size or max MPDU size).
    
    In that case the MPDU is spread over multiple transfers, with the
    first transfer containing the MPDU header and (at least) the first
    A-MSDU subframe and additional transfer(s) containing the following
    A-MSDUs. This can be handled with a series of flags to tagging the
    first and last A-MSDU transfers.
    
    In that case we have to bufferize and re-linearize the A-MSDU buffers
    into a proper MPDU skb before forwarding to mac80211 (in the same way
    as it is done in ath10k).
    
    This change also includes sanity check of the buffer descriptor to
    prevent skb overflow.
    
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1634557705-11120-1-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Oct 27, 2021
  9. wcn36xx: Enable hardware scan offload for 5Ghz band

    Until now, offload scanning for 5Ghz channels was considered broken.
    However it was mostly a driver issue, caused by bad reporting of the
    beacons/probe-resp bands and frequencies, which has been fixed.
    
    We can now allow offload scan for 5GHz band, this reduces the scanning
    time comparing to software driven scanning.
    
    Note that offloaded scan is limited to 48 channels, check for this.
    
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1634554678-7993-2-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Oct 27, 2021
  10. wcn36xx: Correct band/freq reporting on RX

    For packets originating from hardware scan, the channel and band is
    included in the buffer descriptor (bd->rf_band & bd->rx_ch).
    
    For 2Ghz band the channel value is directly reported in the 4-bit
    rx_ch field. For 5Ghz band, the rx_ch field contains a mapping
    index (given the 4-bit limitation).
    
    The reserved0 value field is also used to extend 4-bit mapping to
    5-bit mapping to support more than 16 5Ghz channels.
    
    This change adds correct reporting of the frequency/band, that is
    used in scan mechanism. And is required for 5Ghz hardware scan
    support.
    
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1634554678-7993-1-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Oct 27, 2021

Commits on Oct 25, 2021

  1. wcn36xx: Fix tx_status mechanism

    This change fix the TX ack mechanism in various ways:
    
    - For NO_ACK tagged packets, we don't need to wait for TX_ACK indication
    and so are not subject to the single packet ack limitation. So we don't
    have to stop the tx queue, and can call the tx status callback as soon
    as DMA transfer has completed.
    
    - Fix skb ownership/reference. Only start status indication timeout
    once the DMA transfer has been completed. This avoids the skb to be
    both referenced in the DMA tx ring and by the tx_ack_skb pointer,
    preventing any use-after-free or double-free.
    
    - This adds a sanity (paranoia?) check on the skb tx ack pointer.
    
    - Resume TX queue if TX status tagged packet TX fails.
    
    Cc: stable@vger.kernel.org
    Fixes: fdf21cc ("wcn36xx: Add TX ack support")
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1634567281-28997-1-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Oct 25, 2021
  2. wcn36xx: Fix (QoS) null data frame bitrate/modulation

    We observe unexpected connection drops with some APs due to
    non-acked mac80211 generated null data frames (keep-alive).
    After debugging and capture, we noticed that null frames are
    submitted at standard data bitrate and that the given APs are
    in trouble with that.
    
    After setting the null frame bitrate to control bitrate, all
    null frames are acked as expected and connection is maintained.
    
    Not sure if it's a requirement of the specification, but it seems
    the right thing to do anyway, null frames are mostly used for control
    purpose (power-saving, keep-alive...), and submitting them with
    a slower/simpler bitrate/modulation is more robust.
    
    Cc: stable@vger.kernel.org
    Fixes: 512b191 ("wcn36xx: Fix TX data path")
    Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/1634560399-15290-1-git-send-email-loic.poulain@linaro.org
    Loic Poulain authored and Kalle Valo committed Oct 25, 2021
  3. ath10k: fix module load regression with iram-recovery feature

    Commit 9af7c32 ("ath10k: add target IRAM recovery feature support")
    introduced a new firmware feature flag ATH10K_FW_FEATURE_IRAM_RECOVERY. But
    this caused ath10k_pci module load to fail if ATH10K_FW_CRASH_DUMP_RAM_DATA bit
    was not enabled in the ath10k coredump_mask module parameter:
    
    [ 2209.328190] ath10k_pci 0000:02:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe
    [ 2209.434414] ath10k_pci 0000:02:00.0: kconfig debug 1 debugfs 1 tracing 1 dfs 1 testmode 1
    [ 2209.547191] ath10k_pci 0000:02:00.0: firmware ver 10.4-3.9.0.2-00099 api 5 features no-p2p,mfp,peer-flow-ctrl,btcoex-param,allows-mesh-bcast,no-ps,peer-fixed-rate,iram-recovery crc32 cbade90a
    [ 2210.896485] ath10k_pci 0000:02:00.0: board_file api 1 bmi_id 0:1 crc32 a040efc2
    [ 2213.603339] ath10k_pci 0000:02:00.0: failed to copy target iram contents: -12
    [ 2213.839027] ath10k_pci 0000:02:00.0: could not init core (-12)
    [ 2213.933910] ath10k_pci 0000:02:00.0: could not probe fw (-12)
    
    And by default coredump_mask does not have ATH10K_FW_CRASH_DUMP_RAM_DATA
    enabled so anyone using a firmware with iram-recovery feature would fail. To my
    knowledge only QCA9984 firmwares starting from release 10.4-3.9.0.2-00099
    enabled the feature.
    
    The reason for regression was that ath10k_core_copy_target_iram() used
    ath10k_coredump_get_mem_layout() to get the memory layout, but when
    ATH10K_FW_CRASH_DUMP_RAM_DATA was disabled it would get just NULL and bail out
    with an error.
    
    While looking at all this I noticed another bug: if CONFIG_DEV_COREDUMP is
    disabled but the firmware has iram-recovery enabled the module load fails with
    similar error messages. I fixed that by returning 0 from
    ath10k_core_copy_target_iram() when _ath10k_coredump_get_mem_layout() returns
    NULL.
    
    Tested-on: QCA9984 hw2.0 PCI 10.4-3.9.0.2-00139
    
    Fixes: 9af7c32 ("ath10k: add target IRAM recovery feature support")
    Signed-off-by: Abinaya Kalaiselvan <akalaise@codeaurora.org>
    Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211020075054.23061-1-kvalo@codeaurora.org
    Abinaya Kalaiselvan authored and Kalle Valo committed Oct 25, 2021
Older