cdp_txrx_cmn_struct.h 70 KB

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