Skip to content

Commit

Permalink
Merge tag 'ath-next-20240702' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/ath/ath

ath.git patches for v6.11

We have moved to a new group-managed repo, and this is the first pull
request from that repo, and from me. Fingers crossed...

We have some new features in ath12k along with some cleanups in ath11k
and ath12k. Also notable are some device-tree changes to allow certain
ath11k and ath12k devices to work with a new power sequencing
subsystem.

Major changes:

ath12k

* DebugFS support for datapath statistics
* WCN7850: support for WoW (Wake on WLAN)
* WCN7850: device-tree bindings

ath11k

* QCA6390: device-tree bindings
  • Loading branch information
Kalle Valo committed Jul 3, 2024
2 parents 8c62617 + 5344fc7 commit c1cacb0
Show file tree
Hide file tree
Showing 31 changed files with 5,156 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ description: |
properties:
compatible:
enum:
- pci17cb,1101 # QCA6390
- pci17cb,1103 # WCN6855

reg:
Expand All @@ -28,10 +29,55 @@ properties:
string to uniquely identify variant of the calibration data for designs
with colliding bus and device ids
vddrfacmn-supply:
description: VDD_RFA_CMN supply regulator handle

vddaon-supply:
description: VDD_AON supply regulator handle

vddwlcx-supply:
description: VDD_WL_CX supply regulator handle

vddwlmx-supply:
description: VDD_WL_MX supply regulator handle

vddrfa0p8-supply:
description: VDD_RFA_0P8 supply regulator handle

vddrfa1p2-supply:
description: VDD_RFA_1P2 supply regulator handle

vddrfa1p7-supply:
description: VDD_RFA_1P7 supply regulator handle

vddpcie0p9-supply:
description: VDD_PCIE_0P9 supply regulator handle

vddpcie1p8-supply:
description: VDD_PCIE_1P8 supply regulator handle

required:
- compatible
- reg

allOf:
- if:
properties:
compatible:
contains:
const: pci17cb,1101
then:
required:
- vddrfacmn-supply
- vddaon-supply
- vddwlcx-supply
- vddwlmx-supply
- vddrfa0p8-supply
- vddrfa1p2-supply
- vddrfa1p7-supply
- vddpcie0p9-supply
- vddpcie1p8-supply

additionalProperties: false

examples:
Expand Down
99 changes: 99 additions & 0 deletions Documentation/devicetree/bindings/net/wireless/qcom,ath12k.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (c) 2024 Linaro Limited
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/wireless/qcom,ath12k.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Technologies ath12k wireless devices (PCIe)

maintainers:
- Jeff Johnson <quic_jjohnson@quicinc.com>
- Kalle Valo <kvalo@kernel.org>

description:
Qualcomm Technologies IEEE 802.11be PCIe devices.

properties:
compatible:
enum:
- pci17cb,1107 # WCN7850

reg:
maxItems: 1

vddaon-supply:
description: VDD_AON supply regulator handle

vddwlcx-supply:
description: VDD_WLCX supply regulator handle

vddwlmx-supply:
description: VDD_WLMX supply regulator handle

vddrfacmn-supply:
description: VDD_RFA_CMN supply regulator handle

vddrfa0p8-supply:
description: VDD_RFA_0P8 supply regulator handle

vddrfa1p2-supply:
description: VDD_RFA_1P2 supply regulator handle

vddrfa1p8-supply:
description: VDD_RFA_1P8 supply regulator handle

vddpcie0p9-supply:
description: VDD_PCIE_0P9 supply regulator handle

vddpcie1p8-supply:
description: VDD_PCIE_1P8 supply regulator handle

