cdp_txrx_cmn_struct.h 78 KB

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