]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: ath12k: add support for HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
authorBaochen Qiang <baochen.qiang@oss.qualcomm.com>
Mon, 20 Jul 2026 06:43:25 +0000 (14:43 +0800)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 27 Jul 2026 15:00:42 +0000 (08:00 -0700)
Firmware on chips that allocate the MLD peer ID itself (WCN7850 and
QCC2072) reports the assignment back to the host through
HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP. The message carries the chosen
MLD peer id, the MLD MAC address etc.

Add the message type, the on-the-wire struct, the field masks and a
handler that parses them out. The host-side state update (publishing the
dp peer into ath12k_dp_hw::dp_peers[], propagating the ID to
ath12k_dp_link_peer::ml_id and ath12k_sta::ml_peer_id) is added in a
follow-up patch;

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3

Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260720-ath12k-fw-allocated-ml-peer-id-v2-4-630632758a80@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_htt.c
drivers/net/wireless/ath/ath12k/dp_htt.h

index 52e10059c6d5a84254990a7af74440541a88d4bb..150b190f9c7fc8baae25140801533409ed3da8d2 100644 (file)
@@ -575,6 +575,33 @@ exit:
        rcu_read_unlock();
 }
 
+static void ath12k_dp_htt_mlo_peer_map_handler(struct ath12k_base *ab,
+                                              struct sk_buff *skb)
+{
+       struct htt_resp_msg *resp = (struct htt_resp_msg *)skb->data;
+       struct htt_t2h_mlo_peer_map_event *ev = &resp->mlo_peer_map_ev;
+       u16 raw_peer_id, peer_id, addr_h16;
+       u8 peer_addr[ETH_ALEN];
+
+       if (skb->len < sizeof(*ev)) {
+               ath12k_warn(ab, "unexpected htt mlo peer map event len %u\n",
+                           skb->len);
+               return;
+       }
+
+       raw_peer_id = le32_get_bits(ev->info0,
+                                   HTT_T2H_MLO_PEER_MAP_INFO0_MLO_PEER_ID);
+       peer_id = raw_peer_id | ATH12K_PEER_ML_ID_VALID;
+
+       addr_h16 = le32_get_bits(ev->info1,
+                                HTT_T2H_MLO_PEER_MAP_INFO1_MAC_ADDR_H16);
+       ath12k_dp_get_mac_addr(le32_to_cpu(ev->mac_addr_l32), addr_h16,
+                              peer_addr);
+
+       ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "htt mlo peer map peer %pM id %u\n",
+                  peer_addr, peer_id);
+}
+
 void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab,
                                       struct sk_buff *skb)
 {
@@ -659,6 +686,9 @@ void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab,
        case HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND:
                ath12k_htt_mlo_offset_event_handler(ab, skb);
                break;
+       case HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP:
+               ath12k_dp_htt_mlo_peer_map_handler(ab, skb);
+               break;
        default:
                ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "dp_htt event %d not handled\n",
                           type);
index 987689f11cda4537dd0e6fc368dc3d0716752b2f..2db7fb27c036190a28fbb935b4538554218a4aad 100644 (file)
@@ -930,6 +930,7 @@ enum htt_t2h_msg_type {
        HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
        HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
        HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
+       HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
        HTT_T2H_MSG_TYPE_PEER_MAP3      = 0x2b,
        HTT_T2H_MSG_TYPE_VDEV_TXRX_STATS_PERIODIC_IND = 0x2c,
 };
@@ -974,11 +975,22 @@ struct htt_t2h_peer_unmap_event {
        __le32 info1;
 } __packed;
 
+#define HTT_T2H_MLO_PEER_MAP_INFO0_MLO_PEER_ID         GENMASK(23, 8)
+#define HTT_T2H_MLO_PEER_MAP_INFO1_MAC_ADDR_H16                GENMASK(15, 0)
+
+struct htt_t2h_mlo_peer_map_event {
+       __le32 info0;
+       __le32 mac_addr_l32;
+       __le32 info1;
+       __le32 reserved[5];
+} __packed;
+
 struct htt_resp_msg {
        union {
                struct htt_t2h_version_conf_msg version_msg;
                struct htt_t2h_peer_map_event peer_map_ev;
                struct htt_t2h_peer_unmap_event peer_unmap_ev;
+               struct htt_t2h_mlo_peer_map_event mlo_peer_map_ev;
        };
 } __packed;