dp_internal.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  1. /*
  2. * Copyright (c) 2016-2018 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. #ifndef _DP_INTERNAL_H_
  19. #define _DP_INTERNAL_H_
  20. #include "dp_types.h"
  21. #define RX_BUFFER_SIZE_PKTLOG_LITE 1024
  22. /* Macro For NYSM value received in VHT TLV */
  23. #define VHT_SGI_NYSM 3
  24. #if DP_PRINT_ENABLE
  25. #include <stdarg.h> /* va_list */
  26. #include <qdf_types.h> /* qdf_vprint */
  27. #include <cdp_txrx_handle.h>
  28. enum {
  29. /* FATAL_ERR - print only irrecoverable error messages */
  30. DP_PRINT_LEVEL_FATAL_ERR,
  31. /* ERR - include non-fatal err messages */
  32. DP_PRINT_LEVEL_ERR,
  33. /* WARN - include warnings */
  34. DP_PRINT_LEVEL_WARN,
  35. /* INFO1 - include fundamental, infrequent events */
  36. DP_PRINT_LEVEL_INFO1,
  37. /* INFO2 - include non-fundamental but infrequent events */
  38. DP_PRINT_LEVEL_INFO2,
  39. };
  40. #define dp_print(level, fmt, ...) do { \
  41. if (level <= g_txrx_print_level) \
  42. qdf_print(fmt, ## __VA_ARGS__); \
  43. while (0)
  44. #define DP_PRINT(level, fmt, ...) do { \
  45. dp_print(level, "DP: " fmt, ## __VA_ARGS__); \
  46. while (0)
  47. #else
  48. #define DP_PRINT(level, fmt, ...)
  49. #endif /* DP_PRINT_ENABLE */
  50. #define DP_TRACE(LVL, fmt, args ...) \
  51. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_##LVL, \
  52. fmt, ## args)
  53. #define DP_TRACE_STATS(LVL, fmt, args ...) \
  54. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_##LVL, \
  55. fmt, ## args)
  56. #define DP_PRINT_STATS(fmt, args ...) \
  57. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL, \
  58. fmt, ## args)
  59. #define DP_STATS_INIT(_handle) \
  60. qdf_mem_set(&((_handle)->stats), sizeof((_handle)->stats), 0x0)
  61. #define DP_STATS_CLR(_handle) \
  62. qdf_mem_set(&((_handle)->stats), sizeof((_handle)->stats), 0x0)
  63. #ifndef DISABLE_DP_STATS
  64. #define DP_STATS_INC(_handle, _field, _delta) \
  65. { \
  66. if (likely(_handle)) \
  67. _handle->stats._field += _delta; \
  68. }
  69. #define DP_STATS_INCC(_handle, _field, _delta, _cond) \
  70. { \
  71. if (_cond && likely(_handle)) \
  72. _handle->stats._field += _delta; \
  73. }
  74. #define DP_STATS_DEC(_handle, _field, _delta) \
  75. { \
  76. if (likely(_handle)) \
  77. _handle->stats._field -= _delta; \
  78. }
  79. #define DP_STATS_UPD(_handle, _field, _delta) \
  80. { \
  81. if (likely(_handle)) \
  82. _handle->stats._field = _delta; \
  83. }
  84. #define DP_STATS_INC_PKT(_handle, _field, _count, _bytes) \
  85. { \
  86. DP_STATS_INC(_handle, _field.num, _count); \
  87. DP_STATS_INC(_handle, _field.bytes, _bytes) \
  88. }
  89. #define DP_STATS_INCC_PKT(_handle, _field, _count, _bytes, _cond) \
  90. { \
  91. DP_STATS_INCC(_handle, _field.num, _count, _cond); \
  92. DP_STATS_INCC(_handle, _field.bytes, _bytes, _cond) \
  93. }
  94. #define DP_STATS_AGGR(_handle_a, _handle_b, _field) \
  95. { \
  96. _handle_a->stats._field += _handle_b->stats._field; \
  97. }
  98. #define DP_STATS_AGGR_PKT(_handle_a, _handle_b, _field) \
  99. { \
  100. DP_STATS_AGGR(_handle_a, _handle_b, _field.num); \
  101. DP_STATS_AGGR(_handle_a, _handle_b, _field.bytes);\
  102. }
  103. #define DP_STATS_UPD_STRUCT(_handle_a, _handle_b, _field) \
  104. { \
  105. _handle_a->stats._field = _handle_b->stats._field; \
  106. }
  107. #define DP_HIST_INIT() \
  108. uint32_t num_of_packets[MAX_PDEV_CNT] = {0};
  109. #define DP_HIST_PACKET_COUNT_INC(_pdev_id) \
  110. { \
  111. ++num_of_packets[_pdev_id]; \
  112. }
  113. #define DP_TX_HISTOGRAM_UPDATE(_pdev, _p_cntrs) \
  114. do { \
  115. if (_p_cntrs == 1) { \
  116. DP_STATS_INC(_pdev, \
  117. tx_comp_histogram.pkts_1, 1); \
  118. } else if (_p_cntrs > 1 && _p_cntrs <= 20) { \
  119. DP_STATS_INC(_pdev, \
  120. tx_comp_histogram.pkts_2_20, 1); \
  121. } else if (_p_cntrs > 20 && _p_cntrs <= 40) { \
  122. DP_STATS_INC(_pdev, \
  123. tx_comp_histogram.pkts_21_40, 1); \
  124. } else if (_p_cntrs > 40 && _p_cntrs <= 60) { \
  125. DP_STATS_INC(_pdev, \
  126. tx_comp_histogram.pkts_41_60, 1); \
  127. } else if (_p_cntrs > 60 && _p_cntrs <= 80) { \
  128. DP_STATS_INC(_pdev, \
  129. tx_comp_histogram.pkts_61_80, 1); \
  130. } else if (_p_cntrs > 80 && _p_cntrs <= 100) { \
  131. DP_STATS_INC(_pdev, \
  132. tx_comp_histogram.pkts_81_100, 1); \
  133. } else if (_p_cntrs > 100 && _p_cntrs <= 200) { \
  134. DP_STATS_INC(_pdev, \
  135. tx_comp_histogram.pkts_101_200, 1); \
  136. } else if (_p_cntrs > 200) { \
  137. DP_STATS_INC(_pdev, \
  138. tx_comp_histogram.pkts_201_plus, 1); \
  139. } \
  140. } while (0)
  141. #define DP_RX_HISTOGRAM_UPDATE(_pdev, _p_cntrs) \
  142. do { \
  143. if (_p_cntrs == 1) { \
  144. DP_STATS_INC(_pdev, \
  145. rx_ind_histogram.pkts_1, 1); \
  146. } else if (_p_cntrs > 1 && _p_cntrs <= 20) { \
  147. DP_STATS_INC(_pdev, \
  148. rx_ind_histogram.pkts_2_20, 1); \
  149. } else if (_p_cntrs > 20 && _p_cntrs <= 40) { \
  150. DP_STATS_INC(_pdev, \
  151. rx_ind_histogram.pkts_21_40, 1); \
  152. } else if (_p_cntrs > 40 && _p_cntrs <= 60) { \
  153. DP_STATS_INC(_pdev, \
  154. rx_ind_histogram.pkts_41_60, 1); \
  155. } else if (_p_cntrs > 60 && _p_cntrs <= 80) { \
  156. DP_STATS_INC(_pdev, \
  157. rx_ind_histogram.pkts_61_80, 1); \
  158. } else if (_p_cntrs > 80 && _p_cntrs <= 100) { \
  159. DP_STATS_INC(_pdev, \
  160. rx_ind_histogram.pkts_81_100, 1); \
  161. } else if (_p_cntrs > 100 && _p_cntrs <= 200) { \
  162. DP_STATS_INC(_pdev, \
  163. rx_ind_histogram.pkts_101_200, 1); \
  164. } else if (_p_cntrs > 200) { \
  165. DP_STATS_INC(_pdev, \
  166. rx_ind_histogram.pkts_201_plus, 1); \
  167. } \
  168. } while (0)
  169. #define DP_TX_HIST_STATS_PER_PDEV() \
  170. do { \
  171. uint8_t hist_stats = 0; \
  172. for (hist_stats = 0; hist_stats < soc->pdev_count; \
  173. hist_stats++) { \
  174. DP_TX_HISTOGRAM_UPDATE(soc->pdev_list[hist_stats], \
  175. num_of_packets[hist_stats]); \
  176. } \
  177. } while (0)
  178. #define DP_RX_HIST_STATS_PER_PDEV() \
  179. do { \
  180. uint8_t hist_stats = 0; \
  181. for (hist_stats = 0; hist_stats < soc->pdev_count; \
  182. hist_stats++) { \
  183. DP_RX_HISTOGRAM_UPDATE(soc->pdev_list[hist_stats], \
  184. num_of_packets[hist_stats]); \
  185. } \
  186. } while (0)
  187. #else
  188. #define DP_STATS_INC(_handle, _field, _delta)
  189. #define DP_STATS_INCC(_handle, _field, _delta, _cond)
  190. #define DP_STATS_DEC(_handle, _field, _delta)
  191. #define DP_STATS_UPD(_handle, _field, _delta)
  192. #define DP_STATS_INC_PKT(_handle, _field, _count, _bytes)
  193. #define DP_STATS_INCC_PKT(_handle, _field, _count, _bytes, _cond)
  194. #define DP_STATS_AGGR(_handle_a, _handle_b, _field)
  195. #define DP_STATS_AGGR_PKT(_handle_a, _handle_b, _field)
  196. #define DP_HIST_INIT()
  197. #define DP_HIST_PACKET_COUNT_INC(_pdev_id)
  198. #define DP_TX_HISTOGRAM_UPDATE(_pdev, _p_cntrs)
  199. #define DP_RX_HISTOGRAM_UPDATE(_pdev, _p_cntrs)
  200. #define DP_RX_HIST_STATS_PER_PDEV()
  201. #define DP_TX_HIST_STATS_PER_PDEV()
  202. #endif
  203. #define DP_HTT_T2H_HP_PIPE 5
  204. static inline void dp_update_pdev_stats(struct dp_pdev *tgtobj,
  205. struct cdp_vdev_stats *srcobj)
  206. {
  207. uint8_t i;
  208. uint8_t pream_type;
  209. for (pream_type = 0; pream_type < DOT11_MAX; pream_type++) {
  210. for (i = 0; i < MAX_MCS; i++) {
  211. tgtobj->stats.tx.pkt_type[pream_type].
  212. mcs_count[i] +=
  213. srcobj->tx.pkt_type[pream_type].
  214. mcs_count[i];
  215. tgtobj->stats.rx.pkt_type[pream_type].
  216. mcs_count[i] +=
  217. srcobj->rx.pkt_type[pream_type].
  218. mcs_count[i];
  219. }
  220. }
  221. for (i = 0; i < MAX_BW; i++) {
  222. tgtobj->stats.tx.bw[i] += srcobj->tx.bw[i];
  223. tgtobj->stats.rx.bw[i] += srcobj->rx.bw[i];
  224. }
  225. for (i = 0; i < SS_COUNT; i++) {
  226. tgtobj->stats.tx.nss[i] += srcobj->tx.nss[i];
  227. tgtobj->stats.rx.nss[i] += srcobj->rx.nss[i];
  228. }
  229. for (i = 0; i < WME_AC_MAX; i++) {
  230. tgtobj->stats.tx.wme_ac_type[i] +=
  231. srcobj->tx.wme_ac_type[i];
  232. tgtobj->stats.rx.wme_ac_type[i] +=
  233. srcobj->rx.wme_ac_type[i];
  234. tgtobj->stats.tx.excess_retries_per_ac[i] +=
  235. srcobj->tx.excess_retries_per_ac[i];
  236. }
  237. for (i = 0; i < MAX_GI; i++) {
  238. tgtobj->stats.tx.sgi_count[i] +=
  239. srcobj->tx.sgi_count[i];
  240. tgtobj->stats.rx.sgi_count[i] +=
  241. srcobj->rx.sgi_count[i];
  242. }
  243. for (i = 0; i < MAX_RECEPTION_TYPES; i++)
  244. tgtobj->stats.rx.reception_type[i] +=
  245. srcobj->rx.reception_type[i];
  246. tgtobj->stats.tx.comp_pkt.bytes += srcobj->tx.comp_pkt.bytes;
  247. tgtobj->stats.tx.comp_pkt.num += srcobj->tx.comp_pkt.num;
  248. tgtobj->stats.tx.ucast.num += srcobj->tx.ucast.num;
  249. tgtobj->stats.tx.ucast.bytes += srcobj->tx.ucast.bytes;
  250. tgtobj->stats.tx.mcast.num += srcobj->tx.mcast.num;
  251. tgtobj->stats.tx.mcast.bytes += srcobj->tx.mcast.bytes;
  252. tgtobj->stats.tx.bcast.num += srcobj->tx.bcast.num;
  253. tgtobj->stats.tx.bcast.bytes += srcobj->tx.bcast.bytes;
  254. tgtobj->stats.tx.tx_success.num += srcobj->tx.tx_success.num;
  255. tgtobj->stats.tx.tx_success.bytes +=
  256. srcobj->tx.tx_success.bytes;
  257. tgtobj->stats.tx.nawds_mcast.num +=
  258. srcobj->tx.nawds_mcast.num;
  259. tgtobj->stats.tx.nawds_mcast.bytes +=
  260. srcobj->tx.nawds_mcast.bytes;
  261. tgtobj->stats.tx.tx_failed += srcobj->tx.tx_failed;
  262. tgtobj->stats.tx.ofdma += srcobj->tx.ofdma;
  263. tgtobj->stats.tx.stbc += srcobj->tx.stbc;
  264. tgtobj->stats.tx.ldpc += srcobj->tx.ldpc;
  265. tgtobj->stats.tx.retries += srcobj->tx.retries;
  266. tgtobj->stats.tx.non_amsdu_cnt += srcobj->tx.non_amsdu_cnt;
  267. tgtobj->stats.tx.amsdu_cnt += srcobj->tx.amsdu_cnt;
  268. tgtobj->stats.tx.dropped.fw_rem += srcobj->tx.dropped.fw_rem;
  269. tgtobj->stats.tx.dropped.fw_rem_tx +=
  270. srcobj->tx.dropped.fw_rem_tx;
  271. tgtobj->stats.tx.dropped.fw_rem_notx +=
  272. srcobj->tx.dropped.fw_rem_notx;
  273. tgtobj->stats.tx.dropped.fw_reason1 +=
  274. srcobj->tx.dropped.fw_reason1;
  275. tgtobj->stats.tx.dropped.fw_reason2 +=
  276. srcobj->tx.dropped.fw_reason2;
  277. tgtobj->stats.tx.dropped.fw_reason3 +=
  278. srcobj->tx.dropped.fw_reason3;
  279. tgtobj->stats.tx.dropped.age_out += srcobj->tx.dropped.age_out;
  280. tgtobj->stats.rx.err.mic_err += srcobj->rx.err.mic_err;
  281. tgtobj->stats.rx.rssi = srcobj->rx.rssi;
  282. tgtobj->stats.rx.rx_rate = srcobj->rx.rx_rate;
  283. tgtobj->stats.rx.err.decrypt_err += srcobj->rx.err.decrypt_err;
  284. tgtobj->stats.rx.non_ampdu_cnt += srcobj->rx.non_ampdu_cnt;
  285. tgtobj->stats.rx.amsdu_cnt += srcobj->rx.ampdu_cnt;
  286. tgtobj->stats.rx.non_amsdu_cnt += srcobj->rx.non_amsdu_cnt;
  287. tgtobj->stats.rx.amsdu_cnt += srcobj->rx.amsdu_cnt;
  288. tgtobj->stats.rx.to_stack.num += srcobj->rx.to_stack.num;
  289. tgtobj->stats.rx.to_stack.bytes += srcobj->rx.to_stack.bytes;
  290. for (i = 0; i < CDP_MAX_RX_RINGS; i++) {
  291. tgtobj->stats.rx.rcvd_reo[i].num +=
  292. srcobj->rx.rcvd_reo[i].num;
  293. tgtobj->stats.rx.rcvd_reo[i].bytes +=
  294. srcobj->rx.rcvd_reo[i].bytes;
  295. }
  296. srcobj->rx.unicast.num =
  297. srcobj->rx.to_stack.num -
  298. (srcobj->rx.multicast.num +
  299. srcobj->rx.bcast.num);
  300. srcobj->rx.unicast.bytes =
  301. srcobj->rx.to_stack.bytes -
  302. (srcobj->rx.multicast.bytes +
  303. srcobj->rx.bcast.bytes);
  304. tgtobj->stats.rx.unicast.num += srcobj->rx.unicast.num;
  305. tgtobj->stats.rx.unicast.bytes += srcobj->rx.unicast.bytes;
  306. tgtobj->stats.rx.multicast.num += srcobj->rx.multicast.num;
  307. tgtobj->stats.rx.multicast.bytes += srcobj->rx.multicast.bytes;
  308. tgtobj->stats.rx.bcast.num += srcobj->rx.bcast.num;
  309. tgtobj->stats.rx.bcast.bytes += srcobj->rx.bcast.bytes;
  310. tgtobj->stats.rx.raw.num += srcobj->rx.raw.num;
  311. tgtobj->stats.rx.raw.bytes += srcobj->rx.raw.bytes;
  312. tgtobj->stats.rx.intra_bss.pkts.num +=
  313. srcobj->rx.intra_bss.pkts.num;
  314. tgtobj->stats.rx.intra_bss.pkts.bytes +=
  315. srcobj->rx.intra_bss.pkts.bytes;
  316. tgtobj->stats.rx.intra_bss.fail.num +=
  317. srcobj->rx.intra_bss.fail.num;
  318. tgtobj->stats.rx.intra_bss.fail.bytes +=
  319. srcobj->rx.intra_bss.fail.bytes;
  320. tgtobj->stats.tx.last_ack_rssi =
  321. srcobj->tx.last_ack_rssi;
  322. }
  323. static inline void dp_update_vdev_stats(struct cdp_vdev_stats *tgtobj,
  324. struct dp_peer *srcobj)
  325. {
  326. uint8_t i;
  327. uint8_t pream_type;
  328. for (pream_type = 0; pream_type < DOT11_MAX; pream_type++) {
  329. for (i = 0; i < MAX_MCS; i++) {
  330. tgtobj->tx.pkt_type[pream_type].
  331. mcs_count[i] +=
  332. srcobj->stats.tx.pkt_type[pream_type].
  333. mcs_count[i];
  334. tgtobj->rx.pkt_type[pream_type].
  335. mcs_count[i] +=
  336. srcobj->stats.rx.pkt_type[pream_type].
  337. mcs_count[i];
  338. }
  339. }
  340. for (i = 0; i < MAX_BW; i++) {
  341. tgtobj->tx.bw[i] += srcobj->stats.tx.bw[i];
  342. tgtobj->rx.bw[i] += srcobj->stats.rx.bw[i];
  343. }
  344. for (i = 0; i < SS_COUNT; i++) {
  345. tgtobj->tx.nss[i] += srcobj->stats.tx.nss[i];
  346. tgtobj->rx.nss[i] += srcobj->stats.rx.nss[i];
  347. }
  348. for (i = 0; i < WME_AC_MAX; i++) {
  349. tgtobj->tx.wme_ac_type[i] +=
  350. srcobj->stats.tx.wme_ac_type[i];
  351. tgtobj->rx.wme_ac_type[i] +=
  352. srcobj->stats.rx.wme_ac_type[i];
  353. tgtobj->tx.excess_retries_per_ac[i] +=
  354. srcobj->stats.tx.excess_retries_per_ac[i];
  355. }
  356. for (i = 0; i < MAX_GI; i++) {
  357. tgtobj->tx.sgi_count[i] +=
  358. srcobj->stats.tx.sgi_count[i];
  359. tgtobj->rx.sgi_count[i] +=
  360. srcobj->stats.rx.sgi_count[i];
  361. }
  362. for (i = 0; i < MAX_RECEPTION_TYPES; i++)
  363. tgtobj->rx.reception_type[i] +=
  364. srcobj->stats.rx.reception_type[i];
  365. tgtobj->tx.comp_pkt.bytes += srcobj->stats.tx.comp_pkt.bytes;
  366. tgtobj->tx.comp_pkt.num += srcobj->stats.tx.comp_pkt.num;
  367. tgtobj->tx.ucast.num += srcobj->stats.tx.ucast.num;
  368. tgtobj->tx.ucast.bytes += srcobj->stats.tx.ucast.bytes;
  369. tgtobj->tx.mcast.num += srcobj->stats.tx.mcast.num;
  370. tgtobj->tx.mcast.bytes += srcobj->stats.tx.mcast.bytes;
  371. tgtobj->tx.bcast.num += srcobj->stats.tx.bcast.num;
  372. tgtobj->tx.bcast.bytes += srcobj->stats.tx.bcast.bytes;
  373. tgtobj->tx.tx_success.num += srcobj->stats.tx.tx_success.num;
  374. tgtobj->tx.tx_success.bytes +=
  375. srcobj->stats.tx.tx_success.bytes;
  376. tgtobj->tx.nawds_mcast.num +=
  377. srcobj->stats.tx.nawds_mcast.num;
  378. tgtobj->tx.nawds_mcast.bytes +=
  379. srcobj->stats.tx.nawds_mcast.bytes;
  380. tgtobj->tx.tx_failed += srcobj->stats.tx.tx_failed;
  381. tgtobj->tx.ofdma += srcobj->stats.tx.ofdma;
  382. tgtobj->tx.stbc += srcobj->stats.tx.stbc;
  383. tgtobj->tx.ldpc += srcobj->stats.tx.ldpc;
  384. tgtobj->tx.retries += srcobj->stats.tx.retries;
  385. tgtobj->tx.non_amsdu_cnt += srcobj->stats.tx.non_amsdu_cnt;
  386. tgtobj->tx.amsdu_cnt += srcobj->stats.tx.amsdu_cnt;
  387. tgtobj->tx.dropped.fw_rem += srcobj->stats.tx.dropped.fw_rem;
  388. tgtobj->tx.dropped.fw_rem_tx +=
  389. srcobj->stats.tx.dropped.fw_rem_tx;
  390. tgtobj->tx.dropped.fw_rem_notx +=
  391. srcobj->stats.tx.dropped.fw_rem_notx;
  392. tgtobj->tx.dropped.fw_reason1 +=
  393. srcobj->stats.tx.dropped.fw_reason1;
  394. tgtobj->tx.dropped.fw_reason2 +=
  395. srcobj->stats.tx.dropped.fw_reason2;
  396. tgtobj->tx.dropped.fw_reason3 +=
  397. srcobj->stats.tx.dropped.fw_reason3;
  398. tgtobj->tx.dropped.age_out += srcobj->stats.tx.dropped.age_out;
  399. tgtobj->rx.err.mic_err += srcobj->stats.rx.err.mic_err;
  400. tgtobj->rx.rssi = srcobj->stats.rx.rssi;
  401. tgtobj->rx.rx_rate = srcobj->stats.rx.rx_rate;
  402. tgtobj->rx.err.decrypt_err += srcobj->stats.rx.err.decrypt_err;
  403. tgtobj->rx.non_ampdu_cnt += srcobj->stats.rx.non_ampdu_cnt;
  404. tgtobj->rx.amsdu_cnt += srcobj->stats.rx.ampdu_cnt;
  405. tgtobj->rx.non_amsdu_cnt += srcobj->stats.rx.non_amsdu_cnt;
  406. tgtobj->rx.amsdu_cnt += srcobj->stats.rx.amsdu_cnt;
  407. tgtobj->rx.to_stack.num += srcobj->stats.rx.to_stack.num;
  408. tgtobj->rx.to_stack.bytes += srcobj->stats.rx.to_stack.bytes;
  409. for (i = 0; i < CDP_MAX_RX_RINGS; i++) {
  410. tgtobj->rx.rcvd_reo[i].num +=
  411. srcobj->stats.rx.rcvd_reo[i].num;
  412. tgtobj->rx.rcvd_reo[i].bytes +=
  413. srcobj->stats.rx.rcvd_reo[i].bytes;
  414. }
  415. srcobj->stats.rx.unicast.num =
  416. srcobj->stats.rx.to_stack.num -
  417. srcobj->stats.rx.multicast.num;
  418. srcobj->stats.rx.unicast.bytes =
  419. srcobj->stats.rx.to_stack.bytes -
  420. srcobj->stats.rx.multicast.bytes;
  421. tgtobj->rx.unicast.num += srcobj->stats.rx.unicast.num;
  422. tgtobj->rx.unicast.bytes += srcobj->stats.rx.unicast.bytes;
  423. tgtobj->rx.multicast.num += srcobj->stats.rx.multicast.num;
  424. tgtobj->rx.multicast.bytes += srcobj->stats.rx.multicast.bytes;
  425. tgtobj->rx.bcast.num += srcobj->stats.rx.bcast.num;
  426. tgtobj->rx.bcast.bytes += srcobj->stats.rx.bcast.bytes;
  427. tgtobj->rx.raw.num += srcobj->stats.rx.raw.num;
  428. tgtobj->rx.raw.bytes += srcobj->stats.rx.raw.bytes;
  429. tgtobj->rx.intra_bss.pkts.num +=
  430. srcobj->stats.rx.intra_bss.pkts.num;
  431. tgtobj->rx.intra_bss.pkts.bytes +=
  432. srcobj->stats.rx.intra_bss.pkts.bytes;
  433. tgtobj->rx.intra_bss.fail.num +=
  434. srcobj->stats.rx.intra_bss.fail.num;
  435. tgtobj->rx.intra_bss.fail.bytes +=
  436. srcobj->stats.rx.intra_bss.fail.bytes;
  437. tgtobj->tx.last_ack_rssi =
  438. srcobj->stats.tx.last_ack_rssi;
  439. }
  440. #define DP_UPDATE_STATS(_tgtobj, _srcobj) \
  441. do { \
  442. uint8_t i; \
  443. uint8_t pream_type; \
  444. for (pream_type = 0; pream_type < DOT11_MAX; pream_type++) { \
  445. for (i = 0; i < MAX_MCS; i++) { \
  446. DP_STATS_AGGR(_tgtobj, _srcobj, \
  447. tx.pkt_type[pream_type].mcs_count[i]); \
  448. DP_STATS_AGGR(_tgtobj, _srcobj, \
  449. rx.pkt_type[pream_type].mcs_count[i]); \
  450. } \
  451. } \
  452. \
  453. for (i = 0; i < MAX_BW; i++) { \
  454. DP_STATS_AGGR(_tgtobj, _srcobj, tx.bw[i]); \
  455. DP_STATS_AGGR(_tgtobj, _srcobj, rx.bw[i]); \
  456. } \
  457. \
  458. for (i = 0; i < SS_COUNT; i++) { \
  459. DP_STATS_AGGR(_tgtobj, _srcobj, rx.nss[i]); \
  460. DP_STATS_AGGR(_tgtobj, _srcobj, tx.nss[i]); \
  461. } \
  462. for (i = 0; i < WME_AC_MAX; i++) { \
  463. DP_STATS_AGGR(_tgtobj, _srcobj, tx.wme_ac_type[i]); \
  464. DP_STATS_AGGR(_tgtobj, _srcobj, rx.wme_ac_type[i]); \
  465. DP_STATS_AGGR(_tgtobj, _srcobj, tx.excess_retries_per_ac[i]); \
  466. \
  467. } \
  468. \
  469. for (i = 0; i < MAX_GI; i++) { \
  470. DP_STATS_AGGR(_tgtobj, _srcobj, tx.sgi_count[i]); \
  471. DP_STATS_AGGR(_tgtobj, _srcobj, rx.sgi_count[i]); \
  472. } \
  473. \
  474. for (i = 0; i < MAX_RECEPTION_TYPES; i++) \
  475. DP_STATS_AGGR(_tgtobj, _srcobj, rx.reception_type[i]); \
  476. \
  477. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, tx.comp_pkt); \
  478. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, tx.ucast); \
  479. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, tx.mcast); \
  480. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, tx.bcast); \
  481. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, tx.tx_success); \
  482. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, tx.nawds_mcast); \
  483. DP_STATS_AGGR(_tgtobj, _srcobj, tx.nawds_mcast_drop); \
  484. DP_STATS_AGGR(_tgtobj, _srcobj, tx.tx_failed); \
  485. DP_STATS_AGGR(_tgtobj, _srcobj, tx.ofdma); \
  486. DP_STATS_AGGR(_tgtobj, _srcobj, tx.stbc); \
  487. DP_STATS_AGGR(_tgtobj, _srcobj, tx.ldpc); \
  488. DP_STATS_AGGR(_tgtobj, _srcobj, tx.retries); \
  489. DP_STATS_AGGR(_tgtobj, _srcobj, tx.non_amsdu_cnt); \
  490. DP_STATS_AGGR(_tgtobj, _srcobj, tx.amsdu_cnt); \
  491. DP_STATS_AGGR(_tgtobj, _srcobj, tx.dropped.fw_rem); \
  492. DP_STATS_AGGR(_tgtobj, _srcobj, tx.dropped.fw_rem_tx); \
  493. DP_STATS_AGGR(_tgtobj, _srcobj, tx.dropped.fw_rem_notx); \
  494. DP_STATS_AGGR(_tgtobj, _srcobj, tx.dropped.fw_reason1); \
  495. DP_STATS_AGGR(_tgtobj, _srcobj, tx.dropped.fw_reason2); \
  496. DP_STATS_AGGR(_tgtobj, _srcobj, tx.dropped.fw_reason3); \
  497. DP_STATS_AGGR(_tgtobj, _srcobj, tx.dropped.age_out); \
  498. \
  499. DP_STATS_AGGR(_tgtobj, _srcobj, rx.err.mic_err); \
  500. DP_STATS_UPD_STRUCT(_tgtobj, _srcobj, rx.rssi); \
  501. DP_STATS_UPD_STRUCT(_tgtobj, _srcobj, rx.rx_rate); \
  502. DP_STATS_AGGR(_tgtobj, _srcobj, rx.err.decrypt_err); \
  503. DP_STATS_AGGR(_tgtobj, _srcobj, rx.non_ampdu_cnt); \
  504. DP_STATS_AGGR(_tgtobj, _srcobj, rx.ampdu_cnt); \
  505. DP_STATS_AGGR(_tgtobj, _srcobj, rx.non_amsdu_cnt); \
  506. DP_STATS_AGGR(_tgtobj, _srcobj, rx.amsdu_cnt); \
  507. DP_STATS_AGGR(_tgtobj, _srcobj, rx.nawds_mcast_drop); \
  508. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.to_stack); \
  509. \
  510. for (i = 0; i < CDP_MAX_RX_RINGS; i++) \
  511. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.rcvd_reo[i]); \
  512. \
  513. _srcobj->stats.rx.unicast.num = \
  514. _srcobj->stats.rx.to_stack.num - \
  515. _srcobj->stats.rx.multicast.num; \
  516. _srcobj->stats.rx.unicast.bytes = \
  517. _srcobj->stats.rx.to_stack.bytes - \
  518. _srcobj->stats.rx.multicast.bytes; \
  519. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.unicast); \
  520. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.multicast); \
  521. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.bcast); \
  522. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.raw); \
  523. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.intra_bss.pkts); \
  524. DP_STATS_AGGR_PKT(_tgtobj, _srcobj, rx.intra_bss.fail); \
  525. \
  526. _tgtobj->stats.tx.last_ack_rssi = \
  527. _srcobj->stats.tx.last_ack_rssi; \
  528. } while (0)
  529. extern int dp_peer_find_attach(struct dp_soc *soc);
  530. extern void dp_peer_find_detach(struct dp_soc *soc);
  531. extern void dp_peer_find_hash_add(struct dp_soc *soc, struct dp_peer *peer);
  532. extern void dp_peer_find_hash_remove(struct dp_soc *soc, struct dp_peer *peer);
  533. extern void dp_peer_find_hash_erase(struct dp_soc *soc);
  534. extern void dp_peer_rx_init(struct dp_pdev *pdev, struct dp_peer *peer);
  535. extern void dp_peer_cleanup(struct dp_vdev *vdev, struct dp_peer *peer);
  536. extern void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer);
  537. extern void dp_peer_unref_delete(void *peer_handle);
  538. extern void dp_rx_discard(struct dp_vdev *vdev, struct dp_peer *peer,
  539. unsigned tid, qdf_nbuf_t msdu_list);
  540. extern void *dp_find_peer_by_addr(struct cdp_pdev *dev,
  541. uint8_t *peer_mac_addr, uint8_t *peer_id);
  542. extern struct dp_peer *dp_peer_find_hash_find(struct dp_soc *soc,
  543. uint8_t *peer_mac_addr, int mac_addr_is_aligned, uint8_t vdev_id);
  544. #ifndef CONFIG_WIN
  545. QDF_STATUS dp_register_peer(struct cdp_pdev *pdev_handle,
  546. struct ol_txrx_desc_type *sta_desc);
  547. QDF_STATUS dp_clear_peer(struct cdp_pdev *pdev_handle, uint8_t local_id);
  548. void *dp_find_peer_by_addr_and_vdev(struct cdp_pdev *pdev_handle,
  549. struct cdp_vdev *vdev,
  550. uint8_t *peer_addr, uint8_t *local_id);
  551. uint16_t dp_local_peer_id(void *peer);
  552. void *dp_peer_find_by_local_id(struct cdp_pdev *pdev_handle, uint8_t local_id);
  553. QDF_STATUS dp_peer_state_update(struct cdp_pdev *pdev_handle, uint8_t *peer_mac,
  554. enum ol_txrx_peer_state state);
  555. QDF_STATUS dp_get_vdevid(void *peer_handle, uint8_t *vdev_id);
  556. struct cdp_vdev *dp_get_vdev_by_sta_id(struct cdp_pdev *pdev_handle,
  557. uint8_t sta_id);
  558. struct cdp_vdev *dp_get_vdev_for_peer(void *peer);
  559. uint8_t *dp_peer_get_peer_mac_addr(void *peer);
  560. int dp_get_peer_state(void *peer_handle);
  561. void dp_local_peer_id_pool_init(struct dp_pdev *pdev);
  562. void dp_local_peer_id_alloc(struct dp_pdev *pdev, struct dp_peer *peer);
  563. void dp_local_peer_id_free(struct dp_pdev *pdev, struct dp_peer *peer);
  564. #else
  565. static inline void dp_local_peer_id_pool_init(struct dp_pdev *pdev)
  566. {
  567. }
  568. static inline
  569. void dp_local_peer_id_alloc(struct dp_pdev *pdev, struct dp_peer *peer)
  570. {
  571. }
  572. static inline
  573. void dp_local_peer_id_free(struct dp_pdev *pdev, struct dp_peer *peer)
  574. {
  575. }
  576. #endif
  577. int dp_addba_resp_tx_completion_wifi3(void *peer_handle, uint8_t tid,
  578. int status);
  579. extern int dp_addba_requestprocess_wifi3(void *peer_handle,
  580. uint8_t dialogtoken, uint16_t tid, uint16_t batimeout,
  581. uint16_t buffersize, uint16_t startseqnum);
  582. extern void dp_addba_responsesetup_wifi3(void *peer_handle, uint8_t tid,
  583. uint8_t *dialogtoken, uint16_t *statuscode,
  584. uint16_t *buffersize, uint16_t *batimeout);
  585. extern void dp_set_addba_response(void *peer_handle, uint8_t tid,
  586. uint16_t statuscode);
  587. extern int dp_delba_process_wifi3(void *peer_handle,
  588. int tid, uint16_t reasoncode);
  589. /*
  590. * dp_delba_tx_completion_wifi3() - Handle delba tx completion
  591. *
  592. * @peer_handle: Peer handle
  593. * @tid: Tid number
  594. * @status: Tx completion status
  595. * Indicate status of delba Tx to DP for stats update and retry
  596. * delba if tx failed.
  597. *
  598. */
  599. int dp_delba_tx_completion_wifi3(void *peer_handle, uint8_t tid,
  600. int status);
  601. extern int dp_rx_tid_setup_wifi3(struct dp_peer *peer, int tid,
  602. uint32_t ba_window_size, uint32_t start_seq);
  603. extern QDF_STATUS dp_reo_send_cmd(struct dp_soc *soc,
  604. enum hal_reo_cmd_type type, struct hal_reo_cmd_params *params,
  605. void (*callback_fn), void *data);
  606. extern void dp_reo_cmdlist_destroy(struct dp_soc *soc);
  607. extern void dp_reo_status_ring_handler(struct dp_soc *soc);
  608. void dp_aggregate_vdev_stats(struct dp_vdev *vdev,
  609. struct cdp_vdev_stats *vdev_stats);
  610. void dp_rx_tid_stats_cb(struct dp_soc *soc, void *cb_ctxt,
  611. union hal_reo_status *reo_status);
  612. void dp_rx_bar_stats_cb(struct dp_soc *soc, void *cb_ctxt,
  613. union hal_reo_status *reo_status);
  614. uint16_t dp_tx_me_send_convert_ucast(struct cdp_vdev *vdev_handle,
  615. qdf_nbuf_t nbuf, uint8_t newmac[][DP_MAC_ADDR_LEN],
  616. uint8_t new_mac_cnt);
  617. void dp_tx_me_alloc_descriptor(struct cdp_pdev *pdev);
  618. void dp_tx_me_free_descriptor(struct cdp_pdev *pdev);
  619. QDF_STATUS dp_h2t_ext_stats_msg_send(struct dp_pdev *pdev,
  620. uint32_t stats_type_upload_mask, uint32_t config_param_0,
  621. uint32_t config_param_1, uint32_t config_param_2,
  622. uint32_t config_param_3, int cookie, int cookie_msb,
  623. uint8_t mac_id);
  624. void dp_htt_stats_print_tag(uint8_t tag_type, uint32_t *tag_buf);
  625. void dp_htt_stats_copy_tag(struct dp_pdev *pdev, uint8_t tag_type, uint32_t *tag_buf);
  626. void dp_peer_rxtid_stats(struct dp_peer *peer, void (*callback_fn),
  627. void *cb_ctxt);
  628. void dp_set_pn_check_wifi3(struct cdp_vdev *vdev_handle,
  629. struct cdp_peer *peer_handle, enum cdp_sec_type sec_type,
  630. uint32_t *rx_pn);
  631. void *dp_get_pdev_for_mac_id(struct dp_soc *soc, uint32_t mac_id);
  632. void dp_mark_peer_inact(void *peer_handle, bool inactive);
  633. bool dp_set_inact_params(struct cdp_pdev *pdev_handle,
  634. u_int16_t inact_check_interval,
  635. u_int16_t inact_normal, u_int16_t inact_overload);
  636. bool dp_start_inact_timer(struct cdp_pdev *pdev_handle, bool enable);
  637. void dp_set_overload(struct cdp_pdev *pdev_handle, bool overload);
  638. bool dp_peer_is_inact(void *peer_handle);
  639. void dp_init_inact_timer(struct dp_soc *soc);
  640. void dp_free_inact_timer(struct dp_soc *soc);
  641. void dp_set_michael_key(struct cdp_peer *peer_handle,
  642. bool is_unicast, uint32_t *key);
  643. /*
  644. * dp_get_mac_id_for_pdev() - Return mac corresponding to pdev for mac
  645. *
  646. * @mac_id: MAC id
  647. * @pdev_id: pdev_id corresponding to pdev, 0 for MCL
  648. *
  649. * Single pdev using both MACs will operate on both MAC rings,
  650. * which is the case for MCL.
  651. * For WIN each PDEV will operate one ring, so index is zero.
  652. *
  653. */
  654. static inline int dp_get_mac_id_for_pdev(uint32_t mac_id, uint32_t pdev_id)
  655. {
  656. if (mac_id && pdev_id) {
  657. qdf_print("Both mac_id and pdev_id cannot be non zero");
  658. QDF_BUG(0);
  659. return 0;
  660. }
  661. return (mac_id + pdev_id);
  662. }
  663. /*
  664. * dp_get_mac_id_for_mac() - Return mac corresponding WIN and MCL mac_ids
  665. *
  666. * @soc: handle to DP soc
  667. * @mac_id: MAC id
  668. *
  669. * Single pdev using both MACs will operate on both MAC rings,
  670. * which is the case for MCL.
  671. * For WIN each PDEV will operate one ring, so index is zero.
  672. *
  673. */
  674. static inline int dp_get_mac_id_for_mac(struct dp_soc *soc, uint32_t mac_id)
  675. {
  676. /*
  677. * Single pdev using both MACs will operate on both MAC rings,
  678. * which is the case for MCL.
  679. */
  680. if (!wlan_cfg_per_pdev_lmac_ring(soc->wlan_cfg_ctx))
  681. return mac_id;
  682. /* For WIN each PDEV will operate one ring, so index is zero. */
  683. return 0;
  684. }
  685. #ifdef WDI_EVENT_ENABLE
  686. QDF_STATUS dp_h2t_cfg_stats_msg_send(struct dp_pdev *pdev,
  687. uint32_t stats_type_upload_mask,
  688. uint8_t mac_id);
  689. int dp_wdi_event_unsub(struct cdp_pdev *txrx_pdev_handle,
  690. void *event_cb_sub_handle,
  691. uint32_t event);
  692. int dp_wdi_event_sub(struct cdp_pdev *txrx_pdev_handle,
  693. void *event_cb_sub_handle,
  694. uint32_t event);
  695. void dp_wdi_event_handler(enum WDI_EVENT event, void *soc,
  696. void *data, u_int16_t peer_id,
  697. int status, u_int8_t pdev_id);
  698. int dp_wdi_event_attach(struct dp_pdev *txrx_pdev);
  699. int dp_wdi_event_detach(struct dp_pdev *txrx_pdev);
  700. int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
  701. bool enable);
  702. void *dp_get_pldev(struct cdp_pdev *txrx_pdev);
  703. void dp_pkt_log_init(struct cdp_pdev *ppdev, void *scn);
  704. static inline void dp_hif_update_pipe_callback(void *soc, void *cb_context,
  705. QDF_STATUS (*callback)(void *, qdf_nbuf_t, uint8_t), uint8_t pipe_id)
  706. {
  707. struct hif_msg_callbacks hif_pipe_callbacks;
  708. struct dp_soc *dp_soc = (struct dp_soc *)soc;
  709. /* TODO: Temporary change to bypass HTC connection for this new
  710. * HIF pipe, which will be used for packet log and other high-
  711. * priority HTT messages. Proper HTC connection to be added
  712. * later once required FW changes are available
  713. */
  714. hif_pipe_callbacks.rxCompletionHandler = callback;
  715. hif_pipe_callbacks.Context = cb_context;
  716. hif_update_pipe_callback(dp_soc->hif_handle,
  717. DP_HTT_T2H_HP_PIPE, &hif_pipe_callbacks);
  718. }
  719. QDF_STATUS dp_peer_stats_notify(struct dp_peer *peer);
  720. #else
  721. static inline int dp_wdi_event_unsub(struct cdp_pdev *txrx_pdev_handle,
  722. void *event_cb_sub_handle,
  723. uint32_t event)
  724. {
  725. return 0;
  726. }
  727. static inline int dp_wdi_event_sub(struct cdp_pdev *txrx_pdev_handle,
  728. void *event_cb_sub_handle,
  729. uint32_t event)
  730. {
  731. return 0;
  732. }
  733. static inline void dp_wdi_event_handler(enum WDI_EVENT event, void *soc,
  734. void *data, u_int16_t peer_id,
  735. int status, u_int8_t pdev_id)
  736. {
  737. }
  738. static inline int dp_wdi_event_attach(struct dp_pdev *txrx_pdev)
  739. {
  740. return 0;
  741. }
  742. static inline int dp_wdi_event_detach(struct dp_pdev *txrx_pdev)
  743. {
  744. return 0;
  745. }
  746. static inline int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
  747. bool enable)
  748. {
  749. return 0;
  750. }
  751. static inline QDF_STATUS dp_h2t_cfg_stats_msg_send(struct dp_pdev *pdev,
  752. uint32_t stats_type_upload_mask, uint8_t mac_id)
  753. {
  754. return 0;
  755. }
  756. static inline void dp_hif_update_pipe_callback(void *soc, void *cb_context,
  757. QDF_STATUS (*callback)(void *, qdf_nbuf_t, uint8_t), uint8_t pipe_id)
  758. {
  759. }
  760. static inline QDF_STATUS dp_peer_stats_notify(struct dp_peer *peer)
  761. {
  762. return QDF_STATUS_SUCCESS;
  763. }
  764. #endif /* CONFIG_WIN */
  765. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  766. void dp_tx_dump_flow_pool_info(void *soc);
  767. int dp_tx_delete_flow_pool(struct dp_soc *soc, struct dp_tx_desc_pool_s *pool,
  768. bool force);
  769. #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
  770. #ifdef PEER_PROTECTED_ACCESS
  771. /**
  772. * dp_peer_unref_del_find_by_id() - dec ref and del peer if ref count is
  773. * taken by dp_peer_find_by_id
  774. * @peer: peer context
  775. *
  776. * Return: none
  777. */
  778. static inline void dp_peer_unref_del_find_by_id(struct dp_peer *peer)
  779. {
  780. dp_peer_unref_delete(peer);
  781. }
  782. #else
  783. static inline void dp_peer_unref_del_find_by_id(struct dp_peer *peer)
  784. {
  785. }
  786. #endif
  787. #endif /* #ifndef _DP_INTERNAL_H_ */