diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c index 81ab225a020c..94e159efde4f 100644 --- a/core/dp/htt/htt_rx.c +++ b/core/dp/htt/htt_rx.c @@ -186,7 +186,8 @@ void * (*htt_rx_mpdu_desc_list_next)(htt_pdev_handle pdev, bool (*htt_rx_mpdu_desc_retry)(htt_pdev_handle pdev, void *mpdu_desc); -uint16_t (*htt_rx_mpdu_desc_seq_num)(htt_pdev_handle pdev, void *mpdu_desc); +uint16_t (*htt_rx_mpdu_desc_seq_num)(htt_pdev_handle pdev, void *mpdu_desc, + bool update_seq_num); void (*htt_rx_mpdu_desc_pn)(htt_pdev_handle pdev, void *mpdu_desc, diff --git a/core/dp/htt/htt_rx_hl.c b/core/dp/htt/htt_rx_hl.c index fbd80bf1c2c0..9cb2047e3d1b 100644 --- a/core/dp/htt/htt_rx_hl.c +++ b/core/dp/htt/htt_rx_hl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020 The Linux Foundation. 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 @@ -385,12 +385,17 @@ htt_rx_offload_msdu_pop_hl(htt_pdev_handle pdev, } static uint16_t -htt_rx_mpdu_desc_seq_num_hl(htt_pdev_handle pdev, void *mpdu_desc) +htt_rx_mpdu_desc_seq_num_hl(htt_pdev_handle pdev, void *mpdu_desc, + bool update_seq_num) { if (pdev->rx_desc_size_hl) { - return pdev->cur_seq_num_hl = - (u_int16_t)(HTT_WORD_GET(*(u_int32_t *)mpdu_desc, - HTT_HL_RX_DESC_MPDU_SEQ_NUM)); + if (update_seq_num) + return pdev->cur_seq_num_hl = + (u_int16_t)(HTT_WORD_GET(*(u_int32_t *)mpdu_desc, + HTT_HL_RX_DESC_MPDU_SEQ_NUM)); + else + return (u_int16_t)(HTT_WORD_GET(*(u_int32_t *)mpdu_desc, + HTT_HL_RX_DESC_MPDU_SEQ_NUM)); } else { return (u_int16_t)(pdev->cur_seq_num_hl); } diff --git a/core/dp/htt/htt_rx_ll.c b/core/dp/htt/htt_rx_ll.c index e5952c09d53d..7148c9afb455 100644 --- a/core/dp/htt/htt_rx_ll.c +++ b/core/dp/htt/htt_rx_ll.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020 The Linux Foundation. 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 @@ -767,7 +767,8 @@ htt_rx_mpdu_desc_retry_ll(htt_pdev_handle pdev, void *mpdu_desc) } static uint16_t htt_rx_mpdu_desc_seq_num_ll(htt_pdev_handle pdev, - void *mpdu_desc) + void *mpdu_desc, + bool update_seq_num) { struct htt_host_rx_desc_base *rx_desc = (struct htt_host_rx_desc_base *)mpdu_desc; diff --git a/core/dp/ol/inc/ol_htt_rx_api.h b/core/dp/ol/inc/ol_htt_rx_api.h index 4f39903ae354..d4ceb0d6df39 100644 --- a/core/dp/ol/inc/ol_htt_rx_api.h +++ b/core/dp/ol/inc/ol_htt_rx_api.h @@ -380,7 +380,8 @@ bool (*htt_rx_mpdu_desc_retry)( * @return the LSBs of the sequence number for the MPDU */ extern uint16_t -(*htt_rx_mpdu_desc_seq_num)(htt_pdev_handle pdev, void *mpdu_desc); +(*htt_rx_mpdu_desc_seq_num)(htt_pdev_handle pdev, void *mpdu_desc, + bool update_seq_num); /** * @brief Return a rx MPDU's rx reorder array index, based on sequence number. diff --git a/core/dp/txrx/ol_rx.c b/core/dp/txrx/ol_rx.c index 0747a2853118..dfb62b57db11 100644 --- a/core/dp/txrx/ol_rx.c +++ b/core/dp/txrx/ol_rx.c @@ -416,11 +416,12 @@ static void process_reorder(ol_txrx_pdev_handle pdev, enum htt_rx_status mpdu_status; int reorder_idx; - reorder_idx = htt_rx_mpdu_desc_reorder_idx(htt_pdev, rx_mpdu_desc); + reorder_idx = htt_rx_mpdu_desc_reorder_idx(htt_pdev, rx_mpdu_desc, + true); OL_RX_REORDER_TRACE_ADD(pdev, tid, reorder_idx, htt_rx_mpdu_desc_seq_num(htt_pdev, - rx_mpdu_desc), + rx_mpdu_desc, false), 1); ol_rx_mpdu_rssi_update(peer, rx_mpdu_desc); /* @@ -476,7 +477,7 @@ static void process_reorder(ol_txrx_pdev_handle pdev, if (peer->tids_rx_reorder[tid].win_sz_mask == 0) { peer->tids_last_seq[tid] = htt_rx_mpdu_desc_seq_num( htt_pdev, - rx_mpdu_desc); + rx_mpdu_desc, false); } } } /* process_reorder */ diff --git a/core/dp/txrx/ol_rx_defrag.c b/core/dp/txrx/ol_rx_defrag.c index 821df5d8568b..dc74d09130fd 100644 --- a/core/dp/txrx/ol_rx_defrag.c +++ b/core/dp/txrx/ol_rx_defrag.c @@ -357,7 +357,8 @@ ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev, htt_rx_mpdu_desc_list_next(htt_pdev, rx_frag_ind_msg); } - seq_num = htt_rx_mpdu_desc_seq_num(htt_pdev, rx_mpdu_desc); + seq_num = htt_rx_mpdu_desc_seq_num(htt_pdev, + rx_mpdu_desc, true); OL_RX_ERR_STATISTICS_1(pdev, peer->vdev, peer, rx_mpdu_desc, OL_RX_ERR_NONE_FRAG); ol_rx_send_pktlog_event(pdev, peer, head_msdu, pktlog_bit); diff --git a/core/dp/txrx/ol_rx_pn.c b/core/dp/txrx/ol_rx_pn.c index 53727c8c65b9..9b1749bb2b4c 100644 --- a/core/dp/txrx/ol_rx_pn.c +++ b/core/dp/txrx/ol_rx_pn.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013-2017, 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2011, 2013-2017, 2019-2020 The Linux Foundation. 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 @@ -171,7 +171,7 @@ ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev, new_pn.pn128[1], new_pn.pn128[0], new_pn.pn128[0] & 0xffffffffffffULL, htt_rx_mpdu_desc_seq_num(pdev->htt_pdev, - rx_desc)); + rx_desc, false)); } else { ol_txrx_dbg( "PN check failed - TID %d, peer %pK " @@ -190,7 +190,7 @@ ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev, new_pn.pn128[1], new_pn.pn128[0], new_pn.pn128[0] & 0xffffffffffffULL, htt_rx_mpdu_desc_seq_num(pdev->htt_pdev, - rx_desc)); + rx_desc, false)); } #if defined(ENABLE_RX_PN_TRACE) ol_rx_pn_trace_display(pdev, 1); @@ -300,7 +300,7 @@ ol_rx_pn_trace_add(struct ol_txrx_pdev_t *pdev, htt_rx_mpdu_desc_pn(pdev->htt_pdev, rx_desc, &pn, 48); pn32 = pn.pn48 & 0xffffffff; - seq_num = htt_rx_mpdu_desc_seq_num(pdev->htt_pdev, rx_desc); + seq_num = htt_rx_mpdu_desc_seq_num(pdev->htt_pdev, rx_desc, false); unicast = !htt_rx_msdu_is_wlan_mcast(pdev->htt_pdev, rx_desc); pdev->rx_pn_trace.data[idx].peer = peer; diff --git a/core/dp/txrx/ol_rx_reorder.c b/core/dp/txrx/ol_rx_reorder.c index 8aa10215d78c..294d3396152e 100644 --- a/core/dp/txrx/ol_rx_reorder.c +++ b/core/dp/txrx/ol_rx_reorder.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020 The Linux Foundation. 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 @@ -162,7 +162,7 @@ ol_rx_seq_num_check(struct ol_txrx_pdev_t *pdev, uint16_t seq_num = IEEE80211_SEQ_MAX; bool retry = 0; - seq_num = htt_rx_mpdu_desc_seq_num(pdev->htt_pdev, rx_mpdu_desc); + seq_num = htt_rx_mpdu_desc_seq_num(pdev->htt_pdev, rx_mpdu_desc, false); /* For mcast packets, we only the dup-detection, not re-order check */ @@ -294,7 +294,7 @@ ol_rx_reorder_release(struct ol_txrx_vdev_t *vdev, seq_num = htt_rx_mpdu_desc_seq_num( htt_pdev, htt_rx_msdu_desc_retrieve(htt_pdev, - head_msdu)); + head_msdu), false); peer->tids_last_seq[tid] = seq_num; /* rx_opt_proc takes a NULL-terminated list of msdu netbufs */ qdf_nbuf_set_next(tail_msdu, NULL); @@ -379,7 +379,7 @@ ol_rx_reorder_flush(struct ol_txrx_vdev_t *vdev, seq_num = htt_rx_mpdu_desc_seq_num( htt_pdev, - htt_rx_msdu_desc_retrieve(htt_pdev, head_msdu)); + htt_rx_msdu_desc_retrieve(htt_pdev, head_msdu), false); peer->tids_last_seq[tid] = seq_num; /* rx_opt_proc takes a NULL-terminated list of msdu netbufs */ qdf_nbuf_set_next(tail_msdu, NULL); @@ -770,7 +770,8 @@ ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev, pn.pn128[0], pn.pn128[0] & 0xffffffffffffULL, htt_rx_mpdu_desc_seq_num(htt_pdev, - rx_desc)); + rx_desc, + false)); } else { ol_txrx_dbg( "Tgt PN check failed - TID %d, peer %pK " @@ -783,7 +784,8 @@ ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev, pn.pn128[0], pn.pn128[0] & 0xffffffffffffULL, htt_rx_mpdu_desc_seq_num(htt_pdev, - rx_desc)); + rx_desc, + false)); } ol_rx_err(pdev->ctrl_pdev, vdev->vdev_id, peer->mac_addr.raw, tid,