cdp_txrx_cmn_struct.h 82 KB

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