required:
- compatible
- reg
- vddaon-supply
- vddwlcx-supply
- vddwlmx-supply
- vddrfacmn-supply
- vddrfa0p8-supply
- vddrfa1p2-supply
- vddrfa1p8-supply
- vddpcie0p9-supply
- vddpcie1p8-supply

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/gpio/gpio.h>
pcie {
#address-cells = <3>;
#size-cells = <2>;
pcie@0 {
device_type = "pci";
reg = <0x0 0x0 0x0 0x0 0x0>;
#address-cells = <3>;
#size-cells = <2>;
ranges;
bus-range = <0x01 0xff>;
wifi@0 {
compatible = "pci17cb,1107";
reg = <0x10000 0x0 0x0 0x0 0x0>;
vddaon-supply = <&vreg_pmu_aon_0p59>;
vddwlcx-supply = <&vreg_pmu_wlcx_0p8>;
vddwlmx-supply = <&vreg_pmu_wlmx_0p85>;
vddrfacmn-supply = <&vreg_pmu_rfa_cmn>;
vddrfa0p8-supply = <&vreg_pmu_rfa_0p8>;
vddrfa1p2-supply = <&vreg_pmu_rfa_1p2>;
vddrfa1p8-supply = <&vreg_pmu_rfa_1p8>;
vddpcie0p9-supply = <&vreg_pmu_pcie_0p9>;
vddpcie1p8-supply = <&vreg_pmu_pcie_1p8>;
};
};
};
3 changes: 1 addition & 2 deletions drivers/net/wireless/ath/ath11k/dp_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,8 +1877,7 @@ static void ath11k_dp_rx_h_csum_offload(struct ath11k *ar, struct sk_buff *msdu)
CHECKSUM_NONE : CHECKSUM_UNNECESSARY;
}

