* [PATCH v3 0/2] wifi: ath12k: Add support for MLO Multicast Handling
@ 2025-02-03 7:55 Balamurugan Mahalingam
2025-02-03 7:55 ` [PATCH v3 1/2] wifi: ath12k: Update HTT_TCL_METADATA version and bit mask definitions Balamurugan Mahalingam
2025-02-03 7:55 ` [PATCH v3 2/2] wifi: ath12k: Add support for MLO Multicast handling in driver Balamurugan Mahalingam
0 siblings, 2 replies; 6+ messages in thread
From: Balamurugan Mahalingam @ 2025-02-03 7:55 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_bmahalin
Patch 1 updates the HTT TCL metadata version to use the new bit definitions
of the field to pass additional information from Host to Firmware.
Patch 2 moves the MLO Multicast frame duplication logic to the driver to
have more flexibility to update the HTT TCL metadata with the global
sequence and with a special vdev id to indicate Multicast handling
v3:
Updated the code to handle the ARP transmit failure from AP side during secure mode.
v2: https://patchwork.kernel.org/project/linux-wireless/patch/20250203025016.3851279-3-quic_bmahalin@quicinc.com/
Optimized vdev id arithmetic for more readability based on feedback.
Updated code documentation on intentional reset of meta_data_flag value.
Rebased on top of master branch.
v1: https://patchwork.kernel.org/project/linux-wireless/patch/20250109184932.1593157-3-quic_bmahalin@quicinc.com/
Balamurugan Mahalingam (2):
wifi: ath12k: Update HTT_TCL_METADATA version and bit mask definitions
wifi: ath12k: Add support for MLO Multicast handling in driver
drivers/net/wireless/ath/ath12k/core.h | 1 +
drivers/net/wireless/ath/ath12k/dp.h | 27 ++++--
drivers/net/wireless/ath/ath12k/dp_tx.c | 28 +++++-
drivers/net/wireless/ath/ath12k/dp_tx.h | 4 +-
drivers/net/wireless/ath/ath12k/mac.c | 124 +++++++++++++++++++++++-
5 files changed, 167 insertions(+), 17 deletions(-)
base-commit: a10b8b584b8bcb7559f068ce247fc27d0c4850ca
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 1/2] wifi: ath12k: Update HTT_TCL_METADATA version and bit mask definitions
2025-02-03 7:55 [PATCH v3 0/2] wifi: ath12k: Add support for MLO Multicast Handling Balamurugan Mahalingam
@ 2025-02-03 7:55 ` Balamurugan Mahalingam
2025-02-03 15:30 ` Aditya Kumar Singh
2025-02-03 7:55 ` [PATCH v3 2/2] wifi: ath12k: Add support for MLO Multicast handling in driver Balamurugan Mahalingam
1 sibling, 1 reply; 6+ messages in thread
From: Balamurugan Mahalingam @ 2025-02-03 7:55 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_bmahalin
Update the HTT_TCL_METADATA version to the latest version (2)
as the bit definitions have changed a little to support more
features. This new version allows the host to submit a packet with
more information to the firmware. Firmware uses this additional
information to do special processing for certain frames.
All the firmware binaries available in upstream/public are compatible with
this HTT version update.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
---
drivers/net/wireless/ath/ath12k/dp.h | 21 ++++++++++++++-------
drivers/net/wireless/ath/ath12k/dp_tx.c | 12 ++++++++++--
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
index f68bb78d4a11..7cdc62aa35be 100644
--- a/drivers/net/wireless/ath/ath12k/dp.h
+++ b/drivers/net/wireless/ath/ath12k/dp.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef ATH12K_DP_H
@@ -372,17 +372,18 @@ struct ath12k_dp {
};
/* HTT definitions */
+#define HTT_TAG_TCL_METADATA_VERSION 5
-#define HTT_TCL_META_DATA_TYPE BIT(0)
-#define HTT_TCL_META_DATA_VALID_HTT BIT(1)
+#define HTT_TCL_META_DATA_TYPE GENMASK(1, 0)
+#define HTT_TCL_META_DATA_VALID_HTT BIT(2)
/* vdev meta data */
-#define HTT_TCL_META_DATA_VDEV_ID GENMASK(9, 2)
-#define HTT_TCL_META_DATA_PDEV_ID GENMASK(11, 10)
-#define HTT_TCL_META_DATA_HOST_INSPECTED BIT(12)
+#define HTT_TCL_META_DATA_VDEV_ID GENMASK(10, 3)
+#define HTT_TCL_META_DATA_PDEV_ID GENMASK(12, 11)
+#define HTT_TCL_META_DATA_HOST_INSPECTED_MISSION BIT(13)
/* peer meta data */
-#define HTT_TCL_META_DATA_PEER_ID GENMASK(15, 2)
+#define HTT_TCL_META_DATA_PEER_ID GENMASK(15, 3)
/* HTT tx completion is overlaid in wbm_release_ring */
#define HTT_TX_WBM_COMP_INFO0_STATUS GENMASK(16, 13)
@@ -413,9 +414,15 @@ enum htt_h2t_msg_type {
};
#define HTT_VER_REQ_INFO_MSG_ID GENMASK(7, 0)
+#define HTT_OPTION_TCL_METADATA_VER_V2 2
+#define HTT_OPTION_TAG GENMASK(7, 0)
+#define HTT_OPTION_LEN GENMASK(15, 8)
+#define HTT_OPTION_VALUE GENMASK(31, 16)
+#define HTT_TCL_METADATA_VER_SZ 4
struct htt_ver_req_cmd {
__le32 ver_reg_info;
+ __le32 tcl_metadata_version;
} __packed;
enum htt_srng_ring_type {
diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
index aa8058dd2da6..5ed41783d039 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include "core.h"
@@ -1103,7 +1103,15 @@ int ath12k_dp_tx_htt_h2t_ver_req_msg(struct ath12k_base *ab)
skb_put(skb, len);
cmd = (struct htt_ver_req_cmd *)skb->data;
cmd->ver_reg_info = le32_encode_bits(HTT_H2T_MSG_TYPE_VERSION_REQ,
- HTT_VER_REQ_INFO_MSG_ID);
+ HTT_OPTION_TAG);
+
+ cmd->tcl_metadata_version = le32_encode_bits(HTT_TAG_TCL_METADATA_VERSION,
+ HTT_OPTION_TAG);
+ cmd->tcl_metadata_version |= le32_encode_bits(HTT_TCL_METADATA_VER_SZ,
+ HTT_OPTION_LEN);
+ cmd->tcl_metadata_version |=
+ le32_encode_bits(HTT_OPTION_TCL_METADATA_VER_V2,
+ HTT_OPTION_VALUE);
ret = ath12k_htc_send(&ab->htc, dp->eid, skb);
if (ret) {
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 2/2] wifi: ath12k: Add support for MLO Multicast handling in driver
2025-02-03 7:55 [PATCH v3 0/2] wifi: ath12k: Add support for MLO Multicast Handling Balamurugan Mahalingam
2025-02-03 7:55 ` [PATCH v3 1/2] wifi: ath12k: Update HTT_TCL_METADATA version and bit mask definitions Balamurugan Mahalingam
@ 2025-02-03 7:55 ` Balamurugan Mahalingam
2025-02-03 16:00 ` Aditya Kumar Singh
1 sibling, 1 reply; 6+ messages in thread
From: Balamurugan Mahalingam @ 2025-02-03 7:55 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, quic_bmahalin
For MLO netdevice, the broadcast frame should be transmitted with the
same sequence number on all the links.
Per IEEE 802.11be-2024 section 10.3.2.14.2 "Transmitter requirements",
An AP MLD shall use SNS11 in Table 10-5 (Transmitter sequence number
spaces) maintained by the MLD to determine the sequence number of a
group addressed data frame that is transmitted by an AP affiliated
with the AP MLD so that the same group addressed Data frame
transmitted over multiple links by the AP MLD uses the same
sequence number for transmission on each link.
Currently the MLO multicast handling is done in the mac80211 layer.
Enable support for handling MLO Multicast in the driver to update the
hardware descriptors in a custom way to handle the multicast frames.
Firmware expects the MLO multicast frames to the submitted to the
hardware with special vdev_id (actual vdev_id + 128) to recognize it as
a host inspected frame to avoid using the reinjected path and it also
uses the multicast global sequence number (GSN) provided by the host
in the HTT metadata to process and transmit it with the same sequence
number.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
---
drivers/net/wireless/ath/ath12k/core.h | 1 +
drivers/net/wireless/ath/ath12k/dp.h | 6 ++
drivers/net/wireless/ath/ath12k/dp_tx.c | 16 ++-
drivers/net/wireless/ath/ath12k/dp_tx.h | 4 +-
drivers/net/wireless/ath/ath12k/mac.c | 124 +++++++++++++++++++++++-
5 files changed, 143 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 28db100cfac0..b8c336bc02d8 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -330,6 +330,7 @@ struct ath12k_vif {
u32 key_cipher;
u8 tx_encap_type;
bool ps;
+ atomic_t mcbc_gsn;
struct ath12k_link_vif deflink;
struct ath12k_link_vif __rcu *link[ATH12K_NUM_MAX_LINKS];
diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
index 7cdc62aa35be..75435a931548 100644
--- a/drivers/net/wireless/ath/ath12k/dp.h
+++ b/drivers/net/wireless/ath/ath12k/dp.h
@@ -385,6 +385,12 @@ struct ath12k_dp {
/* peer meta data */
#define HTT_TCL_META_DATA_PEER_ID GENMASK(15, 3)
+/* Global sequence number */
+#define HTT_TCL_META_DATA_TYPE_GLOBAL_SEQ_NUM 3
+#define HTT_TCL_META_DATA_GLOBAL_SEQ_HOST_INSPECTED BIT(2)
+#define HTT_TCL_META_DATA_GLOBAL_SEQ_NUM GENMASK(14, 3)
+#define HTT_TX_MLO_MCAST_HOST_REINJECT_BASE_VDEV_ID 128
+
/* HTT tx completion is overlaid in wbm_release_ring */
#define HTT_TX_WBM_COMP_INFO0_STATUS GENMASK(16, 13)
#define HTT_TX_WBM_COMP_INFO1_REINJECT_REASON GENMASK(3, 0)
diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
index 5ed41783d039..0c55760e3566 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -219,7 +219,7 @@ static int ath12k_dp_tx_align_payload(struct ath12k_base *ab,
}
int ath12k_dp_tx(struct ath12k *ar, struct ath12k_link_vif *arvif,
- struct sk_buff *skb)
+ struct sk_buff *skb, bool gsn_valid, int mcbc_gsn)
{
struct ath12k_base *ab = ar->ab;
struct ath12k_dp *dp = &ab->dp;
@@ -292,13 +292,27 @@ int ath12k_dp_tx(struct ath12k *ar, struct ath12k_link_vif *arvif,
msdu_ext_desc = true;
}
+ if (gsn_valid) {
+ /* Reset and Initialize meta_data_flags with Global Sequence
+ * Number (GSN) info.
+ */
+ ti.meta_data_flags =
+ u32_encode_bits(HTT_TCL_META_DATA_TYPE_GLOBAL_SEQ_NUM,
+ HTT_TCL_META_DATA_TYPE) |
+ u32_encode_bits(mcbc_gsn, HTT_TCL_META_DATA_GLOBAL_SEQ_NUM);
+ }
+
ti.encap_type = ath12k_dp_tx_get_encap_type(arvif, skb);
ti.addr_search_flags = arvif->hal_addr_search_flags;
ti.search_type = arvif->search_type;
ti.type = HAL_TCL_DESC_TYPE_BUFFER;
ti.pkt_offset = 0;
ti.lmac_id = ar->lmac_id;
+
ti.vdev_id = arvif->vdev_id;
+ if (gsn_valid)
+ ti.vdev_id += HTT_TX_MLO_MCAST_HOST_REINJECT_BASE_VDEV_ID;
+
ti.bss_ast_hash = arvif->ast_hash;
ti.bss_ast_idx = arvif->ast_idx;
ti.dscp_tid_tbl_idx = 0;
diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.h b/drivers/net/wireless/ath/ath12k/dp_tx.h
index 46dce23501f3..a5904097dc34 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.h
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022, 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#ifndef ATH12K_DP_TX_H
@@ -17,7 +17,7 @@ struct ath12k_dp_htt_wbm_tx_status {
int ath12k_dp_tx_htt_h2t_ver_req_msg(struct ath12k_base *ab);
int ath12k_dp_tx(struct ath12k *ar, struct ath12k_link_vif *arvif,
- struct sk_buff *skb);
+ struct sk_buff *skb, bool gsn_valid, int mcbc_gsn);
void ath12k_dp_tx_completion_handler(struct ath12k_base *ab, int ring_id);
int ath12k_dp_tx_htt_h2t_ppdu_stats_req(struct ath12k *ar, u32 mask);
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 4fb7e235be66..ee809fa9775e 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -7151,6 +7151,22 @@ static void ath12k_mac_add_p2p_noa_ie(struct ath12k *ar,
spin_unlock_bh(&ar->data_lock);
}
+/* Note: called under rcu_read_lock() */
+static void ath12k_mlo_mcast_update_tx_link_address(struct ieee80211_vif *vif,
+ u8 link, struct sk_buff *skb,
+ u32 info_flags)
+{
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ struct ieee80211_bss_conf *bss_conf;
+
+ if (info_flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
+ return;
+
+ bss_conf = rcu_dereference(vif->link_conf[link]);
+ if (bss_conf)
+ ether_addr_copy(hdr->addr2, bss_conf->addr);
+}
+
/* Note: called under rcu_read_lock() */
static u8 ath12k_mac_get_tx_link(struct ieee80211_sta *sta, struct ieee80211_vif *vif,
u8 link, struct sk_buff *skb, u32 info_flags)
@@ -7262,9 +7278,16 @@ static void ath12k_mac_op_tx(struct ieee80211_hw *hw,
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct ieee80211_key_conf *key = info->control.hw_key;
struct ieee80211_sta *sta = control->sta;
+ struct ath12k_link_vif *tmp_arvif;
u32 info_flags = info->flags;
- struct ath12k *ar;
+ struct sk_buff *msdu_copied;
+ struct ath12k *ar, *tmp_ar;
+ struct ath12k_peer *peer;
+ unsigned long links_map;
+ bool is_mcast = false;
+ struct ethhdr *eth;
bool is_prb_rsp;
+ u16 mcbc_gsn;
u8 link_id;
int ret;
@@ -7301,6 +7324,9 @@ static void ath12k_mac_op_tx(struct ieee80211_hw *hw,
is_prb_rsp = ieee80211_is_probe_resp(hdr->frame_control);
if (info_flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
+ eth = (struct ethhdr *)skb->data;
+ is_mcast = is_multicast_ether_addr(eth->h_dest);
+
skb_cb->flags |= ATH12K_SKB_HW_80211_ENCAP;
} else if (ieee80211_is_mgmt(hdr->frame_control)) {
ret = ath12k_mac_mgmt_tx(ar, skb, is_prb_rsp);
@@ -7312,14 +7338,100 @@ static void ath12k_mac_op_tx(struct ieee80211_hw *hw,
return;
}
+ if (!(info_flags & IEEE80211_TX_CTL_HW_80211_ENCAP))
+ is_mcast = is_multicast_ether_addr(hdr->addr1);
+
/* This is case only for P2P_GO */
if (vif->type == NL80211_IFTYPE_AP && vif->p2p)
ath12k_mac_add_p2p_noa_ie(ar, vif, skb, is_prb_rsp);
- ret = ath12k_dp_tx(ar, arvif, skb);
- if (ret) {
- ath12k_warn(ar->ab, "failed to transmit frame %d\n", ret);
- ieee80211_free_txskb(hw, skb);
+ if (!vif->valid_links || !is_mcast ||
+ test_bit(ATH12K_FLAG_RAW_MODE, &ar->ab->dev_flags)) {
+ ret = ath12k_dp_tx(ar, arvif, skb, false, 0);
+ if (unlikely(ret)) {
+ ath12k_warn(ar->ab, "failed to transmit frame %d\n", ret);
+ ieee80211_free_txskb(ar->ah->hw, skb);
+ return;
+ }
+ } else {
+ mcbc_gsn = atomic_inc_return(&ahvif->mcbc_gsn) & 0xfff;
+
+ links_map = ahvif->links_map;
+ for_each_set_bit(link_id, &links_map,
+ IEEE80211_MLD_MAX_NUM_LINKS) {
+ tmp_arvif = rcu_dereference(ahvif->link[link_id]);
+ if (!tmp_arvif || !tmp_arvif->is_up)
+ continue;
+
+ tmp_ar = tmp_arvif->ar;
+ msdu_copied = skb_copy(skb, GFP_ATOMIC);
+ if (!msdu_copied) {
+ ath12k_err(ar->ab,
+ "skb copy failure link_id 0x%X vdevid 0x%X\n",
+ link_id, tmp_arvif->vdev_id);
+ continue;
+ }
+
+ ath12k_mlo_mcast_update_tx_link_address(vif, link_id,
+ msdu_copied,
+ info_flags);
+
+ skb_cb = ATH12K_SKB_CB(msdu_copied);
+ info = IEEE80211_SKB_CB(msdu_copied);
+ skb_cb->link_id = link_id;
+
+ /* For open mode, skip peer find logic */
+ if (unlikely(ahvif->key_cipher == WMI_CIPHER_NONE))
+ goto skip_peer_find;
+
+ spin_lock_bh(&tmp_ar->ab->base_lock);
+ peer = ath12k_peer_find_by_addr(tmp_ar->ab, tmp_arvif->bssid);
+ if (!peer) {
+ spin_unlock_bh(&tmp_ar->ab->base_lock);
+ ath12k_warn(tmp_ar->ab,
+ "failed to find peer for vdev_id 0x%X addr %pM link_map 0x%X\n",
+ tmp_arvif->vdev_id, tmp_arvif->bssid,
+ ahvif->links_map);
+ dev_kfree_skb_any(msdu_copied);
+ continue;
+ }
+
+ key = peer->keys[peer->mcast_keyidx];
+ if (key) {
+ skb_cb->cipher = key->cipher;
+ skb_cb->flags |= ATH12K_SKB_CIPHER_SET;
+ info->control.hw_key = key;
+
+ hdr = (struct ieee80211_hdr *)msdu_copied->data;
+ if (!ieee80211_has_protected(hdr->frame_control))
+ hdr->frame_control |=
+ cpu_to_le16(IEEE80211_FCTL_PROTECTED);
+ }
+ spin_unlock_bh(&tmp_ar->ab->base_lock);
+
+skip_peer_find:
+ ret = ath12k_dp_tx(tmp_ar, tmp_arvif,
+ msdu_copied, true, mcbc_gsn);
+
+ if (unlikely(ret)) {
+ if (ret == -ENOMEM) {
+ /* Drops are expected during heavy multicast
+ * frame flood. Print with debug log
+ * level to avoid lot of console prints
+ */
+ ath12k_dbg(ar->ab, ATH12K_DBG_MAC,
+ "failed to transmit frame %d\n",
+ ret);
+ } else {
+ ath12k_warn(ar->ab,
+ "failed to transmit frame %d\n",
+ ret);
+ }
+
+ dev_kfree_skb_any(msdu_copied);
+ }
+ }
+ ieee80211_free_txskb(ar->ah->hw, skb);
}
}
@@ -11098,6 +11210,8 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah)
ath12k_iftypes_ext_capa[2].eml_capabilities = cap->eml_cap;
ath12k_iftypes_ext_capa[2].mld_capa_and_ops = cap->mld_cap;
wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO;
+
+ ieee80211_hw_set(hw, MLO_MCAST_MULTI_LINK_TX);
}
hw->queues = ATH12K_HW_MAX_QUEUES;
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/2] wifi: ath12k: Update HTT_TCL_METADATA version and bit mask definitions
2025-02-03 7:55 ` [PATCH v3 1/2] wifi: ath12k: Update HTT_TCL_METADATA version and bit mask definitions Balamurugan Mahalingam
@ 2025-02-03 15:30 ` Aditya Kumar Singh
2025-02-03 20:58 ` Balamurugan Mahalingam
0 siblings, 1 reply; 6+ messages in thread
From: Aditya Kumar Singh @ 2025-02-03 15:30 UTC (permalink / raw)
To: Balamurugan Mahalingam, ath12k; +Cc: linux-wireless
On 2/3/25 13:25, Balamurugan Mahalingam wrote:
> Update the HTT_TCL_METADATA version to the latest version (2)
> as the bit definitions have changed a little to support more
> features. This new version allows the host to submit a packet with
> more information to the firmware. Firmware uses this additional
> information to do special processing for certain frames.
>
> All the firmware binaries available in upstream/public are compatible with
> this HTT version update.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> Signed-off-by: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
> ---
> drivers/net/wireless/ath/ath12k/dp.h | 21 ++++++++++++++-------
> drivers/net/wireless/ath/ath12k/dp_tx.c | 12 ++++++++++--
> 2 files changed, 24 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
> index f68bb78d4a11..7cdc62aa35be 100644
> --- a/drivers/net/wireless/ath/ath12k/dp.h
> +++ b/drivers/net/wireless/ath/ath12k/dp.h
> @@ -1,7 +1,7 @@
> /* SPDX-License-Identifier: BSD-3-Clause-Clear */
> /*
> * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
> - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
> + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
> */
>
> #ifndef ATH12K_DP_H
> @@ -372,17 +372,18 @@ struct ath12k_dp {
> };
>
> /* HTT definitions */
> +#define HTT_TAG_TCL_METADATA_VERSION 5
>
> -#define HTT_TCL_META_DATA_TYPE BIT(0)
> -#define HTT_TCL_META_DATA_VALID_HTT BIT(1)
> +#define HTT_TCL_META_DATA_TYPE GENMASK(1, 0)
> +#define HTT_TCL_META_DATA_VALID_HTT BIT(2)
>
> /* vdev meta data */
> -#define HTT_TCL_META_DATA_VDEV_ID GENMASK(9, 2)
> -#define HTT_TCL_META_DATA_PDEV_ID GENMASK(11, 10)
> -#define HTT_TCL_META_DATA_HOST_INSPECTED BIT(12)
> +#define HTT_TCL_META_DATA_VDEV_ID GENMASK(10, 3)
> +#define HTT_TCL_META_DATA_PDEV_ID GENMASK(12, 11)
> +#define HTT_TCL_META_DATA_HOST_INSPECTED_MISSION BIT(13)
nit: Can we align these three new additions in same column?
>
> /* peer meta data */
> -#define HTT_TCL_META_DATA_PEER_ID GENMASK(15, 2)
> +#define HTT_TCL_META_DATA_PEER_ID GENMASK(15, 3)
>
> /* HTT tx completion is overlaid in wbm_release_ring */
> #define HTT_TX_WBM_COMP_INFO0_STATUS GENMASK(16, 13)
> @@ -413,9 +414,15 @@ enum htt_h2t_msg_type {
> };
>
> #define HTT_VER_REQ_INFO_MSG_ID GENMASK(7, 0)
> +#define HTT_OPTION_TCL_METADATA_VER_V2 2
> +#define HTT_OPTION_TAG GENMASK(7, 0)
> +#define HTT_OPTION_LEN GENMASK(15, 8)
> +#define HTT_OPTION_VALUE GENMASK(31, 16)
> +#define HTT_TCL_METADATA_VER_SZ 4
>
Same here. All aligning in same column would be good.
> struct htt_ver_req_cmd {
> __le32 ver_reg_info;
> + __le32 tcl_metadata_version;
> } __packed;
>
> enum htt_srng_ring_type {
> diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
> index aa8058dd2da6..5ed41783d039 100644
> --- a/drivers/net/wireless/ath/ath12k/dp_tx.c
> +++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
> @@ -1,7 +1,7 @@
> // SPDX-License-Identifier: BSD-3-Clause-Clear
> /*
> * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
> - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
> + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
> */
>
> #include "core.h"
> @@ -1103,7 +1103,15 @@ int ath12k_dp_tx_htt_h2t_ver_req_msg(struct ath12k_base *ab)
> skb_put(skb, len);
> cmd = (struct htt_ver_req_cmd *)skb->data;
> cmd->ver_reg_info = le32_encode_bits(HTT_H2T_MSG_TYPE_VERSION_REQ,
> - HTT_VER_REQ_INFO_MSG_ID);
> + HTT_OPTION_TAG);
> +
> + cmd->tcl_metadata_version = le32_encode_bits(HTT_TAG_TCL_METADATA_VERSION,
> + HTT_OPTION_TAG);
> + cmd->tcl_metadata_version |= le32_encode_bits(HTT_TCL_METADATA_VER_SZ,
> + HTT_OPTION_LEN);
> + cmd->tcl_metadata_version |=
> + le32_encode_bits(HTT_OPTION_TCL_METADATA_VER_V2,
> + HTT_OPTION_VALUE);
>
Can't we write like this ?
x = a |
b |
c;
instead of
x = a;
x |= b;
x |= c;
> ret = ath12k_htc_send(&ab->htc, dp->eid, skb);
> if (ret) {
--
Aditya
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/2] wifi: ath12k: Add support for MLO Multicast handling in driver
2025-02-03 7:55 ` [PATCH v3 2/2] wifi: ath12k: Add support for MLO Multicast handling in driver Balamurugan Mahalingam
@ 2025-02-03 16:00 ` Aditya Kumar Singh
0 siblings, 0 replies; 6+ messages in thread
From: Aditya Kumar Singh @ 2025-02-03 16:00 UTC (permalink / raw)
To: Balamurugan Mahalingam, ath12k; +Cc: linux-wireless
On 2/3/25 13:25, Balamurugan Mahalingam wrote:
> --- a/drivers/net/wireless/ath/ath12k/mac.c
> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> @@ -7151,6 +7151,22 @@ static void ath12k_mac_add_p2p_noa_ie(struct ath12k *ar,
> spin_unlock_bh(&ar->data_lock);
> }
>
> +/* Note: called under rcu_read_lock() */
> +static void ath12k_mlo_mcast_update_tx_link_address(struct ieee80211_vif *vif,
> + u8 link, struct sk_buff *skb,
Can we name the arg as link_id only to have clarity?
[..]
> +
> +skip_peer_find:
> + ret = ath12k_dp_tx(tmp_ar, tmp_arvif,
> + msdu_copied, true, mcbc_gsn);
> +
Remove extra blank line?
--
Aditya
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/2] wifi: ath12k: Update HTT_TCL_METADATA version and bit mask definitions
2025-02-03 15:30 ` Aditya Kumar Singh
@ 2025-02-03 20:58 ` Balamurugan Mahalingam
0 siblings, 0 replies; 6+ messages in thread
From: Balamurugan Mahalingam @ 2025-02-03 20:58 UTC (permalink / raw)
To: Aditya Kumar Singh, ath12k; +Cc: linux-wireless
On 2/3/2025 7:30 AM, Aditya Kumar Singh wrote:
> On 2/3/25 13:25, Balamurugan Mahalingam wrote:
>> Update the HTT_TCL_METADATA version to the latest version (2)
>> as the bit definitions have changed a little to support more
>> features. This new version allows the host to submit a packet with
>> more information to the firmware. Firmware uses this additional
>> information to do special processing for certain frames.
>>
>> All the firmware binaries available in upstream/public are compatible
>> with
>> this HTT version update.
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>> Tested-on: WCN7850 hw2.0 PCI
>> WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>>
>> Signed-off-by: Balamurugan Mahalingam <quic_bmahalin@quicinc.com>
>> ---
>> drivers/net/wireless/ath/ath12k/dp.h | 21 ++++++++++++++-------
>> drivers/net/wireless/ath/ath12k/dp_tx.c | 12 ++++++++++--
>> 2 files changed, 24 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath12k/dp.h
>> b/drivers/net/wireless/ath/ath12k/dp.h
>> index f68bb78d4a11..7cdc62aa35be 100644
>> --- a/drivers/net/wireless/ath/ath12k/dp.h
>> +++ b/drivers/net/wireless/ath/ath12k/dp.h
>> @@ -1,7 +1,7 @@
>> /* SPDX-License-Identifier: BSD-3-Clause-Clear */
>> /*
>> * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
>> - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All
>> rights reserved.
>> + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All
>> rights reserved.
>> */
>> #ifndef ATH12K_DP_H
>> @@ -372,17 +372,18 @@ struct ath12k_dp {
>> };
>> /* HTT definitions */
>> +#define HTT_TAG_TCL_METADATA_VERSION 5
>> -#define HTT_TCL_META_DATA_TYPE BIT(0)
>> -#define HTT_TCL_META_DATA_VALID_HTT BIT(1)
>> +#define HTT_TCL_META_DATA_TYPE GENMASK(1, 0)
>> +#define HTT_TCL_META_DATA_VALID_HTT BIT(2)
>> /* vdev meta data */
>> -#define HTT_TCL_META_DATA_VDEV_ID GENMASK(9, 2)
>> -#define HTT_TCL_META_DATA_PDEV_ID GENMASK(11, 10)
>> -#define HTT_TCL_META_DATA_HOST_INSPECTED BIT(12)
>> +#define HTT_TCL_META_DATA_VDEV_ID GENMASK(10, 3)
>> +#define HTT_TCL_META_DATA_PDEV_ID GENMASK(12, 11)
>> +#define HTT_TCL_META_DATA_HOST_INSPECTED_MISSION BIT(13)
>
> nit: Can we align these three new additions in same column?
It actually looks aligned like inside vim. Tabs are used for indentation
instead of space
>
>> /* peer meta data */
>> -#define HTT_TCL_META_DATA_PEER_ID GENMASK(15, 2)
>> +#define HTT_TCL_META_DATA_PEER_ID GENMASK(15, 3)
>> /* HTT tx completion is overlaid in wbm_release_ring */
>> #define HTT_TX_WBM_COMP_INFO0_STATUS GENMASK(16, 13)
>> @@ -413,9 +414,15 @@ enum htt_h2t_msg_type {
>> };
>> #define HTT_VER_REQ_INFO_MSG_ID GENMASK(7, 0)
>> +#define HTT_OPTION_TCL_METADATA_VER_V2 2
>> +#define HTT_OPTION_TAG GENMASK(7, 0)
>> +#define HTT_OPTION_LEN GENMASK(15, 8)
>> +#define HTT_OPTION_VALUE GENMASK(31, 16)
>> +#define HTT_TCL_METADATA_VER_SZ 4
>>
>
> Same here. All aligning in same column would be good.
It actually looks aligned like inside vim. Tabs are used for indentation
instead of space.
>
>> struct htt_ver_req_cmd {
>> __le32 ver_reg_info;
>> + __le32 tcl_metadata_version;
>> } __packed;
>> enum htt_srng_ring_type {
>> diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c
>> b/drivers/net/wireless/ath/ath12k/dp_tx.c
>> index aa8058dd2da6..5ed41783d039 100644
>> --- a/drivers/net/wireless/ath/ath12k/dp_tx.c
>> +++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
>> @@ -1,7 +1,7 @@
>> // SPDX-License-Identifier: BSD-3-Clause-Clear
>> /*
>> * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
>> - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All
>> rights reserved.
>> + * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All
>> rights reserved.
>> */
>> #include "core.h"
>> @@ -1103,7 +1103,15 @@ int ath12k_dp_tx_htt_h2t_ver_req_msg(struct
>> ath12k_base *ab)
>> skb_put(skb, len);
>> cmd = (struct htt_ver_req_cmd *)skb->data;
>> cmd->ver_reg_info = le32_encode_bits(HTT_H2T_MSG_TYPE_VERSION_REQ,
>> - HTT_VER_REQ_INFO_MSG_ID);
>> + HTT_OPTION_TAG);
>> +
>> + cmd->tcl_metadata_version =
>> le32_encode_bits(HTT_TAG_TCL_METADATA_VERSION,
>> + HTT_OPTION_TAG);
>> + cmd->tcl_metadata_version |=
>> le32_encode_bits(HTT_TCL_METADATA_VER_SZ,
>> + HTT_OPTION_LEN);
>> + cmd->tcl_metadata_version |=
>> + le32_encode_bits(HTT_OPTION_TCL_METADATA_VER_V2,
>> + HTT_OPTION_VALUE);
>>
>
> Can't we write like this ?
>
> x = a |
> b |
> c;
>
> instead of
>
> x = a;
> x |= b;
> x |= c;
Fixed in v4.
>
>> ret = ath12k_htc_send(&ab->htc, dp->eid, skb);
>> if (ret) {
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-02-03 21:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03 7:55 [PATCH v3 0/2] wifi: ath12k: Add support for MLO Multicast Handling Balamurugan Mahalingam
2025-02-03 7:55 ` [PATCH v3 1/2] wifi: ath12k: Update HTT_TCL_METADATA version and bit mask definitions Balamurugan Mahalingam
2025-02-03 15:30 ` Aditya Kumar Singh
2025-02-03 20:58 ` Balamurugan Mahalingam
2025-02-03 7:55 ` [PATCH v3 2/2] wifi: ath12k: Add support for MLO Multicast handling in driver Balamurugan Mahalingam
2025-02-03 16:00 ` Aditya Kumar Singh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox