cdp_txrx_cmn_struct.h 59 KB

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