diff --git a/hal/wifi3.0/hal_internal.h b/hal/wifi3.0/hal_internal.h index c33f9c9e89..cae1902476 100644 --- a/hal/wifi3.0/hal_internal.h +++ b/hal/wifi3.0/hal_internal.h @@ -406,6 +406,7 @@ struct hal_hw_txrx_ops { (*hal_rx_mpdu_get_addr4)(uint8_t *buf, uint8_t *mac_addr); uint8_t (*hal_rx_get_mpdu_sequence_control_valid)(uint8_t *buf); bool (*hal_rx_is_unicast)(uint8_t *buf); + uint32_t (*hal_rx_tid_get)(hal_soc_handle_t hal_soc_hdl, uint8_t *buf); }; /** diff --git a/hal/wifi3.0/hal_rx.h b/hal/wifi3.0/hal_rx.h index 8276ceadd4..3d1bb97da6 100644 --- a/hal/wifi3.0/hal_rx.h +++ b/hal/wifi3.0/hal_rx.h @@ -1231,8 +1231,8 @@ hal_rx_is_unicast(hal_soc_handle_t hal_soc_hdl, uint8_t *buf) /** * hal_rx_tid_get: get tid based on qos control valid. - * - * @ buf: pointer to rx pkt TLV. + * @hal_soc_hdl: hal soc handle + * @buf: pointer to rx pkt TLV. * * Return: tid */ @@ -1240,20 +1240,8 @@ static inline uint32_t hal_rx_tid_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf) { struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl; - struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; - struct rx_mpdu_start *mpdu_start = - &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start; - uint8_t *rx_mpdu_info = (uint8_t *)&mpdu_start->rx_mpdu_info_details; - uint8_t qos_control_valid = - (_HAL_MS((*_OFFSET_TO_WORD_PTR((rx_mpdu_info), - RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_OFFSET)), - RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_MASK, - RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_LSB)); - if (qos_control_valid) - return hal_soc->ops->hal_rx_mpdu_start_tid_get(buf); - - return HAL_RX_NON_QOS_TID; + return hal_soc->ops->hal_rx_tid_get(hal_soc_hdl, buf); } /** diff --git a/hal/wifi3.0/qca6290/hal_6290.c b/hal/wifi3.0/qca6290/hal_6290.c index cc8b60a233..08781a105e 100644 --- a/hal/wifi3.0/qca6290/hal_6290.c +++ b/hal/wifi3.0/qca6290/hal_6290.c @@ -567,6 +567,31 @@ static bool hal_rx_is_unicast_6290(uint8_t *buf) return (HAL_MPDU_SW_FRAME_GROUP_UNICAST_DATA == grp_id) ? true : false; } + +/** + * hal_rx_tid_get_6290: get tid based on qos control valid. + * @hal_soc_hdl: hal soc handle + * @ buf: pointer to rx pkt TLV. + * + * Return: tid + */ +static uint32_t hal_rx_tid_get_6290(hal_soc_handle_t hal_soc_hdl, uint8_t *buf) +{ + struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; + struct rx_mpdu_start *mpdu_start = + &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start; + uint8_t *rx_mpdu_info = (uint8_t *)&mpdu_start->rx_mpdu_info_details; + uint8_t qos_control_valid = + (_HAL_MS((*_OFFSET_TO_WORD_PTR((rx_mpdu_info), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_OFFSET)), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_MASK, + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_LSB)); + + if (qos_control_valid) + return hal_rx_mpdu_start_tid_get_6290(buf); + + return HAL_RX_NON_QOS_TID; +} struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = { /* init and setup */ hal_srng_dst_hw_init_generic, @@ -630,6 +655,7 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = { hal_rx_mpdu_get_addr4_6290, hal_rx_get_mpdu_sequence_control_valid_6290, hal_rx_is_unicast_6290, + hal_rx_tid_get_6290, }; struct hal_hw_srng_config hw_srng_table_6290[] = { diff --git a/hal/wifi3.0/qca6390/hal_6390.c b/hal/wifi3.0/qca6390/hal_6390.c index 100c6c5eb9..7cad16b00e 100644 --- a/hal/wifi3.0/qca6390/hal_6390.c +++ b/hal/wifi3.0/qca6390/hal_6390.c @@ -565,6 +565,31 @@ static bool hal_rx_is_unicast_6390(uint8_t *buf) return (HAL_MPDU_SW_FRAME_GROUP_UNICAST_DATA == grp_id) ? true : false; } + +/** + * hal_rx_tid_get_6390: get tid based on qos control valid. + * @hal_soc_hdl: hal soc handle + * @buf: pointer to rx pkt TLV. + * + * Return: tid + */ +static uint32_t hal_rx_tid_get_6390(hal_soc_handle_t hal_soc_hdl, uint8_t *buf) +{ + struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; + struct rx_mpdu_start *mpdu_start = + &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start; + uint8_t *rx_mpdu_info = (uint8_t *)&mpdu_start->rx_mpdu_info_details; + uint8_t qos_control_valid = + (_HAL_MS((*_OFFSET_TO_WORD_PTR((rx_mpdu_info), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_OFFSET)), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_MASK, + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_LSB)); + + if (qos_control_valid) + return hal_rx_mpdu_start_tid_get_6390(buf); + + return HAL_RX_NON_QOS_TID; +} struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = { /* init and setup */ hal_srng_dst_hw_init_generic, @@ -628,6 +653,7 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = { hal_rx_mpdu_get_addr4_6390, hal_rx_get_mpdu_sequence_control_valid_6390, hal_rx_is_unicast_6390, + hal_rx_tid_get_6390, }; struct hal_hw_srng_config hw_srng_table_6390[] = { diff --git a/hal/wifi3.0/qca6490/hal_6490.c b/hal/wifi3.0/qca6490/hal_6490.c index 818bb9017b..bb93465d49 100644 --- a/hal/wifi3.0/qca6490/hal_6490.c +++ b/hal/wifi3.0/qca6490/hal_6490.c @@ -471,6 +471,31 @@ static bool hal_rx_is_unicast_6490(uint8_t *buf) return (HAL_MPDU_SW_FRAME_GROUP_UNICAST_DATA == grp_id) ? true : false; } + +/** + * hal_rx_tid_get_6490: get tid based on qos control valid. + * @hal_soc_hdl: hal_soc handle + * @ buf: pointer to rx pkt TLV. + * + * Return: tid + */ +static uint32_t hal_rx_tid_get_6490(hal_soc_handle_t hal_soc_hdl, uint8_t *buf) +{ + struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; + struct rx_mpdu_start *mpdu_start = + &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start; + uint8_t *rx_mpdu_info = (uint8_t *)&mpdu_start->rx_mpdu_info_details; + uint8_t qos_control_valid = + (_HAL_MS((*_OFFSET_TO_WORD_PTR((rx_mpdu_info), + RX_MPDU_INFO_11_MPDU_QOS_CONTROL_VALID_OFFSET)), + RX_MPDU_INFO_11_MPDU_QOS_CONTROL_VALID_MASK, + RX_MPDU_INFO_11_MPDU_QOS_CONTROL_VALID_LSB)); + + if (qos_control_valid) + return hal_rx_mpdu_start_tid_get_6490(buf); + + return HAL_RX_NON_QOS_TID; +} struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = { /* rx */ hal_rx_get_rx_fragment_number_6490, @@ -494,4 +519,5 @@ struct hal_hw_txrx_ops qca6490_hal_hw_txrx_ops = { hal_rx_mpdu_get_addr4_6490, hal_rx_get_mpdu_sequence_control_valid_6490, hal_rx_is_unicast_6490, + hal_rx_tid_get_6490, }; diff --git a/hal/wifi3.0/qca8074v1/hal_8074v1.c b/hal/wifi3.0/qca8074v1/hal_8074v1.c index e779bf9a00..569f55cdc8 100644 --- a/hal/wifi3.0/qca8074v1/hal_8074v1.c +++ b/hal/wifi3.0/qca8074v1/hal_8074v1.c @@ -562,6 +562,32 @@ static bool hal_rx_is_unicast_8074v1(uint8_t *buf) return (HAL_MPDU_SW_FRAME_GROUP_UNICAST_DATA == grp_id) ? true : false; } + +/** + * hal_rx_tid_get_8074v1: get tid based on qos control valid. + * + * @ buf: pointer to rx pkt TLV. + * + * Return: tid + */ +static uint32_t hal_rx_tid_get_8074v1(hal_soc_handle_t hal_soc_hdl, + uint8_t *buf) +{ + struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; + struct rx_mpdu_start *mpdu_start = + &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start; + uint8_t *rx_mpdu_info = (uint8_t *)&mpdu_start->rx_mpdu_info_details; + uint8_t qos_control_valid = + (_HAL_MS((*_OFFSET_TO_WORD_PTR((rx_mpdu_info), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_OFFSET)), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_MASK, + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_LSB)); + + if (qos_control_valid) + return hal_rx_mpdu_start_tid_get_8074v1(buf); + + return HAL_RX_NON_QOS_TID; +} struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = { /* init and setup */ @@ -626,6 +652,7 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = { hal_rx_mpdu_get_addr4_8074v1, hal_rx_get_mpdu_sequence_control_valid_8074v1, hal_rx_is_unicast_8074v1, + hal_rx_tid_get_8074v1, }; struct hal_hw_srng_config hw_srng_table_8074[] = { diff --git a/hal/wifi3.0/qca8074v2/hal_8074v2.c b/hal/wifi3.0/qca8074v2/hal_8074v2.c index 43486352bb..aa9ebfb617 100644 --- a/hal/wifi3.0/qca8074v2/hal_8074v2.c +++ b/hal/wifi3.0/qca8074v2/hal_8074v2.c @@ -559,6 +559,32 @@ static bool hal_rx_is_unicast_8074v2(uint8_t *buf) return (HAL_MPDU_SW_FRAME_GROUP_UNICAST_DATA == grp_id) ? true : false; } + +/** + * hal_rx_tid_get_8074v2: get tid based on qos control valid. + * @hal_soc_hdl: hal soc handle + * @buf: pointer to rx pkt TLV. + * + * Return: tid + */ +static uint32_t hal_rx_tid_get_8074v2(hal_soc_handle_t hal_soc_hdl, + uint8_t *buf) +{ + struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; + struct rx_mpdu_start *mpdu_start = + &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start; + uint8_t *rx_mpdu_info = (uint8_t *)&mpdu_start->rx_mpdu_info_details; + uint8_t qos_control_valid = + (_HAL_MS((*_OFFSET_TO_WORD_PTR((rx_mpdu_info), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_OFFSET)), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_MASK, + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_LSB)); + + if (qos_control_valid) + return hal_rx_mpdu_start_tid_get_8074v2(buf); + + return HAL_RX_NON_QOS_TID; +} struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = { /* init and setup */ @@ -623,6 +649,7 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = { hal_rx_mpdu_get_addr4_8074v2, hal_rx_get_mpdu_sequence_control_valid_8074v2, hal_rx_is_unicast_8074v2, + hal_rx_tid_get_8074v2, }; struct hal_hw_srng_config hw_srng_table_8074v2[] = { diff --git a/hal/wifi3.0/qcn9000/hal_9000.c b/hal/wifi3.0/qcn9000/hal_9000.c index 8cd79e42e9..3878eeddae 100644 --- a/hal/wifi3.0/qcn9000/hal_9000.c +++ b/hal/wifi3.0/qcn9000/hal_9000.c @@ -569,6 +569,31 @@ static bool hal_rx_is_unicast_9000(uint8_t *buf) return (HAL_MPDU_SW_FRAME_GROUP_UNICAST_DATA == grp_id) ? true : false; } + +/** + * hal_rx_tid_get_9000: get tid based on qos control valid. + * @hal_soc_hdl: hal soc handle + * @buf: pointer to rx pkt TLV. + * + * Return: tid + */ +static uint32_t hal_rx_tid_get_9000(hal_soc_handle_t hal_soc_hdl, uint8_t *buf) +{ + struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; + struct rx_mpdu_start *mpdu_start = + &pkt_tlvs->mpdu_start_tlv.rx_mpdu_start; + uint8_t *rx_mpdu_info = (uint8_t *)&mpdu_start->rx_mpdu_info_details; + uint8_t qos_control_valid = + (_HAL_MS((*_OFFSET_TO_WORD_PTR((rx_mpdu_info), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_OFFSET)), + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_MASK, + RX_MPDU_INFO_2_MPDU_QOS_CONTROL_VALID_LSB)); + + if (qos_control_valid) + return hal_rx_mpdu_start_tid_get_8074v2(buf); + + return HAL_RX_NON_QOS_TID; +} struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = { /* init and setup */ @@ -633,6 +658,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = { hal_rx_mpdu_get_addr4_9000, hal_rx_get_mpdu_sequence_control_valid_9000, hal_rx_is_unicast_9000, + hal_rx_tid_get_9000, }; struct hal_hw_srng_config hw_srng_table_9000[] = {