cdp_txrx_cmn_struct.h 80 KB

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