cdp_txrx_cmn_struct.h 58 KB

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