static int ath11k_dp_rx_crypto_mic_len(struct ath11k *ar,
enum hal_encrypt_type enctype)
int ath11k_dp_rx_crypto_mic_len(struct ath11k *ar, enum hal_encrypt_type enctype)
{
switch (enctype) {
case HAL_ENCRYPT_TYPE_OPEN:
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/ath11k/dp_rx.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef ATH11K_DP_RX_H
#define ATH11K_DP_RX_H
Expand Down Expand Up @@ -95,4 +96,6 @@ int ath11k_peer_rx_frag_setup(struct ath11k *ar, const u8 *peer_mac, int vdev_id
int ath11k_dp_rx_pktlog_start(struct ath11k_base *ab);
int ath11k_dp_rx_pktlog_stop(struct ath11k_base *ab, bool stop_timer);

int ath11k_dp_rx_crypto_mic_len(struct ath11k *ar, enum hal_encrypt_type enctype);

#endif /* ATH11K_DP_RX_H */
16 changes: 12 additions & 4 deletions drivers/net/wireless/ath/ath11k/dp_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,12 @@ ath11k_dp_tx_htt_tx_complete_buf(struct ath11k_base *ab,
if (ts->acked) {
if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
info->flags |= IEEE80211_TX_STAT_ACK;
info->status.ack_signal = ATH11K_DEFAULT_NOISE_FLOOR +
ts->ack_rssi;
info->status.ack_signal = ts->ack_rssi;

if (!test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT,
ab->wmi_ab.svc_map))
info->status.ack_signal += ATH11K_DEFAULT_NOISE_FLOOR;

info->status.flags |=
IEEE80211_TX_STATUS_ACK_SIGNAL_VALID;
} else {
Expand Down Expand Up @@ -584,8 +588,12 @@ static void ath11k_dp_tx_complete_msdu(struct ath11k *ar,
if (ts->status == HAL_WBM_TQM_REL_REASON_FRAME_ACKED &&
!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
info->flags |= IEEE80211_TX_STAT_ACK;
info->status.ack_signal = ATH11K_DEFAULT_NOISE_FLOOR +
ts->ack_rssi;
info->status.ack_signal = ts->ack_rssi;

if (!test_bit(WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT,
ab->wmi_ab.svc_map))
info->status.ack_signal += ATH11K_DEFAULT_NOISE_FLOOR;

info->status.flags |= IEEE80211_TX_STATUS_ACK_SIGNAL_VALID;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath11k/dp_tx.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2021, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021, 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/

#ifndef ATH11K_DP_TX_H
Expand All @@ -13,7 +13,7 @@
struct ath11k_dp_htt_wbm_tx_status {
u32 msdu_id;
bool acked;
int ack_rssi;
s8 ack_rssi;
u16 peer_id;
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath11k/hal_tx.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/

#ifndef ATH11K_HAL_TX_H
Expand Down Expand Up @@ -54,7 +54,7 @@ struct hal_tx_info {
struct hal_tx_status {
enum hal_wbm_rel_src_module buf_rel_source;
enum hal_wbm_tqm_rel_reason status;
u8 ack_rssi;
s8 ack_rssi;
u32 flags; /* %HAL_TX_STATUS_FLAGS_ */
u32 ppdu_id;
u8 try_cnt;
Expand Down
29 changes: 22 additions & 7 deletions drivers/net/wireless/ath/ath11k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -4229,6 +4229,7 @@ static int ath11k_install_key(struct ath11k_vif *arvif,

switch (key->cipher) {
case WLAN_CIPHER_SUITE_CCMP:
case WLAN_CIPHER_SUITE_CCMP_256:
arg.key_cipher = WMI_CIPHER_AES_CCM;
/* TODO: Re-check if flag is valid */
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV_MGMT;
Expand All @@ -4238,12 +4239,10 @@ static int ath11k_install_key(struct ath11k_vif *arvif,
arg.key_txmic_len = 8;
arg.key_rxmic_len = 8;
break;
case WLAN_CIPHER_SUITE_CCMP_256:
arg.key_cipher = WMI_CIPHER_AES_CCM;
break;
case WLAN_CIPHER_SUITE_GCMP:
case WLAN_CIPHER_SUITE_GCMP_256:
arg.key_cipher = WMI_CIPHER_AES_GCM;
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV_MGMT;
break;
default:
ath11k_warn(ar->ab, "cipher %d is not supported\n", key->cipher);
Expand Down Expand Up @@ -5903,7 +5902,10 @@ static int ath11k_mac_mgmt_tx_wmi(struct ath11k *ar, struct ath11k_vif *arvif,
{
struct ath11k_base *ab = ar->ab;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB(skb);
struct ieee80211_tx_info *info;
enum hal_encrypt_type enctype;
unsigned int mic_len;
dma_addr_t paddr;
int buf_id;
int ret;
Expand All @@ -5927,7 +5929,12 @@ static int ath11k_mac_mgmt_tx_wmi(struct ath11k *ar, struct ath11k_vif *arvif,
ieee80211_is_deauth(hdr->frame_control) ||
ieee80211_is_disassoc(hdr->frame_control)) &&
ieee80211_has_protected(hdr->frame_control)) {
skb_put(skb, IEEE80211_CCMP_MIC_LEN);
if (!(skb_cb->flags & ATH11K_SKB_CIPHER_SET))
ath11k_warn(ab, "WMI management tx frame without ATH11K_SKB_CIPHER_SET");

enctype = ath11k_dp_tx_get_encrypt_type(skb_cb->cipher);
mic_len = ath11k_dp_rx_crypto_mic_len(ar, enctype);
skb_put(skb, mic_len);
}
}

Expand Down Expand Up @@ -8977,8 +8984,11 @@ static void ath11k_mac_op_sta_statistics(struct ieee80211_hw *hw,
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL);
}

sinfo->signal_avg = ewma_avg_rssi_read(&arsta->avg_rssi) +
ATH11K_DEFAULT_NOISE_FLOOR;
sinfo->signal_avg = ewma_avg_rssi_read(&arsta->avg_rssi);

if (!db2dbm)
sinfo->signal_avg += ATH11K_DEFAULT_NOISE_FLOOR;

sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG);
}

Expand Down Expand Up @@ -9020,7 +9030,12 @@ static void ath11k_mac_op_ipv6_changed(struct ieee80211_hw *hw,
offload = &arvif->arp_ns_offload;
count = 0;

/* Note: read_lock_bh() calls rcu_read_lock() */
/* The _ipv6_changed() is called with RCU lock already held in
* atomic_notifier_call_chain(), so we don't need to call
* rcu_read_lock() again here. But note that with CONFIG_PREEMPT_RT
* enabled, read_lock_bh() also calls rcu_read_lock(). This is OK
* because RCU read critical section is allowed to get nested.
*/
read_lock_bh(&idev->lock);

memset(offload->ipv6_addr, 0, sizeof(offload->ipv6_addr));
Expand Down
20 changes: 10 additions & 10 deletions drivers/net/wireless/ath/ath11k/qmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2859,19 +2859,19 @@ int ath11k_qmi_firmware_start(struct ath11k_base *ab,

int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab)
{
int timeout;
long time_left;

if (!ath11k_core_coldboot_cal_support(ab) ||
ab->hw_params.cbcal_restart_fw == 0)
return 0;

ath11k_dbg(ab, ATH11K_DBG_QMI, "wait for cold boot done\n");

timeout = wait_event_timeout(ab->qmi.cold_boot_waitq,
(ab->qmi.cal_done == 1),
ATH11K_COLD_BOOT_FW_RESET_DELAY);
time_left = wait_event_timeout(ab->qmi.cold_boot_waitq,
(ab->qmi.cal_done == 1),
ATH11K_COLD_BOOT_FW_RESET_DELAY);

if (timeout <= 0) {
if (time_left <= 0) {
ath11k_warn(ab, "Coldboot Calibration timed out\n");
return -ETIMEDOUT;
}
Expand All @@ -2886,7 +2886,7 @@ EXPORT_SYMBOL(ath11k_qmi_fwreset_from_cold_boot);

static int ath11k_qmi_process_coldboot_calibration(struct ath11k_base *ab)
{
int timeout;
long time_left;
int ret;

ret = ath11k_qmi_wlanfw_mode_send(ab, ATH11K_FIRMWARE_MODE_COLD_BOOT);
Expand All @@ -2897,10 +2897,10 @@ static int ath11k_qmi_process_coldboot_calibration(struct ath11k_base *ab)

ath11k_dbg(ab, ATH11K_DBG_QMI, "Coldboot calibration wait started\n");

timeout = wait_event_timeout(ab->qmi.cold_boot_waitq,
(ab->qmi.cal_done == 1),
ATH11K_COLD_BOOT_FW_RESET_DELAY);
if (timeout <= 0) {
time_left = wait_event_timeout(ab->qmi.cold_boot_waitq,
(ab->qmi.cal_done == 1),
ATH11K_COLD_BOOT_FW_RESET_DELAY);
if (time_left <= 0) {
ath11k_warn(ab, "coldboot calibration timed out\n");
return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/ath12k/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ ath12k-y += core.o \
fw.o \
p2p.o

ath12k-$(CONFIG_ATH12K_DEBUGFS) += debugfs.o
ath12k-$(CONFIG_ATH12K_DEBUGFS) += debugfs.o debugfs_htt_stats.o
ath12k-$(CONFIG_ACPI) += acpi.o
ath12k-$(CONFIG_ATH12K_TRACING) += trace.o
ath12k-$(CONFIG_PM) += wow.o

# for tracing framework to find trace.h
CFLAGS_trace.o := -I$(src)
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath12k/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,6 @@ void ath12k_acpi_stop(struct ath12k_base *ab)
acpi_remove_notify_handler(ACPI_HANDLE(ab->dev),
ACPI_DEVICE_NOTIFY,
ath12k_acpi_dsm_notify);

memset(&ab->acpi, 0, sizeof(ab->acpi));
}
Loading

0 comments on commit c1cacb0

Please sign in to comment.