dp_rx_mon_status.c 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042
  1. /*
  2. * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  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. */
  18. #include "hal_hw_headers.h"
  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"
  27. #include "dp_rx_mon.h"
  28. #include "dp_internal.h"
  29. #include "qdf_mem.h" /* qdf_mem_malloc,free */
  30. #ifdef FEATURE_PERPKT_INFO
  31. #include "dp_ratetable.h"
  32. #endif
  33. /**
  34. * dp_rx_populate_cdp_indication_ppdu() - Populate cdp rx indication structure
  35. * @pdev: pdev ctx
  36. * @ppdu_info: ppdu info structure from ppdu ring
  37. * @ppdu_nbuf: qdf nbuf abstraction for linux skb
  38. *
  39. * Return: none
  40. */
  41. #ifdef FEATURE_PERPKT_INFO
  42. static inline void
  43. dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
  44. struct hal_rx_ppdu_info *ppdu_info,
  45. qdf_nbuf_t ppdu_nbuf)
  46. {
  47. struct dp_peer *peer;
  48. struct dp_soc *soc = pdev->soc;
  49. struct dp_ast_entry *ast_entry;
  50. struct cdp_rx_indication_ppdu *cdp_rx_ppdu;
  51. uint32_t ast_index;
  52. cdp_rx_ppdu = (struct cdp_rx_indication_ppdu *)ppdu_nbuf->data;
  53. cdp_rx_ppdu->first_data_seq_ctrl =
  54. ppdu_info->rx_status.first_data_seq_ctrl;
  55. cdp_rx_ppdu->frame_ctrl =
  56. ppdu_info->rx_status.frame_control;
  57. cdp_rx_ppdu->ppdu_id = ppdu_info->com_info.ppdu_id;
  58. cdp_rx_ppdu->length = ppdu_info->rx_status.ppdu_len;
  59. cdp_rx_ppdu->duration = ppdu_info->rx_status.duration;
  60. cdp_rx_ppdu->u.bw = ppdu_info->rx_status.bw;
  61. cdp_rx_ppdu->tcp_msdu_count = ppdu_info->rx_status.tcp_msdu_count;
  62. cdp_rx_ppdu->udp_msdu_count = ppdu_info->rx_status.udp_msdu_count;
  63. cdp_rx_ppdu->other_msdu_count = ppdu_info->rx_status.other_msdu_count;
  64. cdp_rx_ppdu->u.nss = ppdu_info->rx_status.nss;
  65. cdp_rx_ppdu->u.mcs = ppdu_info->rx_status.mcs;
  66. if ((ppdu_info->rx_status.sgi == VHT_SGI_NYSM) &&
  67. (ppdu_info->rx_status.preamble_type == HAL_RX_PKT_TYPE_11AC))
  68. cdp_rx_ppdu->u.gi = CDP_SGI_0_4_US;
  69. else
  70. cdp_rx_ppdu->u.gi = ppdu_info->rx_status.sgi;
  71. cdp_rx_ppdu->u.ldpc = ppdu_info->rx_status.ldpc;
  72. cdp_rx_ppdu->u.preamble = ppdu_info->rx_status.preamble_type;
  73. cdp_rx_ppdu->u.ppdu_type = ppdu_info->rx_status.reception_type;
  74. cdp_rx_ppdu->rssi = ppdu_info->rx_status.rssi_comb;
  75. cdp_rx_ppdu->timestamp = ppdu_info->rx_status.tsft;
  76. cdp_rx_ppdu->channel = ppdu_info->rx_status.chan_num;
  77. cdp_rx_ppdu->beamformed = ppdu_info->rx_status.beamformed;
  78. cdp_rx_ppdu->num_msdu = (cdp_rx_ppdu->tcp_msdu_count +
  79. cdp_rx_ppdu->udp_msdu_count +
  80. cdp_rx_ppdu->other_msdu_count);
  81. cdp_rx_ppdu->num_mpdu = ppdu_info->com_info.mpdu_cnt_fcs_ok;
  82. if (ppdu_info->com_info.mpdu_cnt_fcs_ok > 1)
  83. cdp_rx_ppdu->is_ampdu = 1;
  84. else
  85. cdp_rx_ppdu->is_ampdu = 0;
  86. cdp_rx_ppdu->tid = ppdu_info->rx_status.tid;
  87. cdp_rx_ppdu->lsig_a = ppdu_info->rx_status.rate;
  88. ast_index = ppdu_info->rx_status.ast_index;
  89. if (ast_index >= wlan_cfg_get_max_ast_idx(soc->wlan_cfg_ctx)) {
  90. cdp_rx_ppdu->peer_id = HTT_INVALID_PEER;
  91. return;
  92. }
  93. ast_entry = soc->ast_table[ast_index];
  94. if (!ast_entry) {
  95. cdp_rx_ppdu->peer_id = HTT_INVALID_PEER;
  96. return;
  97. }
  98. peer = ast_entry->peer;
  99. if (!peer || peer->peer_ids[0] == HTT_INVALID_PEER) {
  100. cdp_rx_ppdu->peer_id = HTT_INVALID_PEER;
  101. return;
  102. }
  103. qdf_mem_copy(cdp_rx_ppdu->mac_addr,
  104. peer->mac_addr.raw, DP_MAC_ADDR_LEN);
  105. cdp_rx_ppdu->peer_id = peer->peer_ids[0];
  106. cdp_rx_ppdu->vdev_id = peer->vdev->vdev_id;
  107. }
  108. #else
  109. static inline void
  110. dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
  111. struct hal_rx_ppdu_info *ppdu_info,
  112. qdf_nbuf_t ppdu_nbuf)
  113. {
  114. }
  115. #endif
  116. /**
  117. * dp_rx_stats_update() - Update per-peer statistics
  118. * @soc: Datapath SOC handle
  119. * @peer: Datapath peer handle
  120. * @ppdu: PPDU Descriptor
  121. *
  122. * Return: None
  123. */
  124. #ifdef FEATURE_PERPKT_INFO
  125. static inline void dp_rx_rate_stats_update(struct dp_peer *peer,
  126. struct cdp_rx_indication_ppdu *ppdu)
  127. {
  128. uint32_t ratekbps = 0;
  129. uint32_t ppdu_rx_rate = 0;
  130. uint32_t nss = 0;
  131. if (!peer || !ppdu)
  132. return;
  133. if (ppdu->u.nss == 0)
  134. nss = 0;
  135. else
  136. nss = ppdu->u.nss - 1;
  137. ratekbps = dp_getrateindex(ppdu->u.gi,
  138. ppdu->u.mcs,
  139. nss,
  140. ppdu->u.preamble,
  141. ppdu->u.bw);
  142. if (!ratekbps)
  143. return;
  144. DP_STATS_UPD(peer, rx.last_rx_rate, ratekbps);
  145. dp_ath_rate_lpf(peer->stats.rx.avg_rx_rate, ratekbps);
  146. ppdu_rx_rate = dp_ath_rate_out(peer->stats.rx.avg_rx_rate);
  147. DP_STATS_UPD(peer, rx.rnd_avg_rx_rate, ppdu_rx_rate);
  148. if (peer->vdev)
  149. peer->vdev->stats.rx.last_rx_rate = ratekbps;
  150. }
  151. static void dp_rx_stats_update(struct dp_pdev *pdev, struct dp_peer *peer,
  152. struct cdp_rx_indication_ppdu *ppdu)
  153. {
  154. struct dp_soc *soc = NULL;
  155. uint8_t mcs, preamble, ac = 0;
  156. uint16_t num_msdu;
  157. bool is_invalid_peer = false;
  158. mcs = ppdu->u.mcs;
  159. preamble = ppdu->u.preamble;
  160. num_msdu = ppdu->num_msdu;
  161. if (pdev)
  162. soc = pdev->soc;
  163. else
  164. return;
  165. if (!peer) {
  166. is_invalid_peer = true;
  167. peer = pdev->invalid_peer;
  168. }
  169. if (!soc || soc->process_rx_status)
  170. return;
  171. DP_STATS_UPD(peer, rx.rssi, ppdu->rssi);
  172. if ((preamble == DOT11_A) || (preamble == DOT11_B))
  173. ppdu->u.nss = 1;
  174. if (ppdu->u.nss)
  175. DP_STATS_INC(peer, rx.nss[ppdu->u.nss - 1], num_msdu);
  176. DP_STATS_INC(peer, rx.sgi_count[ppdu->u.gi], num_msdu);
  177. DP_STATS_INC(peer, rx.bw[ppdu->u.bw], num_msdu);
  178. DP_STATS_INC(peer, rx.reception_type[ppdu->u.ppdu_type], num_msdu);
  179. DP_STATS_INCC(peer, rx.ampdu_cnt, num_msdu, ppdu->is_ampdu);
  180. DP_STATS_INCC(peer, rx.non_ampdu_cnt, num_msdu, !(ppdu->is_ampdu));
  181. DP_STATS_UPD(peer, rx.rx_rate, mcs);
  182. DP_STATS_INCC(peer,
  183. rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
  184. ((mcs >= MAX_MCS_11A) && (preamble == DOT11_A)));
  185. DP_STATS_INCC(peer,
  186. rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
  187. ((mcs < MAX_MCS_11A) && (preamble == DOT11_A)));
  188. DP_STATS_INCC(peer,
  189. rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
  190. ((mcs >= MAX_MCS_11B) && (preamble == DOT11_B)));
  191. DP_STATS_INCC(peer,
  192. rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
  193. ((mcs < MAX_MCS_11B) && (preamble == DOT11_B)));
  194. DP_STATS_INCC(peer,
  195. rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
  196. ((mcs >= MAX_MCS_11A) && (preamble == DOT11_N)));
  197. DP_STATS_INCC(peer,
  198. rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
  199. ((mcs < MAX_MCS_11A) && (preamble == DOT11_N)));
  200. DP_STATS_INCC(peer,
  201. rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
  202. ((mcs >= MAX_MCS_11AC) && (preamble == DOT11_AC)));
  203. DP_STATS_INCC(peer,
  204. rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
  205. ((mcs < MAX_MCS_11AC) && (preamble == DOT11_AC)));
  206. DP_STATS_INCC(peer,
  207. rx.pkt_type[preamble].mcs_count[MAX_MCS - 1], num_msdu,
  208. ((mcs >= (MAX_MCS - 1)) && (preamble == DOT11_AX)));
  209. DP_STATS_INCC(peer,
  210. rx.pkt_type[preamble].mcs_count[mcs], num_msdu,
  211. ((mcs < (MAX_MCS - 1)) && (preamble == DOT11_AX)));
  212. /*
  213. * If invalid TID, it could be a non-qos frame, hence do not update
  214. * any AC counters
  215. */
  216. ac = TID_TO_WME_AC(ppdu->tid);
  217. if (ppdu->tid != HAL_TID_INVALID)
  218. DP_STATS_INC(peer, rx.wme_ac_type[ac], num_msdu);
  219. dp_peer_stats_notify(peer);
  220. DP_STATS_UPD(peer, rx.last_rssi, ppdu->rssi);
  221. if (is_invalid_peer)
  222. return;
  223. dp_rx_rate_stats_update(peer, ppdu);
  224. #if defined(FEATURE_PERPKT_INFO) && WDI_EVENT_ENABLE
  225. dp_wdi_event_handler(WDI_EVENT_UPDATE_DP_STATS, pdev->soc,
  226. &peer->stats, ppdu->peer_id,
  227. UPDATE_PEER_STATS, pdev->pdev_id);
  228. #endif
  229. }
  230. #endif
  231. /**
  232. * dp_rx_handle_mcopy_mode() - Allocate and deliver first MSDU payload
  233. * @soc: core txrx main context
  234. * @pdev: pdev strcuture
  235. * @ppdu_info: structure for rx ppdu ring
  236. *
  237. * Return: QDF_STATUS_SUCCESS - If nbuf to be freed by caller
  238. * QDF_STATUS_E_ALREADY - If nbuf not to be freed by caller
  239. */
  240. #ifdef FEATURE_PERPKT_INFO
  241. static inline QDF_STATUS
  242. dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
  243. struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf)
  244. {
  245. uint8_t size = 0;
  246. struct ieee80211_frame *wh;
  247. uint32_t *nbuf_data;
  248. if (ppdu_info->msdu_info.first_msdu_payload == NULL)
  249. return QDF_STATUS_SUCCESS;
  250. if (pdev->m_copy_id.rx_ppdu_id == ppdu_info->com_info.ppdu_id)
  251. return QDF_STATUS_SUCCESS;
  252. pdev->m_copy_id.rx_ppdu_id = ppdu_info->com_info.ppdu_id;
  253. wh = (struct ieee80211_frame *)(ppdu_info->msdu_info.first_msdu_payload
  254. + 4);
  255. size = (ppdu_info->msdu_info.first_msdu_payload -
  256. qdf_nbuf_data(nbuf));
  257. ppdu_info->msdu_info.first_msdu_payload = NULL;
  258. if (qdf_nbuf_pull_head(nbuf, size) == NULL)
  259. return QDF_STATUS_SUCCESS;
  260. if (((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) ==
  261. IEEE80211_FC0_TYPE_MGT) ||
  262. ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) ==
  263. IEEE80211_FC0_TYPE_CTL)) {
  264. return QDF_STATUS_SUCCESS;
  265. }
  266. nbuf_data = (uint32_t *)qdf_nbuf_data(nbuf);
  267. *nbuf_data = pdev->ppdu_info.com_info.ppdu_id;
  268. /* only retain RX MSDU payload in the skb */
  269. qdf_nbuf_trim_tail(nbuf, qdf_nbuf_len(nbuf) -
  270. ppdu_info->msdu_info.payload_len);
  271. dp_wdi_event_handler(WDI_EVENT_RX_DATA, soc,
  272. nbuf, HTT_INVALID_PEER, WDI_NO_VAL, pdev->pdev_id);
  273. return QDF_STATUS_E_ALREADY;
  274. }
  275. #else
  276. static inline QDF_STATUS
  277. dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
  278. struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf)
  279. {
  280. return QDF_STATUS_SUCCESS;
  281. }
  282. #endif
  283. /**
  284. * dp_rx_handle_smart_mesh_mode() - Deliver header for smart mesh
  285. * @soc: Datapath SOC handle
  286. * @pdev: Datapath PDEV handle
  287. * @ppdu_info: Structure for rx ppdu info
  288. * @nbuf: Qdf nbuf abstraction for linux skb
  289. *
  290. * Return: 0 on success, 1 on failure
  291. */
  292. static inline int
  293. dp_rx_handle_smart_mesh_mode(struct dp_soc *soc, struct dp_pdev *pdev,
  294. struct hal_rx_ppdu_info *ppdu_info,
  295. qdf_nbuf_t nbuf)
  296. {
  297. uint8_t size = 0;
  298. if (!pdev->monitor_vdev) {
  299. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
  300. "[%s]:[%d] Monitor vdev is NULL !!",
  301. __func__, __LINE__);
  302. return 1;
  303. }
  304. if (ppdu_info->msdu_info.first_msdu_payload == NULL) {
  305. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
  306. "[%s]:[%d] First msdu payload not present",
  307. __func__, __LINE__);
  308. return 1;
  309. }
  310. /* Adding 4 bytes to get to start of 802.11 frame after phy_ppdu_id */
  311. size = (ppdu_info->msdu_info.first_msdu_payload -
  312. qdf_nbuf_data(nbuf)) + 4;
  313. ppdu_info->msdu_info.first_msdu_payload = NULL;
  314. if (qdf_nbuf_pull_head(nbuf, size) == NULL) {
  315. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
  316. "[%s]:[%d] No header present",
  317. __func__, __LINE__);
  318. return 1;
  319. }
  320. /* Only retain RX MSDU payload in the skb */
  321. qdf_nbuf_trim_tail(nbuf, qdf_nbuf_len(nbuf) -
  322. ppdu_info->msdu_info.payload_len);
  323. qdf_nbuf_update_radiotap(&(pdev->ppdu_info.rx_status),
  324. nbuf, sizeof(struct rx_pkt_tlvs));
  325. pdev->monitor_vdev->osif_rx_mon(pdev->monitor_vdev->osif_vdev,
  326. nbuf, NULL);
  327. pdev->ppdu_info.rx_status.monitor_direct_used = 0;
  328. return 0;
  329. }
  330. /**
  331. * dp_rx_handle_ppdu_stats() - Allocate and deliver ppdu stats to cdp layer
  332. * @soc: core txrx main context
  333. * @pdev: pdev strcuture
  334. * @ppdu_info: structure for rx ppdu ring
  335. *
  336. * Return: none
  337. */
  338. #ifdef FEATURE_PERPKT_INFO
  339. static inline void
  340. dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
  341. struct hal_rx_ppdu_info *ppdu_info)
  342. {
  343. qdf_nbuf_t ppdu_nbuf;
  344. struct dp_peer *peer;
  345. struct cdp_rx_indication_ppdu *cdp_rx_ppdu;
  346. /*
  347. * Do not allocate if fcs error,
  348. * ast idx invalid / fctl invalid
  349. */
  350. if (ppdu_info->com_info.mpdu_cnt_fcs_ok == 0)
  351. return;
  352. if (ppdu_info->nac_info.fc_valid &&
  353. ppdu_info->nac_info.to_ds_flag &&
  354. ppdu_info->nac_info.mac_addr2_valid) {
  355. struct dp_neighbour_peer *peer = NULL;
  356. uint8_t rssi = ppdu_info->rx_status.rssi_comb;
  357. qdf_spin_lock_bh(&pdev->neighbour_peer_mutex);
  358. if (pdev->neighbour_peers_added) {
  359. TAILQ_FOREACH(peer, &pdev->neighbour_peers_list,
  360. neighbour_peer_list_elem) {
  361. if (!qdf_mem_cmp(&peer->neighbour_peers_macaddr,
  362. &ppdu_info->nac_info.mac_addr2,
  363. DP_MAC_ADDR_LEN)) {
  364. peer->rssi = rssi;
  365. break;
  366. }
  367. }
  368. }
  369. qdf_spin_unlock_bh(&pdev->neighbour_peer_mutex);
  370. }
  371. /* need not generate wdi event when mcopy and
  372. * enhanced stats are not enabled
  373. */
  374. if (!pdev->mcopy_mode && !pdev->enhanced_stats_en)
  375. return;
  376. if (!pdev->mcopy_mode) {
  377. if (!ppdu_info->rx_status.frame_control_info_valid)
  378. return;
  379. if (ppdu_info->rx_status.ast_index == HAL_AST_IDX_INVALID)
  380. return;
  381. }
  382. ppdu_nbuf = qdf_nbuf_alloc(soc->osdev,
  383. sizeof(struct hal_rx_ppdu_info), 0, 0, FALSE);
  384. if (ppdu_nbuf) {
  385. dp_rx_populate_cdp_indication_ppdu(pdev, ppdu_info, ppdu_nbuf);
  386. qdf_nbuf_put_tail(ppdu_nbuf,
  387. sizeof(struct cdp_rx_indication_ppdu));
  388. cdp_rx_ppdu = (struct cdp_rx_indication_ppdu *)ppdu_nbuf->data;
  389. peer = dp_peer_find_by_id(soc, cdp_rx_ppdu->peer_id);
  390. if (peer) {
  391. dp_rx_stats_update(pdev, peer, cdp_rx_ppdu);
  392. dp_peer_unref_del_find_by_id(peer);
  393. }
  394. if (cdp_rx_ppdu->peer_id != HTT_INVALID_PEER) {
  395. dp_wdi_event_handler(WDI_EVENT_RX_PPDU_DESC,
  396. soc, ppdu_nbuf,
  397. cdp_rx_ppdu->peer_id,
  398. WDI_NO_VAL, pdev->pdev_id);
  399. } else if (pdev->mcopy_mode) {
  400. dp_wdi_event_handler(WDI_EVENT_RX_PPDU_DESC, soc,
  401. ppdu_nbuf, HTT_INVALID_PEER,
  402. WDI_NO_VAL, pdev->pdev_id);
  403. } else {
  404. qdf_nbuf_free(ppdu_nbuf);
  405. }
  406. }
  407. }
  408. #else
  409. static inline void
  410. dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
  411. struct hal_rx_ppdu_info *ppdu_info)
  412. {
  413. }
  414. #endif
  415. /**
  416. * dp_rx_process_peer_based_pktlog() - Process Rx pktlog if peer based
  417. * filtering enabled
  418. * @soc: core txrx main context
  419. * @ppdu_info: Structure for rx ppdu info
  420. * @status_nbuf: Qdf nbuf abstraction for linux skb
  421. * @mac_id: mac_id/pdev_id correspondinggly for MCL and WIN
  422. *
  423. * Return: none
  424. */
  425. static inline void
  426. dp_rx_process_peer_based_pktlog(struct dp_soc *soc,
  427. struct hal_rx_ppdu_info *ppdu_info,
  428. qdf_nbuf_t status_nbuf, uint32_t mac_id)
  429. {
  430. struct dp_peer *peer;
  431. struct dp_ast_entry *ast_entry;
  432. uint32_t ast_index;
  433. ast_index = ppdu_info->rx_status.ast_index;
  434. if (ast_index < (WLAN_UMAC_PSOC_MAX_PEERS * 2)) {
  435. ast_entry = soc->ast_table[ast_index];
  436. if (ast_entry) {
  437. peer = ast_entry->peer;
  438. if (peer && (peer->peer_ids[0] != HTT_INVALID_PEER)) {
  439. if (peer->peer_based_pktlog_filter) {
  440. dp_wdi_event_handler(
  441. WDI_EVENT_RX_DESC, soc,
  442. status_nbuf,
  443. peer->peer_ids[0],
  444. WDI_NO_VAL, mac_id);
  445. }
  446. }
  447. }
  448. }
  449. }
  450. /**
  451. * dp_rx_mon_status_process_tlv() - Process status TLV in status
  452. * buffer on Rx status Queue posted by status SRNG processing.
  453. * @soc: core txrx main context
  454. * @mac_id: mac_id which is one of 3 mac_ids _ring
  455. *
  456. * Return: none
  457. */
  458. static inline void
  459. dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
  460. uint32_t quota)
  461. {
  462. struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
  463. struct hal_rx_ppdu_info *ppdu_info;
  464. qdf_nbuf_t status_nbuf;
  465. uint8_t *rx_tlv;
  466. uint8_t *rx_tlv_start;
  467. uint32_t tlv_status = HAL_TLV_STATUS_BUF_DONE;
  468. QDF_STATUS m_copy_status = QDF_STATUS_SUCCESS;
  469. struct cdp_pdev_mon_stats *rx_mon_stats;
  470. int smart_mesh_status;
  471. ppdu_info = &pdev->ppdu_info;
  472. rx_mon_stats = &pdev->rx_mon_stats;
  473. if (pdev->mon_ppdu_status != DP_PPDU_STATUS_START)
  474. return;
  475. while (!qdf_nbuf_is_queue_empty(&pdev->rx_status_q)) {
  476. status_nbuf = qdf_nbuf_queue_remove(&pdev->rx_status_q);
  477. rx_tlv = qdf_nbuf_data(status_nbuf);
  478. rx_tlv_start = rx_tlv;
  479. if ((pdev->monitor_vdev != NULL) || (pdev->enhanced_stats_en) ||
  480. pdev->mcopy_mode) {
  481. do {
  482. tlv_status = hal_rx_status_get_tlv_info(rx_tlv,
  483. ppdu_info, pdev->soc->hal_soc);
  484. dp_rx_mon_update_dbg_ppdu_stats(ppdu_info,
  485. rx_mon_stats);
  486. rx_tlv = hal_rx_status_get_next_tlv(rx_tlv);
  487. if ((rx_tlv - rx_tlv_start) >= RX_BUFFER_SIZE)
  488. break;
  489. } while (tlv_status == HAL_TLV_STATUS_PPDU_NOT_DONE);
  490. }
  491. if (pdev->dp_peer_based_pktlog) {
  492. dp_rx_process_peer_based_pktlog(soc, ppdu_info,
  493. status_nbuf, mac_id);
  494. } else {
  495. dp_wdi_event_handler(WDI_EVENT_RX_DESC, soc,
  496. status_nbuf, HTT_INVALID_PEER,
  497. WDI_NO_VAL, mac_id);
  498. }
  499. /* smart monitor vap and m_copy cannot co-exist */
  500. if (ppdu_info->rx_status.monitor_direct_used && pdev->neighbour_peers_added
  501. && pdev->monitor_vdev) {
  502. smart_mesh_status = dp_rx_handle_smart_mesh_mode(soc,
  503. pdev, ppdu_info, status_nbuf);
  504. if (smart_mesh_status)
  505. qdf_nbuf_free(status_nbuf);
  506. } else if (pdev->mcopy_mode) {
  507. m_copy_status = dp_rx_handle_mcopy_mode(soc,
  508. pdev, ppdu_info, status_nbuf);
  509. if (m_copy_status == QDF_STATUS_SUCCESS)
  510. qdf_nbuf_free(status_nbuf);
  511. } else {
  512. qdf_nbuf_free(status_nbuf);
  513. }
  514. if (tlv_status == HAL_TLV_STATUS_PPDU_NON_STD_DONE) {
  515. dp_rx_mon_deliver_non_std(soc, mac_id);
  516. } else if (tlv_status == HAL_TLV_STATUS_PPDU_DONE) {
  517. rx_mon_stats->status_ppdu_done++;
  518. if (pdev->enhanced_stats_en ||
  519. pdev->mcopy_mode || pdev->neighbour_peers_added)
  520. dp_rx_handle_ppdu_stats(soc, pdev, ppdu_info);
  521. pdev->mon_ppdu_status = DP_PPDU_STATUS_DONE;
  522. dp_rx_mon_dest_process(soc, mac_id, quota);
  523. pdev->mon_ppdu_status = DP_PPDU_STATUS_START;
  524. }
  525. }
  526. return;
  527. }
  528. /*
  529. * dp_rx_mon_status_srng_process() - Process monitor status ring
  530. * post the status ring buffer to Rx status Queue for later
  531. * processing when status ring is filled with status TLV.
  532. * Allocate a new buffer to status ring if the filled buffer
  533. * is posted.
  534. *
  535. * @soc: core txrx main context
  536. * @mac_id: mac_id which is one of 3 mac_ids
  537. * @quota: No. of ring entry that can be serviced in one shot.
  538. * Return: uint32_t: No. of ring entry that is processed.
  539. */
  540. static inline uint32_t
  541. dp_rx_mon_status_srng_process(struct dp_soc *soc, uint32_t mac_id,
  542. uint32_t quota)
  543. {
  544. struct dp_pdev *pdev = dp_get_pdev_for_mac_id(soc, mac_id);
  545. void *hal_soc;
  546. void *mon_status_srng;
  547. void *rxdma_mon_status_ring_entry;
  548. QDF_STATUS status;
  549. uint32_t work_done = 0;
  550. int mac_for_pdev = dp_get_mac_id_for_mac(soc, mac_id);
  551. mon_status_srng = pdev->rxdma_mon_status_ring[mac_for_pdev].hal_srng;
  552. qdf_assert(mon_status_srng);
  553. if (!mon_status_srng || !hal_srng_initialized(mon_status_srng)) {
  554. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
  555. "%s %d : HAL Monitor Status Ring Init Failed -- %pK",
  556. __func__, __LINE__, mon_status_srng);
  557. return work_done;
  558. }
  559. hal_soc = soc->hal_soc;
  560. qdf_assert(hal_soc);
  561. if (qdf_unlikely(hal_srng_access_start(hal_soc, mon_status_srng)))
  562. goto done;
  563. /* mon_status_ring_desc => WBM_BUFFER_RING STRUCT =>
  564. * BUFFER_ADDR_INFO STRUCT
  565. */
  566. while (qdf_likely((rxdma_mon_status_ring_entry =
  567. hal_srng_src_peek(hal_soc, mon_status_srng))
  568. && quota--)) {
  569. uint32_t rx_buf_cookie;
  570. qdf_nbuf_t status_nbuf;
  571. struct dp_rx_desc *rx_desc;
  572. uint8_t *status_buf;
  573. qdf_dma_addr_t paddr;
  574. uint64_t buf_addr;
  575. buf_addr =
  576. (HAL_RX_BUFFER_ADDR_31_0_GET(
  577. rxdma_mon_status_ring_entry) |
  578. ((uint64_t)(HAL_RX_BUFFER_ADDR_39_32_GET(
  579. rxdma_mon_status_ring_entry)) << 32));
  580. if (qdf_likely(buf_addr)) {
  581. rx_buf_cookie =
  582. HAL_RX_BUF_COOKIE_GET(
  583. rxdma_mon_status_ring_entry);
  584. rx_desc = dp_rx_cookie_2_va_mon_status(soc,
  585. rx_buf_cookie);
  586. qdf_assert(rx_desc);
  587. status_nbuf = rx_desc->nbuf;
  588. qdf_nbuf_sync_for_cpu(soc->osdev, status_nbuf,
  589. QDF_DMA_FROM_DEVICE);
  590. status_buf = qdf_nbuf_data(status_nbuf);
  591. status = hal_get_rx_status_done(status_buf);
  592. if (status != QDF_STATUS_SUCCESS) {
  593. uint32_t hp, tp;
  594. hal_get_sw_hptp(hal_soc, mon_status_srng,
  595. &tp, &hp);
  596. QDF_TRACE(QDF_MODULE_ID_DP,
  597. QDF_TRACE_LEVEL_ERROR,
  598. "[%s][%d] status not done - hp:%u, tp:%u",
  599. __func__, __LINE__, hp, tp);
  600. /* WAR for missing status: Skip status entry */
  601. hal_srng_src_get_next(hal_soc, mon_status_srng);
  602. continue;
  603. }
  604. qdf_nbuf_set_pktlen(status_nbuf, RX_BUFFER_SIZE);
  605. qdf_nbuf_unmap_single(soc->osdev, status_nbuf,
  606. QDF_DMA_FROM_DEVICE);
  607. /* Put the status_nbuf to queue */
  608. qdf_nbuf_queue_add(&pdev->rx_status_q, status_nbuf);
  609. } else {
  610. union dp_rx_desc_list_elem_t *desc_list = NULL;
  611. union dp_rx_desc_list_elem_t *tail = NULL;
  612. struct rx_desc_pool *rx_desc_pool;
  613. uint32_t num_alloc_desc;
  614. rx_desc_pool = &soc->rx_desc_status[mac_id];
  615. num_alloc_desc = dp_rx_get_free_desc_list(soc, mac_id,
  616. rx_desc_pool,
  617. 1,
  618. &desc_list,
  619. &tail);
  620. /*
  621. * No free descriptors available
  622. */
  623. if (qdf_unlikely(num_alloc_desc == 0)) {
  624. work_done++;
  625. break;
  626. }
  627. rx_desc = &desc_list->rx_desc;
  628. }
  629. status_nbuf = dp_rx_nbuf_prepare(soc, pdev);
  630. /*
  631. * qdf_nbuf alloc or map failed,
  632. * free the dp rx desc to free list,
  633. * fill in NULL dma address at current HP entry,
  634. * keep HP in mon_status_ring unchanged,
  635. * wait next time dp_rx_mon_status_srng_process
  636. * to fill in buffer at current HP.
  637. */
  638. if (qdf_unlikely(status_nbuf == NULL)) {
  639. union dp_rx_desc_list_elem_t *desc_list = NULL;
  640. union dp_rx_desc_list_elem_t *tail = NULL;
  641. struct rx_desc_pool *rx_desc_pool;
  642. rx_desc_pool = &soc->rx_desc_status[mac_id];
  643. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  644. "%s: fail to allocate or map qdf_nbuf",
  645. __func__);
  646. dp_rx_add_to_free_desc_list(&desc_list,
  647. &tail, rx_desc);
  648. dp_rx_add_desc_list_to_free_list(soc, &desc_list,
  649. &tail, mac_id, rx_desc_pool);
  650. hal_rxdma_buff_addr_info_set(
  651. rxdma_mon_status_ring_entry,
  652. 0, 0, HAL_RX_BUF_RBM_SW3_BM);
  653. work_done++;
  654. break;
  655. }
  656. paddr = qdf_nbuf_get_frag_paddr(status_nbuf, 0);
  657. rx_desc->nbuf = status_nbuf;
  658. rx_desc->in_use = 1;
  659. hal_rxdma_buff_addr_info_set(rxdma_mon_status_ring_entry,
  660. paddr, rx_desc->cookie, HAL_RX_BUF_RBM_SW3_BM);
  661. hal_srng_src_get_next(hal_soc, mon_status_srng);
  662. work_done++;
  663. }
  664. done:
  665. hal_srng_access_end(hal_soc, mon_status_srng);
  666. return work_done;
  667. }
  668. /*
  669. * dp_rx_mon_status_process() - Process monitor status ring and
  670. * TLV in status ring.
  671. *
  672. * @soc: core txrx main context
  673. * @mac_id: mac_id which is one of 3 mac_ids
  674. * @quota: No. of ring entry that can be serviced in one shot.
  675. * Return: uint32_t: No. of ring entry that is processed.
  676. */
  677. static inline uint32_t
  678. dp_rx_mon_status_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) {
  679. uint32_t work_done;
  680. work_done = dp_rx_mon_status_srng_process(soc, mac_id, quota);
  681. quota -= work_done;
  682. dp_rx_mon_status_process_tlv(soc, mac_id, quota);
  683. return work_done;
  684. }
  685. /**
  686. * dp_mon_process() - Main monitor mode processing roution.
  687. * This call monitor status ring process then monitor
  688. * destination ring process.
  689. * Called from the bottom half (tasklet/NET_RX_SOFTIRQ)
  690. * @soc: core txrx main context
  691. * @mac_id: mac_id which is one of 3 mac_ids
  692. * @quota: No. of status ring entry that can be serviced in one shot.
  693. * Return: uint32_t: No. of ring entry that is processed.
  694. */
  695. uint32_t
  696. dp_mon_process(struct dp_soc *soc, uint32_t mac_id, uint32_t quota) {
  697. return dp_rx_mon_status_process(soc, mac_id, quota);
  698. }
  699. /**
  700. * dp_rx_pdev_mon_status_detach() - detach dp rx for status ring
  701. * @pdev: core txrx pdev context
  702. * @mac_id: mac_id/pdev_id correspondinggly for MCL and WIN
  703. *
  704. * This function will detach DP RX status ring from
  705. * main device context. will free DP Rx resources for
  706. * status ring
  707. *
  708. * Return: QDF_STATUS_SUCCESS: success
  709. * QDF_STATUS_E_RESOURCES: Error return
  710. */
  711. QDF_STATUS
  712. dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id)
  713. {
  714. struct dp_soc *soc = pdev->soc;
  715. struct rx_desc_pool *rx_desc_pool;
  716. rx_desc_pool = &soc->rx_desc_status[mac_id];
  717. if (rx_desc_pool->pool_size != 0)
  718. dp_rx_desc_pool_free(soc, mac_id, rx_desc_pool);
  719. return QDF_STATUS_SUCCESS;
  720. }
  721. /*
  722. * dp_rx_buffers_replenish() - replenish monitor status ring with
  723. * rx nbufs called during dp rx
  724. * monitor status ring initialization
  725. *
  726. * @soc: core txrx main context
  727. * @mac_id: mac_id which is one of 3 mac_ids
  728. * @dp_rxdma_srng: dp monitor status circular ring
  729. * @rx_desc_pool; Pointer to Rx descriptor pool
  730. * @num_req_buffers: number of buffer to be replenished
  731. * @desc_list: list of descs if called from dp rx monitor status
  732. * process or NULL during dp rx initialization or
  733. * out of buffer interrupt
  734. * @tail: tail of descs list
  735. * @owner: who owns the nbuf (host, NSS etc...)
  736. * Return: return success or failure
  737. */
  738. static inline
  739. QDF_STATUS dp_rx_mon_status_buffers_replenish(struct dp_soc *dp_soc,
  740. uint32_t mac_id,
  741. struct dp_srng *dp_rxdma_srng,
  742. struct rx_desc_pool *rx_desc_pool,
  743. uint32_t num_req_buffers,
  744. union dp_rx_desc_list_elem_t **desc_list,
  745. union dp_rx_desc_list_elem_t **tail,
  746. uint8_t owner)
  747. {
  748. uint32_t num_alloc_desc;
  749. uint16_t num_desc_to_free = 0;
  750. uint32_t num_entries_avail;
  751. uint32_t count = 0;
  752. int sync_hw_ptr = 1;
  753. qdf_dma_addr_t paddr;
  754. qdf_nbuf_t rx_netbuf;
  755. void *rxdma_ring_entry;
  756. union dp_rx_desc_list_elem_t *next;
  757. void *rxdma_srng;
  758. struct dp_pdev *dp_pdev = dp_get_pdev_for_mac_id(dp_soc, mac_id);
  759. rxdma_srng = dp_rxdma_srng->hal_srng;
  760. qdf_assert(rxdma_srng);
  761. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
  762. "[%s][%d] requested %d buffers for replenish",
  763. __func__, __LINE__, num_req_buffers);
  764. /*
  765. * if desc_list is NULL, allocate the descs from freelist
  766. */
  767. if (!(*desc_list)) {
  768. num_alloc_desc = dp_rx_get_free_desc_list(dp_soc, mac_id,
  769. rx_desc_pool,
  770. num_req_buffers,
  771. desc_list,
  772. tail);
  773. if (!num_alloc_desc) {
  774. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  775. "[%s][%d] no free rx_descs in freelist",
  776. __func__, __LINE__);
  777. return QDF_STATUS_E_NOMEM;
  778. }
  779. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
  780. "[%s][%d] %d rx desc allocated", __func__, __LINE__,
  781. num_alloc_desc);
  782. num_req_buffers = num_alloc_desc;
  783. }
  784. hal_srng_access_start(dp_soc->hal_soc, rxdma_srng);
  785. num_entries_avail = hal_srng_src_num_avail(dp_soc->hal_soc,
  786. rxdma_srng, sync_hw_ptr);
  787. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
  788. "[%s][%d] no of available entries in rxdma ring: %d",
  789. __func__, __LINE__, num_entries_avail);
  790. if (num_entries_avail < num_req_buffers) {
  791. num_desc_to_free = num_req_buffers - num_entries_avail;
  792. num_req_buffers = num_entries_avail;
  793. }
  794. while (count < num_req_buffers) {
  795. rx_netbuf = dp_rx_nbuf_prepare(dp_soc, dp_pdev);
  796. /*
  797. * qdf_nbuf alloc or map failed,
  798. * keep HP in mon_status_ring unchanged,
  799. * wait dp_rx_mon_status_srng_process
  800. * to fill in buffer at current HP.
  801. */
  802. if (qdf_unlikely(rx_netbuf == NULL)) {
  803. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  804. "%s: qdf_nbuf allocate or map fail, count %d",
  805. __func__, count);
  806. break;
  807. }
  808. paddr = qdf_nbuf_get_frag_paddr(rx_netbuf, 0);
  809. next = (*desc_list)->next;
  810. rxdma_ring_entry = hal_srng_src_get_next(dp_soc->hal_soc,
  811. rxdma_srng);
  812. if (qdf_unlikely(rxdma_ring_entry == NULL)) {
  813. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  814. "[%s][%d] rxdma_ring_entry is NULL, count - %d",
  815. __func__, __LINE__, count);
  816. qdf_nbuf_unmap_single(dp_soc->osdev, rx_netbuf,
  817. QDF_DMA_BIDIRECTIONAL);
  818. qdf_nbuf_free(rx_netbuf);
  819. break;
  820. }
  821. (*desc_list)->rx_desc.nbuf = rx_netbuf;
  822. (*desc_list)->rx_desc.in_use = 1;
  823. count++;
  824. hal_rxdma_buff_addr_info_set(rxdma_ring_entry, paddr,
  825. (*desc_list)->rx_desc.cookie, owner);
  826. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
  827. "[%s][%d] rx_desc=%pK, cookie=%d, nbuf=%pK, \
  828. paddr=%pK",
  829. __func__, __LINE__, &(*desc_list)->rx_desc,
  830. (*desc_list)->rx_desc.cookie, rx_netbuf,
  831. (void *)paddr);
  832. *desc_list = next;
  833. }
  834. hal_srng_access_end(dp_soc->hal_soc, rxdma_srng);
  835. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
  836. "successfully replenished %d buffers", num_req_buffers);
  837. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
  838. "%d rx desc added back to free list", num_desc_to_free);
  839. /*
  840. * add any available free desc back to the free list
  841. */
  842. if (*desc_list) {
  843. dp_rx_add_desc_list_to_free_list(dp_soc, desc_list, tail,
  844. mac_id, rx_desc_pool);
  845. }
  846. return QDF_STATUS_SUCCESS;
  847. }
  848. /**
  849. * dp_rx_pdev_mon_status_attach() - attach DP RX monitor status ring
  850. * @pdev: core txrx pdev context
  851. * @ring_id: ring number
  852. * This function will attach a DP RX monitor status ring into pDEV
  853. * and replenish monitor status ring with buffer.
  854. *
  855. * Return: QDF_STATUS_SUCCESS: success
  856. * QDF_STATUS_E_RESOURCES: Error return
  857. */
  858. QDF_STATUS
  859. dp_rx_pdev_mon_status_attach(struct dp_pdev *pdev, int ring_id) {
  860. struct dp_soc *soc = pdev->soc;
  861. union dp_rx_desc_list_elem_t *desc_list = NULL;
  862. union dp_rx_desc_list_elem_t *tail = NULL;
  863. struct dp_srng *mon_status_ring;
  864. uint32_t num_entries;
  865. struct rx_desc_pool *rx_desc_pool;
  866. QDF_STATUS status;
  867. int mac_for_pdev = dp_get_mac_id_for_mac(soc, ring_id);
  868. mon_status_ring = &pdev->rxdma_mon_status_ring[mac_for_pdev];
  869. num_entries = mon_status_ring->num_entries;
  870. rx_desc_pool = &soc->rx_desc_status[ring_id];
  871. dp_info("Mon RX Status Pool[%d] entries=%d",
  872. ring_id, num_entries);
  873. status = dp_rx_desc_pool_alloc(soc, ring_id, num_entries + 1,
  874. rx_desc_pool);
  875. if (!QDF_IS_STATUS_SUCCESS(status))
  876. return status;
  877. dp_debug("Mon RX Status Buffers Replenish ring_id=%d", ring_id);
  878. status = dp_rx_mon_status_buffers_replenish(soc, ring_id,
  879. mon_status_ring,
  880. rx_desc_pool,
  881. num_entries,
  882. &desc_list, &tail,
  883. HAL_RX_BUF_RBM_SW3_BM);
  884. if (!QDF_IS_STATUS_SUCCESS(status))
  885. return status;
  886. qdf_nbuf_queue_init(&pdev->rx_status_q);
  887. pdev->mon_ppdu_status = DP_PPDU_STATUS_START;
  888. qdf_mem_zero(&(pdev->ppdu_info.rx_status),
  889. sizeof(pdev->ppdu_info.rx_status));
  890. qdf_mem_zero(&pdev->rx_mon_stats,
  891. sizeof(pdev->rx_mon_stats));
  892. dp_rx_mon_init_dbg_ppdu_stats(&pdev->ppdu_info,
  893. &pdev->rx_mon_stats);
  894. return QDF_STATUS_SUCCESS;
  895. }