From 26dff6988a34a063072a86d31193648ef97d9d6a Mon Sep 17 00:00:00 2001 From: Ripan Deuri Date: Fri, 22 Apr 2022 16:18:28 +0530 Subject: [PATCH] qcacmn: Handle PPDU ID format message This is a generic T2H message in which a target can specify bits and offsets to extract a parameter from PPDU-id. Use link-id bit and offset present in T2H message to extract hw link-id from PPDU-id on Tx completion. Change-Id: I64b7559e88b037e30f52ba0b75ab62349e469d20 CRs-Fixed: 3195432 --- dp/wifi3.0/dp_htt.c | 32 ++++++++++++++++++++++++++++++++ dp/wifi3.0/dp_types.h | 3 +++ 2 files changed, 35 insertions(+) diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 48548ad5f1..430a254f4e 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -3166,6 +3166,33 @@ dp_htt_rx_addba_handler(struct dp_soc *soc, uint16_t peer_id, peer_id, win_sz, tid, status); } +/* + * dp_htt_ppdu_id_fmt_handler() - PPDU ID Format handler + * @htt_soc: HTT SOC handle + * @msg_word: Pointer to payload + * + * Return: None + */ +static void +dp_htt_ppdu_id_fmt_handler(struct dp_soc *soc, uint32_t *msg_word) +{ + uint8_t msg_type, valid, bits, offset; + + msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word); + + msg_word += HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET; + valid = HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(*msg_word); + bits = HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(*msg_word); + offset = HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(*msg_word); + + dp_info("link_id: valid %u bits %u offset %u", valid, bits, offset); + + if (valid) { + soc->link_id_offset = offset; + soc->link_id_bits = bits; + } +} + /* * dp_htt_t2h_msg_handler() - Generic Target to host Msg/event handler * @context: Opaque context (HTT SOC handle) @@ -3354,6 +3381,11 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt) tid, win_sz); break; } + case HTT_T2H_PPDU_ID_FMT_IND: + { + dp_htt_ppdu_id_fmt_handler(soc->dp_soc, msg_word); + break; + } case HTT_T2H_MSG_TYPE_EXT_STATS_CONF: { dp_txrx_fw_stats_handler(soc->dp_soc, htt_t2h_msg); diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 9a8e835acb..c8a4572e32 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -2382,6 +2382,9 @@ struct dp_soc { #ifdef DP_UMAC_HW_RESET_SUPPORT struct dp_soc_umac_reset_ctx umac_reset_ctx; #endif + /* PPDU to link_id mapping parameters */ + uint8_t link_id_offset; + uint8_t link_id_bits; }; #ifdef IPA_OFFLOAD