From 41fda10bc5cbb783e6d0a65399e66b5c20a6eb5f Mon Sep 17 00:00:00 2001 From: Chaithanya Garrepalli Date: Wed, 10 Nov 2021 19:07:10 +0530 Subject: [PATCH] qcacmn: In WBM err process read peer_id from peer_meta_data In WBM error processing read peer_id from peer_meta_data instead of sw_peer_id. This changes is needed because we need to process Rx packet on ML peer. But in MLO case sw_peer_id field contains link_peer_id where as peer_meta_data has ml_peer_id. Change-Id: I3f469adfdf7efa88cb081e94fa9fe0c54c1fb078 --- dp/wifi3.0/dp_rx_err.c | 13 +++++-------- hal/wifi3.0/hal_internal.h | 2 ++ hal/wifi3.0/hal_rx.h | 17 +++++++++++++++++ hal/wifi3.0/li/hal_li_rx.h | 3 ++- hal/wifi3.0/qca5018/hal_5018.c | 3 +++ hal/wifi3.0/qca6290/hal_6290.c | 3 +++ hal/wifi3.0/qca6390/hal_6390.c | 3 +++ hal/wifi3.0/qca6490/hal_6490.c | 2 ++ hal/wifi3.0/qca6750/hal_6750.c | 3 +++ hal/wifi3.0/qca8074v1/hal_8074v1.c | 3 +++ hal/wifi3.0/qca8074v2/hal_8074v2.c | 3 +++ hal/wifi3.0/qcn6122/hal_qcn6122.c | 3 +++ hal/wifi3.0/qcn9000/hal_9000.c | 3 +++ hal/wifi3.0/qcn9224/hal_9224.c | 3 +++ hal/wifi3.0/wcn7850/hal_7850.c | 3 +++ 15 files changed, 58 insertions(+), 9 deletions(-) diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c index f3b38ced80..2ac753e8c2 100644 --- a/dp/wifi3.0/dp_rx_err.c +++ b/dp/wifi3.0/dp_rx_err.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2650,6 +2651,7 @@ done: uint16_t peer_id; uint8_t err_code; uint8_t *tlv_hdr; + uint32_t peer_meta_data; rx_tlv_hdr = qdf_nbuf_data(nbuf); /* @@ -2660,8 +2662,9 @@ done: (uint8_t *)&wbm_err_info, sizeof(wbm_err_info)); - peer_id = hal_rx_mpdu_start_sw_peer_id_get(soc->hal_soc, - rx_tlv_hdr); + peer_meta_data = hal_rx_mpdu_peer_meta_data_get(soc->hal_soc, + rx_tlv_hdr); + peer_id = dp_rx_peer_metadata_peer_id_get(soc, peer_meta_data); peer = dp_peer_get_ref_by_id(soc, peer_id, DP_MOD_ID_RX_ERR); if (!peer) @@ -2725,9 +2728,6 @@ done: if (hal_rx_msdu_end_first_msdu_get(soc->hal_soc, rx_tlv_hdr)) { - peer_id = - hal_rx_mpdu_start_sw_peer_id_get(soc->hal_soc, - rx_tlv_hdr); tid = hal_rx_mpdu_start_tid_get(hal_soc, rx_tlv_hdr); } @@ -2745,9 +2745,6 @@ done: rx.err.oor_err, 1); if (hal_rx_msdu_end_first_msdu_get(soc->hal_soc, rx_tlv_hdr)) { - peer_id = - hal_rx_mpdu_start_sw_peer_id_get(soc->hal_soc, - rx_tlv_hdr); tid = hal_rx_mpdu_start_tid_get(hal_soc, rx_tlv_hdr); } diff --git a/hal/wifi3.0/hal_internal.h b/hal/wifi3.0/hal_internal.h index c01eb9f872..b69fc4da19 100644 --- a/hal/wifi3.0/hal_internal.h +++ b/hal/wifi3.0/hal_internal.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -819,6 +820,7 @@ struct hal_hw_txrx_ops { uint8_t (*hal_rx_msdu_end_last_msdu_get)(uint8_t *buf); bool (*hal_rx_get_mpdu_mac_ad4_valid)(uint8_t *buf); uint32_t (*hal_rx_mpdu_start_sw_peer_id_get)(uint8_t *buf); + uint32_t (*hal_rx_mpdu_peer_meta_data_get)(uint8_t *buf); uint32_t (*hal_rx_mpdu_get_to_ds)(uint8_t *buf); uint32_t (*hal_rx_mpdu_get_fr_ds)(uint8_t *buf); uint8_t (*hal_rx_get_mpdu_frame_control_valid)(uint8_t *buf); diff --git a/hal/wifi3.0/hal_rx.h b/hal/wifi3.0/hal_rx.h index b743b46e25..828da764aa 100644 --- a/hal/wifi3.0/hal_rx.h +++ b/hal/wifi3.0/hal_rx.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -950,6 +951,22 @@ hal_rx_mpdu_start_sw_peer_id_get(hal_soc_handle_t hal_soc_hdl, return hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get(buf); } +/** + * hal_rx_mpdu_peer_meta_data_get() - Retrieve PEER_META_DATA + * @hal_soc_hdl: hal soc handle + * @buf: pointer to rx pkt TLV. + * + * Return: peer meta data + */ +static inline uint32_t +hal_rx_mpdu_peer_meta_data_get(hal_soc_handle_t hal_soc_hdl, + uint8_t *buf) +{ + struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl; + + return hal_soc->ops->hal_rx_mpdu_peer_meta_data_get(buf); +} + /* * hal_rx_mpdu_get_tods(): API to get the tods info * from rx_mpdu_start diff --git a/hal/wifi3.0/li/hal_li_rx.h b/hal/wifi3.0/li/hal_li_rx.h index 185e974df1..1f384eb2b5 100644 --- a/hal/wifi3.0/li/hal_li_rx.h +++ b/hal/wifi3.0/li/hal_li_rx.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -478,7 +479,7 @@ hal_rx_msdu_cce_match_get(uint8_t *buf) RX_MPDU_INFO_8_PEER_META_DATA_LSB)) static inline uint32_t -hal_rx_mpdu_peer_meta_data_get(uint8_t *buf) +hal_rx_mpdu_peer_meta_data_get_li(uint8_t *buf) { struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; struct rx_mpdu_start *mpdu_start = diff --git a/hal/wifi3.0/qca5018/hal_5018.c b/hal/wifi3.0/qca5018/hal_5018.c index 8b5cafd44b..920993505c 100644 --- a/hal/wifi3.0/qca5018/hal_5018.c +++ b/hal/wifi3.0/qca5018/hal_5018.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1754,6 +1755,8 @@ static void hal_hw_txrx_ops_attach_qca5018(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_5018; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_5018; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_li; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_5018; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_5018; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/qca6290/hal_6290.c b/hal/wifi3.0/qca6290/hal_6290.c index 6b7737f126..1c769662c1 100644 --- a/hal/wifi3.0/qca6290/hal_6290.c +++ b/hal/wifi3.0/qca6290/hal_6290.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1142,6 +1143,8 @@ static void hal_hw_txrx_ops_attach_6290(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_6290; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_6290; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_li; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_6290; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_6290; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/qca6390/hal_6390.c b/hal/wifi3.0/qca6390/hal_6390.c index 0ac4c44c5d..ae4e1d001e 100644 --- a/hal/wifi3.0/qca6390/hal_6390.c +++ b/hal/wifi3.0/qca6390/hal_6390.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1196,6 +1197,8 @@ static void hal_hw_txrx_ops_attach_qca6390(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_6390; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_6390; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_li; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_6390; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_6390; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/qca6490/hal_6490.c b/hal/wifi3.0/qca6490/hal_6490.c index 645b9eccce..50851cb7ec 100644 --- a/hal/wifi3.0/qca6490/hal_6490.c +++ b/hal/wifi3.0/qca6490/hal_6490.c @@ -1766,6 +1766,8 @@ static void hal_hw_txrx_ops_attach_qca6490(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_6490; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_6490; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_li; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_6490; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_6490; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/qca6750/hal_6750.c b/hal/wifi3.0/qca6750/hal_6750.c index 662673147c..db46ceed1d 100644 --- a/hal/wifi3.0/qca6750/hal_6750.c +++ b/hal/wifi3.0/qca6750/hal_6750.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1929,6 +1930,8 @@ static void hal_hw_txrx_ops_attach_qca6750(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_6750; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_6750; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_li; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_6750; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_6750; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/qca8074v1/hal_8074v1.c b/hal/wifi3.0/qca8074v1/hal_8074v1.c index ff9a272ef4..5fb2c8d62f 100644 --- a/hal/wifi3.0/qca8074v1/hal_8074v1.c +++ b/hal/wifi3.0/qca8074v1/hal_8074v1.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1318,6 +1319,8 @@ static void hal_hw_txrx_ops_attach_qca8074(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_8074v1; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_8074v1; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_li; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_8074v1; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_8074v1; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/qca8074v2/hal_8074v2.c b/hal/wifi3.0/qca8074v2/hal_8074v2.c index bf81ddafd1..2b5366176d 100644 --- a/hal/wifi3.0/qca8074v2/hal_8074v2.c +++ b/hal/wifi3.0/qca8074v2/hal_8074v2.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1315,6 +1316,8 @@ static void hal_hw_txrx_ops_attach_qca8074v2(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_8074v2; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_8074v2; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_li; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_8074v2; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_8074v2; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/qcn6122/hal_qcn6122.c b/hal/wifi3.0/qcn6122/hal_qcn6122.c index 98046c494b..db316ade2e 100644 --- a/hal/wifi3.0/qcn6122/hal_qcn6122.c +++ b/hal/wifi3.0/qcn6122/hal_qcn6122.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -1811,6 +1812,8 @@ static void hal_hw_txrx_ops_attach_qcn6122(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_6122; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_6122; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_li; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_6122; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_6122; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/qcn9000/hal_9000.c b/hal/wifi3.0/qcn9000/hal_9000.c index 25a7411168..04714f3e4e 100644 --- a/hal/wifi3.0/qcn9000/hal_9000.c +++ b/hal/wifi3.0/qcn9000/hal_9000.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1846,6 +1847,8 @@ static void hal_hw_txrx_ops_attach_qcn9000(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_9000; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_9000; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_li; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_9000; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_9000; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/qcn9224/hal_9224.c b/hal/wifi3.0/qcn9224/hal_9224.c index e2d151035a..a9924009c0 100644 --- a/hal/wifi3.0/qcn9224/hal_9224.c +++ b/hal/wifi3.0/qcn9224/hal_9224.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1611,6 +1612,8 @@ static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_be; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_be; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_be; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_be; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_be; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid = diff --git a/hal/wifi3.0/wcn7850/hal_7850.c b/hal/wifi3.0/wcn7850/hal_7850.c index b08ba98a55..ecf223a690 100644 --- a/hal/wifi3.0/wcn7850/hal_7850.c +++ b/hal/wifi3.0/wcn7850/hal_7850.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1367,6 +1368,8 @@ static void hal_hw_txrx_ops_attach_wcn7850(struct hal_soc *hal_soc) hal_rx_get_mpdu_mac_ad4_valid_be; hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get = hal_rx_mpdu_start_sw_peer_id_get_be; + hal_soc->ops->hal_rx_mpdu_peer_meta_data_get = + hal_rx_mpdu_peer_meta_data_get_be; hal_soc->ops->hal_rx_mpdu_get_to_ds = hal_rx_mpdu_get_to_ds_be; hal_soc->ops->hal_rx_mpdu_get_fr_ds = hal_rx_mpdu_get_fr_ds_be; hal_soc->ops->hal_rx_get_mpdu_frame_control_valid =