From 7b61b2f9d5bc0c1b3c7e2c84014a97bf477feefe Mon Sep 17 00:00:00 2001 From: Jinwei Chen Date: Wed, 27 Jul 2022 23:44:48 -0700 Subject: [PATCH] qcacmn: Support NO_RX_PKT_HDR_TLV for KIWI Support NO_RX_PKT_HDR_TLV for KIWI Change-Id: I489a1dd6ffa7b2fe2a12735459490b8da5f79f5b CRs-Fixed: 3262204 --- hal/wifi3.0/be/hal_be_rx_tlv.h | 21 ++++++++++++++++++++- hal/wifi3.0/kiwi/hal_kiwi.c | 32 ++++++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/hal/wifi3.0/be/hal_be_rx_tlv.h b/hal/wifi3.0/be/hal_be_rx_tlv.h index 9a598c2a8f..bada149f3e 100644 --- a/hal/wifi3.0/be/hal_be_rx_tlv.h +++ b/hal/wifi3.0/be/hal_be_rx_tlv.h @@ -1854,11 +1854,30 @@ static inline uint32_t hal_rx_tlv_get_is_decrypted_be(uint8_t *buf) return is_decrypt; } -//TODO - Currently going with NO-PKT-HDR, need to add pkt hdr tlv and check +#ifdef NO_RX_PKT_HDR_TLV +/** + * hal_rx_pkt_hdr_get_be(): API to get 80211 header + * @buf: start of rx_pkt_tlv + * + * If NO_RX_PKT_HDR_TLV is enabled, then this API assume caller gives a raw + * data, get 80211 header from packet data directly. + * If NO_RX_PKT_HDR_TLV is disabled, then get it from rx_pkt_hdr_tlv in + * rx_pkt_tlvs. + * + * Return: pointer to start of 80211 header + */ static inline uint8_t *hal_rx_pkt_hdr_get_be(uint8_t *buf) { return buf + RX_PKT_TLVS_LEN; } +#else +static inline uint8_t *hal_rx_pkt_hdr_get_be(uint8_t *buf) +{ + struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; + + return pkt_tlvs->pkt_hdr_tlv.rx_pkt_hdr; +} +#endif /** * hal_rx_priv_info_set_in_tlv_be(): Save the private info to diff --git a/hal/wifi3.0/kiwi/hal_kiwi.c b/hal/wifi3.0/kiwi/hal_kiwi.c index 139831940e..18269e648f 100644 --- a/hal/wifi3.0/kiwi/hal_kiwi.c +++ b/hal/wifi3.0/kiwi/hal_kiwi.c @@ -763,10 +763,21 @@ static void hal_rx_dump_msdu_end_tlv_kiwi(void *msduend, } #endif +#ifdef NO_RX_PKT_HDR_TLV +static inline void hal_rx_dump_pkt_hdr_tlv_kiwi(struct rx_pkt_tlvs *pkt_tlvs, + uint8_t dbg_level) +{ +} + +static inline +void hal_register_rx_pkt_hdr_tlv_api_kiwi(struct hal_soc *hal_soc) +{ +} +#else /** * hal_rx_dump_pkt_hdr_tlv: dump RX pkt header TLV in hex format - * @ pkt_hdr_tlv: pointer the pkt_hdr_tlv in pkt. - * @ dbg_level: log level. + * @pkt_hdr_tlv: pointer the pkt_hdr_tlv in pkt. + * @dbg_level: log level. * * Return: void */ @@ -785,6 +796,20 @@ static inline void hal_rx_dump_pkt_hdr_tlv_kiwi(struct rx_pkt_tlvs *pkt_tlvs, sizeof(pkt_hdr_tlv->rx_pkt_hdr)); } +/** + * hal_register_rx_pkt_hdr_tlv_api_kiwi: register all rx_pkt_hdr_tlv related api + * @hal_soc: HAL soc handler + * + * Return: none + */ +static inline +void hal_register_rx_pkt_hdr_tlv_api_kiwi(struct hal_soc *hal_soc) +{ + hal_soc->ops->hal_rx_pkt_tlv_offset_get = + hal_rx_pkt_tlv_offset_get_generic; +} +#endif + /** * hal_rx_dump_mpdu_start_tlv_generic_be: dump RX mpdu_start TLV in structured * human readable format. @@ -1981,12 +2006,11 @@ static void hal_hw_txrx_ops_attach_kiwi(struct hal_soc *hal_soc) hal_soc->ops->hal_rx_reo_prev_pn_get = hal_rx_reo_prev_pn_get_kiwi; /* rx - TLV struct offsets */ + hal_register_rx_pkt_hdr_tlv_api_kiwi(hal_soc); hal_soc->ops->hal_rx_msdu_end_offset_get = hal_rx_msdu_end_offset_get_generic; hal_soc->ops->hal_rx_mpdu_start_offset_get = hal_rx_mpdu_start_offset_get_generic; - hal_soc->ops->hal_rx_pkt_tlv_offset_get = - hal_rx_pkt_tlv_offset_get_generic; hal_soc->ops->hal_rx_flow_setup_fse = hal_rx_flow_setup_fse_kiwi; hal_soc->ops->hal_rx_flow_get_tuple_info = hal_rx_flow_get_tuple_info_be;