Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 1 | /* |
Pranita Solanke | ed0aba6 | 2018-01-12 19:14:31 +0530 | [diff] [blame] | 2 | * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 3 | * |
| 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
Balamurugan Mahalingam | d015964 | 2018-07-11 15:02:29 +0530 | [diff] [blame] | 18 | #include "hal_hw_headers.h" |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 19 | #include "dp_types.h" |
| 20 | #include "dp_rx.h" |
| 21 | #include "dp_peer.h" |
| 22 | #include "hal_rx.h" |
| 23 | #include "hal_api.h" |
| 24 | #include "qdf_trace.h" |
| 25 | #include "qdf_nbuf.h" |
| 26 | #include "hal_api_mon.h" |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 27 | #include "dp_rx_mon.h" |
Keyur Parekh | fad6d08 | 2017-05-07 08:54:47 -0700 | [diff] [blame] | 28 | #include "dp_internal.h" |
| 29 | #include "qdf_mem.h" /* qdf_mem_malloc,free */ |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 30 | |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 31 | /** |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 32 | * dp_rx_populate_cdp_indication_ppdu() - Populate cdp rx indication structure |
Soumya Bhat | 560f90c | 2018-03-30 13:53:26 +0530 | [diff] [blame] | 33 | * @pdev: pdev ctx |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 34 | * @ppdu_info: ppdu info structure from ppdu ring |
| 35 | * @ppdu_nbuf: qdf nbuf abstraction for linux skb |
| 36 | * |
| 37 | * Return: none |
| 38 | */ |
| 39 | #ifdef FEATURE_PERPKT_INFO |
| 40 | static inline void |
Soumya Bhat | 560f90c | 2018-03-30 13:53:26 +0530 | [diff] [blame] | 41 | dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev, |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 42 | struct hal_rx_ppdu_info *ppdu_info, |
| 43 | qdf_nbuf_t ppdu_nbuf) |
| 44 | { |
| 45 | struct dp_peer *peer; |
Soumya Bhat | 560f90c | 2018-03-30 13:53:26 +0530 | [diff] [blame] | 46 | struct dp_soc *soc = pdev->soc; |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 47 | struct dp_ast_entry *ast_entry; |
| 48 | struct cdp_rx_indication_ppdu *cdp_rx_ppdu; |
| 49 | uint32_t ast_index; |
| 50 | |
| 51 | cdp_rx_ppdu = (struct cdp_rx_indication_ppdu *)ppdu_nbuf->data; |
| 52 | |
Pamidipati, Vijay | d7eb83e | 2017-09-20 21:19:56 +0530 | [diff] [blame] | 53 | cdp_rx_ppdu->first_data_seq_ctrl = |
| 54 | ppdu_info->rx_status.first_data_seq_ctrl; |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 55 | cdp_rx_ppdu->ppdu_id = ppdu_info->com_info.ppdu_id; |
nobelj | 9ab76e2 | 2018-02-13 18:10:54 -0800 | [diff] [blame] | 56 | cdp_rx_ppdu->length = ppdu_info->rx_status.ppdu_len; |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 57 | cdp_rx_ppdu->duration = ppdu_info->rx_status.duration; |
| 58 | cdp_rx_ppdu->u.bw = ppdu_info->rx_status.bw; |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 59 | cdp_rx_ppdu->tcp_msdu_count = ppdu_info->rx_status.tcp_msdu_count; |
| 60 | cdp_rx_ppdu->udp_msdu_count = ppdu_info->rx_status.udp_msdu_count; |
| 61 | cdp_rx_ppdu->other_msdu_count = ppdu_info->rx_status.other_msdu_count; |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 62 | cdp_rx_ppdu->u.nss = ppdu_info->rx_status.nss; |
| 63 | cdp_rx_ppdu->u.mcs = ppdu_info->rx_status.mcs; |
Keyur Parekh | 49cdc74 | 2018-05-09 10:59:03 -0700 | [diff] [blame] | 64 | if ((ppdu_info->rx_status.sgi == VHT_SGI_NYSM) && |
| 65 | (ppdu_info->rx_status.preamble_type == HAL_RX_PKT_TYPE_11AC)) |
| 66 | cdp_rx_ppdu->u.gi = CDP_SGI_0_4_US; |
| 67 | else |
| 68 | cdp_rx_ppdu->u.gi = ppdu_info->rx_status.sgi; |
Anish Nataraj | 5034701 | 2018-03-06 21:12:45 +0530 | [diff] [blame] | 69 | cdp_rx_ppdu->u.ldpc = ppdu_info->rx_status.ldpc; |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 70 | cdp_rx_ppdu->u.preamble = ppdu_info->rx_status.preamble_type; |
Anish Nataraj | 28490c4 | 2018-01-19 19:34:54 +0530 | [diff] [blame] | 71 | cdp_rx_ppdu->u.ppdu_type = ppdu_info->rx_status.reception_type; |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 72 | cdp_rx_ppdu->rssi = ppdu_info->rx_status.rssi_comb; |
Anish Nataraj | 57614da | 2018-02-07 23:04:24 +0530 | [diff] [blame] | 73 | cdp_rx_ppdu->timestamp = ppdu_info->rx_status.tsft; |
| 74 | cdp_rx_ppdu->channel = ppdu_info->rx_status.chan_num; |
nobelj | d803959 | 2018-03-13 16:59:42 -0700 | [diff] [blame] | 75 | cdp_rx_ppdu->beamformed = ppdu_info->rx_status.beamformed; |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 76 | cdp_rx_ppdu->num_msdu = (cdp_rx_ppdu->tcp_msdu_count + |
| 77 | cdp_rx_ppdu->udp_msdu_count + |
| 78 | cdp_rx_ppdu->other_msdu_count); |
Pranita Solanke | ed0aba6 | 2018-01-12 19:14:31 +0530 | [diff] [blame] | 79 | |
Anish Nataraj | 57614da | 2018-02-07 23:04:24 +0530 | [diff] [blame] | 80 | cdp_rx_ppdu->num_mpdu = ppdu_info->com_info.mpdu_cnt_fcs_ok; |
Pranita Solanke | ed0aba6 | 2018-01-12 19:14:31 +0530 | [diff] [blame] | 81 | if (ppdu_info->com_info.mpdu_cnt_fcs_ok > 1) |
| 82 | cdp_rx_ppdu->is_ampdu = 1; |
| 83 | else |
| 84 | cdp_rx_ppdu->is_ampdu = 0; |
Anish Nataraj | 45d282c | 2017-12-30 01:03:38 +0530 | [diff] [blame] | 85 | |
| 86 | cdp_rx_ppdu->tid = ppdu_info->rx_status.tid; |
Anish Nataraj | 57614da | 2018-02-07 23:04:24 +0530 | [diff] [blame] | 87 | cdp_rx_ppdu->lsig_a = ppdu_info->rx_status.rate; |
Soumya Bhat | 560f90c | 2018-03-30 13:53:26 +0530 | [diff] [blame] | 88 | |
| 89 | ast_index = ppdu_info->rx_status.ast_index; |
| 90 | if (ast_index > (WLAN_UMAC_PSOC_MAX_PEERS * 2)) { |
| 91 | cdp_rx_ppdu->peer_id = HTT_INVALID_PEER; |
| 92 | return; |
| 93 | } |
| 94 | |
| 95 | ast_entry = soc->ast_table[ast_index]; |
| 96 | if (!ast_entry) { |
| 97 | cdp_rx_ppdu->peer_id = HTT_INVALID_PEER; |
| 98 | return; |
| 99 | } |
| 100 | peer = ast_entry->peer; |
| 101 | if (!peer || peer->peer_ids[0] == HTT_INVALID_PEER) { |
| 102 | cdp_rx_ppdu->peer_id = HTT_INVALID_PEER; |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | qdf_mem_copy(cdp_rx_ppdu->mac_addr, |
| 107 | peer->mac_addr.raw, DP_MAC_ADDR_LEN); |
| 108 | cdp_rx_ppdu->peer_id = peer->peer_ids[0]; |
| 109 | cdp_rx_ppdu->vdev_id = peer->vdev->vdev_id; |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 110 | } |
| 111 | #else |
| 112 | static inline void |
Soumya Bhat | 560f90c | 2018-03-30 13:53:26 +0530 | [diff] [blame] | 113 | dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev, |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 114 | struct hal_rx_ppdu_info *ppdu_info, |
| 115 | qdf_nbuf_t ppdu_nbuf) |
| 116 | { |
| 117 | } |
| 118 | #endif |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 119 | /** |
| 120 | * dp_rx_stats_update() - Update per-peer statistics |
| 121 | * @soc: Datapath SOC handle |
| 122 | * @peer: Datapath peer handle |
| 123 | * @ppdu: PPDU Descriptor |
| 124 | * |
| 125 | * Return: None |
| 126 | */ |
| 127 | #ifdef FEATURE_PERPKT_INFO |
| 128 | static void dp_rx_stats_update(struct dp_soc *soc, struct dp_peer *peer, |
| 129 | struct cdp_rx_indication_ppdu *ppdu) |
| 130 | { |
| 131 | struct dp_pdev *pdev = NULL; |
Anish Nataraj | 28490c4 | 2018-01-19 19:34:54 +0530 | [diff] [blame] | 132 | uint8_t mcs, preamble, ac = 0; |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 133 | uint16_t num_msdu; |
| 134 | |
| 135 | mcs = ppdu->u.mcs; |
| 136 | preamble = ppdu->u.preamble; |
| 137 | num_msdu = ppdu->num_msdu; |
| 138 | |
| 139 | if (!peer) |
| 140 | return; |
| 141 | |
| 142 | pdev = peer->vdev->pdev; |
| 143 | |
Subhranil Choudhury | eea6738 | 2018-01-18 20:24:36 +0530 | [diff] [blame] | 144 | dp_mark_peer_inact(peer, false); |
| 145 | |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 146 | if (soc->process_rx_status) |
| 147 | return; |
Pranita Solanke | fc2ff39 | 2017-12-15 19:25:13 +0530 | [diff] [blame] | 148 | |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 149 | DP_STATS_UPD(peer, rx.rssi, ppdu->rssi); |
Pranita Solanke | ed0aba6 | 2018-01-12 19:14:31 +0530 | [diff] [blame] | 150 | |
| 151 | if ((preamble == DOT11_A) || (preamble == DOT11_B)) |
| 152 | ppdu->u.nss = 1; |
| 153 | |
| 154 | if (ppdu->u.nss) |
| 155 | DP_STATS_INC(peer, rx.nss[ppdu->u.nss - 1], num_msdu); |
| 156 | |
Pranita Solanke | a12b4b3 | 2017-11-20 23:04:14 +0530 | [diff] [blame] | 157 | DP_STATS_INC(peer, rx.sgi_count[ppdu->u.gi], num_msdu); |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 158 | DP_STATS_INC(peer, rx.bw[ppdu->u.bw], num_msdu); |
Anish Nataraj | 28490c4 | 2018-01-19 19:34:54 +0530 | [diff] [blame] | 159 | DP_STATS_INC(peer, rx.reception_type[ppdu->u.ppdu_type], num_msdu); |
Pranita Solanke | a12b4b3 | 2017-11-20 23:04:14 +0530 | [diff] [blame] | 160 | DP_STATS_INCC(peer, rx.ampdu_cnt, num_msdu, ppdu->is_ampdu); |
| 161 | DP_STATS_INCC(peer, rx.non_ampdu_cnt, num_msdu, !(ppdu->is_ampdu)); |
| 162 | DP_STATS_UPD(peer, rx.rx_rate, mcs); |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 163 | DP_STATS_INCC(peer, |
Pranita Solanke | ed0aba6 | 2018-01-12 19:14:31 +0530 | [diff] [blame] | 164 | rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu, |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 165 | ((mcs >= MAX_MCS_11A) && (preamble == DOT11_A))); |
| 166 | DP_STATS_INCC(peer, |
| 167 | rx.pkt_type[preamble].mcs_count[mcs], num_msdu, |
Pranita Solanke | a12b4b3 | 2017-11-20 23:04:14 +0530 | [diff] [blame] | 168 | ((mcs < MAX_MCS_11A) && (preamble == DOT11_A))); |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 169 | DP_STATS_INCC(peer, |
Pranita Solanke | ed0aba6 | 2018-01-12 19:14:31 +0530 | [diff] [blame] | 170 | rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu, |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 171 | ((mcs >= MAX_MCS_11B) && (preamble == DOT11_B))); |
| 172 | DP_STATS_INCC(peer, |
| 173 | rx.pkt_type[preamble].mcs_count[mcs], num_msdu, |
Pranita Solanke | a12b4b3 | 2017-11-20 23:04:14 +0530 | [diff] [blame] | 174 | ((mcs < MAX_MCS_11B) && (preamble == DOT11_B))); |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 175 | DP_STATS_INCC(peer, |
Pranita Solanke | ed0aba6 | 2018-01-12 19:14:31 +0530 | [diff] [blame] | 176 | rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu, |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 177 | ((mcs >= MAX_MCS_11A) && (preamble == DOT11_N))); |
| 178 | DP_STATS_INCC(peer, |
| 179 | rx.pkt_type[preamble].mcs_count[mcs], num_msdu, |
Pranita Solanke | a12b4b3 | 2017-11-20 23:04:14 +0530 | [diff] [blame] | 180 | ((mcs < MAX_MCS_11A) && (preamble == DOT11_N))); |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 181 | DP_STATS_INCC(peer, |
Pranita Solanke | ed0aba6 | 2018-01-12 19:14:31 +0530 | [diff] [blame] | 182 | rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu, |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 183 | ((mcs >= MAX_MCS_11AC) && (preamble == DOT11_AC))); |
| 184 | DP_STATS_INCC(peer, |
| 185 | rx.pkt_type[preamble].mcs_count[mcs], num_msdu, |
| 186 | ((mcs < MAX_MCS_11AC) && (preamble == DOT11_AC))); |
| 187 | DP_STATS_INCC(peer, |
Pranita Solanke | ed0aba6 | 2018-01-12 19:14:31 +0530 | [diff] [blame] | 188 | rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu, |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 189 | ((mcs >= (MAX_MCS - 1)) && (preamble == DOT11_AX))); |
| 190 | DP_STATS_INCC(peer, |
| 191 | rx.pkt_type[preamble].mcs_count[mcs], num_msdu, |
| 192 | ((mcs < (MAX_MCS - 1)) && (preamble == DOT11_AX))); |
Anish Nataraj | 28490c4 | 2018-01-19 19:34:54 +0530 | [diff] [blame] | 193 | /* |
| 194 | * If invalid TID, it could be a non-qos frame, hence do not update |
| 195 | * any AC counters |
| 196 | */ |
| 197 | ac = TID_TO_WME_AC(ppdu->tid); |
| 198 | if (ppdu->tid != HAL_TID_INVALID) |
| 199 | DP_STATS_INC(peer, rx.wme_ac_type[ac], num_msdu); |
Amir Patel | 52c6b73 | 2018-08-03 12:13:22 +0530 | [diff] [blame^] | 200 | dp_peer_stats_notify(peer); |
| 201 | DP_STATS_UPD(peer, rx.last_rssi, ppdu->rssi); |
Anish Nataraj | 28490c4 | 2018-01-19 19:34:54 +0530 | [diff] [blame] | 202 | |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 203 | if (soc->cdp_soc.ol_ops->update_dp_stats) { |
Akshay Kosigi | 1a9c6d1 | 2018-04-26 00:54:23 +0530 | [diff] [blame] | 204 | soc->cdp_soc.ol_ops->update_dp_stats(pdev->ctrl_pdev, |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 205 | &peer->stats, ppdu->peer_id, |
| 206 | UPDATE_PEER_STATS); |
Pranita Solanke | fc2ff39 | 2017-12-15 19:25:13 +0530 | [diff] [blame] | 207 | |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 208 | } |
| 209 | } |
| 210 | #endif |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 211 | |
| 212 | /** |
Soumya Bhat | 7422db8 | 2017-12-15 13:48:53 +0530 | [diff] [blame] | 213 | * dp_rx_handle_mcopy_mode() - Allocate and deliver first MSDU payload |
Pranita Solanke | fc2ff39 | 2017-12-15 19:25:13 +0530 | [diff] [blame] | 214 | * @soc: core txrx main context |
| 215 | * @pdev: pdev strcuture |
| 216 | * @ppdu_info: structure for rx ppdu ring |
| 217 | * |
| 218 | * Return: QDF_STATUS_SUCCESS - If nbuf to be freed by caller |
| 219 | * QDF_STATUS_E_ALREADY - If nbuf not to be freed by caller |
Soumya Bhat | 7422db8 | 2017-12-15 13:48:53 +0530 | [diff] [blame] | 220 | */ |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 221 | #ifdef FEATURE_PERPKT_INFO |
| 222 | static inline QDF_STATUS |
Soumya Bhat | 7422db8 | 2017-12-15 13:48:53 +0530 | [diff] [blame] | 223 | dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev, |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 224 | struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf) |
| 225 | { |
| 226 | uint8_t size = 0; |
| 227 | |
Soumya Bhat | dc8aca8 | 2018-03-13 14:10:24 +0530 | [diff] [blame] | 228 | if (ppdu_info->msdu_info.first_msdu_payload == NULL) |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 229 | return QDF_STATUS_SUCCESS; |
| 230 | |
Soumya Bhat | 2f54de2 | 2018-02-21 09:54:28 +0530 | [diff] [blame] | 231 | if (pdev->m_copy_id.rx_ppdu_id == ppdu_info->com_info.ppdu_id) |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 232 | return QDF_STATUS_SUCCESS; |
| 233 | |
Soumya Bhat | 2f54de2 | 2018-02-21 09:54:28 +0530 | [diff] [blame] | 234 | pdev->m_copy_id.rx_ppdu_id = ppdu_info->com_info.ppdu_id; |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 235 | |
Soumya Bhat | 2f54de2 | 2018-02-21 09:54:28 +0530 | [diff] [blame] | 236 | /* Include 2 bytes of reserved space appended to the msdu payload */ |
Soumya Bhat | dc8aca8 | 2018-03-13 14:10:24 +0530 | [diff] [blame] | 237 | size = (ppdu_info->msdu_info.first_msdu_payload - |
| 238 | qdf_nbuf_data(nbuf)) + 2; |
| 239 | ppdu_info->msdu_info.first_msdu_payload = NULL; |
Soumya Bhat | 7422db8 | 2017-12-15 13:48:53 +0530 | [diff] [blame] | 240 | |
| 241 | if (qdf_nbuf_pull_head(nbuf, size) == NULL) |
| 242 | return QDF_STATUS_SUCCESS; |
| 243 | |
Soumya Bhat | dc8aca8 | 2018-03-13 14:10:24 +0530 | [diff] [blame] | 244 | /* only retain RX MSDU payload in the skb */ |
| 245 | qdf_nbuf_trim_tail(nbuf, qdf_nbuf_len(nbuf) - |
| 246 | ppdu_info->msdu_info.payload_len); |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 247 | dp_wdi_event_handler(WDI_EVENT_RX_DATA, soc, |
| 248 | nbuf, HTT_INVALID_PEER, WDI_NO_VAL, pdev->pdev_id); |
| 249 | return QDF_STATUS_E_ALREADY; |
| 250 | } |
| 251 | #else |
| 252 | static inline QDF_STATUS |
Soumya Bhat | 7422db8 | 2017-12-15 13:48:53 +0530 | [diff] [blame] | 253 | dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev, |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 254 | struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf) |
| 255 | { |
| 256 | return QDF_STATUS_SUCCESS; |
| 257 | } |
| 258 | #endif |
| 259 | |
| 260 | |
| 261 | /** |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 262 | * dp_rx_handle_ppdu_stats() - Allocate and deliver ppdu stats to cdp layer |
| 263 | * @soc: core txrx main context |
| 264 | * @pdev: pdev strcuture |
| 265 | * @ppdu_info: structure for rx ppdu ring |
| 266 | * |
| 267 | * Return: none |
| 268 | */ |
| 269 | #ifdef FEATURE_PERPKT_INFO |
| 270 | static inline void |
| 271 | dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev, |
| 272 | struct hal_rx_ppdu_info *ppdu_info) |
| 273 | { |
| 274 | qdf_nbuf_t ppdu_nbuf; |
| 275 | struct dp_peer *peer; |
| 276 | struct cdp_rx_indication_ppdu *cdp_rx_ppdu; |
| 277 | |
Anish Nataraj | 28490c4 | 2018-01-19 19:34:54 +0530 | [diff] [blame] | 278 | /* |
| 279 | * Do not allocate if fcs error, |
| 280 | * ast idx invalid / fctl invalid |
| 281 | */ |
Anish Nataraj | 28490c4 | 2018-01-19 19:34:54 +0530 | [diff] [blame] | 282 | if (ppdu_info->com_info.mpdu_cnt_fcs_ok == 0) |
| 283 | return; |
| 284 | |
Soumya Bhat | 560f90c | 2018-03-30 13:53:26 +0530 | [diff] [blame] | 285 | if (!pdev->mcopy_mode) { |
| 286 | if (!ppdu_info->rx_status.frame_control_info_valid) |
| 287 | return; |
Anish Nataraj | 28490c4 | 2018-01-19 19:34:54 +0530 | [diff] [blame] | 288 | |
Soumya Bhat | 560f90c | 2018-03-30 13:53:26 +0530 | [diff] [blame] | 289 | if (ppdu_info->rx_status.ast_index == HAL_AST_IDX_INVALID) |
| 290 | return; |
| 291 | } |
Tallapragada Kalyan | a867edf | 2017-11-14 12:26:41 +0530 | [diff] [blame] | 292 | ppdu_nbuf = qdf_nbuf_alloc(soc->osdev, |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 293 | sizeof(struct hal_rx_ppdu_info), 0, 0, FALSE); |
| 294 | if (ppdu_nbuf) { |
Soumya Bhat | 560f90c | 2018-03-30 13:53:26 +0530 | [diff] [blame] | 295 | dp_rx_populate_cdp_indication_ppdu(pdev, ppdu_info, ppdu_nbuf); |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 296 | qdf_nbuf_put_tail(ppdu_nbuf, |
| 297 | sizeof(struct cdp_rx_indication_ppdu)); |
| 298 | cdp_rx_ppdu = (struct cdp_rx_indication_ppdu *)ppdu_nbuf->data; |
| 299 | |
| 300 | peer = dp_peer_find_by_id(soc, cdp_rx_ppdu->peer_id); |
| 301 | if (peer && cdp_rx_ppdu->peer_id != HTT_INVALID_PEER) { |
Pamidipati, Vijay | 57a435a | 2017-10-17 11:03:39 +0530 | [diff] [blame] | 302 | dp_rx_stats_update(soc, peer, cdp_rx_ppdu); |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 303 | dp_wdi_event_handler(WDI_EVENT_RX_PPDU_DESC, soc, |
| 304 | ppdu_nbuf, cdp_rx_ppdu->peer_id, |
| 305 | WDI_NO_VAL, pdev->pdev_id); |
Soumya Bhat | 2f54de2 | 2018-02-21 09:54:28 +0530 | [diff] [blame] | 306 | } else if (pdev->mcopy_mode) { |
| 307 | dp_wdi_event_handler(WDI_EVENT_RX_PPDU_DESC, soc, |
| 308 | ppdu_nbuf, HTT_INVALID_PEER, |
| 309 | WDI_NO_VAL, pdev->pdev_id); |
| 310 | } else { |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 311 | qdf_nbuf_free(ppdu_nbuf); |
Soumya Bhat | 2f54de2 | 2018-02-21 09:54:28 +0530 | [diff] [blame] | 312 | } |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 313 | } |
| 314 | } |
| 315 | #else |
| 316 | static inline void |
| 317 | dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev, |
| 318 | struct hal_rx_ppdu_info *ppdu_info) |
| 319 | { |
| 320 | } |
| 321 | #endif |
| 322 | |
| 323 | /** |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 324 | * dp_rx_mon_status_process_tlv() - Process status TLV in status |
| 325 | * buffer on Rx status Queue posted by status SRNG processing. |
| 326 | * @soc: core txrx main context |
| 327 | * @mac_id: mac_id which is one of 3 mac_ids _ring |
| 328 | * |
| 329 | * Return: none |
| 330 | */ |
| 331 | static inline void |
Karunakar Dasineni | 4055568 | 2017-03-26 22:44:39 -0700 | [diff] [blame] | 332 | dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id, |
| 333 | uint32_t quota) |
| 334 | { |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 335 | struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 336 | struct hal_rx_ppdu_info *ppdu_info; |
| 337 | qdf_nbuf_t status_nbuf; |
| 338 | uint8_t *rx_tlv; |
| 339 | uint8_t *rx_tlv_start; |
Kai Chen | ad516ae | 2017-09-08 18:35:47 -0700 | [diff] [blame] | 340 | uint32_t tlv_status = HAL_TLV_STATUS_BUF_DONE; |
Soumya Bhat | 2f54de2 | 2018-02-21 09:54:28 +0530 | [diff] [blame] | 341 | QDF_STATUS m_copy_status = QDF_STATUS_SUCCESS; |
Kai Chen | 783e038 | 2018-01-25 16:29:08 -0800 | [diff] [blame] | 342 | struct cdp_pdev_mon_stats *rx_mon_stats; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 343 | |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 344 | ppdu_info = &pdev->ppdu_info; |
Kai Chen | 783e038 | 2018-01-25 16:29:08 -0800 | [diff] [blame] | 345 | rx_mon_stats = &pdev->rx_mon_stats; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 346 | |
| 347 | if (pdev->mon_ppdu_status != DP_PPDU_STATUS_START) |
| 348 | return; |
| 349 | |
| 350 | while (!qdf_nbuf_is_queue_empty(&pdev->rx_status_q)) { |
| 351 | |
| 352 | status_nbuf = qdf_nbuf_queue_remove(&pdev->rx_status_q); |
| 353 | rx_tlv = qdf_nbuf_data(status_nbuf); |
| 354 | rx_tlv_start = rx_tlv; |
Venkata Sharath Chandra Manchala | 5a6f429 | 2017-11-03 14:57:41 -0700 | [diff] [blame] | 355 | |
Keyur Parekh | fad6d08 | 2017-05-07 08:54:47 -0700 | [diff] [blame] | 356 | #ifndef REMOVE_PKT_LOG |
Venkata Sharath Chandra Manchala | 5a6f429 | 2017-11-03 14:57:41 -0700 | [diff] [blame] | 357 | #if defined(WDI_EVENT_ENABLE) |
Keyur Parekh | fad6d08 | 2017-05-07 08:54:47 -0700 | [diff] [blame] | 358 | dp_wdi_event_handler(WDI_EVENT_RX_DESC, soc, |
Keyur Parekh | db0fa14 | 2017-07-13 19:40:22 -0700 | [diff] [blame] | 359 | status_nbuf, HTT_INVALID_PEER, WDI_NO_VAL, mac_id); |
Keyur Parekh | fad6d08 | 2017-05-07 08:54:47 -0700 | [diff] [blame] | 360 | #endif |
| 361 | #endif |
Soumya Bhat | 2f54de2 | 2018-02-21 09:54:28 +0530 | [diff] [blame] | 362 | if ((pdev->monitor_vdev != NULL) || (pdev->enhanced_stats_en) || |
| 363 | pdev->mcopy_mode) { |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 364 | |
Keyur Parekh | fad6d08 | 2017-05-07 08:54:47 -0700 | [diff] [blame] | 365 | do { |
| 366 | tlv_status = hal_rx_status_get_tlv_info(rx_tlv, |
Balamurugan Mahalingam | d015964 | 2018-07-11 15:02:29 +0530 | [diff] [blame] | 367 | ppdu_info, pdev->soc->hal_soc); |
Kai Chen | 783e038 | 2018-01-25 16:29:08 -0800 | [diff] [blame] | 368 | |
| 369 | dp_rx_mon_update_dbg_ppdu_stats(ppdu_info, |
| 370 | rx_mon_stats); |
| 371 | |
Keyur Parekh | fad6d08 | 2017-05-07 08:54:47 -0700 | [diff] [blame] | 372 | rx_tlv = hal_rx_status_get_next_tlv(rx_tlv); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 373 | |
Keyur Parekh | fad6d08 | 2017-05-07 08:54:47 -0700 | [diff] [blame] | 374 | if ((rx_tlv - rx_tlv_start) >= RX_BUFFER_SIZE) |
| 375 | break; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 376 | |
Keyur Parekh | fad6d08 | 2017-05-07 08:54:47 -0700 | [diff] [blame] | 377 | } while (tlv_status == HAL_TLV_STATUS_PPDU_NOT_DONE); |
| 378 | } |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 379 | |
Soumya Bhat | 7422db8 | 2017-12-15 13:48:53 +0530 | [diff] [blame] | 380 | if (pdev->mcopy_mode) { |
Soumya Bhat | 2f54de2 | 2018-02-21 09:54:28 +0530 | [diff] [blame] | 381 | m_copy_status = dp_rx_handle_mcopy_mode(soc, |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 382 | pdev, ppdu_info, status_nbuf); |
Soumya Bhat | 2f54de2 | 2018-02-21 09:54:28 +0530 | [diff] [blame] | 383 | if (m_copy_status == QDF_STATUS_SUCCESS) |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 384 | qdf_nbuf_free(status_nbuf); |
| 385 | } else { |
| 386 | qdf_nbuf_free(status_nbuf); |
| 387 | } |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 388 | |
| 389 | if (tlv_status == HAL_TLV_STATUS_PPDU_DONE) { |
Kai Chen | 783e038 | 2018-01-25 16:29:08 -0800 | [diff] [blame] | 390 | rx_mon_stats->status_ppdu_done++; |
Soumya Bhat | 5c60deb | 2017-12-12 16:42:04 +0530 | [diff] [blame] | 391 | if (pdev->enhanced_stats_en || |
Soumya Bhat | 7422db8 | 2017-12-15 13:48:53 +0530 | [diff] [blame] | 392 | pdev->mcopy_mode) |
Anish Nataraj | 38a2956 | 2017-08-18 19:41:17 +0530 | [diff] [blame] | 393 | dp_rx_handle_ppdu_stats(soc, pdev, ppdu_info); |
Soumya Bhat | 6fee59c | 2017-10-31 13:12:37 +0530 | [diff] [blame] | 394 | |
nobelj | 1c31fee | 2018-03-21 11:47:05 -0700 | [diff] [blame] | 395 | pdev->mon_ppdu_status = DP_PPDU_STATUS_DONE; |
| 396 | dp_rx_mon_dest_process(soc, mac_id, quota); |
Kai Chen | cbe4c34 | 2017-06-12 20:06:35 -0700 | [diff] [blame] | 397 | pdev->mon_ppdu_status = DP_PPDU_STATUS_START; |
Karunakar Dasineni | 65b626e | 2017-12-18 22:17:29 -0800 | [diff] [blame] | 398 | pdev->ppdu_info.com_info.last_ppdu_id = |
| 399 | pdev->ppdu_info.com_info.ppdu_id; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 400 | } |
| 401 | } |
| 402 | return; |
| 403 | } |
| 404 | |
| 405 | /* |
| 406 | * dp_rx_mon_status_srng_process() - Process monitor status ring |
| 407 | * post the status ring buffer to Rx status Queue for later |
| 408 | * processing when status ring is filled with status TLV. |
| 409 | * Allocate a new buffer to status ring if the filled buffer |
| 410 | * is posted. |
| 411 | * |
| 412 | * @soc: core txrx main context |
| 413 | * @mac_id: mac_id which is one of 3 mac_ids |
| 414 | * @quota: No. of ring entry that can be serviced in one shot. |
| 415 | |
| 416 | * Return: uint32_t: No. of ring entry that is processed. |
| 417 | */ |
| 418 | static inline uint32_t |
| 419 | dp_rx_mon_status_srng_process(struct dp_soc *soc, uint32_t mac_id, |
| 420 | uint32_t quota) |
| 421 | { |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 422 | struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 423 | void *hal_soc; |
| 424 | void *mon_status_srng; |
| 425 | void *rxdma_mon_status_ring_entry; |
| 426 | QDF_STATUS status; |
| 427 | uint32_t work_done = 0; |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 428 | int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 429 | |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 430 | mon_status_srng = pdev->rxdma_mon_status_ring[mac_for_pdev].hal_srng; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 431 | |
| 432 | qdf_assert(mon_status_srng); |
Houston Hoffman | 648a918 | 2017-05-21 23:27:50 -0700 | [diff] [blame] | 433 | if (!mon_status_srng || !hal_srng_initialized(mon_status_srng)) { |
| 434 | |
| 435 | QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, |
Mohit Khanna | 9a6fdd5 | 2017-12-12 10:55:48 +0800 | [diff] [blame] | 436 | "%s %d : HAL Monitor Status Ring Init Failed -- %pK\n", |
Houston Hoffman | 648a918 | 2017-05-21 23:27:50 -0700 | [diff] [blame] | 437 | __func__, __LINE__, mon_status_srng); |
| 438 | return work_done; |
| 439 | } |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 440 | |
| 441 | hal_soc = soc->hal_soc; |
| 442 | |
| 443 | qdf_assert(hal_soc); |
| 444 | |
| 445 | if (qdf_unlikely(hal_srng_access_start(hal_soc, mon_status_srng))) |
| 446 | goto done; |
| 447 | |
| 448 | /* mon_status_ring_desc => WBM_BUFFER_RING STRUCT => |
| 449 | * BUFFER_ADDR_INFO STRUCT |
| 450 | */ |
| 451 | while (qdf_likely((rxdma_mon_status_ring_entry = |
| 452 | hal_srng_src_peek(hal_soc, mon_status_srng)) |
| 453 | && quota--)) { |
| 454 | uint32_t rx_buf_cookie; |
| 455 | qdf_nbuf_t status_nbuf; |
| 456 | struct dp_rx_desc *rx_desc; |
| 457 | uint8_t *status_buf; |
| 458 | qdf_dma_addr_t paddr; |
| 459 | uint64_t buf_addr; |
| 460 | |
| 461 | buf_addr = |
| 462 | (HAL_RX_BUFFER_ADDR_31_0_GET( |
| 463 | rxdma_mon_status_ring_entry) | |
| 464 | ((uint64_t)(HAL_RX_BUFFER_ADDR_39_32_GET( |
| 465 | rxdma_mon_status_ring_entry)) << 32)); |
| 466 | |
| 467 | if (qdf_likely(buf_addr)) { |
| 468 | |
| 469 | rx_buf_cookie = |
| 470 | HAL_RX_BUF_COOKIE_GET( |
| 471 | rxdma_mon_status_ring_entry); |
| 472 | rx_desc = dp_rx_cookie_2_va_mon_status(soc, |
| 473 | rx_buf_cookie); |
| 474 | |
| 475 | qdf_assert(rx_desc); |
| 476 | |
| 477 | status_nbuf = rx_desc->nbuf; |
| 478 | |
| 479 | qdf_nbuf_sync_for_cpu(soc->osdev, status_nbuf, |
| 480 | QDF_DMA_FROM_DEVICE); |
| 481 | |
| 482 | status_buf = qdf_nbuf_data(status_nbuf); |
| 483 | |
| 484 | status = hal_get_rx_status_done(status_buf); |
| 485 | |
| 486 | if (status != QDF_STATUS_SUCCESS) { |
Karunakar Dasineni | 37995ac | 2018-02-06 12:37:30 -0800 | [diff] [blame] | 487 | uint32_t hp, tp; |
| 488 | hal_api_get_tphp(hal_soc, mon_status_srng, |
| 489 | &tp, &hp); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 490 | QDF_TRACE(QDF_MODULE_ID_DP, |
Karunakar Dasineni | 37995ac | 2018-02-06 12:37:30 -0800 | [diff] [blame] | 491 | QDF_TRACE_LEVEL_ERROR, |
| 492 | "[%s][%d] status not done - hp:%u, tp:%u", |
| 493 | __func__, __LINE__, hp, tp); |
| 494 | /* WAR for missing status: Skip status entry */ |
| 495 | hal_srng_src_get_next(hal_soc, mon_status_srng); |
| 496 | continue; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 497 | } |
| 498 | qdf_nbuf_set_pktlen(status_nbuf, RX_BUFFER_SIZE); |
| 499 | |
| 500 | qdf_nbuf_unmap_single(soc->osdev, status_nbuf, |
| 501 | QDF_DMA_FROM_DEVICE); |
| 502 | |
| 503 | /* Put the status_nbuf to queue */ |
| 504 | qdf_nbuf_queue_add(&pdev->rx_status_q, status_nbuf); |
| 505 | |
| 506 | } else { |
| 507 | union dp_rx_desc_list_elem_t *desc_list = NULL; |
| 508 | union dp_rx_desc_list_elem_t *tail = NULL; |
| 509 | struct rx_desc_pool *rx_desc_pool; |
| 510 | uint32_t num_alloc_desc; |
| 511 | |
| 512 | rx_desc_pool = &soc->rx_desc_status[mac_id]; |
| 513 | |
| 514 | num_alloc_desc = dp_rx_get_free_desc_list(soc, mac_id, |
| 515 | rx_desc_pool, |
| 516 | 1, |
| 517 | &desc_list, |
| 518 | &tail); |
| 519 | |
| 520 | rx_desc = &desc_list->rx_desc; |
| 521 | } |
| 522 | |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 523 | status_nbuf = dp_rx_nbuf_prepare(soc, pdev); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 524 | |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 525 | /* |
| 526 | * qdf_nbuf alloc or map failed, |
| 527 | * free the dp rx desc to free list, |
| 528 | * fill in NULL dma address at current HP entry, |
| 529 | * keep HP in mon_status_ring unchanged, |
| 530 | * wait next time dp_rx_mon_status_srng_process |
| 531 | * to fill in buffer at current HP. |
| 532 | */ |
| 533 | if (qdf_unlikely(status_nbuf == NULL)) { |
| 534 | union dp_rx_desc_list_elem_t *desc_list = NULL; |
| 535 | union dp_rx_desc_list_elem_t *tail = NULL; |
| 536 | struct rx_desc_pool *rx_desc_pool; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 537 | |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 538 | rx_desc_pool = &soc->rx_desc_status[mac_id]; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 539 | |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 540 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, |
| 541 | "%s: fail to allocate or map qdf_nbuf", |
| 542 | __func__); |
| 543 | dp_rx_add_to_free_desc_list(&desc_list, |
| 544 | &tail, rx_desc); |
| 545 | dp_rx_add_desc_list_to_free_list(soc, &desc_list, |
| 546 | &tail, mac_id, rx_desc_pool); |
| 547 | |
| 548 | hal_rxdma_buff_addr_info_set( |
| 549 | rxdma_mon_status_ring_entry, |
| 550 | 0, 0, HAL_RX_BUF_RBM_SW3_BM); |
| 551 | work_done++; |
| 552 | break; |
| 553 | } |
| 554 | |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 555 | paddr = qdf_nbuf_get_frag_paddr(status_nbuf, 0); |
| 556 | |
| 557 | rx_desc->nbuf = status_nbuf; |
Pramod Simha | 59fcb31 | 2017-06-22 17:43:16 -0700 | [diff] [blame] | 558 | rx_desc->in_use = 1; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 559 | |
| 560 | hal_rxdma_buff_addr_info_set(rxdma_mon_status_ring_entry, |
| 561 | paddr, rx_desc->cookie, HAL_RX_BUF_RBM_SW3_BM); |
| 562 | |
Karunakar Dasineni | 37995ac | 2018-02-06 12:37:30 -0800 | [diff] [blame] | 563 | hal_srng_src_get_next(hal_soc, mon_status_srng); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 564 | work_done++; |
| 565 | } |
| 566 | done: |
| 567 | |
| 568 | hal_srng_access_end(hal_soc, mon_status_srng); |
| 569 | |
| 570 | return work_done; |
| 571 | |
| 572 | } |
| 573 | /* |
| 574 | * dp_rx_mon_status_process() - Process monitor status ring and |
| 575 | * TLV in status ring. |
| 576 | * |
| 577 | * @soc: core txrx main context |
| 578 | * @mac_id: mac_id which is one of 3 mac_ids |
| 579 | * @quota: No. of ring entry that can be serviced in one shot. |
| 580 | |
| 581 | * Return: uint32_t: No. of ring entry that is processed. |
| 582 | */ |
| 583 | static inline uint32_t |
| 584 | dp_rx_mon_status_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) { |
| 585 | uint32_t work_done; |
| 586 | |
| 587 | work_done = dp_rx_mon_status_srng_process(soc, mac_id, quota); |
Karunakar Dasineni | 4055568 | 2017-03-26 22:44:39 -0700 | [diff] [blame] | 588 | quota -= work_done; |
| 589 | dp_rx_mon_status_process_tlv(soc, mac_id, quota); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 590 | |
| 591 | return work_done; |
| 592 | } |
| 593 | /** |
| 594 | * dp_mon_process() - Main monitor mode processing roution. |
| 595 | * This call monitor status ring process then monitor |
| 596 | * destination ring process. |
| 597 | * Called from the bottom half (tasklet/NET_RX_SOFTIRQ) |
| 598 | * @soc: core txrx main context |
| 599 | * @mac_id: mac_id which is one of 3 mac_ids |
| 600 | * @quota: No. of status ring entry that can be serviced in one shot. |
| 601 | |
| 602 | * Return: uint32_t: No. of ring entry that is processed. |
| 603 | */ |
| 604 | uint32_t |
| 605 | dp_mon_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) { |
Karunakar Dasineni | 4055568 | 2017-03-26 22:44:39 -0700 | [diff] [blame] | 606 | return dp_rx_mon_status_process(soc, mac_id, quota); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 607 | } |
Karunakar Dasineni | 4055568 | 2017-03-26 22:44:39 -0700 | [diff] [blame] | 608 | |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 609 | /** |
| 610 | * dp_rx_pdev_mon_detach() - detach dp rx for status ring |
| 611 | * @pdev: core txrx pdev context |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 612 | * @mac_id: mac_id/pdev_id correspondinggly for MCL and WIN |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 613 | * |
| 614 | * This function will detach DP RX status ring from |
| 615 | * main device context. will free DP Rx resources for |
| 616 | * status ring |
| 617 | * |
| 618 | * Return: QDF_STATUS_SUCCESS: success |
| 619 | * QDF_STATUS_E_RESOURCES: Error return |
| 620 | */ |
Venkata Sharath Chandra Manchala | 30e442b | 2018-06-26 12:29:24 -0700 | [diff] [blame] | 621 | #ifndef QCA_WIFI_QCA6390 |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 622 | QDF_STATUS |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 623 | dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id) |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 624 | { |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 625 | struct dp_soc *soc = pdev->soc; |
| 626 | struct rx_desc_pool *rx_desc_pool; |
| 627 | |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 628 | rx_desc_pool = &soc->rx_desc_status[mac_id]; |
| 629 | if (rx_desc_pool->pool_size != 0) |
| 630 | dp_rx_desc_pool_free(soc, mac_id, rx_desc_pool); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 631 | |
| 632 | return QDF_STATUS_SUCCESS; |
| 633 | } |
Venkata Sharath Chandra Manchala | 30e442b | 2018-06-26 12:29:24 -0700 | [diff] [blame] | 634 | #endif |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 635 | |
| 636 | /* |
| 637 | * dp_rx_buffers_replenish() - replenish monitor status ring with |
| 638 | * rx nbufs called during dp rx |
| 639 | * monitor status ring initialization |
| 640 | * |
| 641 | * @soc: core txrx main context |
| 642 | * @mac_id: mac_id which is one of 3 mac_ids |
| 643 | * @dp_rxdma_srng: dp monitor status circular ring |
| 644 | * @rx_desc_pool; Pointer to Rx descriptor pool |
| 645 | * @num_req_buffers: number of buffer to be replenished |
| 646 | * @desc_list: list of descs if called from dp rx monitor status |
| 647 | * process or NULL during dp rx initialization or |
| 648 | * out of buffer interrupt |
| 649 | * @tail: tail of descs list |
| 650 | * @owner: who owns the nbuf (host, NSS etc...) |
| 651 | * Return: return success or failure |
| 652 | */ |
| 653 | static inline |
| 654 | QDF_STATUS dp_rx_mon_status_buffers_replenish(struct dp_soc *dp_soc, |
| 655 | uint32_t mac_id, |
| 656 | struct dp_srng *dp_rxdma_srng, |
| 657 | struct rx_desc_pool *rx_desc_pool, |
| 658 | uint32_t num_req_buffers, |
| 659 | union dp_rx_desc_list_elem_t **desc_list, |
| 660 | union dp_rx_desc_list_elem_t **tail, |
| 661 | uint8_t owner) |
| 662 | { |
| 663 | uint32_t num_alloc_desc; |
| 664 | uint16_t num_desc_to_free = 0; |
| 665 | uint32_t num_entries_avail; |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 666 | uint32_t count = 0; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 667 | int sync_hw_ptr = 1; |
| 668 | qdf_dma_addr_t paddr; |
| 669 | qdf_nbuf_t rx_netbuf; |
| 670 | void *rxdma_ring_entry; |
| 671 | union dp_rx_desc_list_elem_t *next; |
| 672 | void *rxdma_srng; |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 673 | struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(dp_soc, mac_id); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 674 | |
| 675 | rxdma_srng = dp_rxdma_srng->hal_srng; |
| 676 | |
| 677 | qdf_assert(rxdma_srng); |
| 678 | |
Houston Hoffman | ae850c6 | 2017-08-11 16:47:50 -0700 | [diff] [blame] | 679 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 680 | "[%s][%d] requested %d buffers for replenish\n", |
| 681 | __func__, __LINE__, num_req_buffers); |
| 682 | |
| 683 | /* |
| 684 | * if desc_list is NULL, allocate the descs from freelist |
| 685 | */ |
| 686 | if (!(*desc_list)) { |
| 687 | |
| 688 | num_alloc_desc = dp_rx_get_free_desc_list(dp_soc, mac_id, |
| 689 | rx_desc_pool, |
| 690 | num_req_buffers, |
| 691 | desc_list, |
| 692 | tail); |
| 693 | |
| 694 | if (!num_alloc_desc) { |
| 695 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, |
| 696 | "[%s][%d] no free rx_descs in freelist\n", |
| 697 | __func__, __LINE__); |
| 698 | return QDF_STATUS_E_NOMEM; |
| 699 | } |
| 700 | |
Houston Hoffman | ae850c6 | 2017-08-11 16:47:50 -0700 | [diff] [blame] | 701 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 702 | "[%s][%d] %d rx desc allocated\n", __func__, __LINE__, |
| 703 | num_alloc_desc); |
Houston Hoffman | ae850c6 | 2017-08-11 16:47:50 -0700 | [diff] [blame] | 704 | |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 705 | num_req_buffers = num_alloc_desc; |
| 706 | } |
| 707 | |
| 708 | hal_srng_access_start(dp_soc->hal_soc, rxdma_srng); |
| 709 | num_entries_avail = hal_srng_src_num_avail(dp_soc->hal_soc, |
| 710 | rxdma_srng, sync_hw_ptr); |
| 711 | |
Houston Hoffman | ae850c6 | 2017-08-11 16:47:50 -0700 | [diff] [blame] | 712 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Jeff Johnson | ff2dfb2 | 2018-05-12 10:27:57 -0700 | [diff] [blame] | 713 | "[%s][%d] no of available entries in rxdma ring: %d\n", |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 714 | __func__, __LINE__, num_entries_avail); |
| 715 | |
| 716 | if (num_entries_avail < num_req_buffers) { |
| 717 | num_desc_to_free = num_req_buffers - num_entries_avail; |
| 718 | num_req_buffers = num_entries_avail; |
| 719 | } |
| 720 | |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 721 | while (count < num_req_buffers) { |
| 722 | rx_netbuf = dp_rx_nbuf_prepare(dp_soc, dp_pdev); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 723 | |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 724 | /* |
| 725 | * qdf_nbuf alloc or map failed, |
| 726 | * keep HP in mon_status_ring unchanged, |
| 727 | * wait dp_rx_mon_status_srng_process |
| 728 | * to fill in buffer at current HP. |
| 729 | */ |
| 730 | if (qdf_unlikely(rx_netbuf == NULL)) { |
| 731 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, |
| 732 | "%s: qdf_nbuf allocate or map fail, count %d", |
| 733 | __func__, count); |
| 734 | break; |
| 735 | } |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 736 | |
| 737 | paddr = qdf_nbuf_get_frag_paddr(rx_netbuf, 0); |
| 738 | |
| 739 | next = (*desc_list)->next; |
sumedh baikady | eca2de6 | 2018-04-11 14:20:38 -0700 | [diff] [blame] | 740 | rxdma_ring_entry = hal_srng_src_get_next(dp_soc->hal_soc, |
| 741 | rxdma_srng); |
| 742 | |
| 743 | if (qdf_unlikely(rxdma_ring_entry == NULL)) { |
| 744 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, |
| 745 | "[%s][%d] rxdma_ring_entry is NULL, count - %d\n", |
| 746 | __func__, __LINE__, count); |
| 747 | qdf_nbuf_unmap_single(dp_soc->osdev, rx_netbuf, |
| 748 | QDF_DMA_BIDIRECTIONAL); |
| 749 | qdf_nbuf_free(rx_netbuf); |
| 750 | break; |
| 751 | } |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 752 | |
| 753 | (*desc_list)->rx_desc.nbuf = rx_netbuf; |
Pramod Simha | 59fcb31 | 2017-06-22 17:43:16 -0700 | [diff] [blame] | 754 | (*desc_list)->rx_desc.in_use = 1; |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 755 | count++; |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 756 | |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 757 | hal_rxdma_buff_addr_info_set(rxdma_ring_entry, paddr, |
| 758 | (*desc_list)->rx_desc.cookie, owner); |
| 759 | |
Karunakar Dasineni | 4055568 | 2017-03-26 22:44:39 -0700 | [diff] [blame] | 760 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Jeff Johnson | 3f217e2 | 2017-09-18 10:13:35 -0700 | [diff] [blame] | 761 | "[%s][%d] rx_desc=%pK, cookie=%d, nbuf=%pK, \ |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 762 | paddr=%pK\n", |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 763 | __func__, __LINE__, &(*desc_list)->rx_desc, |
| 764 | (*desc_list)->rx_desc.cookie, rx_netbuf, |
jinweic chen | c354632 | 2018-02-02 15:03:41 +0800 | [diff] [blame] | 765 | (void *)paddr); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 766 | |
| 767 | *desc_list = next; |
| 768 | } |
| 769 | |
| 770 | hal_srng_access_end(dp_soc->hal_soc, rxdma_srng); |
| 771 | |
Houston Hoffman | ae850c6 | 2017-08-11 16:47:50 -0700 | [diff] [blame] | 772 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 773 | "successfully replenished %d buffers\n", num_req_buffers); |
| 774 | |
Houston Hoffman | ae850c6 | 2017-08-11 16:47:50 -0700 | [diff] [blame] | 775 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 776 | "%d rx desc added back to free list\n", num_desc_to_free); |
| 777 | |
Houston Hoffman | ae850c6 | 2017-08-11 16:47:50 -0700 | [diff] [blame] | 778 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG, |
Jeff Johnson | 3f217e2 | 2017-09-18 10:13:35 -0700 | [diff] [blame] | 779 | "[%s][%d] desc_list=%pK, tail=%pK rx_desc=%pK, cookie=%d\n", |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 780 | __func__, __LINE__, desc_list, tail, &(*desc_list)->rx_desc, |
| 781 | (*desc_list)->rx_desc.cookie); |
| 782 | |
| 783 | /* |
| 784 | * add any available free desc back to the free list |
| 785 | */ |
| 786 | if (*desc_list) { |
| 787 | dp_rx_add_desc_list_to_free_list(dp_soc, desc_list, tail, |
| 788 | mac_id, rx_desc_pool); |
| 789 | } |
| 790 | |
| 791 | return QDF_STATUS_SUCCESS; |
| 792 | } |
| 793 | /** |
| 794 | * dp_rx_pdev_mon_status_attach() - attach DP RX monitor status ring |
| 795 | * @pdev: core txrx pdev context |
| 796 | * |
| 797 | * This function will attach a DP RX monitor status ring into pDEV |
| 798 | * and replenish monitor status ring with buffer. |
| 799 | * |
| 800 | * Return: QDF_STATUS_SUCCESS: success |
| 801 | * QDF_STATUS_E_RESOURCES: Error return |
| 802 | */ |
Venkata Sharath Chandra Manchala | 30e442b | 2018-06-26 12:29:24 -0700 | [diff] [blame] | 803 | #ifndef QCA_WIFI_QCA6390 |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 804 | QDF_STATUS |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 805 | dp_rx_pdev_mon_status_attach(struct dp_pdev *pdev, int ring_id) { |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 806 | struct dp_soc *soc = pdev->soc; |
| 807 | union dp_rx_desc_list_elem_t *desc_list = NULL; |
| 808 | union dp_rx_desc_list_elem_t *tail = NULL; |
| 809 | struct dp_srng *rxdma_srng; |
| 810 | uint32_t rxdma_entries; |
| 811 | struct rx_desc_pool *rx_desc_pool; |
Ravi Joshi | a9ebe0a | 2017-06-17 16:43:02 -0700 | [diff] [blame] | 812 | QDF_STATUS status; |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 813 | int mac_for_pdev = dp_get_mac_id_for_mac(soc, ring_id); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 814 | |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 815 | rxdma_srng = &pdev->rxdma_mon_status_ring[mac_for_pdev]; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 816 | |
| 817 | rxdma_entries = rxdma_srng->alloc_size/hal_srng_get_entrysize( |
| 818 | soc->hal_soc, RXDMA_MONITOR_STATUS); |
| 819 | |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 820 | rx_desc_pool = &soc->rx_desc_status[ring_id]; |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 821 | |
Houston Hoffman | 41b912c | 2017-08-30 14:27:51 -0700 | [diff] [blame] | 822 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_LOW, |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 823 | "%s: Mon RX Status Pool[%d] allocation size=%d\n", |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 824 | __func__, ring_id, rxdma_entries); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 825 | |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 826 | status = dp_rx_desc_pool_alloc(soc, ring_id, rxdma_entries+1, |
Ravi Joshi | a9ebe0a | 2017-06-17 16:43:02 -0700 | [diff] [blame] | 827 | rx_desc_pool); |
Ravi Joshi | 73a0551 | 2017-07-10 13:53:32 -0700 | [diff] [blame] | 828 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
Ravi Joshi | a9ebe0a | 2017-06-17 16:43:02 -0700 | [diff] [blame] | 829 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, |
| 830 | "%s: dp_rx_desc_pool_alloc() failed \n", __func__); |
| 831 | return status; |
| 832 | } |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 833 | |
Houston Hoffman | 41b912c | 2017-08-30 14:27:51 -0700 | [diff] [blame] | 834 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_LOW, |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 835 | "%s: Mon RX Status Buffers Replenish ring_id=%d\n", |
| 836 | __func__, ring_id); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 837 | |
Manjunathappa Prakash | d9ce350 | 2018-02-05 14:09:17 -0800 | [diff] [blame] | 838 | status = dp_rx_mon_status_buffers_replenish(soc, ring_id, rxdma_srng, |
Ravi Joshi | a9ebe0a | 2017-06-17 16:43:02 -0700 | [diff] [blame] | 839 | rx_desc_pool, rxdma_entries, &desc_list, &tail, |
| 840 | HAL_RX_BUF_RBM_SW3_BM); |
Ravi Joshi | 73a0551 | 2017-07-10 13:53:32 -0700 | [diff] [blame] | 841 | if (!QDF_IS_STATUS_SUCCESS(status)) { |
Ravi Joshi | a9ebe0a | 2017-06-17 16:43:02 -0700 | [diff] [blame] | 842 | QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, |
| 843 | "%s: dp_rx_buffers_replenish() failed \n", __func__); |
| 844 | return status; |
| 845 | } |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 846 | |
| 847 | qdf_nbuf_queue_init(&pdev->rx_status_q); |
| 848 | |
| 849 | pdev->mon_ppdu_status = DP_PPDU_STATUS_START; |
Karunakar Dasineni | 65b626e | 2017-12-18 22:17:29 -0800 | [diff] [blame] | 850 | pdev->ppdu_info.com_info.last_ppdu_id = 0; |
Kai Chen | 783e038 | 2018-01-25 16:29:08 -0800 | [diff] [blame] | 851 | |
Karunakar Dasineni | 4055568 | 2017-03-26 22:44:39 -0700 | [diff] [blame] | 852 | qdf_mem_zero(&(pdev->ppdu_info.rx_status), |
| 853 | sizeof(pdev->ppdu_info.rx_status)); |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 854 | |
Kai Chen | 783e038 | 2018-01-25 16:29:08 -0800 | [diff] [blame] | 855 | qdf_mem_zero(&pdev->rx_mon_stats, |
| 856 | sizeof(pdev->rx_mon_stats)); |
| 857 | |
| 858 | dp_rx_mon_init_dbg_ppdu_stats(&pdev->ppdu_info, |
| 859 | &pdev->rx_mon_stats); |
| 860 | |
Kai Chen | 6eca1a6 | 2017-01-12 10:17:53 -0800 | [diff] [blame] | 861 | return QDF_STATUS_SUCCESS; |
| 862 | } |
Venkata Sharath Chandra Manchala | 30e442b | 2018-06-26 12:29:24 -0700 | [diff] [blame] | 863 | #endif |