cdp_txrx_cmn_struct.h 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114
  1. /*
  2. * Copyright (c) 2011-2019 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. * @data_vdev - handle to the virtual device object
  628. * @msdu_list - list of network buffers
  629. * @tx_exc_metadata - structure that holds parameters to exception path
  630. */
  631. typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_vdev *data_vdev,
  632. qdf_nbuf_t msdu_list,
  633. struct cdp_tx_exception_metadata
  634. *tx_exc_metadata);
  635. /**
  636. * ol_txrx_completion_fp - top-level transmit function
  637. * for tx completion
  638. * @skb: skb data
  639. * @osif_dev: the virtual device's OS shim object
  640. */
  641. typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
  642. void *osif_dev);
  643. /**
  644. * ol_txrx_tx_flow_control_fp - tx flow control notification
  645. * function from txrx to OS shim
  646. * @osif_dev - the virtual device's OS shim object
  647. * @tx_resume - tx os q should be resumed or not
  648. */
  649. typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
  650. bool tx_resume);
  651. /**
  652. * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
  653. * function from txrx to OS shim
  654. * @osif_dev - the virtual device's OS shim object
  655. *
  656. * Return: true if tx is paused by flow control
  657. */
  658. typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
  659. /**
  660. * ol_txrx_rx_fp - receive function to hand batches of data
  661. * frames from txrx to OS shim
  662. * @data_vdev - handle to the OSIF virtual device object
  663. * @msdu_list - list of network buffers
  664. */
  665. typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
  666. /**
  667. * ol_txrx_rx_flush_fp - receive function to hand batches of data
  668. * frames from txrx to OS shim
  669. * @osif_dev: handle to the OSIF virtual device object
  670. * @vdev_id: vdev_if of the packets to be flushed
  671. */
  672. typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id);
  673. /**
  674. * ol_txrx_rx_gro_flush_ind - function to send GRO flush indication to stack
  675. * for a given RX Context Id.
  676. * @osif_dev - handle to the OSIF virtual device object
  677. * @rx_ctx_id - Rx context Id for which gro flush should happen
  678. */
  679. typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev,
  680. int rx_ctx_id);
  681. /**
  682. * ol_txrx_stats_rx_fp - receive function to hand batches of data
  683. * frames from txrx to OS shim
  684. * @skb: skb data
  685. * @osif_dev: the virtual device's OS shim object
  686. * @action: data packet type
  687. * @pkt_type: packet data type
  688. */
  689. typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
  690. void *osif_dev, enum connectivity_stats_pkt_status action,
  691. uint8_t *pkt_type);
  692. /**
  693. * ol_txrx_get_key_fp - function to gey key based on keyix and peer
  694. * mac address
  695. * @osif_dev - the virtual device's OS shim object
  696. * @key_buf - pointer to store key
  697. * @mac_addr - pointer to mac address
  698. * @keyix - key id
  699. */
  700. typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
  701. /**
  702. * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
  703. * packets in receive path.
  704. * @osif_dev - the virtual device's OS shim object
  705. * @list_head - poniter to head of receive packet queue to decap
  706. * @list_tail - poniter to tail of receive packet queue to decap
  707. * @peer - Peer handler
  708. */
  709. typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
  710. qdf_nbuf_t *list_head,
  711. qdf_nbuf_t *list_tail,
  712. struct cdp_peer *peer);
  713. /* ol_txrx_rx_fp - external tx free function to read per packet stats and
  714. * free tx buffer externally
  715. * @netbuf - tx network buffer
  716. */
  717. typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
  718. /**
  719. * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
  720. */
  721. typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
  722. qdf_nbuf_t mpdu_head,
  723. qdf_nbuf_t mpdu_tail);
  724. /**
  725. * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
  726. * MPDU (802.11 format)
  727. */
  728. typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
  729. qdf_nbuf_t mpdu,
  730. void *rx_status);
  731. /**
  732. * ol_txrx_proxy_arp_fp - proxy arp function pointer
  733. */
  734. typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
  735. qdf_nbuf_t netbuf);
  736. /*
  737. * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
  738. */
  739. typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
  740. qdf_nbuf_t netbuf);
  741. /**
  742. * ol_txrx_stats_callback - statistics notify callback
  743. */
  744. typedef void (*ol_txrx_stats_callback)(void *ctxt,
  745. enum htt_cmn_dbg_stats_type type,
  746. uint8_t *buf, int bytes);
  747. /**
  748. * ol_txrx_pktdump_cb - callback for packet dump feature
  749. */
  750. typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
  751. uint8_t pdev_id,
  752. uint8_t vdev_id,
  753. qdf_nbuf_t netbuf,
  754. uint8_t status,
  755. uint8_t type);
  756. /**
  757. * ol_txrx_ops - (pointers to) the functions used for tx and rx
  758. * data xfer
  759. *
  760. * There are two portions of these txrx operations.
  761. * The rx portion is filled in by OSIF SW before calling
  762. * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
  763. * the txrx SW stores a copy of these rx function pointers, to use
  764. * as it delivers rx data frames to the OSIF SW.
  765. * The tx portion is filled in by the txrx SW inside
  766. * ol_txrx_osif_vdev_register; when the function call returns,
  767. * the OSIF SW stores a copy of these tx functions to use as it
  768. * delivers tx data frames to the txrx SW.
  769. *
  770. * @tx.std - the tx function pointer for standard data
  771. * frames This function pointer is set by the txrx SW
  772. * perform host-side transmit operations based on
  773. * whether a HL or LL host/target interface is in use.
  774. * @tx.flow_control_cb - the transmit flow control
  775. * function that is registered by the
  776. * OSIF which is called from txrx to
  777. * indicate whether the transmit OS
  778. * queues should be paused/resumed
  779. * @rx.rx - the OS shim rx function to deliver rx data
  780. * frames to. This can have different values for
  781. * different virtual devices, e.g. so one virtual
  782. * device's OS shim directly hands rx frames to the OS,
  783. * but another virtual device's OS shim filters out P2P
  784. * messages before sending the rx frames to the OS. The
  785. * netbufs delivered to the osif_rx function are in the
  786. * format specified by the OS to use for tx and rx
  787. * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
  788. * are given to the thread, instead of the stack via this pointer.
  789. * @rx.stack - function to give packets to the stack. Differs from @rx.rx.
  790. * In case RX Threads are enabled, this pointer holds the callback to give
  791. * packets to the stack.
  792. * @rx.rx_gro_flush - GRO flush indication to stack for a given RX CTX ID
  793. * @rx.wai_check - the tx function pointer for WAPI frames
  794. * @rx.mon - the OS shim rx monitor function to deliver
  795. * monitor data to Though in practice, it is probable
  796. * that the same function will be used for delivering
  797. * rx monitor data for all virtual devices, in theory
  798. * each different virtual device can have a different
  799. * OS shim function for accepting rx monitor data. The
  800. * netbufs delivered to the osif_rx_mon function are in
  801. * 802.11 format. Each netbuf holds a 802.11 MPDU, not
  802. * an 802.11 MSDU. Depending on compile-time
  803. * configuration, each netbuf may also have a
  804. * monitor-mode encapsulation header such as a radiotap
  805. * header added before the MPDU contents.
  806. * @rx.std - the OS shim rx function to deliver rx data
  807. * @proxy_arp - proxy arp function pointer - specified by
  808. * OS shim, stored by txrx
  809. * @get_key - function pointer to get key of the peer with
  810. * specific key index
  811. */
  812. struct ol_txrx_ops {
  813. /* tx function pointers - specified by txrx, stored by OS shim */
  814. struct {
  815. ol_txrx_tx_fp tx;
  816. ol_txrx_tx_exc_fp tx_exception;
  817. ol_txrx_tx_free_ext_fp tx_free_ext;
  818. ol_txrx_completion_fp tx_comp;
  819. } tx;
  820. /* rx function pointers - specified by OS shim, stored by txrx */
  821. struct {
  822. ol_txrx_rx_fp rx;
  823. ol_txrx_rx_fp rx_stack;
  824. ol_txrx_rx_flush_fp rx_flush;
  825. ol_txrx_rx_gro_flush_ind_fp rx_gro_flush;
  826. ol_txrx_rx_check_wai_fp wai_check;
  827. ol_txrx_rx_mon_fp mon;
  828. ol_txrx_stats_rx_fp stats_rx;
  829. ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
  830. } rx;
  831. /* proxy arp function pointer - specified by OS shim, stored by txrx */
  832. ol_txrx_proxy_arp_fp proxy_arp;
  833. ol_txrx_mcast_me_fp me_convert;
  834. ol_txrx_get_key_fp get_key;
  835. };
  836. /**
  837. * ol_txrx_stats_req - specifications of the requested
  838. * statistics
  839. */
  840. struct ol_txrx_stats_req {
  841. uint32_t stats_type_upload_mask; /* which stats to upload */
  842. uint32_t stats_type_reset_mask; /* which stats to reset */
  843. /* stats will be printed if either print element is set */
  844. struct {
  845. int verbose; /* verbose stats printout */
  846. int concise; /* concise stats printout (takes precedence) */
  847. } print; /* print uploaded stats */
  848. /* stats notify callback will be invoked if fp is non-NULL */
  849. struct {
  850. ol_txrx_stats_callback fp;
  851. void *ctxt;
  852. } callback;
  853. /* stats will be copied into the specified buffer if buf is non-NULL */
  854. struct {
  855. uint8_t *buf;
  856. int byte_limit; /* don't copy more than this */
  857. } copy;
  858. /*
  859. * If blocking is true, the caller will take the specified semaphore
  860. * to wait for the stats to be uploaded, and the driver will release
  861. * the semaphore when the stats are done being uploaded.
  862. */
  863. struct {
  864. int blocking;
  865. /*Note: this needs to change to some qdf_* type */
  866. qdf_semaphore_t *sem_ptr;
  867. } wait;
  868. };
  869. /* DP soc struct definition */
  870. struct cdp_soc_t {
  871. struct cdp_ops *ops;
  872. struct ol_if_ops *ol_ops;
  873. };
  874. /*
  875. * cdp_pdev_param_type: different types of parameters
  876. * to set values in pdev
  877. * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
  878. * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
  879. * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
  880. * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
  881. * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
  882. * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
  883. * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
  884. * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
  885. * @CDP_INGRESS_STATS: Accumulate ingress statistics
  886. * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
  887. * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
  888. */
  889. enum cdp_pdev_param_type {
  890. CDP_CONFIG_DEBUG_SNIFFER,
  891. CDP_CONFIG_BPR_ENABLE,
  892. CDP_CONFIG_PRIMARY_RADIO,
  893. CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
  894. CDP_CONFIG_IGMPMLD_OVERRIDE,
  895. CDP_CONFIG_IGMPMLD_TID,
  896. CDP_CONFIG_ARP_DBG_CONF,
  897. CDP_CONFIG_CAPTURE_LATENCY,
  898. CDP_INGRESS_STATS,
  899. CDP_OSIF_DROP,
  900. CDP_CONFIG_ENH_RX_CAPTURE,
  901. CDP_CONFIG_TX_CAPTURE,
  902. };
  903. /**
  904. * cdp_rx_enh_capture_mode - Rx enhanced capture modes
  905. * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
  906. * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
  907. * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
  908. */
  909. enum cdp_rx_enh_capture_mode {
  910. CDP_RX_ENH_CAPTURE_DISABLED = 0,
  911. CDP_RX_ENH_CAPTURE_MPDU,
  912. CDP_RX_ENH_CAPTURE_MPDU_MSDU,
  913. };
  914. /**
  915. * cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
  916. * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
  917. * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
  918. */
  919. enum cdp_rx_enh_capture_peer {
  920. CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
  921. CDP_RX_ENH_CAPTURE_PEER_ENABLED,
  922. };
  923. /**
  924. * cdp_tx_enh_capture_mode - Tx enhanced capture modes
  925. * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
  926. * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
  927. * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
  928. */
  929. enum cdp_tx_enh_capture_mode {
  930. CDP_TX_ENH_CAPTURE_DISABLED = 0,
  931. CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
  932. CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
  933. };
  934. /*
  935. * enum cdp_pdev_bpr_param - different types of parameters
  936. * to set value in pdev
  937. * @CDP_BPR_DISABLE: Set bpr to disable state
  938. * @CDP_BPR_ENABLE: set bpr to enable state
  939. *
  940. * Enum indicating bpr state to enable/disable.
  941. */
  942. enum cdp_pdev_bpr_param {
  943. CDP_BPR_DISABLE,
  944. CDP_BPR_ENABLE,
  945. };
  946. /*
  947. * cdp_vdev_param_type: different types of parameters
  948. * to set values in vdev
  949. * @CDP_ENABLE_NAWDS: set nawds enable/disable
  950. * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
  951. * @CDP_ENABLE_WDS: wds sta
  952. * @CDP_ENABLE_MEC: MEC enable flags
  953. * @CDP_ENABLE_PROXYSTA: proxy sta
  954. * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
  955. * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
  956. * @CDP_ENABLE_CIPHER : set cipher type based on security
  957. * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
  958. */
  959. enum cdp_vdev_param_type {
  960. CDP_ENABLE_NAWDS,
  961. CDP_ENABLE_MCAST_EN,
  962. CDP_ENABLE_WDS,
  963. CDP_ENABLE_MEC,
  964. CDP_ENABLE_DA_WAR,
  965. CDP_ENABLE_PROXYSTA,
  966. CDP_UPDATE_TDLS_FLAGS,
  967. CDP_CFG_WDS_AGING_TIMER,
  968. CDP_ENABLE_AP_BRIDGE,
  969. CDP_ENABLE_CIPHER,
  970. CDP_ENABLE_QWRAP_ISOLATION,
  971. CDP_UPDATE_MULTIPASS
  972. };
  973. #define TXRX_FW_STATS_TXSTATS 1
  974. #define TXRX_FW_STATS_RXSTATS 2
  975. #define TXRX_FW_STATS_RX_RATE_INFO 3
  976. #define TXRX_FW_STATS_PHYSTATS 4
  977. #define TXRX_FW_STATS_PHYSTATS_CONCISE 5
  978. #define TXRX_FW_STATS_TX_RATE_INFO 6
  979. #define TXRX_FW_STATS_TID_STATE 7
  980. #define TXRX_FW_STATS_HOST_STATS 8
  981. #define TXRX_FW_STATS_CLEAR_HOST_STATS 9
  982. #define TXRX_FW_STATS_CE_STATS 10
  983. #define TXRX_FW_STATS_VOW_UMAC_COUNTER 11
  984. #define TXRX_FW_STATS_ME_STATS 12
  985. #define TXRX_FW_STATS_TXBF_INFO 13
  986. #define TXRX_FW_STATS_SND_INFO 14
  987. #define TXRX_FW_STATS_ERROR_INFO 15
  988. #define TXRX_FW_STATS_TX_SELFGEN_INFO 16
  989. #define TXRX_FW_STATS_TX_MU_INFO 17
  990. #define TXRX_FW_SIFS_RESP_INFO 18
  991. #define TXRX_FW_RESET_STATS 19
  992. #define TXRX_FW_MAC_WDOG_STATS 20
  993. #define TXRX_FW_MAC_DESC_STATS 21
  994. #define TXRX_FW_MAC_FETCH_MGR_STATS 22
  995. #define TXRX_FW_MAC_PREFETCH_MGR_STATS 23
  996. #define TXRX_FW_STATS_DURATION_INFO 24
  997. #define TXRX_FW_STATS_DURATION_INFO_RESET 25
  998. #define TXRX_FW_HALPHY_STATS 26
  999. #define TXRX_FW_COEX_STATS 27
  1000. #define PER_RADIO_FW_STATS_REQUEST 0
  1001. #define PER_VDEV_FW_STATS_REQUEST 1
  1002. /**
  1003. * enum data_stall_log_event_indicator - Module triggering data stall
  1004. * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
  1005. * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
  1006. * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
  1007. * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
  1008. *
  1009. * Enum indicating the module that indicates data stall event
  1010. */
  1011. enum data_stall_log_event_indicator {
  1012. DATA_STALL_LOG_INDICATOR_UNUSED,
  1013. DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
  1014. DATA_STALL_LOG_INDICATOR_FIRMWARE,
  1015. DATA_STALL_LOG_INDICATOR_FRAMEWORK,
  1016. };
  1017. /**
  1018. * enum data_stall_log_event_type - data stall event type
  1019. * @DATA_STALL_LOG_NONE
  1020. * @DATA_STALL_LOG_FW_VDEV_PAUSE
  1021. * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
  1022. * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
  1023. * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
  1024. * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
  1025. * @DATA_STALL_LOG_FW_WDOG_ERRORS
  1026. * @DATA_STALL_LOG_BB_WDOG_ERROR
  1027. * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
  1028. * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
  1029. * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
  1030. * @DATA_STALL_LOG_NUD_FAILURE
  1031. *
  1032. * Enum indicating data stall event type
  1033. */
  1034. enum data_stall_log_event_type {
  1035. DATA_STALL_LOG_NONE,
  1036. DATA_STALL_LOG_FW_VDEV_PAUSE,
  1037. DATA_STALL_LOG_HWSCHED_CMD_FILTER,
  1038. DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
  1039. DATA_STALL_LOG_FW_RX_REFILL_FAILED,
  1040. DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
  1041. DATA_STALL_LOG_FW_WDOG_ERRORS,
  1042. DATA_STALL_LOG_BB_WDOG_ERROR,
  1043. DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
  1044. /* Stall events triggered by host/framework start from 0x100 onwards. */
  1045. DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
  1046. DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
  1047. DATA_STALL_LOG_NUD_FAILURE,
  1048. };
  1049. /**
  1050. * enum data_stall_log_recovery_type - data stall recovery type
  1051. * @DATA_STALL_LOG_RECOVERY_NONE,
  1052. * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  1053. * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
  1054. *
  1055. * Enum indicating data stall recovery type
  1056. */
  1057. enum data_stall_log_recovery_type {
  1058. DATA_STALL_LOG_RECOVERY_NONE = 0,
  1059. DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  1060. DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
  1061. };
  1062. /**
  1063. * struct data_stall_event_info - data stall info
  1064. * @indicator: Module triggering data stall
  1065. * @data_stall_type: data stall event type
  1066. * @vdev_id_bitmap: vdev_id_bitmap
  1067. * @pdev_id: pdev id
  1068. * @recovery_type: data stall recovery type
  1069. */
  1070. struct data_stall_event_info {
  1071. uint32_t indicator;
  1072. uint32_t data_stall_type;
  1073. uint32_t vdev_id_bitmap;
  1074. uint32_t pdev_id;
  1075. uint32_t recovery_type;
  1076. };
  1077. typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
  1078. /*
  1079. * enum cdp_stats - options for host and firmware
  1080. * statistics
  1081. * @CDP_TXRX_STATS_1: HTT Pdev tx stats
  1082. * @CDP_TXRX_STATS_2: HTT Pdev rx stats
  1083. * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
  1084. * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
  1085. * @CDP_TXRX_STATS_5: HTT Pdev error stats
  1086. * @CDP_TXRX_STATS_6: HTT TQM stats
  1087. * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
  1088. * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
  1089. * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
  1090. * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
  1091. * @CDP_TXRX_STATS_11: HTT Peer stats
  1092. * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
  1093. * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
  1094. * @CDP_TXRX_STATS_14: HTT Ring interface info stats
  1095. * @CDP_TXRX_STATS_15: HTT SRNG info stats
  1096. * @CDP_TXRX_STATS_16: HTT SFM info stats
  1097. * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
  1098. * @CDP_TXRX_STATS_18: HTT Peer list details
  1099. * @CDP_TXRX_STATS_19: Reserved
  1100. * @CDP_TXRX_STATS_20: Reset Host stats
  1101. * @CDP_TXRX_STATS_21: Host Rx rate stats
  1102. * @CDP_TXRX_STATS_22: Host Tx rate stats
  1103. * @CDP_TXRX_STATS_23: Host Tx stats
  1104. * @CDP_TXRX_STATS_24: Host Rx stats
  1105. * @CDP_TXRX_STATS_25: Host Ast stats
  1106. * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
  1107. * @CDP_TXRX_STATS_27: Host Monitor mode stats
  1108. * @CDP_TXRX_STATS_28: Host Peer entry stats
  1109. * @CDP_TXRX_STATS_29: Host Soc config params info
  1110. * @CDP_TXRX_STATS_30: Host Pdev config params info
  1111. * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
  1112. */
  1113. enum cdp_stats {
  1114. CDP_TXRX_STATS_0 = 0,
  1115. CDP_TXRX_STATS_1,
  1116. CDP_TXRX_STATS_2,
  1117. CDP_TXRX_STATS_3,
  1118. CDP_TXRX_STATS_4,
  1119. CDP_TXRX_STATS_5,
  1120. CDP_TXRX_STATS_6,
  1121. CDP_TXRX_STATS_7,
  1122. CDP_TXRX_STATS_8,
  1123. CDP_TXRX_STATS_9,
  1124. CDP_TXRX_STATS_10,
  1125. CDP_TXRX_STATS_11,
  1126. CDP_TXRX_STATS_12,
  1127. CDP_TXRX_STATS_13,
  1128. CDP_TXRX_STATS_14,
  1129. CDP_TXRX_STATS_15,
  1130. CDP_TXRX_STATS_16,
  1131. CDP_TXRX_STATS_17,
  1132. CDP_TXRX_STATS_18,
  1133. CDP_TXRX_STATS_19,
  1134. CDP_TXRX_STATS_20,
  1135. CDP_TXRX_STATS_21,
  1136. CDP_TXRX_STATS_22,
  1137. CDP_TXRX_STATS_23,
  1138. CDP_TXRX_STATS_24,
  1139. CDP_TXRX_STATS_25,
  1140. CDP_TXRX_STATS_26,
  1141. CDP_TXRX_STATS_27,
  1142. CDP_TXRX_STATS_28,
  1143. CDP_TXRX_STATS_29,
  1144. CDP_TXRX_STATS_30,
  1145. CDP_TXRX_STATS_31,
  1146. CDP_TXRX_STATS_HTT_MAX = 256,
  1147. CDP_TXRX_MAX_STATS = 265,
  1148. };
  1149. /*
  1150. * Different Stat update types sent to OL_IF
  1151. * @UPDATE_PEER_STATS: update peer stats
  1152. * @UPDATE_VDEV_STATS: update vdev stats
  1153. * @UPDATE_PDE_STATS: Update pdev stats
  1154. */
  1155. enum cdp_stat_update_type {
  1156. UPDATE_PEER_STATS = 0,
  1157. UPDATE_VDEV_STATS = 1,
  1158. UPDATE_PDEV_STATS = 2,
  1159. };
  1160. /*
  1161. * struct cdp_tx_sojourn_stats - Tx sojourn stats
  1162. * @ppdu_seq_id: ppdu_seq_id from tx completion
  1163. * @avg_sojourn_msdu: average sojourn msdu time
  1164. * @sum_sojourn_msdu: sum sojourn msdu time
  1165. * @num_msdu: number of msdus per ppdu
  1166. * @cookie: cookie to be used by upper layer
  1167. */
  1168. struct cdp_tx_sojourn_stats {
  1169. uint32_t ppdu_seq_id;
  1170. qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
  1171. uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
  1172. uint32_t num_msdus[CDP_DATA_TID_MAX];
  1173. struct cdp_stats_cookie *cookie;
  1174. };
  1175. /**
  1176. * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
  1177. * per-user information
  1178. * @frame_ctrl: frame control field in 802.11 header
  1179. * @qos_ctrl: QoS control field in 802.11 header
  1180. * @mpdu_tried: number of mpdus tried
  1181. * @ltf_size: ltf_size
  1182. * @stbc: stbc
  1183. * @he_re: he_re (range extension)
  1184. * @txbf: txbf
  1185. * @bw: Transmission bandwidth
  1186. * <enum 2 transmit_bw_20_MHz>
  1187. * <enum 3 transmit_bw_40_MHz>
  1188. * <enum 4 transmit_bw_80_MHz>
  1189. * <enum 5 transmit_bw_160_MHz>
  1190. * @nss: NSS 1,2, ...8
  1191. * @mcs: MCS index
  1192. * @preamble: preamble
  1193. * @gi: guard interval 800/400/1600/3200 ns
  1194. * @dcm: dcm
  1195. * @ldpc: ldpc
  1196. * @ru_start: RU start index
  1197. * @ru_tones: RU tones length
  1198. * @is_mcast: MCAST or UCAST
  1199. * @user_pos: user position
  1200. * @mu_group_id: mu group id
  1201. */
  1202. struct cdp_delayed_tx_completion_ppdu_user {
  1203. uint32_t frame_ctrl:16,
  1204. qos_ctrl:16;
  1205. uint32_t mpdu_tried_ucast:16,
  1206. mpdu_tried_mcast:16;
  1207. uint32_t ltf_size:2,
  1208. stbc:1,
  1209. he_re:1,
  1210. txbf:4,
  1211. bw:4,
  1212. nss:4,
  1213. mcs:4,
  1214. preamble:4,
  1215. gi:4,
  1216. dcm:1,
  1217. ldpc:1,
  1218. delayed_ba:1;
  1219. uint16_t ru_start;
  1220. uint16_t ru_tones;
  1221. bool is_mcast;
  1222. uint32_t user_pos;
  1223. uint32_t mu_group_id;
  1224. };
  1225. /**
  1226. * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
  1227. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1228. * @tid: TID number
  1229. * @peer_id: Peer ID
  1230. * @ba_size: Block-Ack size
  1231. * @frame_ctrl: frame control field in 802.11 header
  1232. * @qos_ctrl: QoS control field in 802.11 header
  1233. * @mpdu_tried: number of mpdus tried
  1234. * @mpdu_success: number of mpdus successfully transmitted
  1235. * @long_retries: long retries
  1236. * @short_retries: short retries
  1237. * @is_ampdu: mpdu aggregate or non-aggregate?
  1238. * @success_bytes: bytes successfully transmitted
  1239. * @retry_bytes: bytes retried
  1240. * @failed_msdus: MSDUs failed transmission
  1241. * @duration: user duration in ppdu
  1242. * @ltf_size: ltf_size
  1243. * @stbc: stbc
  1244. * @he_re: he_re (range extension)
  1245. * @txbf: txbf
  1246. * @bw: Transmission bandwidth
  1247. * <enum 2 transmit_bw_20_MHz>
  1248. * <enum 3 transmit_bw_40_MHz>
  1249. * <enum 4 transmit_bw_80_MHz>
  1250. * <enum 5 transmit_bw_160_MHz>
  1251. * @nss: NSS 1,2, ...8
  1252. * @mcs: MCS index
  1253. * @preamble: preamble
  1254. * @gi: guard interval 800/400/1600/3200 ns
  1255. * @dcm: dcm
  1256. * @ldpc: ldpc
  1257. * @delayed_ba: delayed ba bit
  1258. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  1259. * UL_BSR_TRIG/UNKNOWN
  1260. * @ba_seq_no: Block Ack sequence number
  1261. * @ba_bitmap: Block Ack bitmap
  1262. * @start_seqa: Sequence number of first MPDU
  1263. * @enq_bitmap: Enqueue MPDU bitmap
  1264. * @ru_start: RU start index
  1265. * @ru_tones: RU tones length
  1266. * @is_mcast: MCAST or UCAST
  1267. * @tx_rate: Transmission Rate
  1268. * @user_pos: user position
  1269. * @mu_group_id: mu group id
  1270. * @rix: rate index
  1271. * @cookie: cookie to used by upper layer
  1272. * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
  1273. * @ppdu_cookie: 16-bit ppdu_cookie
  1274. * @sa_is_training: smart antenna training packets indication
  1275. * @rssi_chain: rssi chain per bandwidth
  1276. * @sa_tx_antenna: antenna in which packet is transmitted
  1277. * @sa_max_rates: smart antenna tx feedback info max rates
  1278. * @sa_goodput: smart antenna tx feedback info goodput
  1279. * @current_rate_per: Moving average per
  1280. * @last_enq_seq: last equeue sequence number
  1281. */
  1282. struct cdp_tx_completion_ppdu_user {
  1283. uint32_t completion_status:8,
  1284. tid:8,
  1285. peer_id:16;
  1286. uint8_t mac_addr[6];
  1287. uint16_t ba_size;
  1288. uint32_t frame_ctrl:16,
  1289. qos_ctrl:16;
  1290. uint32_t mpdu_tried_ucast:16,
  1291. mpdu_tried_mcast:16;
  1292. uint16_t mpdu_success:16;
  1293. uint16_t mpdu_failed:16;
  1294. uint32_t long_retries:4,
  1295. short_retries:4,
  1296. tx_ratecode:16,
  1297. is_ampdu:1,
  1298. ppdu_type:5;
  1299. uint32_t success_bytes;
  1300. uint32_t retry_bytes;
  1301. uint32_t failed_bytes;
  1302. uint32_t success_msdus:16,
  1303. retry_msdus:16;
  1304. uint32_t failed_msdus:16,
  1305. duration:16;
  1306. uint32_t ltf_size:2,
  1307. stbc:1,
  1308. he_re:1,
  1309. txbf:4,
  1310. bw:4,
  1311. nss:4,
  1312. mcs:4,
  1313. preamble:4,
  1314. gi:4,
  1315. dcm:1,
  1316. ldpc:1,
  1317. delayed_ba:1;
  1318. uint32_t ba_seq_no;
  1319. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1320. uint32_t start_seq;
  1321. uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1322. uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1323. uint32_t num_mpdu:9,
  1324. num_msdu:16;
  1325. uint32_t tx_duration;
  1326. uint16_t ru_start;
  1327. uint16_t ru_tones;
  1328. bool is_mcast;
  1329. uint32_t tx_rate;
  1330. uint32_t tx_ratekbps;
  1331. /*ack rssi for separate chains*/
  1332. uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
  1333. bool ack_rssi_valid;
  1334. uint32_t user_pos;
  1335. uint32_t mu_group_id;
  1336. uint32_t rix;
  1337. struct cdp_stats_cookie *cookie;
  1338. uint8_t is_ppdu_cookie_valid;
  1339. uint16_t ppdu_cookie;
  1340. uint8_t sa_is_training;
  1341. uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
  1342. uint32_t sa_tx_antenna;
  1343. /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ
  1344. * |---------------------------------------|
  1345. * | 16 bits | 16 bits | 16 bits | 16 bits |
  1346. * | BW-1 | BW-2 | BW-3 | BW-4 |
  1347. * | /\ \ |
  1348. * | / \ \ |
  1349. * | / \ \ |
  1350. * | / \ \ |
  1351. * | / \ \ |
  1352. * | / \ \ |
  1353. * |/ \ \ |
  1354. * |[11|8] [5|8] \ |
  1355. * | BW1 PADDED \ |
  1356. * |---------------------------------------|
  1357. */
  1358. uint16_t sa_max_rates[CDP_NUM_SA_BW];
  1359. uint32_t sa_goodput;
  1360. /* below field is used to calculate goodput in non-training period
  1361. * Note: As host is exposing goodput and hence current_rate_per is
  1362. * of no use. It is just for Host computation.
  1363. */
  1364. uint32_t current_rate_per;
  1365. uint32_t last_enq_seq;
  1366. };
  1367. /**
  1368. * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
  1369. * @ppdu_id: PPDU id
  1370. * @duration: user duration in ppdu
  1371. * @frame_type: frame type MGMT/CTRL/DATA/BAR
  1372. * @frame_ctrl: frame control field in 802.11 header
  1373. * @qos_ctrl: QoS control field in 802.11 header
  1374. * @tid: TID number
  1375. * @num_msdu: number of msdu in MPDU
  1376. * @seq_no: Sequence number of first MPDU
  1377. * @ltf_size: ltf_size
  1378. * @stbc: stbc
  1379. * @he_re: he_re (range extension)
  1380. * @txbf: txbf
  1381. * @bw: Transmission bandwidth
  1382. * <enum 2 transmit_bw_20_MHz>
  1383. * <enum 3 transmit_bw_40_MHz>
  1384. * <enum 4 transmit_bw_80_MHz>
  1385. * <enum 5 transmit_bw_160_MHz>
  1386. * @nss: NSS 1,2, ...8
  1387. * @mcs: MCS index
  1388. * @preamble: preamble
  1389. * @gi: guard interval 800/400/1600/3200 ns
  1390. * @resp_type: response type
  1391. * @mprot_type: medium protection type
  1392. * @rts_success: rts success
  1393. * @rts failure: rts failure
  1394. * @channel: frequency
  1395. * @channel_num: channel number
  1396. * @ack_rssi: ack rssi
  1397. * @ldpc: ldpc
  1398. * @tx_rate: Transmission Rate
  1399. * @mac_address: peer mac address
  1400. * @bss_mac_address: bss mac address
  1401. * @ppdu_start_timestamp: TSF at PPDU start
  1402. * @ppdu_end_timestamp: TSF at PPDU end
  1403. * @ba_start_seq: Block Ack sequence number
  1404. * @ba_bitmap: Block Ack bitmap
  1405. * @ppdu_cookie: 16-bit ppdu_cookie
  1406. * @long_retries: long retries
  1407. * @short_retries: short retries
  1408. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1409. */
  1410. struct cdp_tx_indication_mpdu_info {
  1411. uint32_t ppdu_id;
  1412. uint32_t tx_duration;
  1413. uint16_t frame_type;
  1414. uint16_t frame_ctrl;
  1415. uint16_t qos_ctrl;
  1416. uint8_t tid;
  1417. uint32_t num_msdu;
  1418. uint32_t seq_no;
  1419. uint32_t ltf_size:2,
  1420. he_re:1,
  1421. txbf:4,
  1422. bw:4,
  1423. nss:4,
  1424. mcs:4,
  1425. preamble:4,
  1426. gi:4;
  1427. uint32_t channel;
  1428. uint8_t channel_num;
  1429. uint32_t ack_rssi;
  1430. uint32_t ldpc;
  1431. uint32_t tx_rate;
  1432. uint8_t mac_address[QDF_MAC_ADDR_SIZE];
  1433. uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
  1434. uint64_t ppdu_start_timestamp;
  1435. uint64_t ppdu_end_timestamp;
  1436. uint32_t ba_start_seq;
  1437. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1438. uint16_t ppdu_cookie;
  1439. uint16_t long_retries:4,
  1440. short_retries:4,
  1441. completion_status:8;
  1442. uint16_t resp_type:4,
  1443. mprot_type:3,
  1444. rts_success:1,
  1445. rts_failure:1;
  1446. };
  1447. /**
  1448. * struct cdp_tx_indication_info - Tx capture information
  1449. * @mpdu_info: Tx MPDU completion information
  1450. * @mpdu_nbuf: reconstructed mpdu packet
  1451. * @ppdu_desc: tx completion ppdu
  1452. */
  1453. struct cdp_tx_indication_info {
  1454. struct cdp_tx_indication_mpdu_info mpdu_info;
  1455. qdf_nbuf_t mpdu_nbuf;
  1456. struct cdp_tx_completion_ppdu *ppdu_desc;
  1457. };
  1458. /**
  1459. * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
  1460. * @ppdu_id: ppdu_id
  1461. * @is_sgen_pkt: payload recevied from wmi or htt path
  1462. * @retries_count: retries count
  1463. * @tx_tsf: 64 bit timestamp
  1464. */
  1465. struct cdp_tx_mgmt_comp_info {
  1466. uint32_t ppdu_id;
  1467. bool is_sgen_pkt;
  1468. uint16_t retries_count;
  1469. uint64_t tx_tsf;
  1470. };
  1471. /**
  1472. * struct cdp_tx_completion_ppdu - Tx PPDU completion information
  1473. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1474. * @ppdu_id: PPDU Id
  1475. * @ppdu_seq_id: ppdu sequence id for sojourn stats
  1476. * @vdev_id: VAP Id
  1477. * @bar_num_users: BA response user count, based on completion common TLV
  1478. * @num_users: Number of users
  1479. * @pending_retries: pending MPDUs (retries)
  1480. * @drop_reason: drop reason from flush status
  1481. * @is_flush: is_flush is set based on flush tlv
  1482. * @flow_type: tx flow type from flush status
  1483. * @queue_type: queue type from flush status
  1484. * @num_mpdu: Number of MPDUs in PPDU
  1485. * @num_msdu: Number of MSDUs in PPDU
  1486. * @frame_type: frame SU or MU
  1487. * @htt_frame_type: frame type from htt
  1488. * @frame_ctrl: frame control of 80211 header
  1489. * @channel: Channel informartion
  1490. * @resp_type: response type
  1491. * @mprot_type: medium protection type
  1492. * @rts_success: rts success
  1493. * @rts failure: rts failure
  1494. * @phymode: phy mode
  1495. * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
  1496. * @tx_duration: PPDU airtime
  1497. * @ppdu_start_timestamp: TSF at PPDU start
  1498. * @ppdu_end_timestamp: TSF at PPDU end
  1499. * @ack_timestamp: TSF at the reception of ACK
  1500. * @delayed_ba: Delayed ba flag
  1501. * @beam_change: beam change bit in ppdu for he-information
  1502. * @bss_color: 6 bit value for full bss color
  1503. * @user: per-User stats (array of per-user structures)
  1504. * @mpdu_q: queue of mpdu in a ppdu
  1505. * @mpdus: MPDU list based on enqueue sequence bitmap
  1506. * @bar_ppdu_id: BAR ppdu_id
  1507. * @bar_tx_duration: BAR tx duration
  1508. * @bar_ppdu_start_timestamp: BAR start timestamp
  1509. * @bar_ppdu_end_timestamp: BAR end timestamp
  1510. */
  1511. struct cdp_tx_completion_ppdu {
  1512. uint32_t ppdu_id;
  1513. uint32_t ppdu_seq_id;
  1514. uint16_t vdev_id;
  1515. uint16_t bar_num_users;
  1516. uint32_t num_users;
  1517. uint8_t last_usr_index;
  1518. uint32_t pending_retries;
  1519. uint32_t drop_reason;
  1520. uint32_t is_flush:1,
  1521. flow_type:8,
  1522. queue_type:8;
  1523. uint32_t num_mpdu:9,
  1524. num_msdu:16;
  1525. uint16_t frame_type;
  1526. uint16_t htt_frame_type;
  1527. uint16_t frame_ctrl;
  1528. uint16_t channel;
  1529. uint16_t resp_type:4,
  1530. mprot_type:3,
  1531. rts_success:1,
  1532. rts_failure:1;
  1533. uint16_t phy_mode;
  1534. uint32_t ack_rssi;
  1535. uint32_t tx_duration;
  1536. uint64_t ppdu_start_timestamp;
  1537. uint64_t ppdu_end_timestamp;
  1538. uint64_t ack_timestamp;
  1539. bool delayed_ba;
  1540. uint8_t beam_change;
  1541. uint8_t bss_color;
  1542. struct cdp_tx_completion_ppdu_user user[CDP_MU_MAX_USERS];
  1543. qdf_nbuf_queue_t mpdu_q;
  1544. qdf_nbuf_t *mpdus;
  1545. uint32_t bar_ppdu_id;
  1546. uint32_t bar_tx_duration;
  1547. uint32_t bar_ppdu_start_timestamp;
  1548. uint32_t bar_ppdu_end_timestamp;
  1549. };
  1550. /**
  1551. * struct cdp_dev_stats - Network device stats structure
  1552. * @tx_packets: Tx total packets transmitted
  1553. * @tx_bytes : Tx total bytes transmitted
  1554. * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
  1555. * @tx_dropped: Tx dropped is same as tx errors as above
  1556. * @rx_packets: Rx total packets transmitted
  1557. * @rx_bytes : Rx total bytes transmitted
  1558. * @rx_errors : Rx erros
  1559. * @rx_dropped: Rx dropped stats
  1560. */
  1561. struct cdp_dev_stats {
  1562. uint32_t tx_packets;
  1563. uint32_t tx_bytes;
  1564. uint32_t tx_errors;
  1565. uint32_t tx_dropped;
  1566. uint32_t rx_packets;
  1567. uint32_t rx_bytes;
  1568. uint32_t rx_errors;
  1569. uint32_t rx_dropped;
  1570. };
  1571. /**
  1572. * struct cdp_rate_stats - Tx/Rx Rate statistics
  1573. * @bw: Indicates the BW of the upcoming transmission -
  1574. * <enum 2 transmit_bw_20_MHz>
  1575. * <enum 3 transmit_bw_40_MHz>
  1576. * <enum 4 transmit_bw_80_MHz>
  1577. * <enum 5 transmit_bw_160_MHz>
  1578. * @pkt_type: Transmit Packet Type
  1579. * @stbc: When set, STBC transmission rate was used
  1580. * @ldpc: When set, use LDPC transmission rates
  1581. * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
  1582. * <enum 1 0_4_us_sgi > Legacy short GI
  1583. * <enum 2 1_6_us_sgi > HE related GI
  1584. * <enum 3 3_2_us_sgi > HE
  1585. * @mcs: Transmit MCS Rate
  1586. * @ofdma: Set when the transmission was an OFDMA transmission
  1587. * @tones_in_ru: The number of tones in the RU used.
  1588. * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
  1589. * @peer_id: Peer ID of the flow or MPDU queue
  1590. * @tid: TID of the flow or MPDU queue
  1591. */
  1592. struct cdp_rate_stats {
  1593. uint32_t rate_stats_info_valid:1,
  1594. bw:2,
  1595. pkt_type:4,
  1596. stbc:1,
  1597. ldpc:1,
  1598. sgi:2,
  1599. mcs:4,
  1600. ofdma:1,
  1601. tones_in_ru:12,
  1602. resvd0:4;
  1603. uint32_t tsf;
  1604. uint16_t peer_id;
  1605. uint8_t tid;
  1606. };
  1607. /**
  1608. * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
  1609. * @ppdu_id: PPDU to which this MSDU belongs
  1610. * @transmit_cnt: Number of times this frame has been transmitted
  1611. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  1612. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  1613. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  1614. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  1615. * @extd: Extended structure containing rate statistics
  1616. */
  1617. struct cdp_tx_completion_msdu {
  1618. uint32_t ppdu_id;
  1619. uint8_t transmit_cnt;
  1620. uint32_t ack_frame_rssi:8,
  1621. resvd0:1,
  1622. first_msdu:1,
  1623. last_msdu:1,
  1624. msdu_part_of_amsdu:1,
  1625. resvd1:20;
  1626. struct cdp_rate_stats extd;
  1627. };
  1628. /**
  1629. * struct cdp_rx_stats_ppdu_user -- per user RX stats
  1630. * @peer_id: Peer ID
  1631. * @vdev_id: VAP ID
  1632. * @is_ampdu: mpdu aggregate or non-aggregate?
  1633. * @mu_ul_info_valid: MU UL info valid
  1634. * @ofdma_ru_start_index: RU index number(0-73)
  1635. * @ofdma_ru_width: size of RU in units of 1(26tone)RU
  1636. * @nss: NSS 1,2, ...8
  1637. * @mcs: MCS index
  1638. * @user_index: user ID in multi-user case
  1639. * @ast_index: ast index in multi-user case
  1640. * @tid: TID number
  1641. * @num_msdu: Number of MSDUs in PPDU
  1642. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  1643. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  1644. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  1645. * @frame_control: frame control field
  1646. * @frame_control_info_valid: frame_control valid
  1647. * @data_sequence_control_info_valid: data_sequence_control_info valid
  1648. * @first_data_seq_ctrl: Sequence control field of first data frame
  1649. * @preamble: preamble
  1650. * @ht_flag: ht flag
  1651. * @vht_flag: vht flag
  1652. * @he_re: he_re (range extension)
  1653. * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
  1654. * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
  1655. * @mpdu_fcs_ok_bitmap - MPDU with fcs ok bitmap
  1656. * @retried - number of retries
  1657. * @mac_addr: Peer MAC Address
  1658. */
  1659. struct cdp_rx_stats_ppdu_user {
  1660. uint16_t peer_id;
  1661. uint8_t vdev_id;
  1662. bool is_ampdu;
  1663. uint32_t mu_ul_info_valid:1,
  1664. ofdma_ru_start_index:7,
  1665. ofdma_ru_width:7,
  1666. nss:4,
  1667. mcs:4;
  1668. /* user id */
  1669. uint8_t user_index;
  1670. uint32_t ast_index;
  1671. uint32_t tid;
  1672. uint32_t num_msdu;
  1673. uint16_t tcp_msdu_count;
  1674. uint16_t udp_msdu_count;
  1675. uint16_t other_msdu_count;
  1676. uint16_t frame_control;
  1677. uint8_t frame_control_info_valid;
  1678. uint8_t data_sequence_control_info_valid;
  1679. uint16_t first_data_seq_ctrl;
  1680. uint32_t preamble_type;
  1681. uint16_t ht_flags;
  1682. uint16_t vht_flags;
  1683. uint16_t he_flags;
  1684. uint32_t mpdu_cnt_fcs_ok;
  1685. uint32_t mpdu_cnt_fcs_err;
  1686. uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
  1687. uint32_t mpdu_ok_byte_count;
  1688. uint32_t mpdu_err_byte_count;
  1689. uint32_t retries;
  1690. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  1691. };
  1692. /**
  1693. * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
  1694. * @ppdu_id: PPDU Id
  1695. * @is_ampdu: mpdu aggregate or non-aggregate?
  1696. * @num_mpdu: Number of MPDUs in PPDU
  1697. * @reserved: Reserved bits for future use
  1698. * @num_msdu: Number of MSDUs in PPDU
  1699. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  1700. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  1701. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  1702. * @duration: PPDU duration
  1703. * @tid: TID number
  1704. * @peer_id: Peer ID
  1705. * @vdev_id: VAP ID
  1706. * @mac_addr: Peer MAC Address
  1707. * @first_data_seq_ctrl: Sequence control field of first data frame
  1708. * @ltf_size: ltf_size
  1709. * @stbc: When set, STBC rate was used
  1710. * @he_re: he_re (range extension)
  1711. * @bw: Bandwidth
  1712. * <enum 0 bw_20_MHz>
  1713. * <enum 1 bw_40_MHz>
  1714. * <enum 2 bw_80_MHz>
  1715. * <enum 3 bw_160_MHz>
  1716. * @nss: NSS 1,2, ...8
  1717. * @mcs: MCS index
  1718. * @preamble: preamble
  1719. * @gi: <enum 0 0_8_us_sgi > Legacy normal GI
  1720. * <enum 1 0_4_us_sgi > Legacy short GI
  1721. * <enum 2 1_6_us_sgi > HE related GI
  1722. * <enum 3 3_2_us_sgi > HE
  1723. * @dcm: dcm
  1724. * @ldpc: ldpc
  1725. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  1726. * UL_BSR_TRIG/UNKNOWN
  1727. * @rssi: RSSI value (units = dB above noise floor)
  1728. * @timestamp: TSF at the reception of PPDU
  1729. * @length: PPDU length
  1730. * @channel: Channel informartion
  1731. * @lsig_A: L-SIG in 802.11 PHY header
  1732. * @frame_ctrl: frame control field
  1733. * @rix: rate index
  1734. * @rssi_chain: rssi chain per nss per bw
  1735. * @cookie: cookie to used by upper layer
  1736. * @user: per user stats in MU-user case
  1737. * @nf: noise floor
  1738. * @per_chain_rssi: rssi per antenna
  1739. */
  1740. struct cdp_rx_indication_ppdu {
  1741. uint32_t ppdu_id;
  1742. uint16_t is_ampdu:1,
  1743. num_mpdu:9,
  1744. reserved:6;
  1745. uint32_t num_msdu;
  1746. uint32_t num_bytes;
  1747. uint16_t udp_msdu_count;
  1748. uint16_t tcp_msdu_count;
  1749. uint16_t other_msdu_count;
  1750. uint16_t duration;
  1751. uint32_t tid:8,
  1752. peer_id:16;
  1753. uint8_t vdev_id;
  1754. uint8_t mac_addr[6];
  1755. uint16_t first_data_seq_ctrl;
  1756. union {
  1757. uint32_t rate_info;
  1758. struct {
  1759. uint32_t ltf_size:2,
  1760. stbc:1,
  1761. he_re:1,
  1762. bw:4,
  1763. nss:4,
  1764. mcs:4,
  1765. preamble:4,
  1766. gi:4,
  1767. dcm:1,
  1768. ldpc:1,
  1769. ppdu_type:5;
  1770. };
  1771. } u;
  1772. uint32_t rix;
  1773. uint32_t lsig_a;
  1774. uint32_t rssi;
  1775. uint64_t timestamp;
  1776. uint32_t length;
  1777. uint8_t channel;
  1778. uint8_t beamformed;
  1779. uint32_t rx_ratekbps;
  1780. uint32_t ppdu_rx_rate;
  1781. uint32_t retries;
  1782. uint32_t rx_byte_count;
  1783. uint16_t rx_ratecode;
  1784. uint8_t fcs_error_mpdus;
  1785. uint16_t frame_ctrl;
  1786. int8_t rssi_chain[SS_COUNT][MAX_BW];
  1787. struct cdp_stats_cookie *cookie;
  1788. struct cdp_rx_su_evm_info evm_info;
  1789. uint32_t rx_antenna;
  1790. uint8_t num_users;
  1791. struct cdp_rx_stats_ppdu_user user[CDP_MU_MAX_USERS];
  1792. uint32_t nf;
  1793. uint8_t per_chain_rssi[MAX_CHAIN];
  1794. uint8_t is_mcast_bcast;
  1795. };
  1796. /**
  1797. * struct cdp_rx_indication_msdu - Rx MSDU info
  1798. * @ppdu_id: PPDU to which the MSDU belongs
  1799. * @msdu_len: Length of MSDU in bytes
  1800. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  1801. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  1802. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  1803. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  1804. * @extd: Extended structure containing rate statistics
  1805. */
  1806. struct cdp_rx_indication_msdu {
  1807. uint32_t ppdu_id;
  1808. uint16_t msdu_len;
  1809. uint32_t ack_frame_rssi:8,
  1810. resvd0:1,
  1811. first_msdu:1,
  1812. last_msdu:1,
  1813. msdu_part_of_amsdu:1,
  1814. msdu_part_of_ampdu:1,
  1815. resvd1:19;
  1816. struct cdp_rate_stats extd;
  1817. };
  1818. /**
  1819. * struct cdp_config_params - Propagate configuration parameters to datapath
  1820. * @tso_enable: Enable/Disable TSO
  1821. * @lro_enable: Enable/Disable LRO
  1822. * @gro_enable: Enable/Disable GRO
  1823. * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
  1824. * @tcp_Udp_ChecksumOffload: Enable/Disable tcp-Udp checksum Offload
  1825. * @napi_enable: Enable/Disable Napi
  1826. * @ipa_enable: Flag indicating if IPA is enabled or not
  1827. * @tx_flow_stop_queue_threshold: Value to Pause tx queues
  1828. * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
  1829. * tx queue
  1830. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  1831. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  1832. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  1833. */
  1834. struct cdp_config_params {
  1835. unsigned int tso_enable:1;
  1836. unsigned int lro_enable:1;
  1837. unsigned int gro_enable:1;
  1838. unsigned int flow_steering_enable:1;
  1839. unsigned int tcp_udp_checksumoffload:1;
  1840. unsigned int napi_enable:1;
  1841. unsigned int ipa_enable:1;
  1842. /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
  1843. uint8_t tx_flow_stop_queue_threshold;
  1844. uint8_t tx_flow_start_queue_offset;
  1845. uint32_t tx_comp_loop_pkt_limit;
  1846. uint32_t rx_reap_loop_pkt_limit;
  1847. uint32_t rx_hp_oos_update_limit;
  1848. };
  1849. /**
  1850. * cdp_txrx_stats_req: stats request wrapper
  1851. * used to pass request information to cdp layer
  1852. * @stats: type of stats requested
  1853. * @param0: opaque argument 0 to be passed to htt
  1854. * @param1: opaque argument 1 to be passed to htt
  1855. * @param2: opaque argument 2 to be passed to htt
  1856. * @param3: opaque argument 3 to be passed to htt
  1857. * @mac id: mac_id
  1858. */
  1859. struct cdp_txrx_stats_req {
  1860. enum cdp_stats stats;
  1861. uint32_t param0;
  1862. uint32_t param1;
  1863. uint32_t param2;
  1864. uint32_t param3;
  1865. uint32_t cookie_val;
  1866. uint8_t mac_id;
  1867. char *peer_addr;
  1868. };
  1869. /**
  1870. * struct cdp_monitor_filter - monitor filter info
  1871. * @mode: set filter mode
  1872. * @fp_mgmt: set Filter Pass MGMT Configuration
  1873. * @fp_ctrl: set Filter Pass CTRL Configuration
  1874. * @fp_data: set Filter Pass DATA Configuration
  1875. * @mo_mgmt: set Monitor Other MGMT Configuration
  1876. * @mo_ctrl: set Monitor Other CTRL Configuration
  1877. * @mo_data: set Monitor other DATA Configuration
  1878. *
  1879. */
  1880. struct cdp_monitor_filter {
  1881. uint16_t mode;
  1882. uint16_t fp_mgmt;
  1883. uint16_t fp_ctrl;
  1884. uint16_t fp_data;
  1885. uint16_t mo_mgmt;
  1886. uint16_t mo_ctrl;
  1887. uint16_t mo_data;
  1888. };
  1889. /**
  1890. * cdp_dp_cfg - dp ini config enum
  1891. */
  1892. enum cdp_dp_cfg {
  1893. cfg_dp_enable_data_stall,
  1894. cfg_dp_enable_ip_tcp_udp_checksum_offload,
  1895. cfg_dp_tso_enable,
  1896. cfg_dp_lro_enable,
  1897. cfg_dp_gro_enable,
  1898. cfg_dp_tx_flow_start_queue_offset,
  1899. cfg_dp_tx_flow_stop_queue_threshold,
  1900. cfg_dp_ipa_uc_tx_buf_size,
  1901. cfg_dp_ipa_uc_tx_partition_base,
  1902. cfg_dp_ipa_uc_rx_ind_ring_count,
  1903. cfg_dp_enable_flow_steering,
  1904. cfg_dp_reorder_offload_supported,
  1905. cfg_dp_ce_classify_enable,
  1906. cfg_dp_disable_intra_bss_fwd,
  1907. };
  1908. /**
  1909. * struct cdp_peer_cookie - cookie used when creating peer
  1910. * @ctx: context passed to be used by consumer
  1911. * @mac_addr: MAC address of peer
  1912. * @peer_id: peer id
  1913. * @pdev_id: pdev_id
  1914. * @cookie: cookie to be used by consumer
  1915. */
  1916. struct cdp_peer_cookie {
  1917. struct cdp_stats_cookie *ctx;
  1918. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  1919. uint8_t peer_id;
  1920. uint8_t pdev_id;
  1921. uint8_t cookie;
  1922. };
  1923. /**
  1924. * cdp_flow_stats - Per-Flow (5-tuple) statistics
  1925. * @msdu_count: number of rx msdus matching this flow
  1926. *
  1927. * HW also includes msdu_byte_count and timestamp, which
  1928. * are not currently tracked in SW.
  1929. */
  1930. struct cdp_flow_stats {
  1931. uint32_t msdu_count;
  1932. };
  1933. /**
  1934. * cdp_flow_fst_operation - RX FST operations allowed
  1935. */
  1936. enum cdp_flow_fst_operation {
  1937. CDP_FLOW_FST_ENTRY_ADD,
  1938. CDP_FLOW_FST_ENTRY_DEL,
  1939. CDP_FLOW_FST_RX_BYPASS_ENABLE,
  1940. CDP_FLOW_FST_RX_BYPASS_DISABLE
  1941. };
  1942. /**
  1943. * cdp_flow_protocol_type - RX FST supported protocol types, mapped to HW spec
  1944. */
  1945. enum cdp_flow_protocol_type {
  1946. CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
  1947. CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
  1948. };
  1949. /**
  1950. * cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
  1951. * @dest_ip_127_96: destination IP address bit fields 96-127
  1952. * @dest_ip_95_64: destination IP address bit fields 64-95
  1953. * @dest_ip_63_32: destination IP address bit fields 32-63
  1954. * @dest_ip_31_0: destination IP address bit fields 0-31
  1955. * @src_ip_127_96: source IP address bit fields 96-127
  1956. * @src_ip_95_64: source IP address bit fields 64-95
  1957. * @src_ip_63_32: source IP address bit fields 32-63
  1958. * @src_ip_31_0: source IP address bit fields 0-31
  1959. * @dest_port: destination port of flow
  1960. * @src_port: source port of flow
  1961. * @l4_protocol: protocol type in flow (TCP/UDP)
  1962. */
  1963. struct cdp_rx_flow_tuple_info {
  1964. uint32_t dest_ip_127_96;
  1965. uint32_t dest_ip_95_64;
  1966. uint32_t dest_ip_63_32;
  1967. uint32_t dest_ip_31_0;
  1968. uint32_t src_ip_127_96;
  1969. uint32_t src_ip_95_64;
  1970. uint32_t src_ip_63_32;
  1971. uint32_t src_ip_31_0;
  1972. uint16_t dest_port;
  1973. uint16_t src_port;
  1974. uint16_t l4_protocol;
  1975. };
  1976. /**
  1977. * cdp_rx_flow_info - RX flow info used for addition/deletion
  1978. * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
  1979. * @op_code: add/delete/enable/disable operation requested
  1980. * @flow_tupe_info: structure containing tuple info
  1981. * @fse_metadata: metadata to be set in RX flow
  1982. */
  1983. struct cdp_rx_flow_info {
  1984. bool is_addr_ipv4;
  1985. enum cdp_flow_fst_operation op_code;
  1986. struct cdp_rx_flow_tuple_info flow_tuple_info;
  1987. uint16_t fse_metadata;
  1988. };
  1989. #endif