cdp_txrx_cmn_struct.h 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494
  1. /*
  2. * Copyright (c) 2011-2021 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. /**
  19. * @file cdp_txrx_cmn_struct.h
  20. * @brief Define the host data path converged API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_CMN_STRUCT_H_
  24. #define _CDP_TXRX_CMN_STRUCT_H_
  25. /**
  26. * For WIN legacy header compilation
  27. * Temporary add dummy definitions
  28. * should be removed properly WIN legacy code handle
  29. */
  30. #include "htc_api.h"
  31. #include "qdf_types.h"
  32. #include "qdf_nbuf.h"
  33. #include "qdf_atomic.h"
  34. #ifdef DP_MOB_DEFS
  35. #include <cdp_txrx_mob_def.h>
  36. #endif
  37. #include <cdp_txrx_handle.h>
  38. #include <cdp_txrx_stats_struct.h>
  39. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  40. #include "cdp_txrx_extd_struct.h"
  41. #endif
  42. #ifdef WLAN_MAX_CLIENTS_ALLOWED
  43. #define OL_TXRX_NUM_LOCAL_PEER_IDS (WLAN_MAX_CLIENTS_ALLOWED + 1 + 1 + 1)
  44. #endif
  45. #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
  46. /*
  47. * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode.
  48. * Clients will be assigned max 32 IDs.
  49. * STA(associated)/P2P DEV(self-PEER) will get one ID.
  50. */
  51. #define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1)
  52. #endif
  53. #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
  54. #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
  55. #define CDP_RSSI_CHAIN_LEN 8
  56. #define OL_TXRX_INVALID_PDEV_ID 0xff
  57. #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
  58. #define CDP_INVALID_VDEV_ID 0xff
  59. /* Options for Dump Statistics */
  60. #define CDP_HDD_STATS 0
  61. #define CDP_TXRX_PATH_STATS 1
  62. #define CDP_TXRX_HIST_STATS 2
  63. #define CDP_TXRX_TSO_STATS 3
  64. #define CDP_HDD_NETIF_OPER_HISTORY 4
  65. #define CDP_DUMP_TX_FLOW_POOL_INFO 5
  66. #define CDP_TXRX_DESC_STATS 6
  67. #define CDP_HIF_STATS 7
  68. #define CDP_LRO_STATS 8
  69. #define CDP_NAPI_STATS 9
  70. #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
  71. #define CDP_RX_RING_STATS 11
  72. #define CDP_DP_NAPI_STATS 12
  73. #define CDP_DP_RX_THREAD_STATS 13
  74. #define CDP_SCHEDULER_STATS 21
  75. #define CDP_TX_QUEUE_STATS 22
  76. #define CDP_BUNDLE_STATS 23
  77. #define CDP_CREDIT_STATS 24
  78. #define CDP_DISCONNECT_STATS 25
  79. #define CDP_DP_RX_FISA_STATS 26
  80. #define CDP_DP_SWLM_STATS 27
  81. #define WME_AC_TO_TID(_ac) ( \
  82. ((_ac) == WME_AC_VO) ? 6 : \
  83. ((_ac) == WME_AC_VI) ? 5 : \
  84. ((_ac) == WME_AC_BK) ? 1 : \
  85. 0)
  86. #define TID_TO_WME_AC(_tid) ( \
  87. (((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
  88. (((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
  89. (((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
  90. WME_AC_VO)
  91. #define CDP_MU_MAX_USERS 37
  92. #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
  93. #define CDP_INVALID_PEER 0xffff
  94. #define CDP_INVALID_TID 31
  95. #define CDP_INVALID_TX_ENCAP_TYPE 6
  96. #define CDP_INVALID_SEC_TYPE 12
  97. #define CDP_DATA_TID_MAX 8
  98. #define CDP_DATA_NON_QOS_TID 16
  99. #define CDP_NUM_SA_BW 4
  100. #define CDP_PERCENT_MACRO 100
  101. #define CDP_NUM_KB_IN_MB 1000
  102. /*
  103. * advance rx monitor filter
  104. * */
  105. #define MON_FILTER_PASS 0x0001
  106. #define MON_FILTER_OTHER 0x0002
  107. #define MON_FILTER_ALL 0x0003
  108. #define FILTER_MGMT_ALL 0xFFFF
  109. #define FILTER_MGMT_ASSOC_REQ 0x0001
  110. #define FILTER_MGMT_ASSOC_RES 0x0002
  111. #define FILTER_MGMT_REASSOC_REQ 0x0004
  112. #define FILTER_MGMT_REASSOC_RES 0x0008
  113. #define FILTER_MGMT_PROBE_REQ 0x0010
  114. #define FILTER_MGMT_PROBE_RES 0x0020
  115. #define FILTER_MGMT_TIM_ADVT 0x0040
  116. #define FILTER_MGMT_RESERVED_7 0x0080
  117. #define FILTER_MGMT_BEACON 0x0100
  118. #define FILTER_MGMT_ATIM 0x0200
  119. #define FILTER_MGMT_DISASSOC 0x0400
  120. #define FILTER_MGMT_AUTH 0x0800
  121. #define FILTER_MGMT_DEAUTH 0x1000
  122. #define FILTER_MGMT_ACTION 0x2000
  123. #define FILTER_MGMT_ACT_NO_ACK 0x4000
  124. #define FILTER_MGMT_RESERVED_15 0x8000
  125. #define FILTER_CTRL_ALL 0xFFFF
  126. #define FILTER_CTRL_RESERVED_1 0x0001
  127. #define FILTER_CTRL_RESERVED_2 0x0002
  128. #define FILTER_CTRL_TRIGGER 0x0004
  129. #define FILTER_CTRL_RESERVED_4 0x0008
  130. #define FILTER_CTRL_BF_REP_POLL 0x0010
  131. #define FILTER_CTRL_VHT_NDP 0x0020
  132. #define FILTER_CTRL_FRAME_EXT 0x0040
  133. #define FILTER_CTRL_CTRLWRAP 0x0080
  134. #define FILTER_CTRL_BA_REQ 0x0100
  135. #define FILTER_CTRL_BA 0x0200
  136. #define FILTER_CTRL_PSPOLL 0x0400
  137. #define FILTER_CTRL_RTS 0x0800
  138. #define FILTER_CTRL_CTS 0x1000
  139. #define FILTER_CTRL_ACK 0x2000
  140. #define FILTER_CTRL_CFEND 0x4000
  141. #define FILTER_CTRL_CFEND_CFACK 0x8000
  142. #define FILTER_DATA_ALL 0xFFFF
  143. #define FILTER_DATA_MCAST 0x4000
  144. #define FILTER_DATA_UCAST 0x8000
  145. #define FILTER_DATA_DATA 0x0001
  146. #define FILTER_DATA_NULL 0x0008
  147. /*
  148. * Multiply rate by 2 to avoid float point
  149. * and get rate in units of 500kbps
  150. */
  151. #define CDP_11B_RATE_0MCS (11 * 2)
  152. #define CDP_11B_RATE_1MCS (5.5 * 2)
  153. #define CDP_11B_RATE_2MCS (2 * 2)
  154. #define CDP_11B_RATE_3MCS (1 * 2)
  155. #define CDP_11B_RATE_4MCS (11 * 2)
  156. #define CDP_11B_RATE_5MCS (5.5 * 2)
  157. #define CDP_11B_RATE_6MCS (2 * 2)
  158. #define CDP_11A_RATE_0MCS (48 * 2)
  159. #define CDP_11A_RATE_1MCS (24 * 2)
  160. #define CDP_11A_RATE_2MCS (12 * 2)
  161. #define CDP_11A_RATE_3MCS (6 * 2)
  162. #define CDP_11A_RATE_4MCS (54 * 2)
  163. #define CDP_11A_RATE_5MCS (36 * 2)
  164. #define CDP_11A_RATE_6MCS (18 * 2)
  165. #define CDP_11A_RATE_7MCS (9 * 2)
  166. #define CDP_LEGACY_MCS0 0
  167. #define CDP_LEGACY_MCS1 1
  168. #define CDP_LEGACY_MCS2 2
  169. #define CDP_LEGACY_MCS3 3
  170. #define CDP_LEGACY_MCS4 4
  171. #define CDP_LEGACY_MCS5 5
  172. #define CDP_LEGACY_MCS6 6
  173. #define CDP_LEGACY_MCS7 7
  174. QDF_DECLARE_EWMA(tx_lag, 1024, 8)
  175. struct cdp_stats_cookie;
  176. /*
  177. * DP configuration parameters
  178. */
  179. enum cdp_cfg_param_type {
  180. CDP_CFG_MAX_PEER_ID,
  181. CDP_CFG_CCE_DISABLE,
  182. CDP_CFG_NUM_PARAMS
  183. };
  184. /*
  185. * PPDU TYPE from FW -
  186. * @CDP_PPDU_STATS_PPDU_TYPE_SU: single user type
  187. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO: multi user mu-mimo
  188. * @CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA: multi user ofdma
  189. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA: multi user mu-mimo ofdma
  190. * @CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG: ul trigger ppdu
  191. * @CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN: burst beacon
  192. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP: bsr respond
  193. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG: bsr trigger
  194. * @CDP_PPDU_STATS_PPDU_TYPE_UL_RESP: ul response
  195. * @CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN
  196. */
  197. enum CDP_PPDU_STATS_PPDU_TYPE {
  198. CDP_PPDU_STATS_PPDU_TYPE_SU = 0,
  199. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO = 1,
  200. CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA = 2,
  201. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA = 4,
  202. CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG = 5,
  203. CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN = 6,
  204. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP = 7,
  205. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG = 8,
  206. CDP_PPDU_STATS_PPDU_TYPE_UL_RESP = 9,
  207. CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
  208. };
  209. /*
  210. * htt_dbg_stats_type -
  211. * bit positions for each stats type within a stats type bitmask
  212. * The bitmask contains 24 bits.
  213. */
  214. enum htt_cmn_dbg_stats_type {
  215. HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  216. HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  217. HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  218. HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  219. HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  220. HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  221. HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  222. HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  223. HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  224. HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  225. HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  226. HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  227. HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */
  228. HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */
  229. HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */
  230. HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */
  231. HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */
  232. HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
  233. /* bits 18-23 currently reserved */
  234. /* keep this last */
  235. HTT_DBG_CMN_NUM_STATS,
  236. HTT_DBG_CMN_NUM_STATS_INVALID = 31, /* bit 31 -> 0x80000000 */
  237. };
  238. /*
  239. * cdp_host_txrx_stats: Different types of host stats
  240. * @TXRX_HOST_STATS_INVALID: Invalid option
  241. * @TXRX_RX_RATE_STATS: Rx rate info
  242. * @TXRX_TX_RATE_STATS: Tx rate info
  243. * @TXRX_TX_HOST_STATS: Print Tx stats
  244. * @TXRX_RX_HOST_STATS: Print host Rx stats
  245. * @TXRX_CLEAR_STATS: clear all host stats
  246. * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
  247. * @TXRX_RX_MON_STATS: Print monitor mode stats
  248. * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
  249. * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
  250. * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
  251. * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
  252. * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
  253. * @TXRX_HAL_REG_WRITE_STATS: Hal Reg Write stats
  254. */
  255. enum cdp_host_txrx_stats {
  256. TXRX_HOST_STATS_INVALID = -1,
  257. TXRX_CLEAR_STATS = 0,
  258. TXRX_RX_RATE_STATS = 1,
  259. TXRX_TX_RATE_STATS = 2,
  260. TXRX_TX_HOST_STATS = 3,
  261. TXRX_RX_HOST_STATS = 4,
  262. TXRX_AST_STATS = 5,
  263. TXRX_SRNG_PTR_STATS = 6,
  264. TXRX_RX_MON_STATS = 7,
  265. TXRX_REO_QUEUE_STATS = 8,
  266. TXRX_SOC_CFG_PARAMS = 9,
  267. TXRX_PDEV_CFG_PARAMS = 10,
  268. TXRX_NAPI_STATS = 11,
  269. TXRX_SOC_INTERRUPT_STATS = 12,
  270. TXRX_SOC_FSE_STATS = 13,
  271. TXRX_HAL_REG_WRITE_STATS = 14,
  272. TXRX_HOST_STATS_MAX,
  273. };
  274. /*
  275. * cdp_ppdu_ftype: PPDU Frame Type
  276. * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
  277. * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
  278. * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
  279. */
  280. enum cdp_ppdu_ftype {
  281. CDP_PPDU_FTYPE_CTRL,
  282. CDP_PPDU_FTYPE_DATA,
  283. CDP_PPDU_FTYPE_BAR,
  284. CDP_PPDU_FTYPE_MAX
  285. };
  286. /**
  287. * @brief General specification of the tx frame contents
  288. *
  289. * @details
  290. * for efficiency, the HTT packet type values correspond
  291. * to the bit positions of the WAL packet type values, so the
  292. * translation is a simple shift operation.
  293. */
  294. enum htt_cmn_pkt_type {
  295. htt_cmn_pkt_type_raw = 0,
  296. htt_cmn_pkt_type_native_wifi = 1,
  297. htt_cmn_pkt_type_ethernet = 2,
  298. htt_cmn_pkt_type_mgmt = 3,
  299. htt_cmn_pkt_type_eth2 = 4,
  300. /* keep this last */
  301. htt_cmn_pkt_num_types
  302. };
  303. /**
  304. * @General description of HTT received packets status
  305. * It is similar to htt_rx_status enum
  306. * but is added as a cdp enum can be freely used in OL_IF layer
  307. */
  308. enum htt_cmn_rx_status {
  309. htt_cmn_rx_status_unknown = 0x0,
  310. htt_cmn_rx_status_ok,
  311. htt_cmn_rx_status_err_fcs,
  312. htt_cmn_rx_status_err_dup,
  313. htt_cmn_rx_status_err_replay,
  314. htt_cmn_rx_status_inv_peer,
  315. htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
  316. htt_cmn_rx_status_tkip_mic_err = 0x09,
  317. htt_cmn_rx_status_decrypt_err = 0x0A,
  318. htt_cmn_rx_status_mpdu_length_err = 0x0B,
  319. htt_cmn_rx_status_err_misc = 0xFF
  320. };
  321. enum cdp_host_reo_dest_ring {
  322. cdp_host_reo_dest_ring_unknown = 0,
  323. cdp_host_reo_dest_ring_1 = 1,
  324. cdp_host_reo_dest_ring_2 = 2,
  325. cdp_host_reo_dest_ring_3 = 3,
  326. cdp_host_reo_dest_ring_4 = 4,
  327. };
  328. enum htt_cmn_t2h_en_stats_type {
  329. /* keep this alwyas first */
  330. HTT_CMN_T2H_EN_STATS_TYPE_START = 0,
  331. /** ppdu_common_stats is the payload */
  332. HTT_CMN_T2H_EN_STATS_TYPE_COMMON = 1,
  333. /** ppdu_sant_stats is the payload */
  334. HTT_CMN_T2H_EN_STATS_TYPE_SANT = 2,
  335. /** ppdu_common_stats_v2 is the payload */
  336. HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
  337. /* Keep this last */
  338. HTT_CMN_T2H_EN_STATS_TYPE_END = 0x1f,
  339. };
  340. enum htt_cmn_t2h_en_stats_status {
  341. /* Keep this first always */
  342. HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL = 0,
  343. HTT_CMN_T2H_EN_STATS_STATUS_PRESENT = 1,
  344. HTT_CMN_T2H_EN_STATS_STATUS_ERROR = 2,
  345. HTT_CMN_T2H_EN_STATS_STATUS_INVALID = 3,
  346. /* keep this always last */
  347. HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE = 7,
  348. };
  349. /**
  350. * struct ol_txrx_peer_state - Peer state information
  351. */
  352. enum ol_txrx_peer_state {
  353. OL_TXRX_PEER_STATE_INVALID,
  354. OL_TXRX_PEER_STATE_DISC, /* initial state */
  355. OL_TXRX_PEER_STATE_CONN, /* authentication in progress */
  356. OL_TXRX_PEER_STATE_AUTH, /* authentication successful */
  357. };
  358. /**
  359. * struct ol_txrx_ast_type - AST entry type information
  360. */
  361. enum cdp_txrx_ast_entry_type {
  362. CDP_TXRX_AST_TYPE_NONE, /* static ast entry for connected peer */
  363. CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */
  364. CDP_TXRX_AST_TYPE_SELF, /* static ast entry for self peer (STA mode) */
  365. CDP_TXRX_AST_TYPE_WDS, /* WDS peer ast entry type*/
  366. CDP_TXRX_AST_TYPE_MEC, /* Multicast echo ast entry type */
  367. CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */
  368. CDP_TXRX_AST_TYPE_STA_BSS, /* BSS entry(STA mode) */
  369. CDP_TXRX_AST_TYPE_DA, /* AST entry based on Destination address */
  370. CDP_TXRX_AST_TYPE_WDS_HM_SEC, /* HM WDS entry for secondary radio */
  371. CDP_TXRX_AST_TYPE_MAX
  372. };
  373. /*
  374. * cdp_ast_free_status: status passed to callback function before freeing ast
  375. * @CDP_TXRX_AST_DELETED - AST is deleted from FW and delete response received
  376. * @CDP_TXRX_AST_DELETE_IN_PROGRESS - AST delete command sent to FW and host
  377. * is waiting for FW response
  378. */
  379. enum cdp_ast_free_status {
  380. CDP_TXRX_AST_DELETED,
  381. CDP_TXRX_AST_DELETE_IN_PROGRESS,
  382. };
  383. /**
  384. * txrx_ast_free_cb - callback registered for ast free
  385. * @ctrl_soc: control path soc context
  386. * @cdp_soc: DP soc context
  387. * @cookie: cookie
  388. * @cdp_ast_free_status: ast free status
  389. */
  390. typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc,
  391. struct cdp_soc *cdp_soc,
  392. void *cookie,
  393. enum cdp_ast_free_status);
  394. /**
  395. * struct cdp_ast_entry_info - AST entry information
  396. * @peer_mac_addr: mac address of peer on which AST entry is added
  397. * @type: ast entry type
  398. * @vdev_id: vdev_id
  399. * @pdev_id: pdev_id
  400. * @peer_id: peer_id
  401. *
  402. * This structure holds the ast entry information
  403. *
  404. */
  405. struct cdp_ast_entry_info {
  406. uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
  407. enum cdp_txrx_ast_entry_type type;
  408. uint8_t vdev_id;
  409. uint8_t pdev_id;
  410. uint16_t peer_id;
  411. };
  412. #define MIC_SEQ_CTR_SIZE 6
  413. enum cdp_rx_frame_type {
  414. cdp_rx_frame_type_802_11,
  415. cdp_rx_frame_type_802_3,
  416. };
  417. /**
  418. * struct cdp_rx_mic_err_info - rx mic error information
  419. * @frame_type: frame type - 0 - 802.11 frame
  420. * - 1 - 802.3 frame
  421. * @data: 802.11 frame
  422. * @ta_mac_addr: transmitter mac address
  423. * @da_mac_addr: destination mac address
  424. * @tsc: sequence number
  425. * @key_id: Key ID
  426. * @multicast: flag for multicast
  427. * @vdev_id: vdev ID
  428. *
  429. * This structure holds rx mic error information
  430. *
  431. */
  432. struct cdp_rx_mic_err_info {
  433. uint8_t frame_type;
  434. uint8_t *data;
  435. struct qdf_mac_addr ta_mac_addr;
  436. struct qdf_mac_addr da_mac_addr;
  437. uint8_t tsc[MIC_SEQ_CTR_SIZE];
  438. uint8_t key_id;
  439. bool multicast;
  440. uint16_t vdev_id;
  441. };
  442. #ifdef WLAN_SUPPORT_MSCS
  443. /**
  444. * struct cdp_mscs_params - MSCS parameters obtained
  445. * from handshake
  446. * @user_pri_bitmap - User priority bitmap
  447. * @user_pri_limit - User priority limit
  448. * @classifier_type - TCLAS Classifier type
  449. * @classifier_mask - TCLAS Classifier mask
  450. */
  451. struct cdp_mscs_params {
  452. uint8_t user_pri_bitmap;
  453. uint8_t user_pri_limit;
  454. uint8_t classifier_type;
  455. uint8_t classifier_mask;
  456. };
  457. #endif
  458. /**
  459. * struct cdp_sec_type - security type information
  460. */
  461. enum cdp_sec_type {
  462. cdp_sec_type_none,
  463. cdp_sec_type_wep128,
  464. cdp_sec_type_wep104,
  465. cdp_sec_type_wep40,
  466. cdp_sec_type_tkip,
  467. cdp_sec_type_tkip_nomic,
  468. cdp_sec_type_aes_ccmp,
  469. cdp_sec_type_wapi,
  470. cdp_sec_type_aes_ccmp_256,
  471. cdp_sec_type_aes_gcmp,
  472. cdp_sec_type_aes_gcmp_256,
  473. /* keep this last! */
  474. cdp_num_sec_types
  475. };
  476. /**
  477. * struct cdp_tx_exception_metadata - Exception path parameters
  478. * @peer_id: Peer id of the peer
  479. * @tid: Transmit Identifier
  480. * @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
  481. * @sec_type: sec_type to be passed to HAL
  482. * @is_tx_sniffer: Indicates if the packet has to be sniffed
  483. * @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions
  484. *
  485. * This structure holds the parameters needed in the exception path of tx
  486. *
  487. */
  488. struct cdp_tx_exception_metadata {
  489. uint16_t peer_id;
  490. uint8_t tid;
  491. uint16_t tx_encap_type;
  492. enum cdp_sec_type sec_type;
  493. uint8_t is_tx_sniffer;
  494. uint16_t ppdu_cookie;
  495. #ifdef QCA_SUPPORT_WDS_EXTENDED
  496. uint8_t is_wds_extended;
  497. #endif
  498. };
  499. typedef struct cdp_soc_t *ol_txrx_soc_handle;
  500. /**
  501. * ol_txrx_vdev_delete_cb - callback registered during vdev
  502. * detach
  503. */
  504. typedef void (*ol_txrx_vdev_delete_cb)(void *context);
  505. /**
  506. * ol_txrx_peer_unmap_sync_cb - callback registered during peer detach sync
  507. */
  508. typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
  509. uint32_t peer_id_cnt,
  510. uint16_t *peer_id_list);
  511. /**
  512. * ol_txrx_pkt_direction - Packet Direction
  513. * @rx_direction: rx path packet
  514. * @tx_direction: tx path packet
  515. */
  516. enum txrx_direction {
  517. rx_direction = 1,
  518. tx_direction = 0,
  519. };
  520. /**
  521. * cdp_capabilities- DP capabilities
  522. */
  523. enum cdp_capabilities {
  524. CDP_CFG_DP_TSO,
  525. CDP_CFG_DP_LRO,
  526. CDP_CFG_DP_SG,
  527. CDP_CFG_DP_GRO,
  528. CDP_CFG_DP_OL_TX_CSUM,
  529. CDP_CFG_DP_OL_RX_CSUM,
  530. CDP_CFG_DP_RAWMODE,
  531. CDP_CFG_DP_PEER_FLOW_CTRL,
  532. };
  533. /**
  534. * ol_txrx_nbuf_classify - Packet classification object
  535. * @peer_id: unique peer identifier from fw
  536. * @tid: traffic identifier(could be overridden)
  537. * @pkt_tid: traffic identifier(cannot be overridden)
  538. * @pkt_tos: ip header tos value
  539. * @pkt_dscp: ip header dscp value
  540. * @tos: index value in map
  541. * @dscp: DSCP_TID map index
  542. * @is_mcast: multicast pkt check
  543. * @is_eap: eapol pkt check
  544. * @is_arp: arp pkt check
  545. * @is_tcp: tcp pkt check
  546. * @is_dhcp: dhcp pkt check
  547. * @is_igmp: igmp pkt check
  548. * @is_ipv4: ip version 4 pkt check
  549. * @is_ipv6: ip version 6 pkt check
  550. */
  551. struct ol_txrx_nbuf_classify {
  552. uint16_t peer_id;
  553. uint8_t tid;
  554. uint8_t pkt_tid;
  555. uint8_t pkt_tos;
  556. uint8_t pkt_dscp;
  557. uint8_t tos;
  558. uint8_t dscp;
  559. uint8_t is_mcast;
  560. uint8_t is_eap;
  561. uint8_t is_arp;
  562. uint8_t is_tcp;
  563. uint8_t is_dhcp;
  564. uint8_t is_igmp;
  565. uint8_t is_ipv4;
  566. uint8_t is_ipv6;
  567. };
  568. /**
  569. * ol_osif_vdev_handle - paque handle for OS shim virtual device
  570. * object
  571. */
  572. struct ol_osif_vdev_t;
  573. typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
  574. #ifdef QCA_SUPPORT_WDS_EXTENDED
  575. struct ol_osif_peer_t;
  576. typedef struct ol_osif_peer_t *ol_osif_peer_handle;
  577. #endif
  578. /**
  579. * wlan_op_mode - Virtual device operation mode
  580. * @wlan_op_mode_unknown: Unknown mode
  581. * @wlan_op_mode_ap: AP mode
  582. * @wlan_op_mode_ibss: IBSS mode
  583. * @wlan_op_mode_sta: STA (client) mode
  584. * @wlan_op_mode_monitor: Monitor mode
  585. * @wlan_op_mode_ocb: OCB mode
  586. */
  587. enum wlan_op_mode {
  588. wlan_op_mode_unknown,
  589. wlan_op_mode_ap,
  590. wlan_op_mode_ibss,
  591. wlan_op_mode_sta,
  592. wlan_op_mode_monitor,
  593. wlan_op_mode_ocb,
  594. wlan_op_mode_ndi,
  595. };
  596. /**
  597. * enum wlan_op_subtype - Virtual device subtype
  598. * @wlan_op_subtype_none: Subtype not applicable
  599. * @wlan_op_subtype_p2p_device: P2P device
  600. * @wlan_op_subtye_p2p_cli: P2P Client
  601. * @wlan_op_subtype_p2p_go: P2P GO
  602. *
  603. * This enum lists the subtypes of a particular virtual
  604. * device.
  605. */
  606. enum wlan_op_subtype {
  607. wlan_op_subtype_none,
  608. wlan_op_subtype_p2p_device,
  609. wlan_op_subtype_p2p_cli,
  610. wlan_op_subtype_p2p_go,
  611. };
  612. /**
  613. * connectivity_stats_pkt_status - data pkt type
  614. * @PKT_TYPE_REQ: Request packet
  615. * @PKT_TYPE_RSP: Response packet
  616. * @PKT_TYPE_TX_DROPPED: TX packet dropped
  617. * @PKT_TYPE_RX_DROPPED: RX packet dropped
  618. * @PKT_TYPE_RX_DELIVERED: RX packet delivered
  619. * @PKT_TYPE_RX_REFUSED: RX packet refused
  620. * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
  621. * @PKT_TYPE_TX_ACK_CNT:TC packet acked
  622. * @PKT_TYPE_NONE: Invalid packet
  623. */
  624. enum connectivity_stats_pkt_status {
  625. PKT_TYPE_REQ,
  626. PKT_TYPE_RSP,
  627. PKT_TYPE_TX_DROPPED,
  628. PKT_TYPE_RX_DROPPED,
  629. PKT_TYPE_RX_DELIVERED,
  630. PKT_TYPE_RX_REFUSED,
  631. PKT_TYPE_TX_HOST_FW_SENT,
  632. PKT_TYPE_TX_ACK_CNT,
  633. PKT_TYPE_NONE,
  634. };
  635. /**
  636. * ol_txrx_mgmt_tx_cb - tx management delivery notification
  637. * callback function
  638. */
  639. typedef void
  640. (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
  641. /**
  642. * ol_txrx_data_tx_cb - Function registered with the data path
  643. * that is called when tx frames marked as "no free" are
  644. * done being transmitted
  645. */
  646. typedef void
  647. (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
  648. /**
  649. * ol_txrx_tx_fp - top-level transmit function
  650. * @soc - dp soc handle
  651. * @vdev_id - handle to the virtual device object
  652. * @msdu_list - list of network buffers
  653. */
  654. typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  655. qdf_nbuf_t msdu_list);
  656. /**
  657. * ol_txrx_tx_exc_fp - top-level transmit function on exception path
  658. * @soc - dp soc handle
  659. * @vdev_id - handle to the virtual device object
  660. * @msdu_list - list of network buffers
  661. * @tx_exc_metadata - structure that holds parameters to exception path
  662. */
  663. typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  664. qdf_nbuf_t msdu_list,
  665. struct cdp_tx_exception_metadata
  666. *tx_exc_metadata);
  667. /**
  668. * ol_txrx_completion_fp - top-level transmit function
  669. * for tx completion
  670. * @skb: skb data
  671. * @osif_dev: the virtual device's OS shim object
  672. * @flag: flag
  673. */
  674. typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
  675. void *osif_dev, uint16_t flag);
  676. /**
  677. * ol_txrx_tx_flow_control_fp - tx flow control notification
  678. * function from txrx to OS shim
  679. * @osif_dev - the virtual device's OS shim object
  680. * @tx_resume - tx os q should be resumed or not
  681. */
  682. typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
  683. bool tx_resume);
  684. /**
  685. * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
  686. * function from txrx to OS shim
  687. * @osif_dev - the virtual device's OS shim object
  688. *
  689. * Return: true if tx is paused by flow control
  690. */
  691. typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
  692. /**
  693. * ol_txrx_rx_fp - receive function to hand batches of data
  694. * frames from txrx to OS shim
  695. * @data_vdev - handle to the OSIF virtual device object
  696. * @msdu_list - list of network buffers
  697. */
  698. typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
  699. typedef QDF_STATUS(*ol_txrx_fisa_rx_fp)(void *soc,
  700. void *dp_vdev,
  701. qdf_nbuf_t msdu_list);
  702. typedef QDF_STATUS(*ol_txrx_fisa_flush_fp)(void *soc, int ring_num);
  703. /**
  704. * ol_txrx_rx_flush_fp - receive function to hand batches of data
  705. * frames from txrx to OS shim
  706. * @osif_dev: handle to the OSIF virtual device object
  707. * @vdev_id: vdev_if of the packets to be flushed
  708. */
  709. typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id);
  710. /**
  711. * ol_txrx_rx_gro_flush_ind - function to send GRO flush indication to stack
  712. * for a given RX Context Id.
  713. * @osif_dev - handle to the OSIF virtual device object
  714. * @rx_ctx_id - Rx context Id for which gro flush should happen
  715. */
  716. typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev,
  717. int rx_ctx_id);
  718. /**
  719. * ol_txrx_stats_rx_fp - receive function to hand batches of data
  720. * frames from txrx to OS shim
  721. * @skb: skb data
  722. * @osif_dev: the virtual device's OS shim object
  723. * @action: data packet type
  724. * @pkt_type: packet data type
  725. */
  726. typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
  727. void *osif_dev, enum connectivity_stats_pkt_status action,
  728. uint8_t *pkt_type);
  729. /**
  730. * ol_txrx_get_key_fp - function to gey key based on keyix and peer
  731. * mac address
  732. * @osif_dev - the virtual device's OS shim object
  733. * @key_buf - pointer to store key
  734. * @mac_addr - pointer to mac address
  735. * @keyix - key id
  736. */
  737. typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
  738. /**
  739. * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
  740. * packets in receive path.
  741. * @osif_dev - the virtual device's OS shim object
  742. * @list_head - poniter to head of receive packet queue to decap
  743. * @list_tail - poniter to tail of receive packet queue to decap
  744. * @peer_mac - mac address of peer handler
  745. */
  746. typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
  747. qdf_nbuf_t *list_head,
  748. qdf_nbuf_t *list_tail,
  749. uint8_t *peer_mac);
  750. /* ol_txrx_rx_fp - external tx free function to read per packet stats and
  751. * free tx buffer externally
  752. * @netbuf - tx network buffer
  753. */
  754. typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
  755. /**
  756. * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
  757. */
  758. typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
  759. qdf_nbuf_t mpdu_head,
  760. qdf_nbuf_t mpdu_tail);
  761. /**
  762. * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
  763. * MPDU (802.11 format)
  764. */
  765. typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
  766. qdf_nbuf_t mpdu,
  767. void *rx_status);
  768. /**
  769. * ol_txrx_proxy_arp_fp - proxy arp function pointer
  770. */
  771. typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
  772. qdf_nbuf_t netbuf);
  773. /*
  774. * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
  775. */
  776. typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
  777. qdf_nbuf_t netbuf);
  778. /**
  779. * ol_txrx_stats_callback - statistics notify callback
  780. */
  781. typedef void (*ol_txrx_stats_callback)(void *ctxt,
  782. enum htt_cmn_dbg_stats_type type,
  783. uint8_t *buf, int bytes);
  784. /**
  785. * ol_txrx_pktdump_cb - callback for packet dump feature
  786. */
  787. typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
  788. uint8_t pdev_id,
  789. uint8_t vdev_id,
  790. qdf_nbuf_t netbuf,
  791. uint8_t status,
  792. uint8_t type);
  793. /**
  794. * ol_txrx_ops - (pointers to) the functions used for tx and rx
  795. * data xfer
  796. *
  797. * There are two portions of these txrx operations.
  798. * The rx portion is filled in by OSIF SW before calling
  799. * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
  800. * the txrx SW stores a copy of these rx function pointers, to use
  801. * as it delivers rx data frames to the OSIF SW.
  802. * The tx portion is filled in by the txrx SW inside
  803. * ol_txrx_osif_vdev_register; when the function call returns,
  804. * the OSIF SW stores a copy of these tx functions to use as it
  805. * delivers tx data frames to the txrx SW.
  806. *
  807. * @tx.std - the tx function pointer for standard data
  808. * frames This function pointer is set by the txrx SW
  809. * perform host-side transmit operations based on
  810. * whether a HL or LL host/target interface is in use.
  811. * @tx.flow_control_cb - the transmit flow control
  812. * function that is registered by the
  813. * OSIF which is called from txrx to
  814. * indicate whether the transmit OS
  815. * queues should be paused/resumed
  816. * @rx.rx - the OS shim rx function to deliver rx data
  817. * frames to. This can have different values for
  818. * different virtual devices, e.g. so one virtual
  819. * device's OS shim directly hands rx frames to the OS,
  820. * but another virtual device's OS shim filters out P2P
  821. * messages before sending the rx frames to the OS. The
  822. * netbufs delivered to the osif_rx function are in the
  823. * format specified by the OS to use for tx and rx
  824. * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
  825. * are given to the thread, instead of the stack via this pointer.
  826. * @rx.stack - function to give packets to the stack. Differs from @rx.rx.
  827. * In case RX Threads are enabled, this pointer holds the callback to give
  828. * packets to the stack.
  829. * @rx.rx_gro_flush - GRO flush indication to stack for a given RX CTX ID
  830. * @rx.wai_check - the tx function pointer for WAPI frames
  831. * @rx.mon - the OS shim rx monitor function to deliver
  832. * monitor data to Though in practice, it is probable
  833. * that the same function will be used for delivering
  834. * rx monitor data for all virtual devices, in theory
  835. * each different virtual device can have a different
  836. * OS shim function for accepting rx monitor data. The
  837. * netbufs delivered to the osif_rx_mon function are in
  838. * 802.11 format. Each netbuf holds a 802.11 MPDU, not
  839. * an 802.11 MSDU. Depending on compile-time
  840. * configuration, each netbuf may also have a
  841. * monitor-mode encapsulation header such as a radiotap
  842. * header added before the MPDU contents.
  843. * @rx.std - the OS shim rx function to deliver rx data
  844. * @proxy_arp - proxy arp function pointer - specified by
  845. * OS shim, stored by txrx
  846. * @get_key - function pointer to get key of the peer with
  847. * specific key index
  848. */
  849. struct ol_txrx_ops {
  850. /* tx function pointers - specified by txrx, stored by OS shim */
  851. struct {
  852. ol_txrx_tx_fp tx;
  853. ol_txrx_tx_exc_fp tx_exception;
  854. ol_txrx_tx_free_ext_fp tx_free_ext;
  855. ol_txrx_completion_fp tx_comp;
  856. } tx;
  857. /* rx function pointers - specified by OS shim, stored by txrx */
  858. struct {
  859. ol_txrx_rx_fp rx;
  860. ol_txrx_rx_fp rx_stack;
  861. ol_txrx_rx_flush_fp rx_flush;
  862. ol_txrx_rx_gro_flush_ind_fp rx_gro_flush;
  863. ol_txrx_rx_check_wai_fp wai_check;
  864. ol_txrx_rx_mon_fp mon;
  865. ol_txrx_stats_rx_fp stats_rx;
  866. ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
  867. ol_txrx_fisa_rx_fp osif_fisa_rx;
  868. ol_txrx_fisa_flush_fp osif_fisa_flush;
  869. } rx;
  870. /* proxy arp function pointer - specified by OS shim, stored by txrx */
  871. ol_txrx_proxy_arp_fp proxy_arp;
  872. ol_txrx_mcast_me_fp me_convert;
  873. ol_txrx_get_key_fp get_key;
  874. };
  875. /**
  876. * ol_txrx_stats_req - specifications of the requested
  877. * statistics
  878. */
  879. struct ol_txrx_stats_req {
  880. uint32_t stats_type_upload_mask; /* which stats to upload */
  881. uint32_t stats_type_reset_mask; /* which stats to reset */
  882. /* stats will be printed if either print element is set */
  883. struct {
  884. int verbose; /* verbose stats printout */
  885. int concise; /* concise stats printout (takes precedence) */
  886. } print; /* print uploaded stats */
  887. /* stats notify callback will be invoked if fp is non-NULL */
  888. struct {
  889. ol_txrx_stats_callback fp;
  890. void *ctxt;
  891. } callback;
  892. /* stats will be copied into the specified buffer if buf is non-NULL */
  893. struct {
  894. uint8_t *buf;
  895. int byte_limit; /* don't copy more than this */
  896. } copy;
  897. /*
  898. * If blocking is true, the caller will take the specified semaphore
  899. * to wait for the stats to be uploaded, and the driver will release
  900. * the semaphore when the stats are done being uploaded.
  901. */
  902. struct {
  903. int blocking;
  904. /*Note: this needs to change to some qdf_* type */
  905. qdf_semaphore_t *sem_ptr;
  906. } wait;
  907. };
  908. /* DP soc struct definition */
  909. struct cdp_soc_t {
  910. struct cdp_ops *ops;
  911. struct ol_if_ops *ol_ops;
  912. };
  913. /*
  914. * cdp_peer_param_type: different types of parameters
  915. * to set values in peer
  916. * @CDP_CONFIG_NAWDS: Enable nawds mode
  917. * @CDP_CONFIG_NAC: Enable nac
  918. * @CDP_CONFIG_ISOLATION : Enable isolation
  919. * @CDP_CONFIG_IN_TWT : In TWT session or not
  920. */
  921. enum cdp_peer_param_type {
  922. CDP_CONFIG_NAWDS,
  923. CDP_CONFIG_NAC,
  924. CDP_CONFIG_ISOLATION,
  925. CDP_CONFIG_IN_TWT,
  926. };
  927. /*
  928. * cdp_pdev_param_type: different types of parameters
  929. * to set values in pdev
  930. * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
  931. * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
  932. * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
  933. * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
  934. * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
  935. * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
  936. * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
  937. * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
  938. * @CDP_INGRESS_STATS: Accumulate ingress statistics
  939. * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
  940. * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
  941. * @CDP_CONFIG_ENH_TX_CAPTURE: Enable enhanced TX capture
  942. * @CDP_CONFIG_HMMC_TID_OVERRIDE: Enable hmmc tid override
  943. * @CDP_CONFIG_HMMC_TID_VALUE: set hmmc tid value
  944. * @CDP_CONFIG_TX_CAPTURE: set tx capture
  945. * @CDP_CHAN_NOISE_FLOOR: set channel noise floor
  946. * @CDP_CONFIG_VOW: set/get vow config
  947. * @CDP_TIDQ_OVERRIDE: set/get tid queue override
  948. * @CDP_TIDMAP_PRTY: set/get tid map prty
  949. * @CDP_TX_PENDING: get tx pending
  950. * @CDP_FILTER_NEIGH_PEERS: filter neighbour peers
  951. * @CDP_FILTER_UCAST_DATA: filter unicast data
  952. * @CDP_FILTER_MCAST_DATA: filter multicast data
  953. * @CDP_FILTER_NO_DATA: filter no data
  954. * @CDP_MONITOR_CHANNEL: monitor channel
  955. * @CDP_MONITOR_FREQUENCY: monitor frequency
  956. * @CDP_CONFIG_BSS_COLOR: configure bss color
  957. * @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag
  958. */
  959. enum cdp_pdev_param_type {
  960. CDP_CONFIG_DEBUG_SNIFFER,
  961. CDP_CONFIG_BPR_ENABLE,
  962. CDP_CONFIG_PRIMARY_RADIO,
  963. CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
  964. CDP_CONFIG_IGMPMLD_OVERRIDE,
  965. CDP_CONFIG_IGMPMLD_TID,
  966. CDP_CONFIG_ARP_DBG_CONF,
  967. CDP_CONFIG_CAPTURE_LATENCY,
  968. CDP_INGRESS_STATS,
  969. CDP_OSIF_DROP,
  970. CDP_CONFIG_ENH_RX_CAPTURE,
  971. CDP_CONFIG_ENH_TX_CAPTURE,
  972. CDP_CONFIG_HMMC_TID_OVERRIDE,
  973. CDP_CONFIG_HMMC_TID_VALUE,
  974. CDP_CONFIG_TX_CAPTURE,
  975. CDP_CHAN_NOISE_FLOOR,
  976. CDP_CONFIG_VOW,
  977. CDP_TIDQ_OVERRIDE,
  978. CDP_TIDMAP_PRTY,
  979. CDP_TX_PENDING,
  980. CDP_FILTER_NEIGH_PEERS,
  981. CDP_FILTER_UCAST_DATA,
  982. CDP_FILTER_MCAST_DATA,
  983. CDP_FILTER_NO_DATA,
  984. CDP_MONITOR_CHANNEL,
  985. CDP_MONITOR_FREQUENCY,
  986. CDP_CONFIG_BSS_COLOR,
  987. CDP_SET_ATF_STATS_ENABLE,
  988. };
  989. /*
  990. * cdp_config_param_type: union of different types of parameters
  991. * to set values into dp handles.
  992. *
  993. * @cdp_peer_param_nawds: Enable nawds mode
  994. * @cdp_peer_param_isolation: Enable isolation
  995. * @cdp_peer_param_in_twt: in TWT session or not
  996. * @cdp_peer_param_nac: Enable nac
  997. *
  998. * @cdp_vdev_param_nawds: set nawds enable/disable
  999. * @cdp_vdev_param_mcast_en: enable/disable multicast enhancement
  1000. * @cdp_vdev_param_wds: wds sta
  1001. * @cdp_vdev_param_mec: MEC enable flags
  1002. * @cdp_vdev_param_proxysta: proxy sta
  1003. * @cdp_vdev_param_tdls_flags: tdls link flags
  1004. * @cdp_vdev_param_ap_brdg_en: set ap_bridging enable/disable
  1005. * @cdp_vdev_param_cipher_en: set cipher type based on security
  1006. * @cdp_vdev_param_qwrap_isolation: qwrap isolation mode
  1007. * @cdp_vdev_param_tx_encap: tx encap type
  1008. * @cdp_vdev_param_rx_decap: rx decap type
  1009. * @cdp_vdev_param_mesh_rx_filter: set mesh rx filter
  1010. * @cdp_vdev_param_tidmap_prty: set tid vdev prty
  1011. * @cdp_vdev_param_tidmap_tbl_id: set tidmap table id
  1012. * @cdp_vdev_param_mesh_mode: set mesh mode
  1013. * @cdp_vdev_param_safe_mode: set safe mode
  1014. * @cdp_vdev_param_drop_unenc: set drop unencrypted flag
  1015. * @cdp_vdev_param_hlos_tid_override: set hlos tid override
  1016. * @cdp_vdev_param_peer_authorize: set peer authorize
  1017. * @cdp_vdev_param_peer_tid_latency_enable: set peer tid latency enable flag
  1018. * @cdp_vdev_param_mesh_tid: config tatency tid on vdev
  1019. *
  1020. * @cdp_pdev_param_dbg_snf: Enable debug sniffer feature
  1021. * @cdp_pdev_param_bpr_enable: Enable bcast probe feature
  1022. * @cdp_pdev_param_primary_radio: Configure radio as primary
  1023. * @cdp_pdev_param_en_perpkt_txstats: Enable per packet statistics
  1024. * @cdp_pdev_param_igmpmld_override: Override IGMP/MLD
  1025. * @cdp_pdev_param_igmpmld_tid: TID value when igmmld_override is set
  1026. * @cdp_pdev_param_arp_dbg_conf: Enable ARP debug
  1027. * @cdp_pdev_param_cptr_latcy: Capture time latency
  1028. * @cdp_pdev_param_ingrs_stats: Accumulate ingress statistics
  1029. * @cdp_pdev_param_osif_drop: Accumulate drops in OSIF layer
  1030. * @cdp_pdev_param_en_rx_cap: Enable enhanced RX capture
  1031. * @cdp_pdev_param_en_tx_cap: Enable enhanced TX capture
  1032. * @cdp_pdev_param_hmmc_tid_ovrd: Enable hmmc tid override
  1033. * @cdp_pdev_param_hmmc_tid: set hmmc tid value
  1034. * @cdp_pdev_param_tx_capture: set tx capture
  1035. * @cdp_pdev_param_chn_noise_flr: set channel noise floor
  1036. * @cdp_pdev_param_cfg_vow: set/get vow config
  1037. * @cdp_pdev_param_tidq_override: set/get tid queue override
  1038. * @cdp_pdev_param_mon_freq: set monitor frequency
  1039. * @cdp_pdev_param_bss_color: configure bss color
  1040. * @cdp_pdev_param_tidmap_prty: set/get tid map prty
  1041. * @cdp_pdev_param_tx_pending: get tx pending
  1042. * @cdp_pdev_param_fltr_neigh_peers: filter neighbour peers
  1043. * @cdp_pdev_param_fltr_ucast: filter unicast data
  1044. * @cdp_pdev_param_fltr_mcast: filter multicast data
  1045. * @cdp_pdev_param_fltr_none: filter no data
  1046. * @cdp_pdev_param_monitor_chan: monitor channel
  1047. * @cdp_pdev_param_atf_stats_enable: ATF stats enable
  1048. *
  1049. * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
  1050. * @cdp_psoc_param_en_nss_cfg: set nss cfg
  1051. *
  1052. * @cdp_enable_tx_checksum: Flag to specify if HW Tx checksum enabled
  1053. */
  1054. typedef union cdp_config_param_t {
  1055. /* peer params */
  1056. bool cdp_peer_param_nawds;
  1057. bool cdp_peer_param_isolation;
  1058. uint8_t cdp_peer_param_nac;
  1059. bool cdp_peer_param_in_twt;
  1060. /* vdev params */
  1061. bool cdp_vdev_param_wds;
  1062. bool cdp_vdev_param_mec;
  1063. bool cdp_vdev_param_nawds;
  1064. bool cdp_vdev_param_proxysta;
  1065. bool cdp_vdev_param_tdls_flags;
  1066. bool cdp_vdev_param_ap_brdg_en;
  1067. bool cdp_vdev_param_qwrap_isolation;
  1068. bool cdp_vdev_param_update_multipass;
  1069. uint8_t cdp_vdev_param_da_war;
  1070. uint8_t cdp_vdev_param_mcast_en;
  1071. uint8_t cdp_vdev_param_igmp_mcast_en;
  1072. uint8_t cdp_vdev_param_tidmap_prty;
  1073. uint8_t cdp_vdev_param_tidmap_tbl_id;
  1074. uint32_t cdp_vdev_param_aging_tmr;
  1075. uint32_t cdp_vdev_param_cipher_en;
  1076. uint32_t cdp_vdev_param_tx_encap;
  1077. uint32_t cdp_vdev_param_rx_decap;
  1078. uint32_t cdp_vdev_param_mesh_rx_filter;
  1079. uint32_t cdp_vdev_param_mesh_mode;
  1080. uint32_t cdp_vdev_param_safe_mode;
  1081. uint32_t cdp_vdev_param_drop_unenc;
  1082. uint8_t cdp_vdev_param_hlos_tid_override;
  1083. bool cdp_vdev_param_wds_ext;
  1084. uint8_t cdp_vdev_param_peer_authorize;
  1085. uint8_t cdp_vdev_param_peer_tid_latency_enable;
  1086. uint8_t cdp_vdev_param_mesh_tid;
  1087. /* pdev params */
  1088. bool cdp_pdev_param_cptr_latcy;
  1089. bool cdp_pdev_param_hmmc_tid_ovrd;
  1090. bool cdp_pdev_param_fltr_neigh_peers;
  1091. bool cdp_pdev_param_cfg_vow;
  1092. bool cdp_pdev_param_fltr_mcast;
  1093. bool cdp_pdev_param_fltr_none;
  1094. bool cdp_pdev_param_fltr_ucast;
  1095. uint8_t cdp_pdev_param_primary_radio;
  1096. uint8_t cdp_pdev_param_en_rx_cap;
  1097. uint8_t cdp_pdev_param_en_tx_cap;
  1098. uint8_t cdp_pdev_param_tx_capture;
  1099. uint8_t cdp_pdev_param_hmmc_tid;
  1100. uint8_t cdp_pdev_param_tidmap_prty;
  1101. uint8_t cdp_pdev_param_igmpmld_override;
  1102. uint8_t cdp_pdev_param_igmpmld_tid;
  1103. uint8_t cdp_pdev_param_arp_dbg_conf;
  1104. uint8_t cdp_pdev_param_tidq_override;
  1105. uint8_t cdp_pdev_param_bss_color;
  1106. uint16_t cdp_pdev_param_chn_noise_flr;
  1107. qdf_freq_t cdp_pdev_param_mon_freq;
  1108. int cdp_pdev_param_dbg_snf;
  1109. int cdp_pdev_param_bpr_enable;
  1110. int cdp_pdev_param_monitor_chan;
  1111. uint32_t cdp_pdev_param_ingrs_stats;
  1112. uint32_t cdp_pdev_param_osif_drop;
  1113. uint32_t cdp_pdev_param_en_perpkt_txstats;
  1114. uint32_t cdp_pdev_param_tx_pending;
  1115. bool cdp_pdev_param_atf_stats_enable;
  1116. /* psoc params */
  1117. bool cdp_psoc_param_en_rate_stats;
  1118. int cdp_psoc_param_en_nss_cfg;
  1119. int cdp_psoc_param_preferred_hw_mode;
  1120. bool cdp_psoc_param_pext_stats;
  1121. bool cdp_enable_tx_checksum;
  1122. } cdp_config_param_type;
  1123. /**
  1124. * cdp_rx_enh_capture_mode - Rx enhanced capture modes
  1125. * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
  1126. * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
  1127. * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
  1128. */
  1129. enum cdp_rx_enh_capture_mode {
  1130. CDP_RX_ENH_CAPTURE_DISABLED = 0,
  1131. CDP_RX_ENH_CAPTURE_MPDU,
  1132. CDP_RX_ENH_CAPTURE_MPDU_MSDU,
  1133. };
  1134. /**
  1135. * cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
  1136. * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
  1137. * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
  1138. */
  1139. enum cdp_rx_enh_capture_peer {
  1140. CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
  1141. CDP_RX_ENH_CAPTURE_PEER_ENABLED,
  1142. };
  1143. /**
  1144. * cdp_tx_enh_capture_mode - Tx enhanced capture modes
  1145. * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
  1146. * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
  1147. * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
  1148. */
  1149. enum cdp_tx_enh_capture_mode {
  1150. CDP_TX_ENH_CAPTURE_DISABLED = 0,
  1151. CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
  1152. CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
  1153. CDP_TX_ENH_CAPTURE_MAX,
  1154. };
  1155. /*
  1156. * enum cdp_pdev_bpr_param - different types of parameters
  1157. * to set value in pdev
  1158. * @CDP_BPR_DISABLE: Set bpr to disable state
  1159. * @CDP_BPR_ENABLE: set bpr to enable state
  1160. *
  1161. * Enum indicating bpr state to enable/disable.
  1162. */
  1163. enum cdp_pdev_bpr_param {
  1164. CDP_BPR_DISABLE,
  1165. CDP_BPR_ENABLE,
  1166. };
  1167. /*
  1168. * cdp_vdev_param_type: different types of parameters
  1169. * to set values in vdev
  1170. * @CDP_ENABLE_NAWDS: set nawds enable/disable
  1171. * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
  1172. * @CDP_ENABLE_WDS: wds sta
  1173. * @CDP_ENABLE_MEC: MEC enable flags
  1174. * @CDP_ENABLE_PROXYSTA: proxy sta
  1175. * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
  1176. * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
  1177. * @CDP_ENABLE_CIPHER : set cipher type based on security
  1178. * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
  1179. * @CDP_TX_ENCAP_TYPE: tx encap type
  1180. * @CDP_RX_DECAP_TYPE: rx decap type
  1181. * @CDP_MESH_RX_FILTER: set mesh rx filter
  1182. * @CDP_TID_VDEV_PRTY: set tid vdev prty
  1183. * @CDP_TIDMAP_TBL_ID: set tidmap table id
  1184. * @CDP_MESH_MODE: set mesh mode
  1185. * @CDP_SAFEMODE: set safe mode
  1186. * @CDP_DROP_UNENC: set drop unencrypted flag
  1187. * @CDP_ENABLE_IGMP_MCAST_EN: enable/disable igmp multicast enhancement
  1188. * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag
  1189. * @CDP_CFG_WDS_EXT: enable/disable wds ext feature
  1190. * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag
  1191. * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag
  1192. * @CDP_SET_VAP_MESH_TID : Set latency tid in vap
  1193. */
  1194. enum cdp_vdev_param_type {
  1195. CDP_ENABLE_NAWDS,
  1196. CDP_ENABLE_MCAST_EN,
  1197. CDP_ENABLE_WDS,
  1198. CDP_ENABLE_MEC,
  1199. CDP_ENABLE_DA_WAR,
  1200. CDP_ENABLE_PROXYSTA,
  1201. CDP_UPDATE_TDLS_FLAGS,
  1202. CDP_CFG_WDS_AGING_TIMER,
  1203. CDP_ENABLE_AP_BRIDGE,
  1204. CDP_ENABLE_CIPHER,
  1205. CDP_ENABLE_QWRAP_ISOLATION,
  1206. CDP_UPDATE_MULTIPASS,
  1207. CDP_TX_ENCAP_TYPE,
  1208. CDP_RX_DECAP_TYPE,
  1209. CDP_MESH_RX_FILTER,
  1210. CDP_TID_VDEV_PRTY,
  1211. CDP_TIDMAP_TBL_ID,
  1212. #ifdef MESH_MODE_SUPPORT
  1213. CDP_MESH_MODE,
  1214. #endif
  1215. CDP_SAFEMODE,
  1216. CDP_DROP_UNENC,
  1217. CDP_ENABLE_CSUM,
  1218. CDP_ENABLE_IGMP_MCAST_EN,
  1219. CDP_ENABLE_HLOS_TID_OVERRIDE,
  1220. #ifdef QCA_SUPPORT_WDS_EXTENDED
  1221. CDP_CFG_WDS_EXT,
  1222. #endif /* QCA_SUPPORT_WDS_EXTENDED */
  1223. CDP_ENABLE_PEER_AUTHORIZE,
  1224. #ifdef WLAN_SUPPORT_MESH_LATENCY
  1225. CDP_ENABLE_PEER_TID_LATENCY,
  1226. CDP_SET_VAP_MESH_TID,
  1227. #endif
  1228. };
  1229. /*
  1230. * cdp_psoc_param_type: different types of parameters
  1231. * to set values in psoc
  1232. * @CDP_ENABLE_RATE_STATS: set rate stats enable/disable
  1233. * @CDP_SET_NSS_CFG: set nss cfg
  1234. * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
  1235. * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode.
  1236. */
  1237. enum cdp_psoc_param_type {
  1238. CDP_ENABLE_RATE_STATS,
  1239. CDP_SET_NSS_CFG,
  1240. CDP_SET_PREFERRED_HW_MODE,
  1241. CDP_CFG_PEER_EXT_STATS,
  1242. };
  1243. #define TXRX_FW_STATS_TXSTATS 1
  1244. #define TXRX_FW_STATS_RXSTATS 2
  1245. #define TXRX_FW_STATS_RX_RATE_INFO 3
  1246. #define TXRX_FW_STATS_PHYSTATS 4
  1247. #define TXRX_FW_STATS_PHYSTATS_CONCISE 5
  1248. #define TXRX_FW_STATS_TX_RATE_INFO 6
  1249. #define TXRX_FW_STATS_TID_STATE 7
  1250. #define TXRX_FW_STATS_HOST_STATS 8
  1251. #define TXRX_FW_STATS_CLEAR_HOST_STATS 9
  1252. #define TXRX_FW_STATS_CE_STATS 10
  1253. #define TXRX_FW_STATS_VOW_UMAC_COUNTER 11
  1254. #define TXRX_FW_STATS_ME_STATS 12
  1255. #define TXRX_FW_STATS_TXBF_INFO 13
  1256. #define TXRX_FW_STATS_SND_INFO 14
  1257. #define TXRX_FW_STATS_ERROR_INFO 15
  1258. #define TXRX_FW_STATS_TX_SELFGEN_INFO 16
  1259. #define TXRX_FW_STATS_TX_MU_INFO 17
  1260. #define TXRX_FW_SIFS_RESP_INFO 18
  1261. #define TXRX_FW_RESET_STATS 19
  1262. #define TXRX_FW_MAC_WDOG_STATS 20
  1263. #define TXRX_FW_MAC_DESC_STATS 21
  1264. #define TXRX_FW_MAC_FETCH_MGR_STATS 22
  1265. #define TXRX_FW_MAC_PREFETCH_MGR_STATS 23
  1266. #define TXRX_FW_STATS_DURATION_INFO 24
  1267. #define TXRX_FW_STATS_DURATION_INFO_RESET 25
  1268. #define TXRX_FW_HALPHY_STATS 26
  1269. #define TXRX_FW_COEX_STATS 27
  1270. #define PER_RADIO_FW_STATS_REQUEST 0
  1271. #define PER_VDEV_FW_STATS_REQUEST 1
  1272. /**
  1273. * enum data_stall_log_event_indicator - Module triggering data stall
  1274. * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
  1275. * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
  1276. * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
  1277. * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
  1278. *
  1279. * Enum indicating the module that indicates data stall event
  1280. */
  1281. enum data_stall_log_event_indicator {
  1282. DATA_STALL_LOG_INDICATOR_UNUSED,
  1283. DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
  1284. DATA_STALL_LOG_INDICATOR_FIRMWARE,
  1285. DATA_STALL_LOG_INDICATOR_FRAMEWORK,
  1286. };
  1287. /**
  1288. * enum data_stall_log_event_type - data stall event type
  1289. * @DATA_STALL_LOG_NONE
  1290. * @DATA_STALL_LOG_FW_VDEV_PAUSE
  1291. * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
  1292. * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
  1293. * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
  1294. * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
  1295. * @DATA_STALL_LOG_FW_WDOG_ERRORS
  1296. * @DATA_STALL_LOG_BB_WDOG_ERROR
  1297. * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
  1298. * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
  1299. * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
  1300. * @DATA_STALL_LOG_NUD_FAILURE
  1301. *
  1302. * Enum indicating data stall event type
  1303. */
  1304. enum data_stall_log_event_type {
  1305. DATA_STALL_LOG_NONE,
  1306. DATA_STALL_LOG_FW_VDEV_PAUSE,
  1307. DATA_STALL_LOG_HWSCHED_CMD_FILTER,
  1308. DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
  1309. DATA_STALL_LOG_FW_RX_REFILL_FAILED,
  1310. DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
  1311. DATA_STALL_LOG_FW_WDOG_ERRORS,
  1312. DATA_STALL_LOG_BB_WDOG_ERROR,
  1313. DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
  1314. /* Stall events triggered by host/framework start from 0x100 onwards. */
  1315. DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
  1316. DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
  1317. DATA_STALL_LOG_NUD_FAILURE,
  1318. };
  1319. /**
  1320. * enum data_stall_log_recovery_type - data stall recovery type
  1321. * @DATA_STALL_LOG_RECOVERY_NONE,
  1322. * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  1323. * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
  1324. *
  1325. * Enum indicating data stall recovery type
  1326. */
  1327. enum data_stall_log_recovery_type {
  1328. DATA_STALL_LOG_RECOVERY_NONE = 0,
  1329. DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  1330. DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
  1331. };
  1332. /**
  1333. * struct data_stall_event_info - data stall info
  1334. * @indicator: Module triggering data stall
  1335. * @data_stall_type: data stall event type
  1336. * @vdev_id_bitmap: vdev_id_bitmap
  1337. * @pdev_id: pdev id
  1338. * @recovery_type: data stall recovery type
  1339. */
  1340. struct data_stall_event_info {
  1341. uint32_t indicator;
  1342. uint32_t data_stall_type;
  1343. uint32_t vdev_id_bitmap;
  1344. uint32_t pdev_id;
  1345. uint32_t recovery_type;
  1346. };
  1347. typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
  1348. /*
  1349. * enum cdp_stats - options for host and firmware
  1350. * statistics
  1351. * @CDP_TXRX_STATS_1: HTT Pdev tx stats
  1352. * @CDP_TXRX_STATS_2: HTT Pdev rx stats
  1353. * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
  1354. * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
  1355. * @CDP_TXRX_STATS_5: HTT Pdev error stats
  1356. * @CDP_TXRX_STATS_6: HTT TQM stats
  1357. * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
  1358. * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
  1359. * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
  1360. * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
  1361. * @CDP_TXRX_STATS_11: HTT Peer stats
  1362. * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
  1363. * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
  1364. * @CDP_TXRX_STATS_14: HTT Ring interface info stats
  1365. * @CDP_TXRX_STATS_15: HTT SRNG info stats
  1366. * @CDP_TXRX_STATS_16: HTT SFM info stats
  1367. * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
  1368. * @CDP_TXRX_STATS_18: HTT Peer list details
  1369. * @CDP_TXRX_STATS_19: Reserved
  1370. * @CDP_TXRX_STATS_20: Reset Host stats
  1371. * @CDP_TXRX_STATS_21: Host Rx rate stats
  1372. * @CDP_TXRX_STATS_22: Host Tx rate stats
  1373. * @CDP_TXRX_STATS_23: Host Tx stats
  1374. * @CDP_TXRX_STATS_24: Host Rx stats
  1375. * @CDP_TXRX_STATS_25: Host Ast stats
  1376. * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
  1377. * @CDP_TXRX_STATS_27: Host Monitor mode stats
  1378. * @CDP_TXRX_STATS_28: Host Peer entry stats
  1379. * @CDP_TXRX_STATS_29: Host Soc config params info
  1380. * @CDP_TXRX_STATS_30: Host Pdev config params info
  1381. * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
  1382. */
  1383. enum cdp_stats {
  1384. CDP_TXRX_STATS_0 = 0,
  1385. CDP_TXRX_STATS_1,
  1386. CDP_TXRX_STATS_2,
  1387. CDP_TXRX_STATS_3,
  1388. CDP_TXRX_STATS_4,
  1389. CDP_TXRX_STATS_5,
  1390. CDP_TXRX_STATS_6,
  1391. CDP_TXRX_STATS_7,
  1392. CDP_TXRX_STATS_8,
  1393. CDP_TXRX_STATS_9,
  1394. CDP_TXRX_STATS_10,
  1395. CDP_TXRX_STATS_11,
  1396. CDP_TXRX_STATS_12,
  1397. CDP_TXRX_STATS_13,
  1398. CDP_TXRX_STATS_14,
  1399. CDP_TXRX_STATS_15,
  1400. CDP_TXRX_STATS_16,
  1401. CDP_TXRX_STATS_17,
  1402. CDP_TXRX_STATS_18,
  1403. CDP_TXRX_STATS_19,
  1404. CDP_TXRX_STATS_20,
  1405. CDP_TXRX_STATS_21,
  1406. CDP_TXRX_STATS_22,
  1407. CDP_TXRX_STATS_23,
  1408. CDP_TXRX_STATS_24,
  1409. CDP_TXRX_STATS_25,
  1410. CDP_TXRX_STATS_26,
  1411. CDP_TXRX_STATS_27,
  1412. CDP_TXRX_STATS_28,
  1413. CDP_TXRX_STATS_29,
  1414. CDP_TXRX_STATS_30,
  1415. CDP_TXRX_STATS_31,
  1416. CDP_TXRX_STATS_HTT_MAX = 256,
  1417. CDP_TXRX_MAX_STATS = 265,
  1418. };
  1419. /*
  1420. * Different Stat update types sent to OL_IF
  1421. * @UPDATE_PEER_STATS: update peer stats
  1422. * @UPDATE_VDEV_STATS: update vdev stats
  1423. * @UPDATE_PDE_STATS: Update pdev stats
  1424. */
  1425. enum cdp_stat_update_type {
  1426. UPDATE_PEER_STATS = 0,
  1427. UPDATE_VDEV_STATS = 1,
  1428. UPDATE_PDEV_STATS = 2,
  1429. };
  1430. /*
  1431. * struct cdp_tx_sojourn_stats - Tx sojourn stats
  1432. * @ppdu_seq_id: ppdu_seq_id from tx completion
  1433. * @avg_sojourn_msdu: average sojourn msdu time
  1434. * @sum_sojourn_msdu: sum sojourn msdu time
  1435. * @num_msdu: number of msdus per ppdu
  1436. * @cookie: cookie to be used by upper layer
  1437. */
  1438. struct cdp_tx_sojourn_stats {
  1439. uint32_t ppdu_seq_id;
  1440. qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
  1441. uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
  1442. uint32_t num_msdus[CDP_DATA_TID_MAX];
  1443. struct cdp_stats_cookie *cookie;
  1444. };
  1445. /**
  1446. * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
  1447. * per-user information
  1448. * @frame_ctrl: frame control field in 802.11 header
  1449. * @qos_ctrl: QoS control field in 802.11 header
  1450. * @mpdu_tried: number of mpdus tried
  1451. * @ltf_size: ltf_size
  1452. * @stbc: stbc
  1453. * @he_re: he_re (range extension)
  1454. * @txbf: txbf
  1455. * @bw: Transmission bandwidth
  1456. * <enum 2 transmit_bw_20_MHz>
  1457. * <enum 3 transmit_bw_40_MHz>
  1458. * <enum 4 transmit_bw_80_MHz>
  1459. * <enum 5 transmit_bw_160_MHz>
  1460. * @nss: NSS 1,2, ...8
  1461. * @mcs: MCS index
  1462. * @preamble: preamble
  1463. * @gi: guard interval 800/400/1600/3200 ns
  1464. * @dcm: dcm
  1465. * @ldpc: ldpc
  1466. * @ru_start: RU start index
  1467. * @ru_tones: RU tones length
  1468. * @is_mcast: MCAST or UCAST
  1469. * @user_pos: user position
  1470. * @mu_group_id: mu group id
  1471. * @ppdu_start_timestamp: 64 bits ppdu start timestamp
  1472. * @ppdu_end_timestamp: 64 bits ppdu end timestamp
  1473. */
  1474. struct cdp_delayed_tx_completion_ppdu_user {
  1475. uint32_t frame_ctrl:16,
  1476. qos_ctrl:16;
  1477. uint32_t mpdu_tried_ucast:16,
  1478. mpdu_tried_mcast:16;
  1479. uint32_t ltf_size:2,
  1480. stbc:1,
  1481. he_re:1,
  1482. txbf:4,
  1483. bw:4,
  1484. nss:4,
  1485. mcs:4,
  1486. preamble:4,
  1487. gi:4,
  1488. dcm:1,
  1489. ldpc:1,
  1490. delayed_ba:1;
  1491. uint16_t ru_start;
  1492. uint16_t ru_tones;
  1493. bool is_mcast;
  1494. uint32_t user_pos;
  1495. uint32_t mu_group_id;
  1496. uint64_t ppdu_start_timestamp;
  1497. uint64_t ppdu_end_timestamp;
  1498. };
  1499. /**
  1500. * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
  1501. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1502. * @tid: TID number
  1503. * @peer_id: Peer ID
  1504. * @ba_size: Block-Ack size
  1505. * @frame_ctrl: frame control field in 802.11 header
  1506. * @qos_ctrl: QoS control field in 802.11 header
  1507. * @mpdu_tried: number of mpdus tried
  1508. * @mpdu_success: number of mpdus successfully transmitted
  1509. * @long_retries: long retries
  1510. * @short_retries: short retries
  1511. * @is_ampdu: mpdu aggregate or non-aggregate?
  1512. * @success_bytes: bytes successfully transmitted
  1513. * @retry_bytes: bytes retried
  1514. * @failed_msdus: MSDUs failed transmission
  1515. * @duration: user duration in ppdu
  1516. * @ltf_size: ltf_size
  1517. * @stbc: stbc
  1518. * @he_re: he_re (range extension)
  1519. * @txbf: txbf
  1520. * @bw: Transmission bandwidth
  1521. * <enum 2 transmit_bw_20_MHz>
  1522. * <enum 3 transmit_bw_40_MHz>
  1523. * <enum 4 transmit_bw_80_MHz>
  1524. * <enum 5 transmit_bw_160_MHz>
  1525. * @nss: NSS 1,2, ...8
  1526. * @mcs: MCS index
  1527. * @preamble: preamble
  1528. * @gi: guard interval 800/400/1600/3200 ns
  1529. * @dcm: dcm
  1530. * @ldpc: ldpc
  1531. * @delayed_ba: delayed ba bit
  1532. * @ack_ba_tlv: ack ba recv tlv bit
  1533. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  1534. * @pream_punct: Preamble Punctured PPDU
  1535. * UL_BSR_TRIG/UNKNOWN
  1536. * @ba_seq_no: Block Ack sequence number
  1537. * @ba_bitmap: Block Ack bitmap
  1538. * @start_seqa: Sequence number of first MPDU
  1539. * @enq_bitmap: Enqueue MPDU bitmap
  1540. * @ru_start: RU start index
  1541. * @ru_tones: RU tones length
  1542. * @is_mcast: MCAST or UCAST
  1543. * @tx_rate: Transmission Rate
  1544. * @user_pos: user position
  1545. * @mu_group_id: mu group id
  1546. * @rix: rate index
  1547. * @cookie: cookie to used by upper layer
  1548. * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
  1549. * @ppdu_cookie: 16-bit ppdu_cookie
  1550. * @sa_is_training: smart antenna training packets indication
  1551. * @rssi_chain: rssi chain per bandwidth
  1552. * @usr_ack_rssi: overall per user ack rssi
  1553. * @sa_tx_antenna: antenna in which packet is transmitted
  1554. * @sa_max_rates: smart antenna tx feedback info max rates
  1555. * @sa_goodput: smart antenna tx feedback info goodput
  1556. * @current_rate_per: Moving average per
  1557. * @last_enq_seq: last equeue sequence number
  1558. * @is_bss_peer: is bss peer check
  1559. * @mpdu_q: queue of mpdu in a ppdu
  1560. * @mpdus: MPDU list based on enqueue sequence bitmap
  1561. * @pending_retries: pending MPDUs (retries)
  1562. * @tlv_bitmap: per user tlv bitmap
  1563. * @skip: tx capture skip flag
  1564. * @mon_procd: to indicate user processed in ppdu of the sched cmd
  1565. * @debug_copied: flag to indicate bar frame copied
  1566. * @peer_last_delayed_ba: flag to indicate peer last delayed ba
  1567. * @phy_tx_time_us: Phy TX duration for the User
  1568. */
  1569. struct cdp_tx_completion_ppdu_user {
  1570. uint32_t completion_status:8,
  1571. tid:8,
  1572. peer_id:16;
  1573. uint8_t mac_addr[6];
  1574. uint16_t ba_size;
  1575. uint32_t frame_ctrl:16,
  1576. qos_ctrl:16;
  1577. uint32_t mpdu_tried_ucast:16,
  1578. mpdu_tried_mcast:16;
  1579. uint16_t mpdu_success:16;
  1580. uint16_t mpdu_failed:16;
  1581. uint32_t long_retries:4,
  1582. short_retries:4,
  1583. tx_ratecode:16,
  1584. is_ampdu:1,
  1585. ppdu_type:5,
  1586. pream_punct:1;
  1587. uint32_t success_bytes;
  1588. uint32_t retry_bytes;
  1589. uint32_t failed_bytes;
  1590. uint32_t success_msdus:16,
  1591. retry_msdus:16;
  1592. uint32_t failed_msdus:16,
  1593. duration:16;
  1594. uint32_t ltf_size:2,
  1595. stbc:1,
  1596. he_re:1,
  1597. txbf:4,
  1598. bw:4,
  1599. nss:4,
  1600. mcs:4,
  1601. preamble:4,
  1602. gi:4,
  1603. dcm:1,
  1604. ldpc:1,
  1605. delayed_ba:1,
  1606. ack_ba_tlv:1;
  1607. uint32_t ba_seq_no;
  1608. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1609. uint32_t start_seq;
  1610. uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1611. uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1612. uint32_t num_mpdu:9,
  1613. num_msdu:16;
  1614. uint32_t tx_duration;
  1615. uint16_t ru_start;
  1616. uint16_t ru_tones;
  1617. bool is_mcast;
  1618. uint32_t tx_rate;
  1619. uint32_t tx_ratekbps;
  1620. /*ack rssi for separate chains*/
  1621. uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
  1622. bool ack_rssi_valid;
  1623. uint32_t usr_ack_rssi;
  1624. uint32_t user_pos;
  1625. uint32_t mu_group_id;
  1626. uint32_t rix;
  1627. uint8_t is_ppdu_cookie_valid;
  1628. uint16_t ppdu_cookie;
  1629. uint8_t sa_is_training;
  1630. uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
  1631. uint32_t sa_tx_antenna;
  1632. /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ
  1633. * |---------------------------------------|
  1634. * | 16 bits | 16 bits | 16 bits | 16 bits |
  1635. * | BW-1 | BW-2 | BW-3 | BW-4 |
  1636. * | /\ \ |
  1637. * | / \ \ |
  1638. * | / \ \ |
  1639. * | / \ \ |
  1640. * | / \ \ |
  1641. * | / \ \ |
  1642. * |/ \ \ |
  1643. * |[11|8] [5|8] \ |
  1644. * | BW1 PADDED \ |
  1645. * |---------------------------------------|
  1646. */
  1647. uint16_t sa_max_rates[CDP_NUM_SA_BW];
  1648. uint32_t sa_goodput;
  1649. /* below field is used to calculate goodput in non-training period
  1650. * Note: As host is exposing goodput and hence current_rate_per is
  1651. * of no use. It is just for Host computation.
  1652. */
  1653. uint32_t current_rate_per;
  1654. uint32_t last_enq_seq;
  1655. uint8_t is_bss_peer;
  1656. qdf_nbuf_queue_t mpdu_q;
  1657. qdf_nbuf_t *mpdus;
  1658. uint32_t pending_retries;
  1659. uint32_t tlv_bitmap;
  1660. bool skip;
  1661. bool mon_procd;
  1662. bool debug_copied;
  1663. bool peer_last_delayed_ba;
  1664. uint16_t phy_tx_time_us;
  1665. };
  1666. /**
  1667. * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
  1668. * @ppdu_id: PPDU id
  1669. * @duration: user duration in ppdu
  1670. * @frame_type: frame type MGMT/CTRL/DATA/BAR
  1671. * @frame_ctrl: frame control field in 802.11 header
  1672. * @qos_ctrl: QoS control field in 802.11 header
  1673. * @tid: TID number
  1674. * @num_msdu: number of msdu in MPDU
  1675. * @seq_no: Sequence number of first MPDU
  1676. * @ltf_size: ltf_size
  1677. * @stbc: stbc
  1678. * @he_re: he_re (range extension)
  1679. * @txbf: txbf
  1680. * @bw: Transmission bandwidth
  1681. * <enum 2 transmit_bw_20_MHz>
  1682. * <enum 3 transmit_bw_40_MHz>
  1683. * <enum 4 transmit_bw_80_MHz>
  1684. * <enum 5 transmit_bw_160_MHz>
  1685. * @nss: NSS 1,2, ...8
  1686. * @mcs: MCS index
  1687. * @preamble: preamble
  1688. * @gi: guard interval 800/400/1600/3200 ns
  1689. * @resp_type: response type
  1690. * @mprot_type: medium protection type
  1691. * @rts_success: rts success
  1692. * @rts failure: rts failure
  1693. * @channel: frequency
  1694. * @channel_num: channel number
  1695. * @ack_rssi: ack rssi
  1696. * @ldpc: ldpc
  1697. * @tx_rate: Transmission Rate
  1698. * @mac_address: peer mac address
  1699. * @bss_mac_address: bss mac address
  1700. * @ppdu_start_timestamp: TSF at PPDU start
  1701. * @ppdu_end_timestamp: TSF at PPDU end
  1702. * @ba_start_seq: Block Ack sequence number
  1703. * @ba_bitmap: Block Ack bitmap
  1704. * @ppdu_cookie: 16-bit ppdu_cookie
  1705. * @long_retries: long retries
  1706. * @short_retries: short retries
  1707. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1708. * @usr_idx: user index
  1709. */
  1710. struct cdp_tx_indication_mpdu_info {
  1711. uint32_t ppdu_id;
  1712. uint32_t tx_duration;
  1713. uint16_t frame_type;
  1714. uint16_t frame_ctrl;
  1715. uint16_t qos_ctrl;
  1716. uint8_t tid;
  1717. uint32_t num_msdu;
  1718. uint32_t seq_no;
  1719. uint32_t ltf_size:2,
  1720. he_re:1,
  1721. txbf:4,
  1722. bw:4,
  1723. nss:4,
  1724. mcs:4,
  1725. preamble:4,
  1726. gi:4;
  1727. uint32_t channel;
  1728. uint8_t channel_num;
  1729. uint32_t ack_rssi;
  1730. uint32_t ldpc;
  1731. uint32_t tx_rate;
  1732. uint8_t mac_address[QDF_MAC_ADDR_SIZE];
  1733. uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
  1734. uint64_t ppdu_start_timestamp;
  1735. uint64_t ppdu_end_timestamp;
  1736. uint32_t ba_start_seq;
  1737. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1738. uint16_t ppdu_cookie;
  1739. uint16_t long_retries:4,
  1740. short_retries:4,
  1741. completion_status:8;
  1742. uint16_t resp_type:4,
  1743. mprot_type:3,
  1744. rts_success:1,
  1745. rts_failure:1;
  1746. uint8_t usr_idx;
  1747. };
  1748. /**
  1749. * struct cdp_tx_indication_info - Tx capture information
  1750. * @mpdu_info: Tx MPDU completion information
  1751. * @mpdu_nbuf: reconstructed mpdu packet
  1752. * @ppdu_desc: tx completion ppdu
  1753. */
  1754. struct cdp_tx_indication_info {
  1755. struct cdp_tx_indication_mpdu_info mpdu_info;
  1756. qdf_nbuf_t mpdu_nbuf;
  1757. struct cdp_tx_completion_ppdu *ppdu_desc;
  1758. };
  1759. /**
  1760. * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
  1761. * @ppdu_id: ppdu_id
  1762. * @is_sgen_pkt: payload recevied from wmi or htt path
  1763. * @retries_count: retries count
  1764. * @tx_tsf: 64 bit timestamp
  1765. */
  1766. struct cdp_tx_mgmt_comp_info {
  1767. uint32_t ppdu_id;
  1768. bool is_sgen_pkt;
  1769. uint16_t retries_count;
  1770. uint64_t tx_tsf;
  1771. };
  1772. /**
  1773. * struct cdp_tx_completion_ppdu - Tx PPDU completion information
  1774. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1775. * @ppdu_id: PPDU Id
  1776. * @ppdu_seq_id: ppdu sequence id for sojourn stats
  1777. * @vdev_id: VAP Id
  1778. * @bar_num_users: BA response user count, based on completion common TLV
  1779. * @num_users: Number of users
  1780. * @max_users: Number of users from USR_INFO TLV
  1781. * @drop_reason: drop reason from flush status
  1782. * @is_flush: is_flush is set based on flush tlv
  1783. * @flow_type: tx flow type from flush status
  1784. * @queue_type: queue type from flush status
  1785. * @num_mpdu: Number of MPDUs in PPDU
  1786. * @num_msdu: Number of MSDUs in PPDU
  1787. * @frame_type: frame SU or MU
  1788. * @htt_frame_type: frame type from htt
  1789. * @frame_ctrl: frame control of 80211 header
  1790. * @channel: Channel informartion
  1791. * @resp_type: response type
  1792. * @mprot_type: medium protection type
  1793. * @rts_success: rts success
  1794. * @rts failure: rts failure
  1795. * @phymode: phy mode
  1796. * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
  1797. * @tx_duration: PPDU airtime
  1798. * @ppdu_start_timestamp: TSF at PPDU start
  1799. * @ppdu_end_timestamp: TSF at PPDU end
  1800. * @ack_timestamp: TSF at the reception of ACK
  1801. * @delayed_ba: Delayed ba flag
  1802. * @beam_change: beam change bit in ppdu for he-information
  1803. * @bss_color: 6 bit value for full bss color
  1804. * @doppler: value for doppler (will be 0 most of the times)
  1805. * @spatial_reuse: value for spatial reuse used in radiotap HE header
  1806. * @usr_nss_sum: Sum of user nss
  1807. * @usr_ru_tones_sum: Sum of user ru_tones
  1808. * @bar_ppdu_id: BAR ppdu_id
  1809. * @bar_tx_duration: BAR tx duration
  1810. * @bar_ppdu_start_timestamp: BAR start timestamp
  1811. * @bar_ppdu_end_timestamp: BAR end timestamp
  1812. * @tlv_bitmap: tlv_bitmap for the PPDU
  1813. * @sched_cmdid: schedule command id
  1814. * @phy_ppdu_tx_time_us: Phy per PPDU TX duration
  1815. * @user: per-User stats (array of per-user structures)
  1816. */
  1817. struct cdp_tx_completion_ppdu {
  1818. uint32_t ppdu_id;
  1819. uint32_t ppdu_seq_id;
  1820. uint16_t vdev_id;
  1821. uint16_t bar_num_users;
  1822. uint32_t num_users;
  1823. uint8_t max_users;
  1824. uint8_t last_usr_index;
  1825. uint32_t drop_reason;
  1826. uint32_t is_flush:1,
  1827. flow_type:8,
  1828. queue_type:8;
  1829. uint32_t num_mpdu:9,
  1830. num_msdu:16;
  1831. uint16_t frame_type;
  1832. uint16_t htt_frame_type;
  1833. uint16_t frame_ctrl;
  1834. uint16_t channel;
  1835. uint16_t resp_type:4,
  1836. mprot_type:3,
  1837. rts_success:1,
  1838. rts_failure:1;
  1839. uint16_t phy_mode;
  1840. uint32_t ack_rssi;
  1841. uint32_t tx_duration;
  1842. uint64_t ppdu_start_timestamp;
  1843. uint64_t ppdu_end_timestamp;
  1844. uint64_t ack_timestamp;
  1845. bool delayed_ba;
  1846. uint8_t beam_change;
  1847. uint8_t bss_color;
  1848. uint8_t doppler;
  1849. uint8_t spatial_reuse;
  1850. uint8_t usr_nss_sum;
  1851. uint32_t usr_ru_tones_sum;
  1852. uint32_t bar_ppdu_id;
  1853. uint32_t bar_tx_duration;
  1854. uint64_t bar_ppdu_start_timestamp;
  1855. uint64_t bar_ppdu_end_timestamp;
  1856. uint32_t tlv_bitmap;
  1857. uint16_t sched_cmdid;
  1858. uint16_t phy_ppdu_tx_time_us;
  1859. struct cdp_tx_completion_ppdu_user user[];
  1860. };
  1861. /**
  1862. * struct cdp_dev_stats - Network device stats structure
  1863. * @tx_packets: Tx total packets transmitted
  1864. * @tx_bytes : Tx total bytes transmitted
  1865. * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
  1866. * @tx_dropped: Tx dropped is same as tx errors as above
  1867. * @rx_packets: Rx total packets transmitted
  1868. * @rx_bytes : Rx total bytes transmitted
  1869. * @rx_errors : Rx erros
  1870. * @rx_dropped: Rx dropped stats
  1871. */
  1872. struct cdp_dev_stats {
  1873. uint32_t tx_packets;
  1874. uint32_t tx_bytes;
  1875. uint32_t tx_errors;
  1876. uint32_t tx_dropped;
  1877. uint32_t rx_packets;
  1878. uint32_t rx_bytes;
  1879. uint32_t rx_errors;
  1880. uint32_t rx_dropped;
  1881. };
  1882. /**
  1883. * struct cdp_rate_stats - Tx/Rx Rate statistics
  1884. * @bw: Indicates the BW of the upcoming transmission -
  1885. * <enum 2 transmit_bw_20_MHz>
  1886. * <enum 3 transmit_bw_40_MHz>
  1887. * <enum 4 transmit_bw_80_MHz>
  1888. * <enum 5 transmit_bw_160_MHz>
  1889. * @pkt_type: Transmit Packet Type
  1890. * @stbc: When set, STBC transmission rate was used
  1891. * @ldpc: When set, use LDPC transmission rates
  1892. * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
  1893. * <enum 1 0_4_us_sgi > Legacy short GI
  1894. * <enum 2 1_6_us_sgi > HE related GI
  1895. * <enum 3 3_2_us_sgi > HE
  1896. * @mcs: Transmit MCS Rate
  1897. * @ofdma: Set when the transmission was an OFDMA transmission
  1898. * @tones_in_ru: The number of tones in the RU used.
  1899. * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
  1900. * @peer_id: Peer ID of the flow or MPDU queue
  1901. * @tid: TID of the flow or MPDU queue
  1902. */
  1903. struct cdp_rate_stats {
  1904. uint32_t rate_stats_info_valid:1,
  1905. bw:2,
  1906. pkt_type:4,
  1907. stbc:1,
  1908. ldpc:1,
  1909. sgi:2,
  1910. mcs:4,
  1911. ofdma:1,
  1912. tones_in_ru:12,
  1913. resvd0:4;
  1914. uint32_t tsf;
  1915. uint16_t peer_id;
  1916. uint8_t tid;
  1917. };
  1918. /**
  1919. * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
  1920. * @ppdu_id: PPDU to which this MSDU belongs
  1921. * @transmit_cnt: Number of times this frame has been transmitted
  1922. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  1923. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  1924. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  1925. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  1926. * @extd: Extended structure containing rate statistics
  1927. */
  1928. struct cdp_tx_completion_msdu {
  1929. uint32_t ppdu_id;
  1930. uint8_t transmit_cnt;
  1931. uint32_t ack_frame_rssi:8,
  1932. resvd0:1,
  1933. first_msdu:1,
  1934. last_msdu:1,
  1935. msdu_part_of_amsdu:1,
  1936. resvd1:20;
  1937. struct cdp_rate_stats extd;
  1938. };
  1939. /**
  1940. * struct cdp_rx_stats_ppdu_user -- per user RX stats
  1941. * @peer_id: Peer ID
  1942. * @vdev_id: VAP ID
  1943. * @is_ampdu: mpdu aggregate or non-aggregate?
  1944. * @mu_ul_info_valid: MU UL info valid
  1945. * @ofdma_ru_start_index: RU index number(0-73)
  1946. * @ofdma_ru_width: size of RU in units of 1(26tone)RU
  1947. * @nss: NSS 1,2, ...8
  1948. * @mcs: MCS index
  1949. * @user_index: user ID in multi-user case
  1950. * @is_bss_peer - is bss peer check
  1951. * @ast_index: ast index in multi-user case
  1952. * @tid: TID number
  1953. * @num_msdu: Number of MSDUs in PPDU
  1954. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  1955. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  1956. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  1957. * @frame_control: frame control field
  1958. * @frame_control_info_valid: frame_control valid
  1959. * @qos_control: qos control field
  1960. * @qos_control_info_valid: qos_control valid
  1961. * @data_sequence_control_info_valid: data_sequence_control_info valid
  1962. * @first_data_seq_ctrl: Sequence control field of first data frame
  1963. * @preamble: preamble
  1964. * @ht_flag: ht flag
  1965. * @vht_flag: vht flag
  1966. * @he_re: he_re (range extension)
  1967. * @mac_addr: Peer MAC Address
  1968. * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
  1969. * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
  1970. * @mpdu_fcs_ok_bitmap - MPDU with fcs ok bitmap
  1971. * @retries - number of retries
  1972. * @rx_ratekpbs - rx rate in kbps
  1973. */
  1974. struct cdp_rx_stats_ppdu_user {
  1975. uint16_t peer_id;
  1976. uint8_t vdev_id;
  1977. bool is_ampdu;
  1978. uint32_t mu_ul_info_valid:1,
  1979. ofdma_ru_start_index:7,
  1980. ofdma_ru_width:7,
  1981. nss:4,
  1982. mcs:4;
  1983. /* user id */
  1984. uint8_t user_index;
  1985. uint8_t is_bss_peer;
  1986. uint32_t ast_index;
  1987. uint32_t tid;
  1988. uint32_t num_msdu;
  1989. uint16_t tcp_msdu_count;
  1990. uint16_t udp_msdu_count;
  1991. uint16_t other_msdu_count;
  1992. uint16_t frame_control;
  1993. uint8_t frame_control_info_valid;
  1994. uint16_t qos_control;
  1995. uint8_t qos_control_info_valid;
  1996. uint8_t data_sequence_control_info_valid;
  1997. uint16_t first_data_seq_ctrl;
  1998. uint32_t preamble_type;
  1999. uint16_t ht_flags;
  2000. uint16_t vht_flags;
  2001. uint16_t he_flags;
  2002. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2003. uint32_t mpdu_cnt_fcs_ok;
  2004. uint32_t mpdu_cnt_fcs_err;
  2005. uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
  2006. uint32_t mpdu_ok_byte_count;
  2007. uint32_t mpdu_err_byte_count;
  2008. uint32_t retries;
  2009. uint32_t rx_ratekbps;
  2010. };
  2011. /**
  2012. * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
  2013. * @ppdu_id: PPDU Id
  2014. * @is_ampdu: mpdu aggregate or non-aggregate?
  2015. * @num_mpdu: Number of MPDUs in PPDU
  2016. * @reserved: Reserved bits for future use
  2017. * @num_msdu: Number of MSDUs in PPDU
  2018. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  2019. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  2020. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  2021. * @duration: PPDU duration
  2022. * @tid: TID number
  2023. * @peer_id: Peer ID
  2024. * @vdev_id: VAP ID
  2025. * @mac_addr: Peer MAC Address
  2026. * @first_data_seq_ctrl: Sequence control field of first data frame
  2027. * @ltf_size: ltf_size
  2028. * @stbc: When set, STBC rate was used
  2029. * @he_re: he_re (range extension)
  2030. * @bw: Bandwidth
  2031. * <enum 0 bw_20_MHz>
  2032. * <enum 1 bw_40_MHz>
  2033. * <enum 2 bw_80_MHz>
  2034. * <enum 3 bw_160_MHz>
  2035. * @nss: NSS 1,2, ...8
  2036. * @mcs: MCS index
  2037. * @preamble: preamble
  2038. * @gi: <enum 0 0_8_us_sgi > Legacy normal GI
  2039. * <enum 1 0_4_us_sgi > Legacy short GI
  2040. * <enum 2 1_6_us_sgi > HE related GI
  2041. * <enum 3 3_2_us_sgi > HE
  2042. * @dcm: dcm
  2043. * @ldpc: ldpc
  2044. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  2045. * UL_BSR_TRIG/UNKNOWN
  2046. * @rssi: RSSI value (units = dB above noise floor)
  2047. * @timestamp: TSF at the reception of PPDU
  2048. * @length: PPDU length
  2049. * @channel: Channel informartion
  2050. * @lsig_A: L-SIG in 802.11 PHY header
  2051. * @frame_ctrl: frame control field
  2052. * @rix: rate index
  2053. * @rssi_chain: rssi chain per nss per bw
  2054. * @cookie: cookie to used by upper layer
  2055. * @user: per user stats in MU-user case
  2056. * @nf: noise floor
  2057. * @per_chain_rssi: rssi per antenna
  2058. */
  2059. struct cdp_rx_indication_ppdu {
  2060. uint32_t ppdu_id;
  2061. uint16_t is_ampdu:1,
  2062. num_mpdu:9,
  2063. reserved:6;
  2064. uint32_t num_msdu;
  2065. uint32_t num_bytes;
  2066. uint16_t udp_msdu_count;
  2067. uint16_t tcp_msdu_count;
  2068. uint16_t other_msdu_count;
  2069. uint16_t duration;
  2070. uint32_t tid:8,
  2071. peer_id:16;
  2072. uint8_t vdev_id;
  2073. uint8_t mac_addr[6];
  2074. uint16_t first_data_seq_ctrl;
  2075. union {
  2076. uint32_t rate_info;
  2077. struct {
  2078. uint32_t ltf_size:2,
  2079. stbc:1,
  2080. he_re:1,
  2081. bw:4,
  2082. nss:4,
  2083. mcs:4,
  2084. preamble:4,
  2085. gi:4,
  2086. dcm:1,
  2087. ldpc:1,
  2088. ppdu_type:5;
  2089. };
  2090. } u;
  2091. uint32_t rix;
  2092. uint32_t lsig_a;
  2093. uint32_t rssi;
  2094. uint64_t timestamp;
  2095. uint32_t length;
  2096. uint8_t channel;
  2097. uint8_t beamformed;
  2098. uint32_t rx_ratekbps;
  2099. uint32_t ppdu_rx_rate;
  2100. uint32_t retries;
  2101. uint32_t rx_byte_count;
  2102. uint16_t rx_ratecode;
  2103. uint8_t fcs_error_mpdus;
  2104. uint16_t frame_ctrl;
  2105. int8_t rssi_chain[SS_COUNT][MAX_BW];
  2106. struct cdp_rx_su_evm_info evm_info;
  2107. uint32_t rx_antenna;
  2108. uint8_t num_users;
  2109. struct cdp_rx_stats_ppdu_user user[CDP_MU_MAX_USERS];
  2110. uint32_t nf;
  2111. uint8_t per_chain_rssi[MAX_CHAIN];
  2112. uint8_t is_mcast_bcast;
  2113. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  2114. struct cdp_rx_ppdu_cfr_info cfr_info;
  2115. #endif
  2116. };
  2117. /**
  2118. * struct cdp_rx_indication_msdu - Rx MSDU info
  2119. * @ppdu_id: PPDU to which the MSDU belongs
  2120. * @msdu_len: Length of MSDU in bytes
  2121. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  2122. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  2123. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  2124. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  2125. * @extd: Extended structure containing rate statistics
  2126. */
  2127. struct cdp_rx_indication_msdu {
  2128. uint32_t ppdu_id;
  2129. uint16_t msdu_len;
  2130. uint32_t ack_frame_rssi:8,
  2131. resvd0:1,
  2132. first_msdu:1,
  2133. last_msdu:1,
  2134. msdu_part_of_amsdu:1,
  2135. msdu_part_of_ampdu:1,
  2136. resvd1:19;
  2137. struct cdp_rate_stats extd;
  2138. };
  2139. /**
  2140. * struct cdp_config_params - Propagate configuration parameters to datapath
  2141. * @tso_enable: Enable/Disable TSO
  2142. * @lro_enable: Enable/Disable LRO
  2143. * @gro_enable: Enable/Disable GRO
  2144. * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
  2145. * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P
  2146. * @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN
  2147. * @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload
  2148. * @legacy_mode_checksumoffload_disable: Disable TCP/UDP Checksum Offload for
  2149. * legacy modes.
  2150. * @napi_enable: Enable/Disable Napi
  2151. * @ipa_enable: Flag indicating if IPA is enabled or not
  2152. * @tx_flow_stop_queue_threshold: Value to Pause tx queues
  2153. * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
  2154. * tx queue
  2155. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  2156. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  2157. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  2158. */
  2159. struct cdp_config_params {
  2160. unsigned int tso_enable:1;
  2161. unsigned int lro_enable:1;
  2162. unsigned int gro_enable:1;
  2163. unsigned int flow_steering_enable:1;
  2164. unsigned int p2p_tcp_udp_checksumoffload:1;
  2165. unsigned int nan_tcp_udp_checksumoffload:1;
  2166. unsigned int tcp_udp_checksumoffload:1;
  2167. unsigned int legacy_mode_checksumoffload_disable:1;
  2168. unsigned int napi_enable:1;
  2169. unsigned int ipa_enable:1;
  2170. /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
  2171. uint8_t tx_flow_stop_queue_threshold;
  2172. uint8_t tx_flow_start_queue_offset;
  2173. uint32_t tx_comp_loop_pkt_limit;
  2174. uint32_t rx_reap_loop_pkt_limit;
  2175. uint32_t rx_hp_oos_update_limit;
  2176. };
  2177. /**
  2178. * cdp_txrx_stats_req: stats request wrapper
  2179. * used to pass request information to cdp layer
  2180. * @stats: type of stats requested
  2181. * @param0: opaque argument 0 to be passed to htt
  2182. * @param1: opaque argument 1 to be passed to htt
  2183. * @param2: opaque argument 2 to be passed to htt
  2184. * @param3: opaque argument 3 to be passed to htt
  2185. * @mac id: mac_id
  2186. */
  2187. struct cdp_txrx_stats_req {
  2188. enum cdp_stats stats;
  2189. uint32_t param0;
  2190. uint32_t param1;
  2191. uint32_t param2;
  2192. uint32_t param3;
  2193. uint32_t cookie_val;
  2194. uint8_t mac_id;
  2195. char *peer_addr;
  2196. };
  2197. /**
  2198. * struct cdp_monitor_filter - monitor filter info
  2199. * @mode: set filter mode
  2200. * @fp_mgmt: set Filter Pass MGMT Configuration
  2201. * @fp_ctrl: set Filter Pass CTRL Configuration
  2202. * @fp_data: set Filter Pass DATA Configuration
  2203. * @mo_mgmt: set Monitor Other MGMT Configuration
  2204. * @mo_ctrl: set Monitor Other CTRL Configuration
  2205. * @mo_data: set Monitor other DATA Configuration
  2206. *
  2207. */
  2208. struct cdp_monitor_filter {
  2209. uint16_t mode;
  2210. uint16_t fp_mgmt;
  2211. uint16_t fp_ctrl;
  2212. uint16_t fp_data;
  2213. uint16_t mo_mgmt;
  2214. uint16_t mo_ctrl;
  2215. uint16_t mo_data;
  2216. };
  2217. /**
  2218. * enum cdp_dp_cfg - CDP ENUMs to get to DP configation
  2219. * @cfg_dp_enable_data_stall: context passed to be used by consumer
  2220. * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config
  2221. * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config
  2222. * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others
  2223. * @cfg_dp_tso_enable: get TSO enable config
  2224. * @cfg_dp_lro_enable: get LRO enable config
  2225. * @cfg_dp_gro_enable: get GRP enable config
  2226. * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset
  2227. * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold
  2228. * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config
  2229. * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config
  2230. * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config
  2231. * @cfg_dp_enable_flow_steering: get flow steerint enable config
  2232. * @cfg_dp_reorder_offload_supported: get reorder offload support config
  2233. * @cfg_dp_ce_classify_enable: get CE classify enable config
  2234. * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config
  2235. * @cfg_dp_pktlog_buffer_size: get packet log buffer size config
  2236. * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config
  2237. */
  2238. enum cdp_dp_cfg {
  2239. cfg_dp_enable_data_stall,
  2240. cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload,
  2241. cfg_dp_enable_nan_ip_tcp_udp_checksum_offload,
  2242. cfg_dp_enable_ip_tcp_udp_checksum_offload,
  2243. /* Disable checksum offload for legacy modes */
  2244. cfg_dp_disable_legacy_mode_csum_offload,
  2245. cfg_dp_tso_enable,
  2246. cfg_dp_lro_enable,
  2247. cfg_dp_gro_enable,
  2248. cfg_dp_sg_enable,
  2249. cfg_dp_tx_flow_start_queue_offset,
  2250. cfg_dp_tx_flow_stop_queue_threshold,
  2251. cfg_dp_ipa_uc_tx_buf_size,
  2252. cfg_dp_ipa_uc_tx_partition_base,
  2253. cfg_dp_ipa_uc_rx_ind_ring_count,
  2254. cfg_dp_enable_flow_steering,
  2255. cfg_dp_reorder_offload_supported,
  2256. cfg_dp_ce_classify_enable,
  2257. cfg_dp_disable_intra_bss_fwd,
  2258. cfg_dp_pktlog_buffer_size,
  2259. cfg_dp_wow_check_rx_pending,
  2260. };
  2261. /**
  2262. * struct cdp_peer_cookie - cookie used when creating peer
  2263. * @ctx: context passed to be used by consumer
  2264. * @mac_addr: MAC address of peer
  2265. * @peer_id: peer id
  2266. * @pdev_id: pdev_id
  2267. * @cookie: cookie to be used by consumer
  2268. */
  2269. struct cdp_peer_cookie {
  2270. struct cdp_stats_cookie *ctx;
  2271. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2272. uint8_t peer_id;
  2273. uint8_t pdev_id;
  2274. uint8_t cookie;
  2275. };
  2276. #ifdef WLAN_SUPPORT_RX_FISA
  2277. struct cdp_flow_stats {
  2278. uint32_t aggr_count;
  2279. uint32_t curr_aggr_count;
  2280. uint32_t flush_count;
  2281. uint32_t bytes_aggregated;
  2282. };
  2283. #else
  2284. /**
  2285. * cdp_flow_stats - Per-Flow (5-tuple) statistics
  2286. * @msdu_count: number of rx msdus matching this flow
  2287. *
  2288. * HW also includes msdu_byte_count and timestamp, which
  2289. * are not currently tracked in SW.
  2290. */
  2291. struct cdp_flow_stats {
  2292. uint32_t msdu_count;
  2293. };
  2294. #endif
  2295. /**
  2296. * cdp_flow_fst_operation - RX FST operations allowed
  2297. */
  2298. enum cdp_flow_fst_operation {
  2299. CDP_FLOW_FST_ENTRY_ADD,
  2300. CDP_FLOW_FST_ENTRY_DEL,
  2301. CDP_FLOW_FST_RX_BYPASS_ENABLE,
  2302. CDP_FLOW_FST_RX_BYPASS_DISABLE
  2303. };
  2304. /**
  2305. * cdp_flow_protocol_type - RX FST supported protocol types, mapped to HW spec
  2306. */
  2307. enum cdp_flow_protocol_type {
  2308. CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
  2309. CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
  2310. };
  2311. /**
  2312. * cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
  2313. * @dest_ip_127_96: destination IP address bit fields 96-127
  2314. * @dest_ip_95_64: destination IP address bit fields 64-95
  2315. * @dest_ip_63_32: destination IP address bit fields 32-63
  2316. * @dest_ip_31_0: destination IP address bit fields 0-31
  2317. * @src_ip_127_96: source IP address bit fields 96-127
  2318. * @src_ip_95_64: source IP address bit fields 64-95
  2319. * @src_ip_63_32: source IP address bit fields 32-63
  2320. * @src_ip_31_0: source IP address bit fields 0-31
  2321. * @dest_port: destination port of flow
  2322. * @src_port: source port of flow
  2323. * @l4_protocol: protocol type in flow (TCP/UDP)
  2324. */
  2325. struct cdp_rx_flow_tuple_info {
  2326. #ifdef WLAN_SUPPORT_RX_FISA
  2327. uint8_t tuple_populated;
  2328. uint8_t is_exception;
  2329. #endif
  2330. uint32_t dest_ip_127_96;
  2331. uint32_t dest_ip_95_64;
  2332. uint32_t dest_ip_63_32;
  2333. uint32_t dest_ip_31_0;
  2334. uint32_t src_ip_127_96;
  2335. uint32_t src_ip_95_64;
  2336. uint32_t src_ip_63_32;
  2337. uint32_t src_ip_31_0;
  2338. uint16_t dest_port;
  2339. uint16_t src_port;
  2340. uint16_t l4_protocol;
  2341. };
  2342. /**
  2343. * cdp_rx_flow_info - RX flow info used for addition/deletion
  2344. * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
  2345. * @op_code: add/delete/enable/disable operation requested
  2346. * @flow_tupe_info: structure containing tuple info
  2347. * @fse_metadata: metadata to be set in RX flow
  2348. */
  2349. struct cdp_rx_flow_info {
  2350. bool is_addr_ipv4;
  2351. enum cdp_flow_fst_operation op_code;
  2352. struct cdp_rx_flow_tuple_info flow_tuple_info;
  2353. uint16_t fse_metadata;
  2354. };
  2355. #endif