blob: 1ecb0841cb06016a4fb27bba171d8a60c4fa0cda [file] [log] [blame]
Kai Chen6eca1a62017-01-12 10:17:53 -08001/*
phadimanebf4cde2019-01-28 17:50:37 +05302 * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
Kai Chen6eca1a62017-01-12 10:17:53 -08003 *
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 Mahalingamd0159642018-07-11 15:02:29 +053018#include "hal_hw_headers.h"
Kai Chen6eca1a62017-01-12 10:17:53 -080019#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 Chen6eca1a62017-01-12 10:17:53 -080027#include "dp_rx_mon.h"
Keyur Parekhfad6d082017-05-07 08:54:47 -070028#include "dp_internal.h"
29#include "qdf_mem.h" /* qdf_mem_malloc,free */
Kai Chen6eca1a62017-01-12 10:17:53 -080030
ydb247452018-08-08 00:23:16 +053031#ifdef FEATURE_PERPKT_INFO
32#include "dp_ratetable.h"
33#endif
34
Kai Chen52ef33f2019-03-05 18:33:40 -080035#ifdef WLAN_RX_PKT_CAPTURE_ENH
36#include "dp_rx_mon_feature.h"
37#else
38static QDF_STATUS
39dp_rx_handle_enh_capture(struct dp_soc *soc, struct dp_pdev *pdev,
40 struct hal_rx_ppdu_info *ppdu_info)
41{
42 return QDF_STATUS_SUCCESS;
43}
44
45static void
46dp_rx_mon_enh_capture_process(struct dp_pdev *pdev, uint32_t tlv_status,
47 qdf_nbuf_t status_nbuf,
48 struct hal_rx_ppdu_info *ppdu_info,
49 bool *nbuf_used,
50 uint32_t rx_enh_capture_mode)
51{
52}
53#endif
54
Kai Chen6eca1a62017-01-12 10:17:53 -080055/**
Anish Nataraj38a29562017-08-18 19:41:17 +053056* dp_rx_populate_cdp_indication_ppdu() - Populate cdp rx indication structure
Soumya Bhat560f90c2018-03-30 13:53:26 +053057* @pdev: pdev ctx
Anish Nataraj38a29562017-08-18 19:41:17 +053058* @ppdu_info: ppdu info structure from ppdu ring
59* @ppdu_nbuf: qdf nbuf abstraction for linux skb
60*
61* Return: none
62*/
63#ifdef FEATURE_PERPKT_INFO
64static inline void
Soumya Bhat560f90c2018-03-30 13:53:26 +053065dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
Anish Nataraj38a29562017-08-18 19:41:17 +053066 struct hal_rx_ppdu_info *ppdu_info,
67 qdf_nbuf_t ppdu_nbuf)
68{
69 struct dp_peer *peer;
Soumya Bhat560f90c2018-03-30 13:53:26 +053070 struct dp_soc *soc = pdev->soc;
Anish Nataraj38a29562017-08-18 19:41:17 +053071 struct dp_ast_entry *ast_entry;
72 struct cdp_rx_indication_ppdu *cdp_rx_ppdu;
73 uint32_t ast_index;
74
75 cdp_rx_ppdu = (struct cdp_rx_indication_ppdu *)ppdu_nbuf->data;
76
Pamidipati, Vijayd7eb83e2017-09-20 21:19:56 +053077 cdp_rx_ppdu->first_data_seq_ctrl =
78 ppdu_info->rx_status.first_data_seq_ctrl;
Anish Natarajeb30aa72018-09-20 16:34:01 +053079 cdp_rx_ppdu->frame_ctrl =
80 ppdu_info->rx_status.frame_control;
Anish Nataraj38a29562017-08-18 19:41:17 +053081 cdp_rx_ppdu->ppdu_id = ppdu_info->com_info.ppdu_id;
nobelj9ab76e22018-02-13 18:10:54 -080082 cdp_rx_ppdu->length = ppdu_info->rx_status.ppdu_len;
Anish Nataraj38a29562017-08-18 19:41:17 +053083 cdp_rx_ppdu->duration = ppdu_info->rx_status.duration;
84 cdp_rx_ppdu->u.bw = ppdu_info->rx_status.bw;
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +053085 cdp_rx_ppdu->tcp_msdu_count = ppdu_info->rx_status.tcp_msdu_count;
86 cdp_rx_ppdu->udp_msdu_count = ppdu_info->rx_status.udp_msdu_count;
87 cdp_rx_ppdu->other_msdu_count = ppdu_info->rx_status.other_msdu_count;
Anish Nataraj38a29562017-08-18 19:41:17 +053088 cdp_rx_ppdu->u.nss = ppdu_info->rx_status.nss;
89 cdp_rx_ppdu->u.mcs = ppdu_info->rx_status.mcs;
Keyur Parekh49cdc742018-05-09 10:59:03 -070090 if ((ppdu_info->rx_status.sgi == VHT_SGI_NYSM) &&
91 (ppdu_info->rx_status.preamble_type == HAL_RX_PKT_TYPE_11AC))
92 cdp_rx_ppdu->u.gi = CDP_SGI_0_4_US;
93 else
94 cdp_rx_ppdu->u.gi = ppdu_info->rx_status.sgi;
Anish Nataraj50347012018-03-06 21:12:45 +053095 cdp_rx_ppdu->u.ldpc = ppdu_info->rx_status.ldpc;
Anish Nataraj38a29562017-08-18 19:41:17 +053096 cdp_rx_ppdu->u.preamble = ppdu_info->rx_status.preamble_type;
Anish Nataraj28490c42018-01-19 19:34:54 +053097 cdp_rx_ppdu->u.ppdu_type = ppdu_info->rx_status.reception_type;
Pamidipati, Vijayba4b57f2019-02-13 16:47:23 +053098 cdp_rx_ppdu->u.ltf_size = (ppdu_info->rx_status.he_data5 >>
99 QDF_MON_STATUS_HE_LTF_SIZE_SHIFT) & 0x3;
100 cdp_rx_ppdu->num_mpdu = ppdu_info->com_info.mpdu_cnt_fcs_ok;
Anish Nataraj38a29562017-08-18 19:41:17 +0530101 cdp_rx_ppdu->rssi = ppdu_info->rx_status.rssi_comb;
Anish Nataraj57614da2018-02-07 23:04:24 +0530102 cdp_rx_ppdu->timestamp = ppdu_info->rx_status.tsft;
103 cdp_rx_ppdu->channel = ppdu_info->rx_status.chan_num;
nobeljd8039592018-03-13 16:59:42 -0700104 cdp_rx_ppdu->beamformed = ppdu_info->rx_status.beamformed;
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530105 cdp_rx_ppdu->num_msdu = (cdp_rx_ppdu->tcp_msdu_count +
106 cdp_rx_ppdu->udp_msdu_count +
107 cdp_rx_ppdu->other_msdu_count);
Amir Patel468bded2019-03-21 11:42:31 +0530108 cdp_rx_ppdu->num_bytes = ppdu_info->rx_status.ppdu_len;
Amir Patelac7d9462019-03-28 16:16:01 +0530109 cdp_rx_ppdu->retries = CDP_FC_IS_RETRY_SET(cdp_rx_ppdu->frame_ctrl) ?
110 ppdu_info->com_info.mpdu_cnt_fcs_ok : 0;
Pranita Solankeed0aba62018-01-12 19:14:31 +0530111
112 if (ppdu_info->com_info.mpdu_cnt_fcs_ok > 1)
113 cdp_rx_ppdu->is_ampdu = 1;
114 else
115 cdp_rx_ppdu->is_ampdu = 0;
Anish Nataraj45d282c2017-12-30 01:03:38 +0530116
117 cdp_rx_ppdu->tid = ppdu_info->rx_status.tid;
Anish Nataraj57614da2018-02-07 23:04:24 +0530118 cdp_rx_ppdu->lsig_a = ppdu_info->rx_status.rate;
Soumya Bhat560f90c2018-03-30 13:53:26 +0530119
120 ast_index = ppdu_info->rx_status.ast_index;
Tallapragada Kalyana7023622018-12-03 19:29:52 +0530121 if (ast_index >= wlan_cfg_get_max_ast_idx(soc->wlan_cfg_ctx)) {
Soumya Bhat560f90c2018-03-30 13:53:26 +0530122 cdp_rx_ppdu->peer_id = HTT_INVALID_PEER;
123 return;
124 }
125
126 ast_entry = soc->ast_table[ast_index];
127 if (!ast_entry) {
128 cdp_rx_ppdu->peer_id = HTT_INVALID_PEER;
129 return;
130 }
131 peer = ast_entry->peer;
132 if (!peer || peer->peer_ids[0] == HTT_INVALID_PEER) {
133 cdp_rx_ppdu->peer_id = HTT_INVALID_PEER;
134 return;
135 }
136
137 qdf_mem_copy(cdp_rx_ppdu->mac_addr,
Srinivas Girigowda2751b6d2019-02-27 12:28:13 -0800138 peer->mac_addr.raw, QDF_MAC_ADDR_SIZE);
Soumya Bhat560f90c2018-03-30 13:53:26 +0530139 cdp_rx_ppdu->peer_id = peer->peer_ids[0];
140 cdp_rx_ppdu->vdev_id = peer->vdev->vdev_id;
Keyur Parekh44d8f8f2019-03-12 12:39:41 -0700141 cdp_rx_ppdu->u.ltf_size = ppdu_info->rx_status.ltf_size;
Anish Nataraj38a29562017-08-18 19:41:17 +0530142}
143#else
144static inline void
Soumya Bhat560f90c2018-03-30 13:53:26 +0530145dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
Anish Nataraj38a29562017-08-18 19:41:17 +0530146 struct hal_rx_ppdu_info *ppdu_info,
147 qdf_nbuf_t ppdu_nbuf)
148{
149}
150#endif
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530151/**
152 * dp_rx_stats_update() - Update per-peer statistics
153 * @soc: Datapath SOC handle
154 * @peer: Datapath peer handle
155 * @ppdu: PPDU Descriptor
156 *
157 * Return: None
158 */
159#ifdef FEATURE_PERPKT_INFO
ydb247452018-08-08 00:23:16 +0530160static inline void dp_rx_rate_stats_update(struct dp_peer *peer,
161 struct cdp_rx_indication_ppdu *ppdu)
162{
163 uint32_t ratekbps = 0;
164 uint32_t ppdu_rx_rate = 0;
165 uint32_t nss = 0;
Amir Patel78824b12019-02-23 10:54:32 +0530166 uint32_t rix;
ydb247452018-08-08 00:23:16 +0530167
168 if (!peer || !ppdu)
169 return;
170
171 if (ppdu->u.nss == 0)
172 nss = 0;
173 else
174 nss = ppdu->u.nss - 1;
175
Anish Nataraj376d9b12018-08-13 14:12:01 +0530176 ratekbps = dp_getrateindex(ppdu->u.gi,
177 ppdu->u.mcs,
ydb247452018-08-08 00:23:16 +0530178 nss,
179 ppdu->u.preamble,
Amir Patel78824b12019-02-23 10:54:32 +0530180 ppdu->u.bw,
181 &rix);
ydb247452018-08-08 00:23:16 +0530182
183 if (!ratekbps)
184 return;
185
Amir Patel468bded2019-03-21 11:42:31 +0530186 ppdu->rix = rix;
ydb247452018-08-08 00:23:16 +0530187 DP_STATS_UPD(peer, rx.last_rx_rate, ratekbps);
188 dp_ath_rate_lpf(peer->stats.rx.avg_rx_rate, ratekbps);
189 ppdu_rx_rate = dp_ath_rate_out(peer->stats.rx.avg_rx_rate);
190 DP_STATS_UPD(peer, rx.rnd_avg_rx_rate, ppdu_rx_rate);
Amir Patelac7d9462019-03-28 16:16:01 +0530191 ppdu->rx_ratekbps = ratekbps;
ydb247452018-08-08 00:23:16 +0530192
193 if (peer->vdev)
194 peer->vdev->stats.rx.last_rx_rate = ratekbps;
195}
196
Ruchi, Agrawal4c5ade62018-09-27 21:52:11 +0530197static void dp_rx_stats_update(struct dp_pdev *pdev, struct dp_peer *peer,
198 struct cdp_rx_indication_ppdu *ppdu)
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530199{
Ruchi, Agrawal4c5ade62018-09-27 21:52:11 +0530200 struct dp_soc *soc = NULL;
Anish Nataraj28490c42018-01-19 19:34:54 +0530201 uint8_t mcs, preamble, ac = 0;
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530202 uint16_t num_msdu;
Ruchi, Agrawal4c5ade62018-09-27 21:52:11 +0530203 bool is_invalid_peer = false;
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530204
205 mcs = ppdu->u.mcs;
206 preamble = ppdu->u.preamble;
207 num_msdu = ppdu->num_msdu;
208
Ruchi, Agrawal4c5ade62018-09-27 21:52:11 +0530209 if (pdev)
210 soc = pdev->soc;
211 else
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530212 return;
213
Ruchi, Agrawal4c5ade62018-09-27 21:52:11 +0530214 if (!peer) {
215 is_invalid_peer = true;
216 peer = pdev->invalid_peer;
217 }
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530218
Ruchi, Agrawal4c5ade62018-09-27 21:52:11 +0530219 if (!soc || soc->process_rx_status)
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530220 return;
Pranita Solankefc2ff392017-12-15 19:25:13 +0530221
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530222 DP_STATS_UPD(peer, rx.rssi, ppdu->rssi);
Surya Prakash07c81e72019-04-29 10:08:01 +0530223 if (peer->stats.rx.avg_rssi == INVALID_RSSI)
Amir Patelbb69cfa2019-03-28 16:16:01 +0530224 peer->stats.rx.avg_rssi = ppdu->rssi;
225 else
226 peer->stats.rx.avg_rssi =
227 DP_GET_AVG_RSSI(peer->stats.rx.avg_rssi, ppdu->rssi);
Pranita Solankeed0aba62018-01-12 19:14:31 +0530228
229 if ((preamble == DOT11_A) || (preamble == DOT11_B))
230 ppdu->u.nss = 1;
231
232 if (ppdu->u.nss)
233 DP_STATS_INC(peer, rx.nss[ppdu->u.nss - 1], num_msdu);
234
Pranita Solankea12b4b32017-11-20 23:04:14 +0530235 DP_STATS_INC(peer, rx.sgi_count[ppdu->u.gi], num_msdu);
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530236 DP_STATS_INC(peer, rx.bw[ppdu->u.bw], num_msdu);
Anish Nataraj28490c42018-01-19 19:34:54 +0530237 DP_STATS_INC(peer, rx.reception_type[ppdu->u.ppdu_type], num_msdu);
Pranita Solankea12b4b32017-11-20 23:04:14 +0530238 DP_STATS_INCC(peer, rx.ampdu_cnt, num_msdu, ppdu->is_ampdu);
239 DP_STATS_INCC(peer, rx.non_ampdu_cnt, num_msdu, !(ppdu->is_ampdu));
240 DP_STATS_UPD(peer, rx.rx_rate, mcs);
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530241 DP_STATS_INCC(peer,
Pranita Solankeed0aba62018-01-12 19:14:31 +0530242 rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530243 ((mcs >= MAX_MCS_11A) && (preamble == DOT11_A)));
244 DP_STATS_INCC(peer,
245 rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
Pranita Solankea12b4b32017-11-20 23:04:14 +0530246 ((mcs < MAX_MCS_11A) && (preamble == DOT11_A)));
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530247 DP_STATS_INCC(peer,
Pranita Solankeed0aba62018-01-12 19:14:31 +0530248 rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530249 ((mcs >= MAX_MCS_11B) && (preamble == DOT11_B)));
250 DP_STATS_INCC(peer,
251 rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
Pranita Solankea12b4b32017-11-20 23:04:14 +0530252 ((mcs < MAX_MCS_11B) && (preamble == DOT11_B)));
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530253 DP_STATS_INCC(peer,
Pranita Solankeed0aba62018-01-12 19:14:31 +0530254 rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530255 ((mcs >= MAX_MCS_11A) && (preamble == DOT11_N)));
256 DP_STATS_INCC(peer,
257 rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
Pranita Solankea12b4b32017-11-20 23:04:14 +0530258 ((mcs < MAX_MCS_11A) && (preamble == DOT11_N)));
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530259 DP_STATS_INCC(peer,
Pranita Solankeed0aba62018-01-12 19:14:31 +0530260 rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530261 ((mcs >= MAX_MCS_11AC) && (preamble == DOT11_AC)));
262 DP_STATS_INCC(peer,
263 rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
264 ((mcs < MAX_MCS_11AC) && (preamble == DOT11_AC)));
265 DP_STATS_INCC(peer,
Pranita Solankeed0aba62018-01-12 19:14:31 +0530266 rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530267 ((mcs >= (MAX_MCS - 1)) && (preamble == DOT11_AX)));
268 DP_STATS_INCC(peer,
269 rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
270 ((mcs < (MAX_MCS - 1)) && (preamble == DOT11_AX)));
Anish Nataraj28490c42018-01-19 19:34:54 +0530271 /*
272 * If invalid TID, it could be a non-qos frame, hence do not update
273 * any AC counters
274 */
275 ac = TID_TO_WME_AC(ppdu->tid);
276 if (ppdu->tid != HAL_TID_INVALID)
277 DP_STATS_INC(peer, rx.wme_ac_type[ac], num_msdu);
Amir Patel52c6b732018-08-03 12:13:22 +0530278 dp_peer_stats_notify(peer);
279 DP_STATS_UPD(peer, rx.last_rssi, ppdu->rssi);
Anish Nataraj28490c42018-01-19 19:34:54 +0530280
Ruchi, Agrawal4c5ade62018-09-27 21:52:11 +0530281 if (is_invalid_peer)
282 return;
283
Jeffin Mammen1514e792019-05-20 10:30:44 +0530284 if (dp_is_subtype_data(ppdu->frame_ctrl))
285 dp_rx_rate_stats_update(peer, ppdu);
ydb247452018-08-08 00:23:16 +0530286
Amir Patel756d05e2018-10-10 12:35:30 +0530287#if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
288 dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, pdev->soc,
289 &peer->stats, ppdu->peer_id,
290 UPDATE_PEER_STATS, pdev->pdev_id);
291#endif
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +0530292}
293#endif
Anish Nataraj38a29562017-08-18 19:41:17 +0530294
295/**
Soumya Bhat7422db82017-12-15 13:48:53 +0530296 * dp_rx_handle_mcopy_mode() - Allocate and deliver first MSDU payload
Pranita Solankefc2ff392017-12-15 19:25:13 +0530297 * @soc: core txrx main context
298 * @pdev: pdev strcuture
299 * @ppdu_info: structure for rx ppdu ring
300 *
301 * Return: QDF_STATUS_SUCCESS - If nbuf to be freed by caller
302 * QDF_STATUS_E_ALREADY - If nbuf not to be freed by caller
Soumya Bhat7422db82017-12-15 13:48:53 +0530303 */
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530304#ifdef FEATURE_PERPKT_INFO
305static inline QDF_STATUS
Soumya Bhat7422db82017-12-15 13:48:53 +0530306dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530307 struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf)
308{
309 uint8_t size = 0;
Chaithanya Garrepalli7ab76ae2018-07-05 14:53:50 +0530310 struct ieee80211_frame *wh;
311 uint32_t *nbuf_data;
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530312
Jeff Johnsona8edf332019-03-18 09:51:52 -0700313 if (!ppdu_info->msdu_info.first_msdu_payload)
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530314 return QDF_STATUS_SUCCESS;
315
Soumya Bhat2f54de22018-02-21 09:54:28 +0530316 if (pdev->m_copy_id.rx_ppdu_id == ppdu_info->com_info.ppdu_id)
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530317 return QDF_STATUS_SUCCESS;
318
Soumya Bhat2f54de22018-02-21 09:54:28 +0530319 pdev->m_copy_id.rx_ppdu_id = ppdu_info->com_info.ppdu_id;
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530320
Chaithanya Garrepalli7ab76ae2018-07-05 14:53:50 +0530321 wh = (struct ieee80211_frame *)(ppdu_info->msdu_info.first_msdu_payload
322 + 4);
Soumya Bhatdc8aca82018-03-13 14:10:24 +0530323 size = (ppdu_info->msdu_info.first_msdu_payload -
Chaithanya Garrepalli7ab76ae2018-07-05 14:53:50 +0530324 qdf_nbuf_data(nbuf));
Soumya Bhatdc8aca82018-03-13 14:10:24 +0530325 ppdu_info->msdu_info.first_msdu_payload = NULL;
Soumya Bhat7422db82017-12-15 13:48:53 +0530326
327 if (qdf_nbuf_pull_head(nbuf, size) == NULL)
328 return QDF_STATUS_SUCCESS;
329
Chaithanya Garrepalli7ab76ae2018-07-05 14:53:50 +0530330 if (((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) ==
331 IEEE80211_FC0_TYPE_MGT) ||
332 ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) ==
333 IEEE80211_FC0_TYPE_CTL)) {
334 return QDF_STATUS_SUCCESS;
335 }
336
337 nbuf_data = (uint32_t *)qdf_nbuf_data(nbuf);
338 *nbuf_data = pdev->ppdu_info.com_info.ppdu_id;
Soumya Bhatdc8aca82018-03-13 14:10:24 +0530339 /* only retain RX MSDU payload in the skb */
340 qdf_nbuf_trim_tail(nbuf, qdf_nbuf_len(nbuf) -
341 ppdu_info->msdu_info.payload_len);
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530342 dp_wdi_event_handler(WDI_EVENT_RX_DATA, soc,
343 nbuf, HTT_INVALID_PEER, WDI_NO_VAL, pdev->pdev_id);
344 return QDF_STATUS_E_ALREADY;
345}
346#else
347static inline QDF_STATUS
Soumya Bhat7422db82017-12-15 13:48:53 +0530348dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530349 struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf)
350{
351 return QDF_STATUS_SUCCESS;
352}
353#endif
354
sumedh baikady59a2d332018-05-22 01:50:38 -0700355/**
356 * dp_rx_handle_smart_mesh_mode() - Deliver header for smart mesh
357 * @soc: Datapath SOC handle
358 * @pdev: Datapath PDEV handle
359 * @ppdu_info: Structure for rx ppdu info
360 * @nbuf: Qdf nbuf abstraction for linux skb
361 *
362 * Return: 0 on success, 1 on failure
363 */
364static inline int
365dp_rx_handle_smart_mesh_mode(struct dp_soc *soc, struct dp_pdev *pdev,
366 struct hal_rx_ppdu_info *ppdu_info,
367 qdf_nbuf_t nbuf)
368{
369 uint8_t size = 0;
370
371 if (!pdev->monitor_vdev) {
372 QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
373 "[%s]:[%d] Monitor vdev is NULL !!",
374 __func__, __LINE__);
375 return 1;
376 }
Jeff Johnsona8edf332019-03-18 09:51:52 -0700377 if (!ppdu_info->msdu_info.first_msdu_payload) {
sumedh baikady59a2d332018-05-22 01:50:38 -0700378 QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
379 "[%s]:[%d] First msdu payload not present",
380 __func__, __LINE__);
381 return 1;
382 }
383
sumedh baikadyda159202018-11-01 17:31:23 -0700384 /* Adding 4 bytes to get to start of 802.11 frame after phy_ppdu_id */
sumedh baikady59a2d332018-05-22 01:50:38 -0700385 size = (ppdu_info->msdu_info.first_msdu_payload -
sumedh baikadyda159202018-11-01 17:31:23 -0700386 qdf_nbuf_data(nbuf)) + 4;
sumedh baikady59a2d332018-05-22 01:50:38 -0700387 ppdu_info->msdu_info.first_msdu_payload = NULL;
388
389 if (qdf_nbuf_pull_head(nbuf, size) == NULL) {
390 QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
391 "[%s]:[%d] No header present",
392 __func__, __LINE__);
393 return 1;
394 }
395
sumedh baikadyda159202018-11-01 17:31:23 -0700396 /* Only retain RX MSDU payload in the skb */
sumedh baikady59a2d332018-05-22 01:50:38 -0700397 qdf_nbuf_trim_tail(nbuf, qdf_nbuf_len(nbuf) -
398 ppdu_info->msdu_info.payload_len);
399 qdf_nbuf_update_radiotap(&(pdev->ppdu_info.rx_status),
400 nbuf, sizeof(struct rx_pkt_tlvs));
401 pdev->monitor_vdev->osif_rx_mon(pdev->monitor_vdev->osif_vdev,
402 nbuf, NULL);
sumedh baikadyda159202018-11-01 17:31:23 -0700403 pdev->ppdu_info.rx_status.monitor_direct_used = 0;
sumedh baikady59a2d332018-05-22 01:50:38 -0700404 return 0;
405}
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530406
407/**
Anish Nataraj38a29562017-08-18 19:41:17 +0530408* dp_rx_handle_ppdu_stats() - Allocate and deliver ppdu stats to cdp layer
409* @soc: core txrx main context
410* @pdev: pdev strcuture
411* @ppdu_info: structure for rx ppdu ring
412*
413* Return: none
414*/
415#ifdef FEATURE_PERPKT_INFO
416static inline void
417dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
418 struct hal_rx_ppdu_info *ppdu_info)
419{
420 qdf_nbuf_t ppdu_nbuf;
421 struct dp_peer *peer;
422 struct cdp_rx_indication_ppdu *cdp_rx_ppdu;
423
Anish Nataraj28490c42018-01-19 19:34:54 +0530424 /*
425 * Do not allocate if fcs error,
426 * ast idx invalid / fctl invalid
427 */
Anish Nataraj28490c42018-01-19 19:34:54 +0530428 if (ppdu_info->com_info.mpdu_cnt_fcs_ok == 0)
429 return;
430
Chaithanya Garrepalli95fc62f2018-07-24 18:52:27 +0530431 if (ppdu_info->nac_info.fc_valid &&
432 ppdu_info->nac_info.to_ds_flag &&
433 ppdu_info->nac_info.mac_addr2_valid) {
434 struct dp_neighbour_peer *peer = NULL;
435 uint8_t rssi = ppdu_info->rx_status.rssi_comb;
436
437 qdf_spin_lock_bh(&pdev->neighbour_peer_mutex);
438 if (pdev->neighbour_peers_added) {
439 TAILQ_FOREACH(peer, &pdev->neighbour_peers_list,
440 neighbour_peer_list_elem) {
441 if (!qdf_mem_cmp(&peer->neighbour_peers_macaddr,
442 &ppdu_info->nac_info.mac_addr2,
Srinivas Girigowda2751b6d2019-02-27 12:28:13 -0800443 QDF_MAC_ADDR_SIZE)) {
Chaithanya Garrepalli95fc62f2018-07-24 18:52:27 +0530444 peer->rssi = rssi;
445 break;
446 }
447 }
448 }
449 qdf_spin_unlock_bh(&pdev->neighbour_peer_mutex);
450 }
451
Chaithanya Garrepalli3e4ac1c2018-12-12 20:50:45 +0530452 /* need not generate wdi event when mcopy and
453 * enhanced stats are not enabled
454 */
455 if (!pdev->mcopy_mode && !pdev->enhanced_stats_en)
456 return;
457
Soumya Bhat560f90c2018-03-30 13:53:26 +0530458 if (!pdev->mcopy_mode) {
459 if (!ppdu_info->rx_status.frame_control_info_valid)
460 return;
Anish Nataraj28490c42018-01-19 19:34:54 +0530461
Soumya Bhat560f90c2018-03-30 13:53:26 +0530462 if (ppdu_info->rx_status.ast_index == HAL_AST_IDX_INVALID)
463 return;
464 }
Tallapragada Kalyana867edf2017-11-14 12:26:41 +0530465 ppdu_nbuf = qdf_nbuf_alloc(soc->osdev,
Kiran Venkatappa4b50f332019-03-20 18:14:17 +0530466 sizeof(struct cdp_rx_indication_ppdu), 0, 0, FALSE);
Anish Nataraj38a29562017-08-18 19:41:17 +0530467 if (ppdu_nbuf) {
Soumya Bhat560f90c2018-03-30 13:53:26 +0530468 dp_rx_populate_cdp_indication_ppdu(pdev, ppdu_info, ppdu_nbuf);
Anish Nataraj38a29562017-08-18 19:41:17 +0530469 qdf_nbuf_put_tail(ppdu_nbuf,
470 sizeof(struct cdp_rx_indication_ppdu));
471 cdp_rx_ppdu = (struct cdp_rx_indication_ppdu *)ppdu_nbuf->data;
Ruchi, Agrawal4c5ade62018-09-27 21:52:11 +0530472 peer = dp_peer_find_by_id(soc, cdp_rx_ppdu->peer_id);
chenguob21a49a2018-11-19 19:17:12 +0800473 if (peer) {
Amir Patel468bded2019-03-21 11:42:31 +0530474 cdp_rx_ppdu->cookie = (void *)peer->wlanstats_ctx;
Ruchi, Agrawal4c5ade62018-09-27 21:52:11 +0530475 dp_rx_stats_update(pdev, peer, cdp_rx_ppdu);
chenguob21a49a2018-11-19 19:17:12 +0800476 dp_peer_unref_del_find_by_id(peer);
477 }
478 if (cdp_rx_ppdu->peer_id != HTT_INVALID_PEER) {
479 dp_wdi_event_handler(WDI_EVENT_RX_PPDU_DESC,
480 soc, ppdu_nbuf,
481 cdp_rx_ppdu->peer_id,
482 WDI_NO_VAL, pdev->pdev_id);
483 } else if (pdev->mcopy_mode) {
Soumya Bhat2f54de22018-02-21 09:54:28 +0530484 dp_wdi_event_handler(WDI_EVENT_RX_PPDU_DESC, soc,
485 ppdu_nbuf, HTT_INVALID_PEER,
486 WDI_NO_VAL, pdev->pdev_id);
487 } else {
Anish Nataraj38a29562017-08-18 19:41:17 +0530488 qdf_nbuf_free(ppdu_nbuf);
Soumya Bhat2f54de22018-02-21 09:54:28 +0530489 }
Anish Nataraj38a29562017-08-18 19:41:17 +0530490 }
491}
492#else
493static inline void
494dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
495 struct hal_rx_ppdu_info *ppdu_info)
496{
497}
498#endif
499
500/**
Keyur Parekhc28f8392018-11-21 02:50:56 -0800501* dp_rx_process_peer_based_pktlog() - Process Rx pktlog if peer based
502* filtering enabled
503* @soc: core txrx main context
504* @ppdu_info: Structure for rx ppdu info
505* @status_nbuf: Qdf nbuf abstraction for linux skb
506* @mac_id: mac_id/pdev_id correspondinggly for MCL and WIN
507*
508* Return: none
509*/
510static inline void
511dp_rx_process_peer_based_pktlog(struct dp_soc *soc,
512 struct hal_rx_ppdu_info *ppdu_info,
513 qdf_nbuf_t status_nbuf, uint32_t mac_id)
514{
515 struct dp_peer *peer;
516 struct dp_ast_entry *ast_entry;
517 uint32_t ast_index;
518
519 ast_index = ppdu_info->rx_status.ast_index;
520 if (ast_index < (WLAN_UMAC_PSOC_MAX_PEERS * 2)) {
521 ast_entry = soc->ast_table[ast_index];
522 if (ast_entry) {
523 peer = ast_entry->peer;
524 if (peer && (peer->peer_ids[0] != HTT_INVALID_PEER)) {
525 if (peer->peer_based_pktlog_filter) {
526 dp_wdi_event_handler(
527 WDI_EVENT_RX_DESC, soc,
528 status_nbuf,
529 peer->peer_ids[0],
530 WDI_NO_VAL, mac_id);
531 }
532 }
533 }
534 }
535}
536
537/**
Kai Chen6eca1a62017-01-12 10:17:53 -0800538* dp_rx_mon_status_process_tlv() - Process status TLV in status
539* buffer on Rx status Queue posted by status SRNG processing.
540* @soc: core txrx main context
541* @mac_id: mac_id which is one of 3 mac_ids _ring
542*
543* Return: none
544*/
545static inline void
Karunakar Dasineni40555682017-03-26 22:44:39 -0700546dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
547 uint32_t quota)
548{
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -0800549 struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
Kai Chen6eca1a62017-01-12 10:17:53 -0800550 struct hal_rx_ppdu_info *ppdu_info;
551 qdf_nbuf_t status_nbuf;
552 uint8_t *rx_tlv;
553 uint8_t *rx_tlv_start;
Kai Chenad516ae2017-09-08 18:35:47 -0700554 uint32_t tlv_status = HAL_TLV_STATUS_BUF_DONE;
Soumya Bhat2f54de22018-02-21 09:54:28 +0530555 QDF_STATUS m_copy_status = QDF_STATUS_SUCCESS;
Kai Chen52ef33f2019-03-05 18:33:40 -0800556 QDF_STATUS enh_log_status = QDF_STATUS_SUCCESS;
Kai Chen783e0382018-01-25 16:29:08 -0800557 struct cdp_pdev_mon_stats *rx_mon_stats;
sumedh baikady59a2d332018-05-22 01:50:38 -0700558 int smart_mesh_status;
Venkata Sharath Chandra Manchalacad74ad2019-01-28 11:36:47 -0800559 enum WDI_EVENT pktlog_mode = WDI_NO_VAL;
Kai Chen52ef33f2019-03-05 18:33:40 -0800560 bool nbuf_used;
561 uint32_t rx_enh_capture_mode;
562
Kai Chen6eca1a62017-01-12 10:17:53 -0800563
Kai Chen6eca1a62017-01-12 10:17:53 -0800564 ppdu_info = &pdev->ppdu_info;
Kai Chen783e0382018-01-25 16:29:08 -0800565 rx_mon_stats = &pdev->rx_mon_stats;
Kai Chen6eca1a62017-01-12 10:17:53 -0800566
567 if (pdev->mon_ppdu_status != DP_PPDU_STATUS_START)
568 return;
569
Kai Chen52ef33f2019-03-05 18:33:40 -0800570 rx_enh_capture_mode = pdev->rx_enh_capture_mode;
571
Kai Chen6eca1a62017-01-12 10:17:53 -0800572 while (!qdf_nbuf_is_queue_empty(&pdev->rx_status_q)) {
573
574 status_nbuf = qdf_nbuf_queue_remove(&pdev->rx_status_q);
phadiman49757302018-12-18 16:13:59 +0530575
Kai Chen6eca1a62017-01-12 10:17:53 -0800576 rx_tlv = qdf_nbuf_data(status_nbuf);
577 rx_tlv_start = rx_tlv;
Kai Chen52ef33f2019-03-05 18:33:40 -0800578 nbuf_used = false;
Venkata Sharath Chandra Manchala5a6f4292017-11-03 14:57:41 -0700579
Jeff Johnsona8edf332019-03-18 09:51:52 -0700580 if ((pdev->monitor_vdev) || (pdev->enhanced_stats_en) ||
Kai Chen52ef33f2019-03-05 18:33:40 -0800581 pdev->mcopy_mode ||
582 (rx_enh_capture_mode != CDP_RX_ENH_CAPTURE_DISABLED)) {
Keyur Parekhfad6d082017-05-07 08:54:47 -0700583 do {
584 tlv_status = hal_rx_status_get_tlv_info(rx_tlv,
Balamurugan Mahalingamd0159642018-07-11 15:02:29 +0530585 ppdu_info, pdev->soc->hal_soc);
Kai Chen783e0382018-01-25 16:29:08 -0800586
587 dp_rx_mon_update_dbg_ppdu_stats(ppdu_info,
588 rx_mon_stats);
589
Kai Chen52ef33f2019-03-05 18:33:40 -0800590 dp_rx_mon_enh_capture_process(pdev, tlv_status,
591 status_nbuf, ppdu_info,
592 &nbuf_used, rx_enh_capture_mode);
593
Keyur Parekhfad6d082017-05-07 08:54:47 -0700594 rx_tlv = hal_rx_status_get_next_tlv(rx_tlv);
Kai Chen6eca1a62017-01-12 10:17:53 -0800595
Keyur Parekhfad6d082017-05-07 08:54:47 -0700596 if ((rx_tlv - rx_tlv_start) >= RX_BUFFER_SIZE)
597 break;
Kai Chen6eca1a62017-01-12 10:17:53 -0800598
Kai Chen52ef33f2019-03-05 18:33:40 -0800599 } while ((tlv_status == HAL_TLV_STATUS_PPDU_NOT_DONE) ||
600 (tlv_status == HAL_TLV_STATUS_HEADER) ||
601 (tlv_status == HAL_TLV_STATUS_MPDU_END));
Keyur Parekhfad6d082017-05-07 08:54:47 -0700602 }
Keyur Parekhc28f8392018-11-21 02:50:56 -0800603 if (pdev->dp_peer_based_pktlog) {
604 dp_rx_process_peer_based_pktlog(soc, ppdu_info,
605 status_nbuf, mac_id);
606 } else {
Venkata Sharath Chandra Manchalacad74ad2019-01-28 11:36:47 -0800607 if (pdev->rx_pktlog_mode == DP_RX_PKTLOG_FULL)
608 pktlog_mode = WDI_EVENT_RX_DESC;
609 else if (pdev->rx_pktlog_mode == DP_RX_PKTLOG_LITE)
610 pktlog_mode = WDI_EVENT_LITE_RX;
611
612 if (pktlog_mode != WDI_NO_VAL)
613 dp_wdi_event_handler(pktlog_mode, soc,
614 status_nbuf,
615 HTT_INVALID_PEER,
616 WDI_NO_VAL, mac_id);
Keyur Parekhc28f8392018-11-21 02:50:56 -0800617 }
Chaithanya Garrepalli3e4ac1c2018-12-12 20:50:45 +0530618
619 /* smart monitor vap and m_copy cannot co-exist */
sumedh baikady59a2d332018-05-22 01:50:38 -0700620 if (ppdu_info->rx_status.monitor_direct_used && pdev->neighbour_peers_added
621 && pdev->monitor_vdev) {
622 smart_mesh_status = dp_rx_handle_smart_mesh_mode(soc,
623 pdev, ppdu_info, status_nbuf);
624 if (smart_mesh_status)
625 qdf_nbuf_free(status_nbuf);
Chaithanya Garrepalli3e4ac1c2018-12-12 20:50:45 +0530626 } else if (pdev->mcopy_mode) {
Soumya Bhat2f54de22018-02-21 09:54:28 +0530627 m_copy_status = dp_rx_handle_mcopy_mode(soc,
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530628 pdev, ppdu_info, status_nbuf);
Soumya Bhat2f54de22018-02-21 09:54:28 +0530629 if (m_copy_status == QDF_STATUS_SUCCESS)
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530630 qdf_nbuf_free(status_nbuf);
Kai Chen52ef33f2019-03-05 18:33:40 -0800631 } else if (rx_enh_capture_mode != CDP_RX_ENH_CAPTURE_DISABLED) {
632 if (!nbuf_used)
633 qdf_nbuf_free(status_nbuf);
634
635 if (tlv_status == HAL_TLV_STATUS_PPDU_DONE)
636 enh_log_status =
637 dp_rx_handle_enh_capture(soc,
638 pdev, ppdu_info);
Chaithanya Garrepalli3e4ac1c2018-12-12 20:50:45 +0530639 } else {
sumedh baikady59a2d332018-05-22 01:50:38 -0700640 qdf_nbuf_free(status_nbuf);
Chaithanya Garrepalli3e4ac1c2018-12-12 20:50:45 +0530641 }
Kai Chen6eca1a62017-01-12 10:17:53 -0800642
chenguo1b880462018-07-11 15:34:56 +0800643 if (tlv_status == HAL_TLV_STATUS_PPDU_NON_STD_DONE) {
644 dp_rx_mon_deliver_non_std(soc, mac_id);
645 } else if (tlv_status == HAL_TLV_STATUS_PPDU_DONE) {
Kai Chen783e0382018-01-25 16:29:08 -0800646 rx_mon_stats->status_ppdu_done++;
Soumya Bhat5c60deb2017-12-12 16:42:04 +0530647 if (pdev->enhanced_stats_en ||
sumedh baikady59a2d332018-05-22 01:50:38 -0700648 pdev->mcopy_mode || pdev->neighbour_peers_added)
Anish Nataraj38a29562017-08-18 19:41:17 +0530649 dp_rx_handle_ppdu_stats(soc, pdev, ppdu_info);
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530650
nobelj1c31fee2018-03-21 11:47:05 -0700651 pdev->mon_ppdu_status = DP_PPDU_STATUS_DONE;
652 dp_rx_mon_dest_process(soc, mac_id, quota);
Kai Chencbe4c342017-06-12 20:06:35 -0700653 pdev->mon_ppdu_status = DP_PPDU_STATUS_START;
Kai Chen6eca1a62017-01-12 10:17:53 -0800654 }
655 }
656 return;
657}
658
659/*
660 * dp_rx_mon_status_srng_process() - Process monitor status ring
661 * post the status ring buffer to Rx status Queue for later
662 * processing when status ring is filled with status TLV.
663 * Allocate a new buffer to status ring if the filled buffer
664 * is posted.
665 *
666 * @soc: core txrx main context
667 * @mac_id: mac_id which is one of 3 mac_ids
668 * @quota: No. of ring entry that can be serviced in one shot.
669
670 * Return: uint32_t: No. of ring entry that is processed.
671 */
672static inline uint32_t
673dp_rx_mon_status_srng_process(struct dp_soc *soc, uint32_t mac_id,
674 uint32_t quota)
675{
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -0800676 struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
Kai Chen6eca1a62017-01-12 10:17:53 -0800677 void *hal_soc;
678 void *mon_status_srng;
679 void *rxdma_mon_status_ring_entry;
680 QDF_STATUS status;
681 uint32_t work_done = 0;
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -0800682 int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id);
Kai Chen6eca1a62017-01-12 10:17:53 -0800683
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -0800684 mon_status_srng = pdev->rxdma_mon_status_ring[mac_for_pdev].hal_srng;
Kai Chen6eca1a62017-01-12 10:17:53 -0800685
686 qdf_assert(mon_status_srng);
Houston Hoffman648a9182017-05-21 23:27:50 -0700687 if (!mon_status_srng || !hal_srng_initialized(mon_status_srng)) {
688
689 QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
Aditya Sathishded018e2018-07-02 16:25:21 +0530690 "%s %d : HAL Monitor Status Ring Init Failed -- %pK",
Houston Hoffman648a9182017-05-21 23:27:50 -0700691 __func__, __LINE__, mon_status_srng);
692 return work_done;
693 }
Kai Chen6eca1a62017-01-12 10:17:53 -0800694
695 hal_soc = soc->hal_soc;
696
697 qdf_assert(hal_soc);
698
699 if (qdf_unlikely(hal_srng_access_start(hal_soc, mon_status_srng)))
700 goto done;
701
702 /* mon_status_ring_desc => WBM_BUFFER_RING STRUCT =>
703 * BUFFER_ADDR_INFO STRUCT
704 */
705 while (qdf_likely((rxdma_mon_status_ring_entry =
706 hal_srng_src_peek(hal_soc, mon_status_srng))
707 && quota--)) {
708 uint32_t rx_buf_cookie;
709 qdf_nbuf_t status_nbuf;
710 struct dp_rx_desc *rx_desc;
711 uint8_t *status_buf;
712 qdf_dma_addr_t paddr;
713 uint64_t buf_addr;
714
715 buf_addr =
716 (HAL_RX_BUFFER_ADDR_31_0_GET(
717 rxdma_mon_status_ring_entry) |
718 ((uint64_t)(HAL_RX_BUFFER_ADDR_39_32_GET(
719 rxdma_mon_status_ring_entry)) << 32));
720
721 if (qdf_likely(buf_addr)) {
722
723 rx_buf_cookie =
724 HAL_RX_BUF_COOKIE_GET(
725 rxdma_mon_status_ring_entry);
726 rx_desc = dp_rx_cookie_2_va_mon_status(soc,
727 rx_buf_cookie);
728
729 qdf_assert(rx_desc);
730
731 status_nbuf = rx_desc->nbuf;
732
733 qdf_nbuf_sync_for_cpu(soc->osdev, status_nbuf,
734 QDF_DMA_FROM_DEVICE);
735
736 status_buf = qdf_nbuf_data(status_nbuf);
737
738 status = hal_get_rx_status_done(status_buf);
739
740 if (status != QDF_STATUS_SUCCESS) {
Karunakar Dasineni37995ac2018-02-06 12:37:30 -0800741 uint32_t hp, tp;
Venkata Sharath Chandra Manchala443b9b42018-10-10 12:04:54 -0700742 hal_get_sw_hptp(hal_soc, mon_status_srng,
743 &tp, &hp);
Kai Chen6eca1a62017-01-12 10:17:53 -0800744 QDF_TRACE(QDF_MODULE_ID_DP,
Karunakar Dasineni37995ac2018-02-06 12:37:30 -0800745 QDF_TRACE_LEVEL_ERROR,
746 "[%s][%d] status not done - hp:%u, tp:%u",
747 __func__, __LINE__, hp, tp);
748 /* WAR for missing status: Skip status entry */
749 hal_srng_src_get_next(hal_soc, mon_status_srng);
750 continue;
Kai Chen6eca1a62017-01-12 10:17:53 -0800751 }
752 qdf_nbuf_set_pktlen(status_nbuf, RX_BUFFER_SIZE);
753
754 qdf_nbuf_unmap_single(soc->osdev, status_nbuf,
755 QDF_DMA_FROM_DEVICE);
756
757 /* Put the status_nbuf to queue */
758 qdf_nbuf_queue_add(&pdev->rx_status_q, status_nbuf);
759
760 } else {
761 union dp_rx_desc_list_elem_t *desc_list = NULL;
762 union dp_rx_desc_list_elem_t *tail = NULL;
763 struct rx_desc_pool *rx_desc_pool;
764 uint32_t num_alloc_desc;
765
766 rx_desc_pool = &soc->rx_desc_status[mac_id];
767
768 num_alloc_desc = dp_rx_get_free_desc_list(soc, mac_id,
769 rx_desc_pool,
770 1,
771 &desc_list,
772 &tail);
phadimanebf4cde2019-01-28 17:50:37 +0530773 /*
774 * No free descriptors available
775 */
776 if (qdf_unlikely(num_alloc_desc == 0)) {
777 work_done++;
778 break;
779 }
Kai Chen6eca1a62017-01-12 10:17:53 -0800780
781 rx_desc = &desc_list->rx_desc;
782 }
783
jinweic chenc3546322018-02-02 15:03:41 +0800784 status_nbuf = dp_rx_nbuf_prepare(soc, pdev);
Kai Chen6eca1a62017-01-12 10:17:53 -0800785
jinweic chenc3546322018-02-02 15:03:41 +0800786 /*
787 * qdf_nbuf alloc or map failed,
788 * free the dp rx desc to free list,
789 * fill in NULL dma address at current HP entry,
790 * keep HP in mon_status_ring unchanged,
791 * wait next time dp_rx_mon_status_srng_process
792 * to fill in buffer at current HP.
793 */
Jeff Johnsona8edf332019-03-18 09:51:52 -0700794 if (qdf_unlikely(!status_nbuf)) {
jinweic chenc3546322018-02-02 15:03:41 +0800795 union dp_rx_desc_list_elem_t *desc_list = NULL;
796 union dp_rx_desc_list_elem_t *tail = NULL;
797 struct rx_desc_pool *rx_desc_pool;
Kai Chen6eca1a62017-01-12 10:17:53 -0800798
jinweic chenc3546322018-02-02 15:03:41 +0800799 rx_desc_pool = &soc->rx_desc_status[mac_id];
Kai Chen6eca1a62017-01-12 10:17:53 -0800800
jinweic chenc3546322018-02-02 15:03:41 +0800801 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
802 "%s: fail to allocate or map qdf_nbuf",
803 __func__);
804 dp_rx_add_to_free_desc_list(&desc_list,
805 &tail, rx_desc);
806 dp_rx_add_desc_list_to_free_list(soc, &desc_list,
807 &tail, mac_id, rx_desc_pool);
808
809 hal_rxdma_buff_addr_info_set(
810 rxdma_mon_status_ring_entry,
811 0, 0, HAL_RX_BUF_RBM_SW3_BM);
812 work_done++;
813 break;
814 }
815
Kai Chen6eca1a62017-01-12 10:17:53 -0800816 paddr = qdf_nbuf_get_frag_paddr(status_nbuf, 0);
817
818 rx_desc->nbuf = status_nbuf;
Pramod Simha59fcb312017-06-22 17:43:16 -0700819 rx_desc->in_use = 1;
Kai Chen6eca1a62017-01-12 10:17:53 -0800820
821 hal_rxdma_buff_addr_info_set(rxdma_mon_status_ring_entry,
822 paddr, rx_desc->cookie, HAL_RX_BUF_RBM_SW3_BM);
823
Karunakar Dasineni37995ac2018-02-06 12:37:30 -0800824 hal_srng_src_get_next(hal_soc, mon_status_srng);
Kai Chen6eca1a62017-01-12 10:17:53 -0800825 work_done++;
826 }
827done:
828
829 hal_srng_access_end(hal_soc, mon_status_srng);
830
831 return work_done;
832
833}
834/*
835 * dp_rx_mon_status_process() - Process monitor status ring and
836 * TLV in status ring.
837 *
838 * @soc: core txrx main context
839 * @mac_id: mac_id which is one of 3 mac_ids
840 * @quota: No. of ring entry that can be serviced in one shot.
841
842 * Return: uint32_t: No. of ring entry that is processed.
843 */
844static inline uint32_t
845dp_rx_mon_status_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) {
846 uint32_t work_done;
847
848 work_done = dp_rx_mon_status_srng_process(soc, mac_id, quota);
Karunakar Dasineni40555682017-03-26 22:44:39 -0700849 quota -= work_done;
850 dp_rx_mon_status_process_tlv(soc, mac_id, quota);
Kai Chen6eca1a62017-01-12 10:17:53 -0800851
852 return work_done;
853}
854/**
855 * dp_mon_process() - Main monitor mode processing roution.
856 * This call monitor status ring process then monitor
857 * destination ring process.
858 * Called from the bottom half (tasklet/NET_RX_SOFTIRQ)
859 * @soc: core txrx main context
860 * @mac_id: mac_id which is one of 3 mac_ids
861 * @quota: No. of status ring entry that can be serviced in one shot.
862
863 * Return: uint32_t: No. of ring entry that is processed.
864 */
865uint32_t
866dp_mon_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) {
Karunakar Dasineni40555682017-03-26 22:44:39 -0700867 return dp_rx_mon_status_process(soc, mac_id, quota);
Kai Chen6eca1a62017-01-12 10:17:53 -0800868}
Karunakar Dasineni40555682017-03-26 22:44:39 -0700869
Kai Chen6eca1a62017-01-12 10:17:53 -0800870/**
Venkata Sharath Chandra Manchala87479582018-08-01 12:45:34 -0700871 * dp_rx_pdev_mon_status_detach() - detach dp rx for status ring
Kai Chen6eca1a62017-01-12 10:17:53 -0800872 * @pdev: core txrx pdev context
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -0800873 * @mac_id: mac_id/pdev_id correspondinggly for MCL and WIN
Kai Chen6eca1a62017-01-12 10:17:53 -0800874 *
875 * This function will detach DP RX status ring from
876 * main device context. will free DP Rx resources for
877 * status ring
878 *
879 * Return: QDF_STATUS_SUCCESS: success
880 * QDF_STATUS_E_RESOURCES: Error return
881 */
882QDF_STATUS
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -0800883dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id)
Kai Chen6eca1a62017-01-12 10:17:53 -0800884{
Kai Chen6eca1a62017-01-12 10:17:53 -0800885 struct dp_soc *soc = pdev->soc;
886 struct rx_desc_pool *rx_desc_pool;
887
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -0800888 rx_desc_pool = &soc->rx_desc_status[mac_id];
phadiman449a2682019-02-20 14:00:00 +0530889 if (rx_desc_pool->pool_size != 0) {
890 if (!dp_is_soc_reinit(soc))
Varun Reddy Yeturua7c21dc2019-05-16 14:03:46 -0700891 dp_rx_desc_nbuf_and_pool_free(soc, mac_id,
892 rx_desc_pool);
phadiman449a2682019-02-20 14:00:00 +0530893 else
Varun Reddy Yeturua7c21dc2019-05-16 14:03:46 -0700894 dp_rx_desc_nbuf_free(soc, rx_desc_pool);
phadiman449a2682019-02-20 14:00:00 +0530895 }
Kai Chen6eca1a62017-01-12 10:17:53 -0800896
897 return QDF_STATUS_SUCCESS;
898}
899
900/*
901 * dp_rx_buffers_replenish() - replenish monitor status ring with
902 * rx nbufs called during dp rx
903 * monitor status ring initialization
904 *
905 * @soc: core txrx main context
906 * @mac_id: mac_id which is one of 3 mac_ids
907 * @dp_rxdma_srng: dp monitor status circular ring
908 * @rx_desc_pool; Pointer to Rx descriptor pool
909 * @num_req_buffers: number of buffer to be replenished
910 * @desc_list: list of descs if called from dp rx monitor status
911 * process or NULL during dp rx initialization or
912 * out of buffer interrupt
913 * @tail: tail of descs list
914 * @owner: who owns the nbuf (host, NSS etc...)
915 * Return: return success or failure
916 */
917static inline
918QDF_STATUS dp_rx_mon_status_buffers_replenish(struct dp_soc *dp_soc,
919 uint32_t mac_id,
920 struct dp_srng *dp_rxdma_srng,
921 struct rx_desc_pool *rx_desc_pool,
922 uint32_t num_req_buffers,
923 union dp_rx_desc_list_elem_t **desc_list,
924 union dp_rx_desc_list_elem_t **tail,
925 uint8_t owner)
926{
927 uint32_t num_alloc_desc;
928 uint16_t num_desc_to_free = 0;
929 uint32_t num_entries_avail;
jinweic chenc3546322018-02-02 15:03:41 +0800930 uint32_t count = 0;
Kai Chen6eca1a62017-01-12 10:17:53 -0800931 int sync_hw_ptr = 1;
932 qdf_dma_addr_t paddr;
933 qdf_nbuf_t rx_netbuf;
934 void *rxdma_ring_entry;
935 union dp_rx_desc_list_elem_t *next;
936 void *rxdma_srng;
jinweic chenc3546322018-02-02 15:03:41 +0800937 struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(dp_soc, mac_id);
Kai Chen6eca1a62017-01-12 10:17:53 -0800938
939 rxdma_srng = dp_rxdma_srng->hal_srng;
940
941 qdf_assert(rxdma_srng);
942
Houston Hoffmanae850c62017-08-11 16:47:50 -0700943 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
Aditya Sathishded018e2018-07-02 16:25:21 +0530944 "[%s][%d] requested %d buffers for replenish",
Kai Chen6eca1a62017-01-12 10:17:53 -0800945 __func__, __LINE__, num_req_buffers);
946
947 /*
948 * if desc_list is NULL, allocate the descs from freelist
949 */
950 if (!(*desc_list)) {
951
952 num_alloc_desc = dp_rx_get_free_desc_list(dp_soc, mac_id,
953 rx_desc_pool,
954 num_req_buffers,
955 desc_list,
956 tail);
957
958 if (!num_alloc_desc) {
959 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
Aditya Sathishded018e2018-07-02 16:25:21 +0530960 "[%s][%d] no free rx_descs in freelist",
Kai Chen6eca1a62017-01-12 10:17:53 -0800961 __func__, __LINE__);
962 return QDF_STATUS_E_NOMEM;
963 }
964
Houston Hoffmanae850c62017-08-11 16:47:50 -0700965 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
Aditya Sathishded018e2018-07-02 16:25:21 +0530966 "[%s][%d] %d rx desc allocated", __func__, __LINE__,
Kai Chen6eca1a62017-01-12 10:17:53 -0800967 num_alloc_desc);
Houston Hoffmanae850c62017-08-11 16:47:50 -0700968
Kai Chen6eca1a62017-01-12 10:17:53 -0800969 num_req_buffers = num_alloc_desc;
970 }
971
972 hal_srng_access_start(dp_soc->hal_soc, rxdma_srng);
973 num_entries_avail = hal_srng_src_num_avail(dp_soc->hal_soc,
974 rxdma_srng, sync_hw_ptr);
975
Houston Hoffmanae850c62017-08-11 16:47:50 -0700976 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
Aditya Sathishded018e2018-07-02 16:25:21 +0530977 "[%s][%d] no of available entries in rxdma ring: %d",
Kai Chen6eca1a62017-01-12 10:17:53 -0800978 __func__, __LINE__, num_entries_avail);
979
980 if (num_entries_avail < num_req_buffers) {
981 num_desc_to_free = num_req_buffers - num_entries_avail;
982 num_req_buffers = num_entries_avail;
983 }
984
jinweic chenc3546322018-02-02 15:03:41 +0800985 while (count < num_req_buffers) {
986 rx_netbuf = dp_rx_nbuf_prepare(dp_soc, dp_pdev);
Kai Chen6eca1a62017-01-12 10:17:53 -0800987
jinweic chenc3546322018-02-02 15:03:41 +0800988 /*
989 * qdf_nbuf alloc or map failed,
990 * keep HP in mon_status_ring unchanged,
991 * wait dp_rx_mon_status_srng_process
992 * to fill in buffer at current HP.
993 */
Jeff Johnsona8edf332019-03-18 09:51:52 -0700994 if (qdf_unlikely(!rx_netbuf)) {
jinweic chenc3546322018-02-02 15:03:41 +0800995 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
996 "%s: qdf_nbuf allocate or map fail, count %d",
997 __func__, count);
998 break;
999 }
Kai Chen6eca1a62017-01-12 10:17:53 -08001000
1001 paddr = qdf_nbuf_get_frag_paddr(rx_netbuf, 0);
1002
1003 next = (*desc_list)->next;
sumedh baikadyeca2de62018-04-11 14:20:38 -07001004 rxdma_ring_entry = hal_srng_src_get_next(dp_soc->hal_soc,
1005 rxdma_srng);
1006
Jeff Johnsona8edf332019-03-18 09:51:52 -07001007 if (qdf_unlikely(!rxdma_ring_entry)) {
sumedh baikadyeca2de62018-04-11 14:20:38 -07001008 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
Aditya Sathishded018e2018-07-02 16:25:21 +05301009 "[%s][%d] rxdma_ring_entry is NULL, count - %d",
sumedh baikadyeca2de62018-04-11 14:20:38 -07001010 __func__, __LINE__, count);
1011 qdf_nbuf_unmap_single(dp_soc->osdev, rx_netbuf,
Ankit Kumar0ae4abc2019-05-02 15:08:42 +05301012 QDF_DMA_FROM_DEVICE);
sumedh baikadyeca2de62018-04-11 14:20:38 -07001013 qdf_nbuf_free(rx_netbuf);
1014 break;
1015 }
Kai Chen6eca1a62017-01-12 10:17:53 -08001016
1017 (*desc_list)->rx_desc.nbuf = rx_netbuf;
Pramod Simha59fcb312017-06-22 17:43:16 -07001018 (*desc_list)->rx_desc.in_use = 1;
jinweic chenc3546322018-02-02 15:03:41 +08001019 count++;
jinweic chenc3546322018-02-02 15:03:41 +08001020
Kai Chen6eca1a62017-01-12 10:17:53 -08001021 hal_rxdma_buff_addr_info_set(rxdma_ring_entry, paddr,
1022 (*desc_list)->rx_desc.cookie, owner);
1023
Karunakar Dasineni40555682017-03-26 22:44:39 -07001024 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
Jeff Johnson3f217e22017-09-18 10:13:35 -07001025 "[%s][%d] rx_desc=%pK, cookie=%d, nbuf=%pK, \
Aditya Sathishded018e2018-07-02 16:25:21 +05301026 paddr=%pK",
Kai Chen6eca1a62017-01-12 10:17:53 -08001027 __func__, __LINE__, &(*desc_list)->rx_desc,
1028 (*desc_list)->rx_desc.cookie, rx_netbuf,
jinweic chenc3546322018-02-02 15:03:41 +08001029 (void *)paddr);
Kai Chen6eca1a62017-01-12 10:17:53 -08001030
1031 *desc_list = next;
1032 }
1033
1034 hal_srng_access_end(dp_soc->hal_soc, rxdma_srng);
1035
Houston Hoffmanae850c62017-08-11 16:47:50 -07001036 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
Aditya Sathishded018e2018-07-02 16:25:21 +05301037 "successfully replenished %d buffers", num_req_buffers);
Kai Chen6eca1a62017-01-12 10:17:53 -08001038
Houston Hoffmanae850c62017-08-11 16:47:50 -07001039 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
Aditya Sathishded018e2018-07-02 16:25:21 +05301040 "%d rx desc added back to free list", num_desc_to_free);
Kai Chen6eca1a62017-01-12 10:17:53 -08001041
Kai Chen6eca1a62017-01-12 10:17:53 -08001042 /*
1043 * add any available free desc back to the free list
1044 */
1045 if (*desc_list) {
1046 dp_rx_add_desc_list_to_free_list(dp_soc, desc_list, tail,
1047 mac_id, rx_desc_pool);
1048 }
1049
1050 return QDF_STATUS_SUCCESS;
1051}
1052/**
1053 * dp_rx_pdev_mon_status_attach() - attach DP RX monitor status ring
1054 * @pdev: core txrx pdev context
Venkata Sharath Chandra Manchala87479582018-08-01 12:45:34 -07001055 * @ring_id: ring number
Kai Chen6eca1a62017-01-12 10:17:53 -08001056 * This function will attach a DP RX monitor status ring into pDEV
1057 * and replenish monitor status ring with buffer.
1058 *
1059 * Return: QDF_STATUS_SUCCESS: success
1060 * QDF_STATUS_E_RESOURCES: Error return
1061 */
1062QDF_STATUS
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -08001063dp_rx_pdev_mon_status_attach(struct dp_pdev *pdev, int ring_id) {
Kai Chen6eca1a62017-01-12 10:17:53 -08001064 struct dp_soc *soc = pdev->soc;
1065 union dp_rx_desc_list_elem_t *desc_list = NULL;
1066 union dp_rx_desc_list_elem_t *tail = NULL;
Mohit Khanna70514992018-11-12 18:39:03 -08001067 struct dp_srng *mon_status_ring;
1068 uint32_t num_entries;
Kai Chen52ef33f2019-03-05 18:33:40 -08001069 uint32_t i;
Kai Chen6eca1a62017-01-12 10:17:53 -08001070 struct rx_desc_pool *rx_desc_pool;
Ravi Joshia9ebe0a2017-06-17 16:43:02 -07001071 QDF_STATUS status;
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -08001072 int mac_for_pdev = dp_get_mac_id_for_mac(soc, ring_id);
Kai Chen6eca1a62017-01-12 10:17:53 -08001073
Mohit Khanna70514992018-11-12 18:39:03 -08001074 mon_status_ring = &pdev->rxdma_mon_status_ring[mac_for_pdev];
Kai Chen6eca1a62017-01-12 10:17:53 -08001075
Mohit Khanna70514992018-11-12 18:39:03 -08001076 num_entries = mon_status_ring->num_entries;
Kai Chen6eca1a62017-01-12 10:17:53 -08001077
Manjunathappa Prakashd9ce3502018-02-05 14:09:17 -08001078 rx_desc_pool = &soc->rx_desc_status[ring_id];
Kai Chen6eca1a62017-01-12 10:17:53 -08001079
Mohit Khanna70514992018-11-12 18:39:03 -08001080 dp_info("Mon RX Status Pool[%d] entries=%d",
1081 ring_id, num_entries);
Kai Chen6eca1a62017-01-12 10:17:53 -08001082
Mohit Khanna70514992018-11-12 18:39:03 -08001083 status = dp_rx_desc_pool_alloc(soc, ring_id, num_entries + 1,
1084 rx_desc_pool);
1085 if (!QDF_IS_STATUS_SUCCESS(status))
Ravi Joshia9ebe0a2017-06-17 16:43:02 -07001086 return status;
Kai Chen6eca1a62017-01-12 10:17:53 -08001087
Mohit Khanna70514992018-11-12 18:39:03 -08001088 dp_debug("Mon RX Status Buffers Replenish ring_id=%d", ring_id);
Kai Chen6eca1a62017-01-12 10:17:53 -08001089
Mohit Khanna70514992018-11-12 18:39:03 -08001090 status = dp_rx_mon_status_buffers_replenish(soc, ring_id,
1091 mon_status_ring,
1092 rx_desc_pool,
1093 num_entries,
1094 &desc_list, &tail,
1095 HAL_RX_BUF_RBM_SW3_BM);
1096
1097 if (!QDF_IS_STATUS_SUCCESS(status))
Ravi Joshia9ebe0a2017-06-17 16:43:02 -07001098 return status;
Kai Chen6eca1a62017-01-12 10:17:53 -08001099
1100 qdf_nbuf_queue_init(&pdev->rx_status_q);
1101
1102 pdev->mon_ppdu_status = DP_PPDU_STATUS_START;
Kai Chen783e0382018-01-25 16:29:08 -08001103
Karunakar Dasineni40555682017-03-26 22:44:39 -07001104 qdf_mem_zero(&(pdev->ppdu_info.rx_status),
Mohit Khanna70514992018-11-12 18:39:03 -08001105 sizeof(pdev->ppdu_info.rx_status));
Kai Chen6eca1a62017-01-12 10:17:53 -08001106
Kai Chen783e0382018-01-25 16:29:08 -08001107 qdf_mem_zero(&pdev->rx_mon_stats,
1108 sizeof(pdev->rx_mon_stats));
1109
1110 dp_rx_mon_init_dbg_ppdu_stats(&pdev->ppdu_info,
1111 &pdev->rx_mon_stats);
1112
Kai Chen52ef33f2019-03-05 18:33:40 -08001113 for (i = 0; i < MAX_MU_USERS; i++) {
1114 qdf_nbuf_queue_init(&pdev->mpdu_q[i]);
1115 pdev->is_mpdu_hdr[i] = true;
1116 }
1117 qdf_mem_zero(pdev->msdu_list, sizeof(pdev->msdu_list[MAX_MU_USERS]));
1118
1119 pdev->rx_enh_capture_mode = CDP_RX_ENH_CAPTURE_DISABLED;
1120
Kai Chen6eca1a62017-01-12 10:17:53 -08001121 return QDF_STATUS_SUCCESS;
1122}