cdp_txrx_cmn_struct.h 69 KB

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