cdp_txrx_cmn_struct.h 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: cdp_txrx_cmn_struct.h
  21. * Define the host data path converged API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_CMN_STRUCT_H_
  25. #define _CDP_TXRX_CMN_STRUCT_H_
  26. /*
  27. * For WIN legacy header compilation
  28. * Temporary add dummy definitions
  29. * should be removed properly WIN legacy code handle
  30. */
  31. #include "htc_api.h"
  32. #include "qdf_types.h"
  33. #include "qdf_nbuf.h"
  34. #include "qdf_atomic.h"
  35. #ifdef DP_MOB_DEFS
  36. #include <cdp_txrx_mob_def.h>
  37. #endif
  38. #include <cdp_txrx_handle.h>
  39. #include <cdp_txrx_stats_struct.h>
  40. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  41. #include "cdp_txrx_extd_struct.h"
  42. #endif
  43. #ifdef WLAN_MAX_CLIENTS_ALLOWED
  44. #define OL_TXRX_NUM_LOCAL_PEER_IDS (WLAN_MAX_CLIENTS_ALLOWED + 1 + 1 + 1)
  45. #endif
  46. #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
  47. /*
  48. * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode.
  49. * Clients will be assigned max 32 IDs.
  50. * STA(associated)/P2P DEV(self-PEER) will get one ID.
  51. */
  52. #define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1)
  53. #endif
  54. #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
  55. #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
  56. #define CDP_RSSI_CHAIN_LEN 8
  57. #define OL_TXRX_INVALID_PDEV_ID 0xff
  58. #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
  59. #define CDP_INVALID_VDEV_ID 0xff
  60. /* Max vdev_stats_id(48) is as per the max vdevs supported by HW */
  61. #define CDP_MAX_VDEV_STATS_ID 0x30
  62. /* Invalid vdev_stats_id */
  63. #define CDP_INVALID_VDEV_STATS_ID 0xFF
  64. /* Options for Dump Statistics */
  65. #define CDP_HDD_STATS 0
  66. #define CDP_TXRX_PATH_STATS 1
  67. #define CDP_TXRX_HIST_STATS 2
  68. #define CDP_TXRX_TSO_STATS 3
  69. #define CDP_HDD_NETIF_OPER_HISTORY 4
  70. #define CDP_DUMP_TX_FLOW_POOL_INFO 5
  71. #define CDP_TXRX_DESC_STATS 6
  72. #define CDP_HIF_STATS 7
  73. #define CDP_LRO_STATS 8
  74. #define CDP_NAPI_STATS 9
  75. #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
  76. #define CDP_RX_RING_STATS 11
  77. #define CDP_DP_NAPI_STATS 12
  78. #define CDP_DP_RX_THREAD_STATS 13
  79. #define CDP_SCHEDULER_STATS 21
  80. #define CDP_TX_QUEUE_STATS 22
  81. #define CDP_BUNDLE_STATS 23
  82. #define CDP_CREDIT_STATS 24
  83. #define CDP_DISCONNECT_STATS 25
  84. #define CDP_DP_RX_FISA_STATS 26
  85. #define CDP_DP_SWLM_STATS 27
  86. #define CDP_DP_TX_HW_LATENCY_STATS 28
  87. #define WME_AC_TO_TID(_ac) ( \
  88. ((_ac) == WME_AC_VO) ? 6 : \
  89. ((_ac) == WME_AC_VI) ? 5 : \
  90. ((_ac) == WME_AC_BK) ? 1 : \
  91. 0)
  92. #define TID_TO_WME_AC(_tid) ( \
  93. (((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
  94. (((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
  95. (((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
  96. WME_AC_VO)
  97. #define CDP_MU_MAX_USERS 37
  98. #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
  99. #define CDP_INVALID_PEER 0xffff
  100. #define CDP_INVALID_TID 31
  101. #define CDP_INVALID_TX_ENCAP_TYPE 6
  102. #define CDP_INVALID_SEC_TYPE 12
  103. #define CDP_DATA_TID_MAX 8
  104. #define CDP_DATA_NON_QOS_TID 16
  105. #define CDP_NUM_SA_BW 4
  106. #define CDP_PERCENT_MACRO 100
  107. #define CDP_NUM_KB_IN_MB 1000
  108. /*
  109. * advance rx monitor filter
  110. */
  111. #define MON_FILTER_PASS 0x0001
  112. #define MON_FILTER_OTHER 0x0002
  113. #define MON_FILTER_ALL 0x0003
  114. #define FILTER_MGMT_ALL 0xFFFF
  115. #define FILTER_MGMT_ASSOC_REQ 0x0001
  116. #define FILTER_MGMT_ASSOC_RES 0x0002
  117. #define FILTER_MGMT_REASSOC_REQ 0x0004
  118. #define FILTER_MGMT_REASSOC_RES 0x0008
  119. #define FILTER_MGMT_PROBE_REQ 0x0010
  120. #define FILTER_MGMT_PROBE_RES 0x0020
  121. #define FILTER_MGMT_TIM_ADVT 0x0040
  122. #define FILTER_MGMT_RESERVED_7 0x0080
  123. #define FILTER_MGMT_BEACON 0x0100
  124. #define FILTER_MGMT_ATIM 0x0200
  125. #define FILTER_MGMT_DISASSOC 0x0400
  126. #define FILTER_MGMT_AUTH 0x0800
  127. #define FILTER_MGMT_DEAUTH 0x1000
  128. #define FILTER_MGMT_ACTION 0x2000
  129. #define FILTER_MGMT_ACT_NO_ACK 0x4000
  130. #define FILTER_MGMT_RESERVED_15 0x8000
  131. #define FILTER_CTRL_ALL 0xFFFF
  132. #define FILTER_CTRL_RESERVED_1 0x0001
  133. #define FILTER_CTRL_RESERVED_2 0x0002
  134. #define FILTER_CTRL_TRIGGER 0x0004
  135. #define FILTER_CTRL_RESERVED_4 0x0008
  136. #define FILTER_CTRL_BF_REP_POLL 0x0010
  137. #define FILTER_CTRL_VHT_NDP 0x0020
  138. #define FILTER_CTRL_FRAME_EXT 0x0040
  139. #define FILTER_CTRL_CTRLWRAP 0x0080
  140. #define FILTER_CTRL_BA_REQ 0x0100
  141. #define FILTER_CTRL_BA 0x0200
  142. #define FILTER_CTRL_PSPOLL 0x0400
  143. #define FILTER_CTRL_RTS 0x0800
  144. #define FILTER_CTRL_CTS 0x1000
  145. #define FILTER_CTRL_ACK 0x2000
  146. #define FILTER_CTRL_CFEND 0x4000
  147. #define FILTER_CTRL_CFEND_CFACK 0x8000
  148. #define FILTER_DATA_ALL 0xFFFF
  149. #define FILTER_DATA_MCAST 0x4000
  150. #define FILTER_DATA_UCAST 0x8000
  151. #define FILTER_DATA_DATA 0x0001
  152. #define FILTER_DATA_NULL 0x0008
  153. /*
  154. * Multiply rate by 2 to avoid float point
  155. * and get rate in units of 500kbps
  156. */
  157. #define CDP_11B_RATE_0MCS (11 * 2)
  158. #define CDP_11B_RATE_1MCS (5.5 * 2)
  159. #define CDP_11B_RATE_2MCS (2 * 2)
  160. #define CDP_11B_RATE_3MCS (1 * 2)
  161. #define CDP_11B_RATE_4MCS (11 * 2)
  162. #define CDP_11B_RATE_5MCS (5.5 * 2)
  163. #define CDP_11B_RATE_6MCS (2 * 2)
  164. #define CDP_11A_RATE_0MCS (48 * 2)
  165. #define CDP_11A_RATE_1MCS (24 * 2)
  166. #define CDP_11A_RATE_2MCS (12 * 2)
  167. #define CDP_11A_RATE_3MCS (6 * 2)
  168. #define CDP_11A_RATE_4MCS (54 * 2)
  169. #define CDP_11A_RATE_5MCS (36 * 2)
  170. #define CDP_11A_RATE_6MCS (18 * 2)
  171. #define CDP_11A_RATE_7MCS (9 * 2)
  172. #define CDP_LEGACY_MCS0 0
  173. #define CDP_LEGACY_MCS1 1
  174. #define CDP_LEGACY_MCS2 2
  175. #define CDP_LEGACY_MCS3 3
  176. #define CDP_LEGACY_MCS4 4
  177. #define CDP_LEGACY_MCS5 5
  178. #define CDP_LEGACY_MCS6 6
  179. #define CDP_LEGACY_MCS7 7
  180. QDF_DECLARE_EWMA(tx_lag, 1024, 8)
  181. struct cdp_stats_cookie;
  182. /**
  183. * enum cdp_cfg_param_type - DP configuration parameters
  184. * @CDP_CFG_MAX_PEER_ID: Maximum peer id
  185. * @CDP_CFG_CCE_DISABLE: CCE disable
  186. * @CDP_CFG_NUM_PARAMS: Total number of params
  187. */
  188. enum cdp_cfg_param_type {
  189. CDP_CFG_MAX_PEER_ID,
  190. CDP_CFG_CCE_DISABLE,
  191. CDP_CFG_NUM_PARAMS
  192. };
  193. /**
  194. * enum CDP_PPDU_STATS_PPDU_TYPE - PPDU TYPE from FW
  195. * @CDP_PPDU_STATS_PPDU_TYPE_SU: single user type
  196. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO: multi user mu-mimo
  197. * @CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA: multi user ofdma
  198. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA: multi user mu-mimo ofdma
  199. * @CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG: ul trigger ppdu
  200. * @CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN: burst beacon
  201. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP: bsr respond
  202. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG: bsr trigger
  203. * @CDP_PPDU_STATS_PPDU_TYPE_UL_RESP: ul response
  204. * @CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN: unknown
  205. */
  206. enum CDP_PPDU_STATS_PPDU_TYPE {
  207. CDP_PPDU_STATS_PPDU_TYPE_SU = 0,
  208. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO = 1,
  209. CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA = 2,
  210. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA = 4,
  211. CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG = 5,
  212. CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN = 6,
  213. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP = 7,
  214. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG = 8,
  215. CDP_PPDU_STATS_PPDU_TYPE_UL_RESP = 9,
  216. CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
  217. };
  218. /**
  219. * enum htt_cmn_dbg_stats_type -
  220. * bit positions for each stats type within a stats type bitmask
  221. * The bitmask contains 24 bits.
  222. * @HTT_DBG_CMN_STATS_WAL_PDEV_TXRX:
  223. * @HTT_DBG_CMN_STATS_RX_REORDER:
  224. * @HTT_DBG_CMN_STATS_RX_RATE_INFO:
  225. * @HTT_DBG_CMN_STATS_TX_PPDU_LOG:
  226. * @HTT_DBG_CMN_STATS_TX_RATE_INFO:
  227. * @HTT_DBG_CMN_STATS_TIDQ:
  228. * @HTT_DBG_CMN_STATS_TXBF_INFO:
  229. * @HTT_DBG_CMN_STATS_SND_INFO:
  230. * @HTT_DBG_CMN_STATS_ERROR_INFO:
  231. * @HTT_DBG_CMN_STATS_TX_SELFGEN_INFO:
  232. * @HTT_DBG_CMN_STATS_TX_MU_INFO:
  233. * @HTT_DBG_CMN_STATS_SIFS_RESP_INFO:
  234. * @HTT_DBG_CMN_STATS_RESET_INFO:
  235. * @HTT_DBG_CMN_STATS_MAC_WDOG_INFO:
  236. * @HTT_DBG_CMN_STATS_TX_DESC_INFO:
  237. * @HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO:
  238. * @HTT_DBG_CMN_STATS_TX_PFSCHED_INFO:
  239. * @HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO:
  240. * @HTT_DBG_CMN_NUM_STATS:
  241. * @HTT_DBG_CMN_NUM_STATS_INVALID:
  242. */
  243. enum htt_cmn_dbg_stats_type {
  244. HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  245. HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  246. HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  247. HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  248. HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  249. HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  250. HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  251. HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  252. HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  253. HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  254. HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  255. HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  256. HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */
  257. HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */
  258. HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */
  259. HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */
  260. HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */
  261. HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
  262. /* bits 18-23 currently reserved */
  263. /* keep this last */
  264. HTT_DBG_CMN_NUM_STATS,
  265. HTT_DBG_CMN_NUM_STATS_INVALID = 31, /* bit 31 -> 0x80000000 */
  266. };
  267. /**
  268. * enum cdp_host_txrx_stats - Different types of host stats
  269. * @TXRX_HOST_STATS_INVALID: Invalid option
  270. * @TXRX_CLEAR_STATS: clear all host stats
  271. * @TXRX_RX_RATE_STATS: Rx rate info
  272. * @TXRX_TX_RATE_STATS: Tx rate info
  273. * @TXRX_TX_HOST_STATS: Print Tx stats
  274. * @TXRX_RX_HOST_STATS: Print host Rx stats
  275. * @TXRX_AST_STATS:
  276. * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
  277. * @TXRX_RX_MON_STATS: Print monitor mode stats
  278. * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
  279. * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
  280. * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
  281. * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
  282. * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
  283. * @TXRX_SOC_FSE_STATS:
  284. * @TXRX_HAL_REG_WRITE_STATS: Hal Reg Write stats
  285. * @TXRX_SOC_REO_HW_DESC_DUMP: HW REO queue desc dump
  286. * @TXRX_SOC_WBM_IDLE_HPTP_DUMP: WBM idle link desc SRNG HP/TP dump
  287. * @TXRX_SRNG_USAGE_WM_STATS: SRNG usage watermark stats
  288. * @TXRX_HOST_STATS_MAX:
  289. */
  290. enum cdp_host_txrx_stats {
  291. TXRX_HOST_STATS_INVALID = -1,
  292. TXRX_CLEAR_STATS = 0,
  293. TXRX_RX_RATE_STATS = 1,
  294. TXRX_TX_RATE_STATS = 2,
  295. TXRX_TX_HOST_STATS = 3,
  296. TXRX_RX_HOST_STATS = 4,
  297. TXRX_AST_STATS = 5,
  298. TXRX_SRNG_PTR_STATS = 6,
  299. TXRX_RX_MON_STATS = 7,
  300. TXRX_REO_QUEUE_STATS = 8,
  301. TXRX_SOC_CFG_PARAMS = 9,
  302. TXRX_PDEV_CFG_PARAMS = 10,
  303. TXRX_NAPI_STATS = 11,
  304. TXRX_SOC_INTERRUPT_STATS = 12,
  305. TXRX_SOC_FSE_STATS = 13,
  306. TXRX_HAL_REG_WRITE_STATS = 14,
  307. TXRX_SOC_REO_HW_DESC_DUMP = 15,
  308. TXRX_SOC_WBM_IDLE_HPTP_DUMP = 16,
  309. TXRX_SRNG_USAGE_WM_STATS = 17,
  310. TXRX_HOST_STATS_MAX,
  311. };
  312. /**
  313. * enum cdp_ppdu_ftype - PPDU Frame Type
  314. * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
  315. * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
  316. * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
  317. * @CDP_PPDU_FTYPE_MAX: Max value
  318. */
  319. enum cdp_ppdu_ftype {
  320. CDP_PPDU_FTYPE_CTRL,
  321. CDP_PPDU_FTYPE_DATA,
  322. CDP_PPDU_FTYPE_BAR,
  323. CDP_PPDU_FTYPE_MAX
  324. };
  325. /**
  326. * enum htt_cmn_pkt_type - General specification of the tx frame contents
  327. * @htt_cmn_pkt_type_raw: raw
  328. * @htt_cmn_pkt_type_native_wifi: native wifi
  329. * @htt_cmn_pkt_type_ethernet: ethernet
  330. * @htt_cmn_pkt_type_mgmt: management
  331. * @htt_cmn_pkt_type_eth2: ethernet2
  332. * @htt_cmn_pkt_num_types: number of packet types
  333. *
  334. * for efficiency, the HTT packet type values correspond
  335. * to the bit positions of the WAL packet type values, so the
  336. * translation is a simple shift operation.
  337. */
  338. enum htt_cmn_pkt_type {
  339. htt_cmn_pkt_type_raw = 0,
  340. htt_cmn_pkt_type_native_wifi = 1,
  341. htt_cmn_pkt_type_ethernet = 2,
  342. htt_cmn_pkt_type_mgmt = 3,
  343. htt_cmn_pkt_type_eth2 = 4,
  344. /* keep this last */
  345. htt_cmn_pkt_num_types
  346. };
  347. /**
  348. * enum htt_cmn_rx_status - description of HTT received packets status
  349. * @htt_cmn_rx_status_unknown:
  350. * @htt_cmn_rx_status_ok:
  351. * @htt_cmn_rx_status_err_fcs:
  352. * @htt_cmn_rx_status_err_dup:
  353. * @htt_cmn_rx_status_err_replay:
  354. * @htt_cmn_rx_status_inv_peer:
  355. * @htt_cmn_rx_status_ctrl_mgmt_null:
  356. * @htt_cmn_rx_status_tkip_mic_err:
  357. * @htt_cmn_rx_status_decrypt_err:
  358. * @htt_cmn_rx_status_mpdu_length_err:
  359. * @htt_cmn_rx_status_err_misc:
  360. *
  361. * It is similar to htt_rx_status enum
  362. * but is added as a cdp enum can be freely used in OL_IF layer
  363. */
  364. enum htt_cmn_rx_status {
  365. htt_cmn_rx_status_unknown = 0x0,
  366. htt_cmn_rx_status_ok,
  367. htt_cmn_rx_status_err_fcs,
  368. htt_cmn_rx_status_err_dup,
  369. htt_cmn_rx_status_err_replay,
  370. htt_cmn_rx_status_inv_peer,
  371. htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
  372. htt_cmn_rx_status_tkip_mic_err = 0x09,
  373. htt_cmn_rx_status_decrypt_err = 0x0A,
  374. htt_cmn_rx_status_mpdu_length_err = 0x0B,
  375. htt_cmn_rx_status_err_misc = 0xFF
  376. };
  377. enum cdp_host_reo_dest_ring {
  378. cdp_host_reo_dest_ring_unknown = 0,
  379. cdp_host_reo_dest_ring_1 = 1,
  380. cdp_host_reo_dest_ring_2 = 2,
  381. cdp_host_reo_dest_ring_3 = 3,
  382. cdp_host_reo_dest_ring_4 = 4,
  383. };
  384. enum htt_cmn_t2h_en_stats_type {
  385. /* keep this always first */
  386. HTT_CMN_T2H_EN_STATS_TYPE_START = 0,
  387. /** ppdu_common_stats is the payload */
  388. HTT_CMN_T2H_EN_STATS_TYPE_COMMON = 1,
  389. /** ppdu_sant_stats is the payload */
  390. HTT_CMN_T2H_EN_STATS_TYPE_SANT = 2,
  391. /** ppdu_common_stats_v2 is the payload */
  392. HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
  393. /* Keep this last */
  394. HTT_CMN_T2H_EN_STATS_TYPE_END = 0x1f,
  395. };
  396. enum htt_cmn_t2h_en_stats_status {
  397. /* Keep this first always */
  398. HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL = 0,
  399. HTT_CMN_T2H_EN_STATS_STATUS_PRESENT = 1,
  400. HTT_CMN_T2H_EN_STATS_STATUS_ERROR = 2,
  401. HTT_CMN_T2H_EN_STATS_STATUS_INVALID = 3,
  402. /* keep this always last */
  403. HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE = 7,
  404. };
  405. /**
  406. * enum cdp_peer_type - Peer type
  407. * @CDP_INVALID_PEER_TYPE: invalid peer type
  408. * @CDP_LINK_PEER_TYPE: legacy peer or link peer for MLO connection
  409. * @CDP_MLD_PEER_TYPE: MLD peer for MLO connection
  410. * @CDP_WILD_PEER_TYPE: used to set peer type for same mld/link mac addr
  411. */
  412. enum cdp_peer_type {
  413. CDP_INVALID_PEER_TYPE,
  414. CDP_LINK_PEER_TYPE,
  415. CDP_MLD_PEER_TYPE,
  416. CDP_WILD_PEER_TYPE,
  417. };
  418. /**
  419. * struct cdp_peer_setup_info - MLO connection info for cdp_peer_setup()
  420. * @mld_peer_mac: mld peer mac address pointer
  421. * @is_first_link: set true for first MLO link peer
  422. * @is_primary_link: set true for MLO primary link peer
  423. * @primary_umac_id: primary umac_id
  424. * @num_links: number of links in MLO
  425. */
  426. struct cdp_peer_setup_info {
  427. uint8_t *mld_peer_mac;
  428. uint8_t is_first_link:1,
  429. is_primary_link:1;
  430. uint8_t primary_umac_id;
  431. uint8_t num_links;
  432. };
  433. /**
  434. * struct cdp_peer_info - peer info for dp hash find
  435. * @vdev_id: Vdev ID
  436. * @mac_addr: peer mac address to search
  437. * @mac_addr_is_aligned: true only if mac_addr type is
  438. * "union dp_align_mac_addr", otherwise set false always.
  439. * @peer_type: link or MLD peer type
  440. */
  441. struct cdp_peer_info {
  442. uint8_t vdev_id;
  443. uint8_t *mac_addr;
  444. bool mac_addr_is_aligned;
  445. enum cdp_peer_type peer_type;
  446. };
  447. /**
  448. * enum ol_txrx_peer_state - Peer state information
  449. * @OL_TXRX_PEER_STATE_INVALID: Invalid
  450. * @OL_TXRX_PEER_STATE_DISC: disconnected (initial state)
  451. * @OL_TXRX_PEER_STATE_CONN: authentication in progress
  452. * @OL_TXRX_PEER_STATE_AUTH: authentication successful
  453. */
  454. enum ol_txrx_peer_state {
  455. OL_TXRX_PEER_STATE_INVALID,
  456. OL_TXRX_PEER_STATE_DISC,
  457. OL_TXRX_PEER_STATE_CONN,
  458. OL_TXRX_PEER_STATE_AUTH,
  459. };
  460. /**
  461. * enum cdp_txrx_ast_entry_type - AST entry type information
  462. * @CDP_TXRX_AST_TYPE_NONE: static ast entry for connected peer
  463. * @CDP_TXRX_AST_TYPE_STATIC: static ast entry for connected peer
  464. * @CDP_TXRX_AST_TYPE_SELF: static ast entry for self peer (STA mode)
  465. * @CDP_TXRX_AST_TYPE_WDS: WDS peer ast entry type
  466. * @CDP_TXRX_AST_TYPE_WDS_HM: HM WDS entry
  467. * @CDP_TXRX_AST_TYPE_STA_BSS: BSS entry(STA mode)
  468. * @CDP_TXRX_AST_TYPE_DA: AST entry based on Destination address
  469. * @CDP_TXRX_AST_TYPE_WDS_HM_SEC: HM WDS entry for secondary radio
  470. * @CDP_TXRX_AST_TYPE_MLD: AST entry type for MLD peer
  471. * @CDP_TXRX_AST_TYPE_MAX:
  472. */
  473. enum cdp_txrx_ast_entry_type {
  474. CDP_TXRX_AST_TYPE_NONE,
  475. CDP_TXRX_AST_TYPE_STATIC,
  476. CDP_TXRX_AST_TYPE_SELF,
  477. CDP_TXRX_AST_TYPE_WDS,
  478. CDP_TXRX_AST_TYPE_WDS_HM,
  479. CDP_TXRX_AST_TYPE_STA_BSS,
  480. CDP_TXRX_AST_TYPE_DA,
  481. CDP_TXRX_AST_TYPE_WDS_HM_SEC,
  482. CDP_TXRX_AST_TYPE_MLD,
  483. CDP_TXRX_AST_TYPE_MAX
  484. };
  485. /**
  486. * enum cdp_ast_free_status - status passed to callback function before
  487. * freeing ast
  488. * @CDP_TXRX_AST_DELETED: AST is deleted from FW and delete response received
  489. * @CDP_TXRX_AST_DELETE_IN_PROGRESS: AST delete command sent to FW and host
  490. * is waiting for FW response
  491. */
  492. enum cdp_ast_free_status {
  493. CDP_TXRX_AST_DELETED,
  494. CDP_TXRX_AST_DELETE_IN_PROGRESS,
  495. };
  496. /**
  497. * typedef txrx_ast_free_cb() - callback registered for ast free
  498. * @ctrl_soc: control path soc context
  499. * @cdp_soc: DP soc context
  500. * @cookie: cookie
  501. * @cdp_ast_free_status: ast free status
  502. */
  503. typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc,
  504. struct cdp_soc *cdp_soc,
  505. void *cookie,
  506. enum cdp_ast_free_status);
  507. /**
  508. * struct cdp_ast_entry_info - AST entry information
  509. * @peer_mac_addr: mac address of peer on which AST entry is added
  510. * @type: ast entry type
  511. * @vdev_id: vdev_id
  512. * @pdev_id: pdev_id
  513. * @peer_id: peer_id
  514. *
  515. * This structure holds the ast entry information
  516. *
  517. */
  518. struct cdp_ast_entry_info {
  519. uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
  520. enum cdp_txrx_ast_entry_type type;
  521. uint8_t vdev_id;
  522. uint8_t pdev_id;
  523. uint16_t peer_id;
  524. };
  525. #define MIC_SEQ_CTR_SIZE 6
  526. enum cdp_rx_frame_type {
  527. cdp_rx_frame_type_802_11,
  528. cdp_rx_frame_type_802_3,
  529. };
  530. /**
  531. * struct cdp_rx_mic_err_info - rx mic error information
  532. * @frame_type: frame type - 0 - 802.11 frame
  533. * - 1 - 802.3 frame
  534. * @data: 802.11 frame
  535. * @ta_mac_addr: transmitter mac address
  536. * @da_mac_addr: destination mac address
  537. * @tsc: sequence number
  538. * @key_id: Key ID
  539. * @multicast: flag for multicast
  540. * @vdev_id: vdev ID
  541. *
  542. * This structure holds rx mic error information
  543. *
  544. */
  545. struct cdp_rx_mic_err_info {
  546. uint8_t frame_type;
  547. uint8_t *data;
  548. struct qdf_mac_addr ta_mac_addr;
  549. struct qdf_mac_addr da_mac_addr;
  550. uint8_t tsc[MIC_SEQ_CTR_SIZE];
  551. uint8_t key_id;
  552. bool multicast;
  553. uint16_t vdev_id;
  554. };
  555. #ifdef WLAN_SUPPORT_MSCS
  556. /**
  557. * struct cdp_mscs_params - MSCS parameters obtained
  558. * from handshake
  559. * @user_pri_bitmap: User priority bitmap
  560. * @user_pri_limit: User priority limit
  561. * @classifier_type: TCLAS Classifier type
  562. * @classifier_mask: TCLAS Classifier mask
  563. */
  564. struct cdp_mscs_params {
  565. uint8_t user_pri_bitmap;
  566. uint8_t user_pri_limit;
  567. uint8_t classifier_type;
  568. uint8_t classifier_mask;
  569. };
  570. #endif
  571. /**
  572. * enum cdp_sec_type - security type information
  573. * @cdp_sec_type_none:
  574. * @cdp_sec_type_wep128:
  575. * @cdp_sec_type_wep104:
  576. * @cdp_sec_type_wep40:
  577. * @cdp_sec_type_tkip:
  578. * @cdp_sec_type_tkip_nomic:
  579. * @cdp_sec_type_aes_ccmp:
  580. * @cdp_sec_type_wapi:
  581. * @cdp_sec_type_aes_ccmp_256:
  582. * @cdp_sec_type_aes_gcmp:
  583. * @cdp_sec_type_aes_gcmp_256:
  584. * @cdp_num_sec_types:
  585. */
  586. enum cdp_sec_type {
  587. cdp_sec_type_none,
  588. cdp_sec_type_wep128,
  589. cdp_sec_type_wep104,
  590. cdp_sec_type_wep40,
  591. cdp_sec_type_tkip,
  592. cdp_sec_type_tkip_nomic,
  593. cdp_sec_type_aes_ccmp,
  594. cdp_sec_type_wapi,
  595. cdp_sec_type_aes_ccmp_256,
  596. cdp_sec_type_aes_gcmp,
  597. cdp_sec_type_aes_gcmp_256,
  598. /* keep this last! */
  599. cdp_num_sec_types
  600. };
  601. /**
  602. * struct cdp_tx_exception_metadata - Exception path parameters
  603. * @peer_id: Peer id of the peer
  604. * @tid: Transmit Identifier
  605. * @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
  606. * @sec_type: sec_type to be passed to HAL
  607. * @is_tx_sniffer: Indicates if the packet has to be sniffed
  608. * @is_intrabss_fwd:
  609. * @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions
  610. * @is_wds_extended:
  611. *
  612. * This structure holds the parameters needed in the exception path of tx
  613. *
  614. */
  615. struct cdp_tx_exception_metadata {
  616. uint16_t peer_id;
  617. uint8_t tid;
  618. uint16_t tx_encap_type;
  619. enum cdp_sec_type sec_type;
  620. uint8_t is_tx_sniffer :1,
  621. is_intrabss_fwd :1;
  622. uint16_t ppdu_cookie;
  623. #ifdef QCA_SUPPORT_WDS_EXTENDED
  624. uint8_t is_wds_extended;
  625. #endif
  626. };
  627. /**
  628. * enum wlan_op_mode - Virtual device operation mode
  629. * @wlan_op_mode_unknown: Unknown mode
  630. * @wlan_op_mode_ap: AP mode
  631. * @wlan_op_mode_ibss: IBSS mode
  632. * @wlan_op_mode_sta: STA (client) mode
  633. * @wlan_op_mode_monitor: Monitor mode
  634. * @wlan_op_mode_ocb: OCB mode
  635. * @wlan_op_mode_ndi: NDI mode
  636. */
  637. enum wlan_op_mode {
  638. wlan_op_mode_unknown,
  639. wlan_op_mode_ap,
  640. wlan_op_mode_ibss,
  641. wlan_op_mode_sta,
  642. wlan_op_mode_monitor,
  643. wlan_op_mode_ocb,
  644. wlan_op_mode_ndi,
  645. };
  646. /**
  647. * enum wlan_op_subtype - Virtual device subtype
  648. * @wlan_op_subtype_none: Subtype not applicable
  649. * @wlan_op_subtype_p2p_device: P2P device
  650. * @wlan_op_subtype_p2p_cli: P2P Client
  651. * @wlan_op_subtype_p2p_go: P2P GO
  652. *
  653. * This enum lists the subtypes of a particular virtual
  654. * device.
  655. */
  656. enum wlan_op_subtype {
  657. wlan_op_subtype_none,
  658. wlan_op_subtype_p2p_device,
  659. wlan_op_subtype_p2p_cli,
  660. wlan_op_subtype_p2p_go,
  661. };
  662. /**
  663. * struct cdp_vdev_info - Vdev information
  664. * @vdev_mac_addr: mac address of the vdev
  665. * @vdev_id: ID of the vdev
  666. * @vdev_stats_id: Stats ID of the vdev
  667. * @op_mode: Operation mode of the vdev
  668. * @subtype: subtype of the vdev
  669. * @mld_mac_addr: MLD mac addr of the current vdev.
  670. */
  671. struct cdp_vdev_info {
  672. uint8_t *vdev_mac_addr;
  673. uint8_t vdev_id;
  674. uint8_t vdev_stats_id;
  675. enum wlan_op_mode op_mode;
  676. enum wlan_op_subtype subtype;
  677. #ifdef WLAN_FEATURE_11BE_MLO
  678. uint8_t *mld_mac_addr;
  679. #endif
  680. };
  681. typedef struct cdp_soc_t *ol_txrx_soc_handle;
  682. /**
  683. * typedef ol_txrx_vdev_delete_cb ()- callback registered during vdev detach
  684. * @context:
  685. */
  686. typedef void (*ol_txrx_vdev_delete_cb)(void *context);
  687. /**
  688. * typedef ol_txrx_peer_unmap_sync_cb() - callback registered during peer
  689. * detach sync
  690. * @vdev_id:
  691. * @peer_id_cnt:
  692. * @peer_id_list:
  693. */
  694. typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
  695. uint32_t peer_id_cnt,
  696. uint16_t *peer_id_list);
  697. /**
  698. * enum txrx_direction - Packet Direction
  699. * @rx_direction: rx path packet
  700. * @tx_direction: tx path packet
  701. */
  702. enum txrx_direction {
  703. rx_direction = 1,
  704. tx_direction = 0,
  705. };
  706. /**
  707. * enum cdp_capabilities- DP capabilities
  708. * @CDP_CFG_DP_TSO: TSO capability
  709. * @CDP_CFG_DP_LRO: LRO capability
  710. * @CDP_CFG_DP_SG: Scatter Gather capability
  711. * @CDP_CFG_DP_GRO: GRO capability
  712. * @CDP_CFG_DP_OL_TX_CSUM: Hardware based TX checksum capability
  713. * @CDP_CFG_DP_OL_RX_CSUM: Hardware based RX checksum capability
  714. * @CDP_CFG_DP_RAWMODE: RAW mode capability
  715. * @CDP_CFG_DP_PEER_FLOW_CTRL: Peer flow-control capability
  716. * @CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT: mark notify frames capability
  717. */
  718. enum cdp_capabilities {
  719. CDP_CFG_DP_TSO,
  720. CDP_CFG_DP_LRO,
  721. CDP_CFG_DP_SG,
  722. CDP_CFG_DP_GRO,
  723. CDP_CFG_DP_OL_TX_CSUM,
  724. CDP_CFG_DP_OL_RX_CSUM,
  725. CDP_CFG_DP_RAWMODE,
  726. CDP_CFG_DP_PEER_FLOW_CTRL,
  727. CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT,
  728. };
  729. /**
  730. * struct ol_txrx_nbuf_classify - Packet classification object
  731. * @peer_id: unique peer identifier from fw
  732. * @tid: traffic identifier(could be overridden)
  733. * @pkt_tid: traffic identifier(cannot be overridden)
  734. * @pkt_tos: ip header tos value
  735. * @pkt_dscp: ip header dscp value
  736. * @tos: index value in map
  737. * @dscp: DSCP_TID map index
  738. * @is_mcast: multicast pkt check
  739. * @is_eap: eapol pkt check
  740. * @is_arp: arp pkt check
  741. * @is_tcp: tcp pkt check
  742. * @is_dhcp: dhcp pkt check
  743. * @is_igmp: igmp pkt check
  744. * @is_ipv4: ip version 4 pkt check
  745. * @is_ipv6: ip version 6 pkt check
  746. */
  747. struct ol_txrx_nbuf_classify {
  748. uint16_t peer_id;
  749. uint8_t tid;
  750. uint8_t pkt_tid;
  751. uint8_t pkt_tos;
  752. uint8_t pkt_dscp;
  753. uint8_t tos;
  754. uint8_t dscp;
  755. uint8_t is_mcast;
  756. uint8_t is_eap;
  757. uint8_t is_arp;
  758. uint8_t is_tcp;
  759. uint8_t is_dhcp;
  760. uint8_t is_igmp;
  761. uint8_t is_ipv4;
  762. uint8_t is_ipv6;
  763. };
  764. /*
  765. * typedef ol_osif_vdev_handle - opaque handle for OS shim virtual
  766. * device object
  767. */
  768. struct ol_osif_vdev_t;
  769. typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
  770. #ifdef QCA_SUPPORT_WDS_EXTENDED
  771. struct ol_osif_peer_t;
  772. typedef struct ol_osif_peer_t *ol_osif_peer_handle;
  773. #endif
  774. /**
  775. * enum connectivity_stats_pkt_status - data pkt type
  776. * @PKT_TYPE_REQ: Request packet
  777. * @PKT_TYPE_RSP: Response packet
  778. * @PKT_TYPE_TX_DROPPED: TX packet dropped
  779. * @PKT_TYPE_RX_DROPPED: RX packet dropped
  780. * @PKT_TYPE_RX_DELIVERED: RX packet delivered
  781. * @PKT_TYPE_RX_REFUSED: RX packet refused
  782. * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
  783. * @PKT_TYPE_TX_ACK_CNT:TC packet acked
  784. * @PKT_TYPE_NONE: Invalid packet
  785. */
  786. enum connectivity_stats_pkt_status {
  787. PKT_TYPE_REQ,
  788. PKT_TYPE_RSP,
  789. PKT_TYPE_TX_DROPPED,
  790. PKT_TYPE_RX_DROPPED,
  791. PKT_TYPE_RX_DELIVERED,
  792. PKT_TYPE_RX_REFUSED,
  793. PKT_TYPE_TX_HOST_FW_SENT,
  794. PKT_TYPE_TX_ACK_CNT,
  795. PKT_TYPE_NONE,
  796. };
  797. /**
  798. * typedef ol_txrx_mgmt_tx_cb() - tx management delivery notification
  799. * callback function
  800. * @ctxt:
  801. * @tx_mgmt_frm:
  802. * @had_error:
  803. */
  804. typedef void
  805. (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
  806. /**
  807. * typedef ol_txrx_data_tx_cb() - Function registered with the data path
  808. * that is called when tx frames marked as "no free" are
  809. * done being transmitted
  810. * @ctxt:
  811. * @tx_frm:
  812. * @had_error:
  813. */
  814. typedef void
  815. (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
  816. /**
  817. * typedef ol_txrx_tx_fp() - top-level transmit function
  818. * @soc: dp soc handle
  819. * @vdev_id: handle to the virtual device object
  820. * @msdu_list: list of network buffers
  821. */
  822. typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  823. qdf_nbuf_t msdu_list);
  824. /**
  825. * typedef ol_txrx_tx_fast_fp() - top-level fast transmit function
  826. * @soc: dp soc handle
  827. * @vdev_id: handle to the virtual device object
  828. * @msdu_list: list of network buffers
  829. */
  830. typedef qdf_nbuf_t (*ol_txrx_tx_fast_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  831. qdf_nbuf_t msdu_list);
  832. /**
  833. * typedef ol_txrx_tx_exc_fp() - top-level transmit function on exception path
  834. * @soc: dp soc handle
  835. * @vdev_id: handle to the virtual device object
  836. * @msdu_list: list of network buffers
  837. * @tx_exc_metadata: structure that holds parameters to exception path
  838. */
  839. typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  840. qdf_nbuf_t msdu_list,
  841. struct cdp_tx_exception_metadata
  842. *tx_exc_metadata);
  843. /**
  844. * typedef ol_txrx_completion_fp() - top-level transmit function
  845. * for tx completion
  846. * @skb: skb data
  847. * @osif_dev: the virtual device's OS shim object
  848. * @flag: flag
  849. */
  850. typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
  851. void *osif_dev, uint16_t flag);
  852. /**
  853. * typedef ol_txrx_classify_critical_pkt_fp() - classification cb for critical
  854. * frames
  855. * @osif_dev: the virtual device's OS shim object
  856. * @skb: skb data
  857. */
  858. typedef void (*ol_txrx_classify_critical_pkt_fp)(void *osif_dev,
  859. qdf_nbuf_t skb);
  860. /**
  861. * typedef ol_txrx_tx_flow_control_fp() - tx flow control notification
  862. * function from txrx to OS shim
  863. * @osif_dev: the virtual device's OS shim object
  864. * @tx_resume: tx os q should be resumed or not
  865. */
  866. typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
  867. bool tx_resume);
  868. /**
  869. * typedef ol_txrx_tx_flow_control_is_pause_fp() - is tx paused by flow control
  870. * function from txrx to OS shim
  871. * @osif_dev: the virtual device's OS shim object
  872. *
  873. * Return: true if tx is paused by flow control
  874. */
  875. typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
  876. /**
  877. * typedef ol_txrx_rx_fp() - receive function to hand batches of data
  878. * frames from txrx to OS shim
  879. * @osif_dev: handle to the OSIF virtual device object
  880. * @msdu_list: list of network buffers
  881. */
  882. typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
  883. typedef QDF_STATUS(*ol_txrx_fisa_rx_fp)(void *soc,
  884. void *dp_vdev,
  885. qdf_nbuf_t msdu_list);
  886. typedef QDF_STATUS(*ol_txrx_fisa_flush_fp)(void *soc, int ring_num);
  887. /**
  888. * typedef ol_txrx_rx_flush_fp() - receive function to hand batches of
  889. * data frames from txrx to OS shim
  890. * @osif_dev: handle to the OSIF virtual device object
  891. * @vdev_id: vdev_if of the packets to be flushed
  892. */
  893. typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id);
  894. /**
  895. * typedef ol_txrx_rx_gro_flush_ind_fp() - function to send GRO flush
  896. * indication to stack for a given
  897. * RX Context Id.
  898. * @osif_dev: handle to the OSIF virtual device object
  899. * @rx_ctx_id: Rx context Id for which gro flush should happen
  900. */
  901. typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev,
  902. int rx_ctx_id);
  903. /**
  904. * typedef ol_txrx_stats_rx_fp() - receive function to hand batches of
  905. * data frames from txrx to OS shim
  906. * @skb: skb data
  907. * @osif_dev: the virtual device's OS shim object
  908. * @action: data packet type
  909. * @pkt_type: packet data type
  910. */
  911. typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
  912. void *osif_dev, enum connectivity_stats_pkt_status action,
  913. uint8_t *pkt_type);
  914. /**
  915. * typedef ol_txrx_get_key_fp() - function to gey key based on keyix
  916. * and peer mac address
  917. * @osif_dev: the virtual device's OS shim object
  918. * @key_buf: pointer to store key
  919. * @mac_addr: pointer to mac address
  920. * @keyix: key id
  921. */
  922. typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf,
  923. uint8_t *mac_addr, uint8_t keyix);
  924. /**
  925. * typedef ol_txrx_rsim_rx_decap_fp() - raw mode simulation function
  926. * to decap the packets in
  927. * receive path.
  928. * @osif_dev: the virtual device's OS shim object
  929. * @list_head: pointer to head of receive packet queue to decap
  930. * @list_tail: pointer to tail of receive packet queue to decap
  931. * @peer_mac: mac address of peer handler
  932. */
  933. typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
  934. qdf_nbuf_t *list_head,
  935. qdf_nbuf_t *list_tail);
  936. /**
  937. * typedef ol_txrx_tx_free_ext_fp() - external tx free function to
  938. * read per packet stats and free
  939. * tx buffer externally
  940. * @netbuf: tx network buffer
  941. */
  942. typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
  943. /**
  944. * typedef ol_txrx_rx_check_wai_fp() - OSIF WAPI receive function
  945. * @vdev:
  946. * @mpdu_head:
  947. * @mpdu_tail:
  948. */
  949. typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
  950. qdf_nbuf_t mpdu_head,
  951. qdf_nbuf_t mpdu_tail);
  952. /**
  953. * typedef ol_txrx_rx_mon_fp() - OSIF monitor mode receive function for single
  954. * MPDU (802.11 format)
  955. * @vdev:
  956. * @mpdu:
  957. * @rx_status:
  958. */
  959. typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
  960. qdf_nbuf_t mpdu,
  961. void *rx_status);
  962. /**
  963. * typedef ol_txrx_proxy_arp_fp() - proxy arp function pointer
  964. * @vdev:
  965. * @netbuf:
  966. */
  967. typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
  968. qdf_nbuf_t netbuf);
  969. /**
  970. * typedef ol_txrx_mcast_me_fp() - function pointer for multicast enhancement
  971. * @vdev:
  972. * @netbuf:
  973. */
  974. typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
  975. qdf_nbuf_t netbuf);
  976. /**
  977. * typedef ol_txrx_stats_callback() - statistics notify callback
  978. * @ctxt:
  979. * @type:
  980. * @buf:
  981. * @bytes:
  982. */
  983. typedef void (*ol_txrx_stats_callback)(void *ctxt,
  984. enum htt_cmn_dbg_stats_type type,
  985. uint8_t *buf, int bytes);
  986. /**
  987. * typedef ol_txrx_pktdump_cb() - callback for packet dump feature
  988. * @soc:
  989. * @pdev_id:
  990. * @vdev_id:
  991. * @netbuf:
  992. * @status:
  993. * @type:
  994. */
  995. typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
  996. uint8_t pdev_id,
  997. uint8_t vdev_id,
  998. qdf_nbuf_t netbuf,
  999. enum qdf_dp_tx_rx_status status,
  1000. enum qdf_pkt_type type);
  1001. /**
  1002. * typedef ol_txrx_get_tsf_time() - callback to get tsf time
  1003. * @osif_dev:
  1004. * @input_time:
  1005. * @tsf_time:
  1006. */
  1007. typedef QDF_STATUS(*ol_txrx_get_tsf_time)(void *osif_dev, uint64_t input_time,
  1008. uint64_t *tsf_time);
  1009. /**
  1010. * struct ol_txrx_ops - (pointers to) the functions used for tx and rx
  1011. * data xfer
  1012. *
  1013. * There are two portions of these txrx operations.
  1014. * The rx portion is filled in by OSIF SW before calling
  1015. * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
  1016. * the txrx SW stores a copy of these rx function pointers, to use
  1017. * as it delivers rx data frames to the OSIF SW.
  1018. * The tx portion is filled in by the txrx SW inside
  1019. * ol_txrx_osif_vdev_register; when the function call returns,
  1020. * the OSIF SW stores a copy of these tx functions to use as it
  1021. * delivers tx data frames to the txrx SW.
  1022. *
  1023. * @tx: tx function pointers - specified by txrx, stored by OS shim
  1024. * @tx.std: the tx function pointer for standard data
  1025. * frames This function pointer is set by the txrx SW
  1026. * perform host-side transmit operations based on
  1027. * whether a HL or LL host/target interface is in use.
  1028. * @tx.flow_control_cb: the transmit flow control
  1029. * function that is registered by the
  1030. * OSIF which is called from txrx to
  1031. * indicate whether the transmit OS
  1032. * queues should be paused/resumed
  1033. * @rx: rx function pointers - specified by OS shim, stored by txrx
  1034. * @rx.rx: the OS shim rx function to deliver rx data
  1035. * frames to. This can have different values for
  1036. * different virtual devices, e.g. so one virtual
  1037. * device's OS shim directly hands rx frames to the OS,
  1038. * but another virtual device's OS shim filters out P2P
  1039. * messages before sending the rx frames to the OS. The
  1040. * netbufs delivered to the osif_rx function are in the
  1041. * format specified by the OS to use for tx and rx
  1042. * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
  1043. * are given to the thread, instead of the stack via this pointer.
  1044. * @rx.rx_eapol: This rx function pointer used to receive only eapol frames
  1045. * @rx.stack: function to give packets to the stack. Differs from @rx.rx.
  1046. * In case RX Threads are enabled, this pointer holds the callback to give
  1047. * packets to the stack.
  1048. * @rx.rx_gro_flush: GRO flush indication to stack for a given RX CTX ID
  1049. * @rx.wai_check: the tx function pointer for WAPI frames
  1050. * @rx.mon: the OS shim rx monitor function to deliver
  1051. * monitor data to Though in practice, it is probable
  1052. * that the same function will be used for delivering
  1053. * rx monitor data for all virtual devices, in theory
  1054. * each different virtual device can have a different
  1055. * OS shim function for accepting rx monitor data. The
  1056. * netbufs delivered to the osif_rx_mon function are in
  1057. * 802.11 format. Each netbuf holds a 802.11 MPDU, not
  1058. * an 802.11 MSDU. Depending on compile-time
  1059. * configuration, each netbuf may also have a
  1060. * monitor-mode encapsulation header such as a radiotap
  1061. * header added before the MPDU contents.
  1062. * @rx.std: the OS shim rx function to deliver rx data
  1063. * @proxy_arp: proxy arp function pointer - specified by
  1064. * OS shim, stored by txrx
  1065. * @me_convert:
  1066. * @get_key: function pointer to get key of the peer with
  1067. * specific key index
  1068. * @get_tsf_time: function pointer to get TSF
  1069. */
  1070. struct ol_txrx_ops {
  1071. struct {
  1072. ol_txrx_tx_fp tx;
  1073. ol_txrx_tx_fast_fp tx_fast;
  1074. ol_txrx_tx_exc_fp tx_exception;
  1075. ol_txrx_tx_free_ext_fp tx_free_ext;
  1076. ol_txrx_completion_fp tx_comp;
  1077. ol_txrx_classify_critical_pkt_fp tx_classify_critical_pkt_cb;
  1078. } tx;
  1079. struct {
  1080. ol_txrx_rx_fp rx;
  1081. #ifdef QCA_SUPPORT_EAPOL_OVER_CONTROL_PORT
  1082. ol_txrx_rx_fp rx_eapol;
  1083. #endif
  1084. ol_txrx_rx_fp rx_stack;
  1085. ol_txrx_rx_flush_fp rx_flush;
  1086. ol_txrx_rx_gro_flush_ind_fp rx_gro_flush;
  1087. ol_txrx_rx_check_wai_fp wai_check;
  1088. ol_txrx_rx_mon_fp mon;
  1089. ol_txrx_stats_rx_fp stats_rx;
  1090. ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
  1091. ol_txrx_fisa_rx_fp osif_fisa_rx;
  1092. ol_txrx_fisa_flush_fp osif_fisa_flush;
  1093. } rx;
  1094. /* proxy arp function pointer - specified by OS shim, stored by txrx */
  1095. ol_txrx_proxy_arp_fp proxy_arp;
  1096. ol_txrx_mcast_me_fp me_convert;
  1097. ol_txrx_get_key_fp get_key;
  1098. ol_txrx_get_tsf_time get_tsf_time;
  1099. };
  1100. /**
  1101. * struct ol_txrx_hardtart_ctxt - handlers for dp tx path
  1102. * @tx: normal tx function
  1103. * @tx_fast: fast tx function
  1104. * @tx_exception: exception tx function
  1105. */
  1106. struct ol_txrx_hardtart_ctxt {
  1107. ol_txrx_tx_fp tx;
  1108. ol_txrx_tx_fast_fp tx_fast;
  1109. ol_txrx_tx_exc_fp tx_exception;
  1110. };
  1111. /**
  1112. * struct ol_txrx_stats_req - specifications of the requested
  1113. * statistics
  1114. * @stats_type_upload_mask: which stats to upload
  1115. * @stats_type_reset_mask: which stats to reset
  1116. * @print: control to print uploaded stats. stats will be printed if
  1117. * either print element is set
  1118. * @print.verbose: verbose stats printout
  1119. * @print.concise: concise stats printout (takes precedence)
  1120. * @callback: callback context
  1121. * @callback.fp: function pointer to call. stats notify callback will
  1122. * be invoked if fp is non-NULL
  1123. * @callback.ctxt: opaque context to pass to callback function
  1124. * @copy: copy context
  1125. * @copy.buf: stats will be copied into the specified buffer if buf is
  1126. * non-NULL
  1127. * @byte_limit: don't copy more than this
  1128. * @wait: wait context
  1129. * @wait.blocking: If true, the caller will take the specified
  1130. * semaphore to wait for the stats to be uploaded, and
  1131. * the driver will release the semaphore when the
  1132. * stats are done being uploaded.
  1133. * @wait.sem_ptr: Semaphore to use for blocking
  1134. */
  1135. struct ol_txrx_stats_req {
  1136. uint32_t stats_type_upload_mask;
  1137. uint32_t stats_type_reset_mask;
  1138. struct {
  1139. int verbose;
  1140. int concise;
  1141. } print;
  1142. struct {
  1143. ol_txrx_stats_callback fp;
  1144. void *ctxt;
  1145. } callback;
  1146. struct {
  1147. uint8_t *buf;
  1148. int byte_limit;
  1149. } copy;
  1150. struct {
  1151. int blocking;
  1152. qdf_semaphore_t *sem_ptr;
  1153. } wait;
  1154. };
  1155. /* DP soc struct definition */
  1156. struct cdp_soc_t {
  1157. struct cdp_ops *ops;
  1158. struct ol_if_ops *ol_ops;
  1159. };
  1160. /**
  1161. * enum cdp_peer_param_type - different types of parameters
  1162. * to set values in peer
  1163. * @CDP_CONFIG_NAWDS: Enable nawds mode
  1164. * @CDP_CONFIG_NAC: Enable nac
  1165. * @CDP_CONFIG_ISOLATION: Enable isolation
  1166. * @CDP_CONFIG_IN_TWT: In TWT session or not
  1167. */
  1168. enum cdp_peer_param_type {
  1169. CDP_CONFIG_NAWDS,
  1170. CDP_CONFIG_NAC,
  1171. CDP_CONFIG_ISOLATION,
  1172. CDP_CONFIG_IN_TWT,
  1173. };
  1174. /**
  1175. * enum cdp_pdev_param_type - different types of parameters
  1176. * to set values in pdev
  1177. * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
  1178. * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
  1179. * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
  1180. * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
  1181. * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
  1182. * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
  1183. * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
  1184. * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
  1185. * @CDP_INGRESS_STATS: Accumulate ingress statistics
  1186. * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
  1187. * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
  1188. * @CDP_CONFIG_ENH_TX_CAPTURE: Enable enhanced TX capture
  1189. * @CDP_CONFIG_HMMC_TID_OVERRIDE: Enable hmmc tid override
  1190. * @CDP_CONFIG_HMMC_TID_VALUE: set hmmc tid value
  1191. * @CDP_CONFIG_TX_CAPTURE: set tx capture
  1192. * @CDP_CHAN_NOISE_FLOOR: set channel noise floor
  1193. * @CDP_CONFIG_VOW: set/get vow config
  1194. * @CDP_TIDQ_OVERRIDE: set/get tid queue override
  1195. * @CDP_TIDMAP_PRTY: set/get tid map prty
  1196. * @CDP_TX_PENDING: get tx pending
  1197. * @CDP_FILTER_NEIGH_PEERS: filter neighbour peers
  1198. * @CDP_FILTER_UCAST_DATA: filter unicast data
  1199. * @CDP_FILTER_MCAST_DATA: filter multicast data
  1200. * @CDP_FILTER_NO_DATA: filter no data
  1201. * @CDP_MONITOR_CHANNEL: monitor channel
  1202. * @CDP_MONITOR_FREQUENCY: monitor frequency
  1203. * @CDP_CONFIG_BSS_COLOR: configure bss color
  1204. * @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag
  1205. * @CDP_CONFIG_SPECIAL_VAP: Configure Special vap
  1206. * @CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE: Enable scan spcl vap stats reset
  1207. * @CDP_CONFIG_ENHANCED_STATS_ENABLE:
  1208. * @CDP_ISOLATION: set isolation flag
  1209. * @CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE: Undecoded metadata capture
  1210. */
  1211. enum cdp_pdev_param_type {
  1212. CDP_CONFIG_DEBUG_SNIFFER,
  1213. CDP_CONFIG_BPR_ENABLE,
  1214. CDP_CONFIG_PRIMARY_RADIO,
  1215. CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
  1216. CDP_CONFIG_IGMPMLD_OVERRIDE,
  1217. CDP_CONFIG_IGMPMLD_TID,
  1218. CDP_CONFIG_ARP_DBG_CONF,
  1219. CDP_CONFIG_CAPTURE_LATENCY,
  1220. CDP_INGRESS_STATS,
  1221. CDP_OSIF_DROP,
  1222. CDP_CONFIG_ENH_RX_CAPTURE,
  1223. CDP_CONFIG_ENH_TX_CAPTURE,
  1224. CDP_CONFIG_HMMC_TID_OVERRIDE,
  1225. CDP_CONFIG_HMMC_TID_VALUE,
  1226. CDP_CONFIG_TX_CAPTURE,
  1227. CDP_CHAN_NOISE_FLOOR,
  1228. CDP_CONFIG_VOW,
  1229. CDP_TIDQ_OVERRIDE,
  1230. CDP_TIDMAP_PRTY,
  1231. CDP_TX_PENDING,
  1232. CDP_FILTER_NEIGH_PEERS,
  1233. CDP_FILTER_UCAST_DATA,
  1234. CDP_FILTER_MCAST_DATA,
  1235. CDP_FILTER_NO_DATA,
  1236. CDP_MONITOR_CHANNEL,
  1237. CDP_MONITOR_FREQUENCY,
  1238. CDP_CONFIG_BSS_COLOR,
  1239. CDP_SET_ATF_STATS_ENABLE,
  1240. CDP_CONFIG_SPECIAL_VAP,
  1241. CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE,
  1242. CDP_CONFIG_ENHANCED_STATS_ENABLE,
  1243. CDP_ISOLATION,
  1244. CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE,
  1245. };
  1246. /**
  1247. * typedef cdp_config_param_type - union of different types of parameters
  1248. * to set values into dp handles.
  1249. *
  1250. * @cdp_peer_param_nawds: Enable nawds mode
  1251. * @cdp_peer_param_isolation: Enable isolation
  1252. * @cdp_peer_param_in_twt: in TWT session or not
  1253. * @cdp_peer_param_nac: Enable nac
  1254. *
  1255. * @cdp_vdev_param_nawds: set nawds enable/disable
  1256. * @cdp_vdev_param_mcast_en: enable/disable multicast enhancement
  1257. * @cdp_vdev_param_wds: wds sta
  1258. * @cdp_vdev_param_mec: MEC enable flags
  1259. * @cdp_vdev_param_proxysta: proxy sta
  1260. * @cdp_vdev_param_tdls_flags: tdls link flags
  1261. * @cdp_vdev_param_ap_brdg_en: set ap_bridging enable/disable
  1262. * @cdp_vdev_param_cipher_en: set cipher type based on security
  1263. * @cdp_vdev_param_qwrap_isolation: qwrap isolation mode
  1264. * @cdp_vdev_param_tx_encap: tx encap type
  1265. * @cdp_vdev_param_rx_decap: rx decap type
  1266. * @cdp_vdev_param_mesh_rx_filter: set mesh rx filter
  1267. * @cdp_vdev_param_tidmap_prty: set tid vdev prty
  1268. * @cdp_vdev_param_tidmap_tbl_id: set tidmap table id
  1269. * @cdp_vdev_param_mesh_mode: set mesh mode
  1270. * @cdp_vdev_param_safe_mode: set safe mode
  1271. * @cdp_vdev_param_drop_unenc: set drop unencrypted flag
  1272. * @cdp_vdev_param_hlos_tid_override: set hlos tid override
  1273. * @cdp_vdev_param_peer_authorize: set peer authorize
  1274. * @cdp_vdev_param_peer_tid_latency_enable: set peer tid latency enable flag
  1275. * @cdp_vdev_param_mesh_tid: config tatency tid on vdev
  1276. * @cdp_vdev_param_dscp_tid_map_id: set dscp to tid map id
  1277. * @cdp_vdev_param_mcast_vdev: set mcast vdev params
  1278. * @cdp_vdev_param_wrap: qwrap ap vap
  1279. *
  1280. * @cdp_pdev_param_dbg_snf: Enable debug sniffer feature
  1281. * @cdp_pdev_param_bpr_enable: Enable bcast probe feature
  1282. * @cdp_pdev_param_primary_radio: Configure radio as primary
  1283. * @cdp_pdev_param_en_perpkt_txstats: Enable per packet statistics
  1284. * @cdp_pdev_param_igmpmld_override: Override IGMP/MLD
  1285. * @cdp_pdev_param_igmpmld_tid: TID value when igmmld_override is set
  1286. * @cdp_pdev_param_arp_dbg_conf: Enable ARP debug
  1287. * @cdp_pdev_param_cptr_latcy: Capture time latency
  1288. * @cdp_pdev_param_ingrs_stats: Accumulate ingress statistics
  1289. * @cdp_pdev_param_osif_drop: Accumulate drops in OSIF layer
  1290. * @cdp_pdev_param_en_rx_cap: Enable enhanced RX capture
  1291. * @cdp_pdev_param_en_tx_cap: Enable enhanced TX capture
  1292. * @cdp_pdev_param_hmmc_tid_ovrd: Enable hmmc tid override
  1293. * @cdp_pdev_param_hmmc_tid: set hmmc tid value
  1294. * @cdp_pdev_param_tx_capture: set tx capture
  1295. * @cdp_pdev_param_chn_noise_flr: set channel noise floor
  1296. * @cdp_pdev_param_cfg_vow: set/get vow config
  1297. * @cdp_pdev_param_tidq_override: set/get tid queue override
  1298. * @cdp_pdev_param_mon_freq: set monitor frequency
  1299. * @cdp_pdev_param_bss_color: configure bss color
  1300. * @cdp_pdev_param_tidmap_prty: set/get tid map prty
  1301. * @cdp_pdev_param_tx_pending: get tx pending
  1302. * @cdp_pdev_param_fltr_neigh_peers: filter neighbour peers
  1303. * @cdp_pdev_param_fltr_ucast: filter unicast data
  1304. * @cdp_pdev_param_fltr_mcast: filter multicast data
  1305. * @cdp_pdev_param_fltr_none: filter no data
  1306. * @cdp_pdev_param_monitor_chan: monitor channel
  1307. * @cdp_pdev_param_atf_stats_enable: ATF stats enable
  1308. * @cdp_pdev_param_config_special_vap: Configure Special vap
  1309. * @cdp_pdev_param_isolation : set isolation mode
  1310. *
  1311. * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
  1312. * @cdp_psoc_param_en_nss_cfg: set nss cfg
  1313. * @cdp_psoc_param_ppeds_enabled: PPE-DS feature enable
  1314. * @cdp_ipa_enabled : set ipa mode
  1315. * @cdp_psoc_param_vdev_stats_hw_offload: Configure HW vdev stats offload
  1316. * @cdp_pdev_param_undecoded_metadata_enable: Undecoded metadata capture enable
  1317. * @cdp_sawf_enabled: SAWF enable/disable
  1318. * @cdp_sawf_stats: SAWF stats config
  1319. * @cdp_vdev_param_traffic_end_ind: Traffic end indication enable/disable
  1320. * @cdp_skel_enable : Enable/Disable skeleton code for Umac reset debug
  1321. * @cdp_drop_tx_mcast: Enable/Disable tx mcast drop
  1322. * @cdp_vdev_tx_to_fw: Set to_fw bit for all tx packets for the vdev
  1323. */
  1324. typedef union cdp_config_param_t {
  1325. /* peer params */
  1326. bool cdp_peer_param_nawds;
  1327. bool cdp_peer_param_isolation;
  1328. uint8_t cdp_peer_param_nac;
  1329. bool cdp_peer_param_in_twt;
  1330. /* vdev params */
  1331. bool cdp_vdev_param_wds;
  1332. bool cdp_vdev_param_mec;
  1333. bool cdp_vdev_param_nawds;
  1334. bool cdp_vdev_param_proxysta;
  1335. bool cdp_vdev_param_tdls_flags;
  1336. bool cdp_vdev_param_ap_brdg_en;
  1337. bool cdp_vdev_param_qwrap_isolation;
  1338. bool cdp_vdev_param_update_multipass;
  1339. uint8_t cdp_vdev_param_da_war;
  1340. uint8_t cdp_vdev_param_mcast_en;
  1341. uint8_t cdp_vdev_param_igmp_mcast_en;
  1342. uint8_t cdp_vdev_param_tidmap_prty;
  1343. uint8_t cdp_vdev_param_tidmap_tbl_id;
  1344. uint32_t cdp_vdev_param_aging_tmr;
  1345. uint32_t cdp_vdev_param_cipher_en;
  1346. uint32_t cdp_vdev_param_tx_encap;
  1347. uint32_t cdp_vdev_param_rx_decap;
  1348. uint32_t cdp_vdev_param_mesh_rx_filter;
  1349. uint32_t cdp_vdev_param_mesh_mode;
  1350. uint32_t cdp_vdev_param_safe_mode;
  1351. uint32_t cdp_vdev_param_drop_unenc;
  1352. uint8_t cdp_vdev_param_hlos_tid_override;
  1353. bool cdp_vdev_param_wds_ext;
  1354. uint8_t cdp_vdev_param_peer_authorize;
  1355. uint8_t cdp_vdev_param_peer_tid_latency_enable;
  1356. uint8_t cdp_vdev_param_mesh_tid;
  1357. uint8_t cdp_vdev_param_dscp_tid_map_id;
  1358. bool cdp_vdev_param_mcast_vdev;
  1359. bool cdp_vdev_param_wrap;
  1360. /* pdev params */
  1361. bool cdp_pdev_param_cptr_latcy;
  1362. bool cdp_pdev_param_hmmc_tid_ovrd;
  1363. bool cdp_pdev_param_fltr_neigh_peers;
  1364. bool cdp_pdev_param_cfg_vow;
  1365. bool cdp_pdev_param_fltr_mcast;
  1366. bool cdp_pdev_param_fltr_none;
  1367. bool cdp_pdev_param_fltr_ucast;
  1368. uint8_t cdp_pdev_param_primary_radio;
  1369. uint8_t cdp_pdev_param_en_rx_cap;
  1370. uint8_t cdp_pdev_param_en_tx_cap;
  1371. uint8_t cdp_pdev_param_tx_capture;
  1372. uint8_t cdp_pdev_param_hmmc_tid;
  1373. uint8_t cdp_pdev_param_tidmap_prty;
  1374. uint8_t cdp_pdev_param_igmpmld_override;
  1375. uint8_t cdp_pdev_param_igmpmld_tid;
  1376. uint8_t cdp_pdev_param_arp_dbg_conf;
  1377. uint8_t cdp_pdev_param_tidq_override;
  1378. uint8_t cdp_pdev_param_bss_color;
  1379. uint16_t cdp_pdev_param_chn_noise_flr;
  1380. qdf_freq_t cdp_pdev_param_mon_freq;
  1381. int cdp_pdev_param_dbg_snf;
  1382. int cdp_pdev_param_bpr_enable;
  1383. int cdp_pdev_param_monitor_chan;
  1384. uint32_t cdp_pdev_param_ingrs_stats;
  1385. uint32_t cdp_pdev_param_osif_drop;
  1386. uint32_t cdp_pdev_param_en_perpkt_txstats;
  1387. uint32_t cdp_pdev_param_tx_pending;
  1388. bool cdp_pdev_param_atf_stats_enable;
  1389. bool cdp_pdev_param_config_special_vap;
  1390. bool cdp_pdev_param_reset_scan_spcl_vap_stats_enable;
  1391. bool cdp_pdev_param_enhanced_stats_enable;
  1392. bool cdp_pdev_param_isolation;
  1393. /* psoc params */
  1394. bool cdp_psoc_param_en_rate_stats;
  1395. int cdp_psoc_param_en_nss_cfg;
  1396. int cdp_psoc_param_preferred_hw_mode;
  1397. bool cdp_psoc_param_pext_stats;
  1398. bool cdp_psoc_param_ppeds_enabled;
  1399. bool cdp_skip_bar_update;
  1400. bool cdp_ipa_enabled;
  1401. bool cdp_psoc_param_vdev_stats_hw_offload;
  1402. bool cdp_pdev_param_undecoded_metadata_enable;
  1403. bool cdp_sawf_enabled;
  1404. uint8_t cdp_sawf_stats;
  1405. bool cdp_drop_3addr_mcast;
  1406. bool cdp_vdev_param_traffic_end_ind;
  1407. bool cdp_umac_rst_skel;
  1408. bool cdp_drop_tx_mcast;
  1409. bool cdp_vdev_tx_to_fw;
  1410. } cdp_config_param_type;
  1411. /**
  1412. * enum cdp_rx_enh_capture_mode - Rx enhanced capture modes
  1413. * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
  1414. * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
  1415. * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
  1416. */
  1417. enum cdp_rx_enh_capture_mode {
  1418. CDP_RX_ENH_CAPTURE_DISABLED = 0,
  1419. CDP_RX_ENH_CAPTURE_MPDU,
  1420. CDP_RX_ENH_CAPTURE_MPDU_MSDU,
  1421. };
  1422. /**
  1423. * enum cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
  1424. * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
  1425. * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
  1426. */
  1427. enum cdp_rx_enh_capture_peer {
  1428. CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
  1429. CDP_RX_ENH_CAPTURE_PEER_ENABLED,
  1430. };
  1431. /**
  1432. * enum cdp_tx_enh_capture_mode - Tx enhanced capture modes
  1433. * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
  1434. * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
  1435. * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
  1436. * @CDP_TX_ENH_CAPTURE_MAX: Max value
  1437. */
  1438. enum cdp_tx_enh_capture_mode {
  1439. CDP_TX_ENH_CAPTURE_DISABLED = 0,
  1440. CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
  1441. CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
  1442. CDP_TX_ENH_CAPTURE_MAX,
  1443. };
  1444. /**
  1445. * enum cdp_pdev_bpr_param - different types of parameters
  1446. * to set value in pdev
  1447. * @CDP_BPR_DISABLE: Set bpr to disable state
  1448. * @CDP_BPR_ENABLE: set bpr to enable state
  1449. *
  1450. * Enum indicating bpr state to enable/disable.
  1451. */
  1452. enum cdp_pdev_bpr_param {
  1453. CDP_BPR_DISABLE,
  1454. CDP_BPR_ENABLE,
  1455. };
  1456. /**
  1457. * enum cdp_vdev_param_type - different types of parameters
  1458. * to set values in vdev
  1459. * @CDP_ENABLE_NAWDS: set nawds enable/disable
  1460. * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
  1461. * @CDP_ENABLE_WDS: wds sta
  1462. * @CDP_ENABLE_MEC: MEC enable flags
  1463. * @CDP_ENABLE_DA_WAR:
  1464. * @CDP_ENABLE_PROXYSTA: proxy sta
  1465. * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
  1466. * @CDP_CFG_WDS_AGING_TIMER: modify/stop wds aging timer
  1467. * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
  1468. * @CDP_ENABLE_CIPHER: set cipher type based on security
  1469. * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
  1470. * @CDP_UPDATE_MULTIPASS: enable/disable multipass
  1471. * @CDP_TX_ENCAP_TYPE: tx encap type
  1472. * @CDP_RX_DECAP_TYPE: rx decap type
  1473. * @CDP_MESH_RX_FILTER: set mesh rx filter
  1474. * @CDP_TID_VDEV_PRTY: set tid vdev prty
  1475. * @CDP_TIDMAP_TBL_ID: set tidmap table id
  1476. * @CDP_MESH_MODE: set mesh mode
  1477. * @CDP_SAFEMODE: set safe mode
  1478. * @CDP_DROP_UNENC: set drop unencrypted flag
  1479. * @CDP_ENABLE_IGMP_MCAST_EN: enable/disable igmp multicast enhancement
  1480. * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag
  1481. * @CDP_CFG_WDS_EXT: enable/disable wds ext feature
  1482. * @CDP_DROP_TX_MCAST: enable/disable tx mcast drop
  1483. * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag
  1484. * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag
  1485. * @CDP_SET_VAP_MESH_TID: Set latency tid in vap
  1486. * @CDP_SKIP_BAR_UPDATE_AP: enable/disable bar
  1487. * @CDP_UPDATE_DSCP_TO_TID_MAP: Set DSCP to TID map id
  1488. * @CDP_SET_MCAST_VDEV: Set primary mcast vdev
  1489. * @CDP_RESET_MLO_MCAST_VDEV: Reset mlo mcast vdev settings
  1490. * @CDP_SET_MCAST_VDEV_HW_UPDATE: Not in use
  1491. * @CDP_DROP_3ADDR_MCAST: enable/disable drop 3addr multicast flag
  1492. * @CDP_ENABLE_WRAP: qwrap ap
  1493. * @CDP_ENABLE_TRAFFIC_END_INDICATION: enable/disable traffic end indication
  1494. * @CDP_VDEV_TX_TO_FW: Set to_fw bit for tx packets for the vdev
  1495. */
  1496. enum cdp_vdev_param_type {
  1497. CDP_ENABLE_NAWDS,
  1498. CDP_ENABLE_MCAST_EN,
  1499. CDP_ENABLE_WDS,
  1500. CDP_ENABLE_MEC,
  1501. CDP_ENABLE_DA_WAR,
  1502. CDP_ENABLE_PROXYSTA,
  1503. CDP_UPDATE_TDLS_FLAGS,
  1504. CDP_CFG_WDS_AGING_TIMER,
  1505. CDP_ENABLE_AP_BRIDGE,
  1506. CDP_ENABLE_CIPHER,
  1507. CDP_ENABLE_QWRAP_ISOLATION,
  1508. CDP_UPDATE_MULTIPASS,
  1509. CDP_TX_ENCAP_TYPE,
  1510. CDP_RX_DECAP_TYPE,
  1511. CDP_MESH_RX_FILTER,
  1512. CDP_TID_VDEV_PRTY,
  1513. CDP_TIDMAP_TBL_ID,
  1514. #ifdef MESH_MODE_SUPPORT
  1515. CDP_MESH_MODE,
  1516. #endif
  1517. CDP_SAFEMODE,
  1518. CDP_DROP_UNENC,
  1519. CDP_ENABLE_IGMP_MCAST_EN,
  1520. CDP_ENABLE_HLOS_TID_OVERRIDE,
  1521. #ifdef QCA_SUPPORT_WDS_EXTENDED
  1522. CDP_CFG_WDS_EXT,
  1523. CDP_DROP_TX_MCAST,
  1524. #endif /* QCA_SUPPORT_WDS_EXTENDED */
  1525. CDP_ENABLE_PEER_AUTHORIZE,
  1526. #ifdef WLAN_SUPPORT_MESH_LATENCY
  1527. CDP_ENABLE_PEER_TID_LATENCY,
  1528. CDP_SET_VAP_MESH_TID,
  1529. #endif
  1530. #ifdef WLAN_VENDOR_SPECIFIC_BAR_UPDATE
  1531. CDP_SKIP_BAR_UPDATE_AP,
  1532. #endif
  1533. CDP_UPDATE_DSCP_TO_TID_MAP,
  1534. CDP_SET_MCAST_VDEV,
  1535. CDP_RESET_MLO_MCAST_VDEV,
  1536. CDP_SET_MCAST_VDEV_HW_UPDATE,
  1537. CDP_DROP_3ADDR_MCAST,
  1538. CDP_ENABLE_WRAP,
  1539. #ifdef DP_TRAFFIC_END_INDICATION
  1540. CDP_ENABLE_TRAFFIC_END_INDICATION,
  1541. #endif
  1542. #ifdef FEATURE_DIRECT_LINK
  1543. CDP_VDEV_TX_TO_FW,
  1544. #endif
  1545. };
  1546. /**
  1547. * enum cdp_psoc_param_type - different types of parameters
  1548. * to set values in psoc
  1549. * @CDP_ENABLE_RATE_STATS: set rate stats enable/disable
  1550. * @CDP_SET_NSS_CFG: set nss cfg
  1551. * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
  1552. * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode.
  1553. * @CDP_IPA_ENABLE : set IPA enable mode.
  1554. * @CDP_CFG_VDEV_STATS_HW_OFFLOAD: HW Vdev stats config
  1555. * @CDP_SAWF_ENABLE:
  1556. * @CDP_UMAC_RST_SKEL_ENABLE: Enable Umac reset skeleton code for debug
  1557. * @CDP_PPEDS_ENABLE: PPEDS is enabled or not
  1558. * @CDP_SAWF_STATS: set SAWF stats config
  1559. */
  1560. enum cdp_psoc_param_type {
  1561. CDP_ENABLE_RATE_STATS,
  1562. CDP_SET_NSS_CFG,
  1563. CDP_SET_PREFERRED_HW_MODE,
  1564. CDP_CFG_PEER_EXT_STATS,
  1565. CDP_IPA_ENABLE,
  1566. CDP_CFG_VDEV_STATS_HW_OFFLOAD,
  1567. CDP_SAWF_ENABLE,
  1568. CDP_UMAC_RST_SKEL_ENABLE,
  1569. CDP_PPEDS_ENABLE,
  1570. CDP_SAWF_STATS,
  1571. };
  1572. #define TXRX_FW_STATS_TXSTATS 1
  1573. #define TXRX_FW_STATS_RXSTATS 2
  1574. #define TXRX_FW_STATS_RX_RATE_INFO 3
  1575. #define TXRX_FW_STATS_PHYSTATS 4
  1576. #define TXRX_FW_STATS_PHYSTATS_CONCISE 5
  1577. #define TXRX_FW_STATS_TX_RATE_INFO 6
  1578. #define TXRX_FW_STATS_TID_STATE 7
  1579. #define TXRX_FW_STATS_HOST_STATS 8
  1580. #define TXRX_FW_STATS_CLEAR_HOST_STATS 9
  1581. #define TXRX_FW_STATS_CE_STATS 10
  1582. #define TXRX_FW_STATS_VOW_UMAC_COUNTER 11
  1583. #define TXRX_FW_STATS_ME_STATS 12
  1584. #define TXRX_FW_STATS_TXBF_INFO 13
  1585. #define TXRX_FW_STATS_SND_INFO 14
  1586. #define TXRX_FW_STATS_ERROR_INFO 15
  1587. #define TXRX_FW_STATS_TX_SELFGEN_INFO 16
  1588. #define TXRX_FW_STATS_TX_MU_INFO 17
  1589. #define TXRX_FW_SIFS_RESP_INFO 18
  1590. #define TXRX_FW_RESET_STATS 19
  1591. #define TXRX_FW_MAC_WDOG_STATS 20
  1592. #define TXRX_FW_MAC_DESC_STATS 21
  1593. #define TXRX_FW_MAC_FETCH_MGR_STATS 22
  1594. #define TXRX_FW_MAC_PREFETCH_MGR_STATS 23
  1595. #define TXRX_FW_STATS_DURATION_INFO 24
  1596. #define TXRX_FW_STATS_DURATION_INFO_RESET 25
  1597. #define TXRX_FW_HALPHY_STATS 26
  1598. #define TXRX_FW_COEX_STATS 27
  1599. #define PER_RADIO_FW_STATS_REQUEST 0
  1600. #define PER_VDEV_FW_STATS_REQUEST 1
  1601. /**
  1602. * enum data_stall_log_event_indicator - Module triggering data stall
  1603. * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
  1604. * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
  1605. * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
  1606. * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
  1607. *
  1608. * Enum indicating the module that indicates data stall event
  1609. */
  1610. enum data_stall_log_event_indicator {
  1611. DATA_STALL_LOG_INDICATOR_UNUSED,
  1612. DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
  1613. DATA_STALL_LOG_INDICATOR_FIRMWARE,
  1614. DATA_STALL_LOG_INDICATOR_FRAMEWORK,
  1615. };
  1616. /**
  1617. * enum data_stall_log_event_type - data stall event type
  1618. * @DATA_STALL_LOG_NONE:
  1619. * @DATA_STALL_LOG_FW_VDEV_PAUSE:
  1620. * @DATA_STALL_LOG_HWSCHED_CMD_FILTER:
  1621. * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH:
  1622. * @DATA_STALL_LOG_FW_RX_REFILL_FAILED:
  1623. * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR:
  1624. * @DATA_STALL_LOG_FW_WDOG_ERRORS:
  1625. * @DATA_STALL_LOG_BB_WDOG_ERROR:
  1626. * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR:
  1627. * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT:
  1628. * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT:
  1629. * @DATA_STALL_LOG_NUD_FAILURE:
  1630. *
  1631. * Enum indicating data stall event type
  1632. */
  1633. enum data_stall_log_event_type {
  1634. DATA_STALL_LOG_NONE,
  1635. DATA_STALL_LOG_FW_VDEV_PAUSE,
  1636. DATA_STALL_LOG_HWSCHED_CMD_FILTER,
  1637. DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
  1638. DATA_STALL_LOG_FW_RX_REFILL_FAILED,
  1639. DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
  1640. DATA_STALL_LOG_FW_WDOG_ERRORS,
  1641. DATA_STALL_LOG_BB_WDOG_ERROR,
  1642. DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
  1643. /* Stall events triggered by host/framework start from 0x100 onwards. */
  1644. DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
  1645. DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
  1646. DATA_STALL_LOG_NUD_FAILURE,
  1647. };
  1648. /**
  1649. * enum data_stall_log_recovery_type - data stall recovery type
  1650. * @DATA_STALL_LOG_RECOVERY_NONE:
  1651. * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT:
  1652. * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR:
  1653. *
  1654. * Enum indicating data stall recovery type
  1655. */
  1656. enum data_stall_log_recovery_type {
  1657. DATA_STALL_LOG_RECOVERY_NONE = 0,
  1658. DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  1659. DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
  1660. };
  1661. /**
  1662. * struct data_stall_event_info - data stall info
  1663. * @indicator: Module triggering data stall
  1664. * @data_stall_type: data stall event type
  1665. * @vdev_id_bitmap: vdev_id_bitmap
  1666. * @pdev_id: pdev id
  1667. * @recovery_type: data stall recovery type
  1668. */
  1669. struct data_stall_event_info {
  1670. uint32_t indicator;
  1671. uint32_t data_stall_type;
  1672. uint32_t vdev_id_bitmap;
  1673. uint32_t pdev_id;
  1674. uint32_t recovery_type;
  1675. };
  1676. typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
  1677. /**
  1678. * enum cdp_stats - options for host and firmware statistics
  1679. * @CDP_TXRX_STATS_0:
  1680. * @CDP_TXRX_STATS_1: HTT Pdev tx stats
  1681. * @CDP_TXRX_STATS_2: HTT Pdev rx stats
  1682. * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
  1683. * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
  1684. * @CDP_TXRX_STATS_5: HTT Pdev error stats
  1685. * @CDP_TXRX_STATS_6: HTT TQM stats
  1686. * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
  1687. * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
  1688. * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
  1689. * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
  1690. * @CDP_TXRX_STATS_11: HTT Peer stats
  1691. * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
  1692. * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
  1693. * @CDP_TXRX_STATS_14: HTT Ring interface info stats
  1694. * @CDP_TXRX_STATS_15: HTT SRNG info stats
  1695. * @CDP_TXRX_STATS_16: HTT SFM info stats
  1696. * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
  1697. * @CDP_TXRX_STATS_18: HTT Peer list details
  1698. * @CDP_TXRX_STATS_19: Reserved
  1699. * @CDP_TXRX_STATS_20: Reset Host stats
  1700. * @CDP_TXRX_STATS_21: Host Rx rate stats
  1701. * @CDP_TXRX_STATS_22: Host Tx rate stats
  1702. * @CDP_TXRX_STATS_23: Host Tx stats
  1703. * @CDP_TXRX_STATS_24: Host Rx stats
  1704. * @CDP_TXRX_STATS_25: Host Ast stats
  1705. * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
  1706. * @CDP_TXRX_STATS_27: Host Monitor mode stats
  1707. * @CDP_TXRX_STATS_28: Host Peer entry stats
  1708. * @CDP_TXRX_STATS_29: Host Soc config params info
  1709. * @CDP_TXRX_STATS_30: Host Pdev config params info
  1710. * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
  1711. * @CDP_TXRX_STATS_HTT_MAX:
  1712. * @CDP_TXRX_MAX_STATS:
  1713. */
  1714. enum cdp_stats {
  1715. CDP_TXRX_STATS_0 = 0,
  1716. CDP_TXRX_STATS_1,
  1717. CDP_TXRX_STATS_2,
  1718. CDP_TXRX_STATS_3,
  1719. CDP_TXRX_STATS_4,
  1720. CDP_TXRX_STATS_5,
  1721. CDP_TXRX_STATS_6,
  1722. CDP_TXRX_STATS_7,
  1723. CDP_TXRX_STATS_8,
  1724. CDP_TXRX_STATS_9,
  1725. CDP_TXRX_STATS_10,
  1726. CDP_TXRX_STATS_11,
  1727. CDP_TXRX_STATS_12,
  1728. CDP_TXRX_STATS_13,
  1729. CDP_TXRX_STATS_14,
  1730. CDP_TXRX_STATS_15,
  1731. CDP_TXRX_STATS_16,
  1732. CDP_TXRX_STATS_17,
  1733. CDP_TXRX_STATS_18,
  1734. CDP_TXRX_STATS_19,
  1735. CDP_TXRX_STATS_20,
  1736. CDP_TXRX_STATS_21,
  1737. CDP_TXRX_STATS_22,
  1738. CDP_TXRX_STATS_23,
  1739. CDP_TXRX_STATS_24,
  1740. CDP_TXRX_STATS_25,
  1741. CDP_TXRX_STATS_26,
  1742. CDP_TXRX_STATS_27,
  1743. CDP_TXRX_STATS_28,
  1744. CDP_TXRX_STATS_29,
  1745. CDP_TXRX_STATS_30,
  1746. CDP_TXRX_STATS_31,
  1747. CDP_TXRX_STATS_HTT_MAX = 256,
  1748. CDP_TXRX_MAX_STATS = 265,
  1749. };
  1750. /**
  1751. * enum cdp_stat_update_type - Different Stat update types sent to
  1752. * OL_IF
  1753. * @UPDATE_PEER_STATS: update peer stats
  1754. * @UPDATE_VDEV_STATS: update vdev stats
  1755. * @UPDATE_PDEV_STATS: Update pdev stats
  1756. */
  1757. enum cdp_stat_update_type {
  1758. UPDATE_PEER_STATS = 0,
  1759. UPDATE_VDEV_STATS = 1,
  1760. UPDATE_PDEV_STATS = 2,
  1761. };
  1762. /**
  1763. * struct cdp_tx_sojourn_stats - Tx sojourn stats
  1764. * @ppdu_seq_id: ppdu_seq_id from tx completion
  1765. * @avg_sojourn_msdu: average sojourn msdu time
  1766. * @sum_sojourn_msdu: sum sojourn msdu time
  1767. * @num_msdus: number of msdus per ppdu
  1768. * @cookie: cookie to be used by upper layer
  1769. */
  1770. struct cdp_tx_sojourn_stats {
  1771. uint32_t ppdu_seq_id;
  1772. qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
  1773. uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
  1774. uint32_t num_msdus[CDP_DATA_TID_MAX];
  1775. struct cdp_stats_cookie *cookie;
  1776. };
  1777. /**
  1778. * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
  1779. * per-user information
  1780. * @frame_ctrl: frame control field in 802.11 header
  1781. * @qos_ctrl: QoS control field in 802.11 header
  1782. * @mpdu_tried_ucast: number of unicast mpdus tried
  1783. * @mpdu_tried_mcast: number of multicastmpdus tried
  1784. * @ltf_size: ltf_size
  1785. * @stbc: stbc
  1786. * @he_re: he_re (range extension)
  1787. * @txbf: txbf
  1788. * @bw: Transmission bandwidth
  1789. * <enum 2 transmit_bw_20_MHz>
  1790. * <enum 3 transmit_bw_40_MHz>
  1791. * <enum 4 transmit_bw_80_MHz>
  1792. * <enum 5 transmit_bw_160_MHz>
  1793. * @nss: NSS 1,2, ...8
  1794. * @mcs: MCS index
  1795. * @preamble: preamble
  1796. * @gi: guard interval 800/400/1600/3200 ns
  1797. * @dcm: dcm
  1798. * @ldpc: ldpc
  1799. * @delayed_ba:
  1800. * @ru_start: RU start index
  1801. * @ru_tones: RU tones length
  1802. * @is_mcast: MCAST or UCAST
  1803. * @user_pos: user position
  1804. * @mu_group_id: mu group id
  1805. * @ppdu_start_timestamp: 64 bits ppdu start timestamp
  1806. * @ppdu_end_timestamp: 64 bits ppdu end timestamp
  1807. */
  1808. struct cdp_delayed_tx_completion_ppdu_user {
  1809. uint32_t frame_ctrl:16,
  1810. qos_ctrl:16;
  1811. uint32_t mpdu_tried_ucast:16,
  1812. mpdu_tried_mcast:16;
  1813. uint32_t ltf_size:2,
  1814. stbc:1,
  1815. he_re:1,
  1816. txbf:4,
  1817. bw:4,
  1818. nss:4,
  1819. mcs:4,
  1820. preamble:4,
  1821. gi:4,
  1822. dcm:1,
  1823. ldpc:1,
  1824. delayed_ba:1;
  1825. uint16_t ru_start;
  1826. uint16_t ru_tones;
  1827. bool is_mcast;
  1828. uint32_t user_pos;
  1829. uint32_t mu_group_id;
  1830. uint64_t ppdu_start_timestamp;
  1831. uint64_t ppdu_end_timestamp;
  1832. };
  1833. /**
  1834. * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
  1835. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1836. * @tid: TID number
  1837. * @peer_id: Peer ID
  1838. * @mac_addr:
  1839. * @ba_size: Block-Ack size
  1840. * @frame_ctrl: frame control field in 802.11 header
  1841. * @qos_ctrl: QoS control field in 802.11 header
  1842. * @mpdu_tried_ucast: number of unicast mpdus tried
  1843. * @mpdu_tried_mcast: number of multicast mpdus tried
  1844. * @mpdu_success: number of mpdus successfully transmitted
  1845. * @mpdu_failed:
  1846. * @long_retries: long retries
  1847. * @short_retries: short retries
  1848. * @tx_ratecode:
  1849. * @is_ampdu: mpdu aggregate or non-aggregate?
  1850. * @ppdu_type:
  1851. * @pream_punct:
  1852. * @is_seq_num_valid:
  1853. * @success_bytes: bytes successfully transmitted
  1854. * @retry_bytes: bytes retried
  1855. * @failed_bytes:
  1856. * @success_msdus: MSDUs successfully transmitted
  1857. * @retry_msdus: MSDUs retried
  1858. * @retry_mpdus: MPDUs retried
  1859. * @failed_msdus: MSDUs failed transmission
  1860. * @duration: user duration in ppdu
  1861. * @ltf_size: ltf_size
  1862. * @stbc: stbc
  1863. * @he_re: he_re (range extension)
  1864. * @txbf: txbf
  1865. * @bw: Transmission bandwidth
  1866. * <enum 2 transmit_bw_20_MHz>
  1867. * <enum 3 transmit_bw_40_MHz>
  1868. * <enum 4 transmit_bw_80_MHz>
  1869. * <enum 5 transmit_bw_160_MHz>
  1870. * @nss: NSS 1,2, ...8
  1871. * @mcs: MCS index
  1872. * @preamble: preamble
  1873. * @gi: guard interval 800/400/1600/3200 ns
  1874. * @dcm: dcm
  1875. * @ldpc: ldpc
  1876. * @delayed_ba: delayed ba bit
  1877. * @ack_ba_tlv: ack ba recv tlv bit
  1878. * @ba_seq_no: Block Ack sequence number
  1879. * @ba_bitmap: Block Ack bitmap
  1880. * @start_seq: Sequence number of first MPDU
  1881. * @enq_bitmap: Enqueue MPDU bitmap
  1882. * @failed_bitmap:
  1883. * @num_mpdu:
  1884. * @num_msdu:
  1885. * @tx_duration:
  1886. * @ru_start: RU start index
  1887. * @ru_tones: RU tones length
  1888. * @is_mcast: MCAST or UCAST
  1889. * @tx_rate: Transmission Rate
  1890. * @tx_ratekbps:
  1891. * @ack_rssi: ack rssi for separate chains
  1892. * @ack_rssi_valid:
  1893. * @usr_ack_rssi:
  1894. * @user_pos: user position
  1895. * @mu_group_id: mu group id
  1896. * @rix: rate index
  1897. * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
  1898. * @ppdu_cookie: 16-bit ppdu_cookie
  1899. * @sa_is_training: smart antenna training packets indication
  1900. * @rssi_chain: rssi chain per bandwidth
  1901. * @sa_tx_antenna: antenna in which packet is transmitted
  1902. * @sa_max_rates: smart antenna tx feedback info max rates
  1903. * @sa_goodput: smart antenna tx feedback info goodput
  1904. * @current_rate_per: Moving average per
  1905. * @last_enq_seq: last equeue sequence number
  1906. * @is_bss_peer: is bss peer check
  1907. * @mpdu_q: queue of mpdu in a ppdu
  1908. * @mpdus: MPDU list based on enqueue sequence bitmap
  1909. * @pending_retries: pending MPDUs (retries)
  1910. * @tlv_bitmap: per user tlv bitmap
  1911. * @skip: tx capture skip flag
  1912. * @mon_procd: to indicate user processed in ppdu of the sched cmd
  1913. * @debug_copied: flag to indicate bar frame copied
  1914. * @peer_last_delayed_ba: flag to indicate peer last delayed ba
  1915. * @phy_tx_time_us: Phy TX duration for the User
  1916. * @mpdu_bytes: accumulated bytes per mpdu for mem limit feature
  1917. * @punc_mode: puncutured mode to indicate punctured bw
  1918. * @punc_pattern_bitmap: bitmap indicating punctured pattern
  1919. * @mprot_type: medium protection type
  1920. * @rts_success: rts success
  1921. * @rts_failure: rts failure
  1922. */
  1923. struct cdp_tx_completion_ppdu_user {
  1924. uint32_t completion_status:8,
  1925. tid:8,
  1926. peer_id:16;
  1927. uint8_t mac_addr[6];
  1928. uint16_t ba_size;
  1929. uint32_t frame_ctrl:16,
  1930. qos_ctrl:16;
  1931. uint32_t mpdu_tried_ucast:16,
  1932. mpdu_tried_mcast:16;
  1933. uint16_t mpdu_success:16;
  1934. uint16_t mpdu_failed:16;
  1935. uint32_t long_retries:4,
  1936. short_retries:4,
  1937. tx_ratecode:16,
  1938. is_ampdu:1,
  1939. ppdu_type:5,
  1940. pream_punct:1,
  1941. is_seq_num_valid:1;
  1942. uint32_t success_bytes;
  1943. uint32_t retry_bytes;
  1944. uint32_t failed_bytes;
  1945. uint32_t success_msdus:16,
  1946. retry_msdus:16;
  1947. uint32_t retry_mpdus;
  1948. uint32_t failed_msdus:16,
  1949. duration:16;
  1950. uint32_t ltf_size:2,
  1951. stbc:1,
  1952. he_re:1,
  1953. txbf:4,
  1954. bw:4,
  1955. nss:4,
  1956. mcs:4,
  1957. preamble:4,
  1958. gi:4,
  1959. dcm:1,
  1960. ldpc:1,
  1961. delayed_ba:1,
  1962. ack_ba_tlv:1;
  1963. uint32_t ba_seq_no;
  1964. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1965. uint32_t start_seq;
  1966. uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1967. uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1968. uint32_t num_mpdu:9,
  1969. num_msdu:16;
  1970. uint32_t tx_duration;
  1971. uint16_t ru_start;
  1972. uint16_t ru_tones;
  1973. bool is_mcast;
  1974. uint32_t tx_rate;
  1975. uint32_t tx_ratekbps;
  1976. uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
  1977. bool ack_rssi_valid;
  1978. uint32_t usr_ack_rssi;
  1979. uint32_t user_pos;
  1980. uint32_t mu_group_id;
  1981. uint32_t rix;
  1982. uint8_t is_ppdu_cookie_valid;
  1983. uint16_t ppdu_cookie;
  1984. uint8_t sa_is_training;
  1985. uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
  1986. uint32_t sa_tx_antenna;
  1987. /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ
  1988. * |---------------------------------------|
  1989. * | 16 bits | 16 bits | 16 bits | 16 bits |
  1990. * | BW-1 | BW-2 | BW-3 | BW-4 |
  1991. * | /\ \ |
  1992. * | / \ \ |
  1993. * | / \ \ |
  1994. * | / \ \ |
  1995. * | / \ \ |
  1996. * | / \ \ |
  1997. * |/ \ \ |
  1998. * |[11|8] [5|8] \ |
  1999. * | BW1 PADDED \ |
  2000. * |---------------------------------------|
  2001. */
  2002. uint16_t sa_max_rates[CDP_NUM_SA_BW];
  2003. uint32_t sa_goodput;
  2004. /* below field is used to calculate goodput in non-training period
  2005. * Note: As host is exposing goodput and hence current_rate_per is
  2006. * of no use. It is just for Host computation.
  2007. */
  2008. uint32_t current_rate_per;
  2009. uint32_t last_enq_seq;
  2010. uint8_t is_bss_peer;
  2011. qdf_nbuf_queue_t mpdu_q;
  2012. qdf_nbuf_t *mpdus;
  2013. uint32_t pending_retries;
  2014. uint32_t tlv_bitmap;
  2015. bool skip;
  2016. bool mon_procd;
  2017. bool debug_copied;
  2018. bool peer_last_delayed_ba;
  2019. uint16_t phy_tx_time_us;
  2020. uint32_t mpdu_bytes;
  2021. uint8_t punc_mode;
  2022. uint16_t punc_pattern_bitmap;
  2023. uint8_t mprot_type:3,
  2024. rts_success:1,
  2025. rts_failure:1;
  2026. };
  2027. /**
  2028. * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
  2029. * @ppdu_id: PPDU id
  2030. * @tx_duration: user duration in ppdu
  2031. * @frame_type: frame type MGMT/CTRL/DATA/BAR
  2032. * @frame_ctrl: frame control field in 802.11 header
  2033. * @qos_ctrl: QoS control field in 802.11 header
  2034. * @tid: TID number
  2035. * @num_msdu: number of msdu in MPDU
  2036. * @seq_no: Sequence number of first MPDU
  2037. * @ltf_size: ltf_size
  2038. * @he_re: he_re (range extension)
  2039. * @txbf: txbf
  2040. * @bw: Transmission bandwidth
  2041. * <enum 2 transmit_bw_20_MHz>
  2042. * <enum 3 transmit_bw_40_MHz>
  2043. * <enum 4 transmit_bw_80_MHz>
  2044. * <enum 5 transmit_bw_160_MHz>
  2045. * @nss: NSS 1,2, ...8
  2046. * @mcs: MCS index
  2047. * @preamble: preamble
  2048. * @gi: guard interval 800/400/1600/3200 ns
  2049. * @channel: frequency
  2050. * @channel_num: channel number
  2051. * @ack_rssi: ack rssi
  2052. * @ldpc: ldpc
  2053. * @tx_rate: Transmission Rate
  2054. * @mac_address: peer mac address
  2055. * @bss_mac_address: bss mac address
  2056. * @ppdu_start_timestamp: TSF at PPDU start
  2057. * @ppdu_end_timestamp: TSF at PPDU end
  2058. * @ba_start_seq: Block Ack sequence number
  2059. * @ba_bitmap: Block Ack bitmap
  2060. * @ppdu_cookie: 16-bit ppdu_cookie
  2061. * @long_retries: long retries
  2062. * @short_retries: short retries
  2063. * @completion_status: completion status - OK/Filter/Abort/Timeout
  2064. * @resp_type: response type
  2065. * @mprot_type: medium protection type
  2066. * @rts_success: rts success
  2067. * @rts_failure: rts failure
  2068. * @usr_idx: user index
  2069. */
  2070. struct cdp_tx_indication_mpdu_info {
  2071. uint32_t ppdu_id;
  2072. uint32_t tx_duration;
  2073. uint16_t frame_type;
  2074. uint16_t frame_ctrl;
  2075. uint16_t qos_ctrl;
  2076. uint8_t tid;
  2077. uint32_t num_msdu;
  2078. uint32_t seq_no;
  2079. uint32_t ltf_size:2,
  2080. he_re:1,
  2081. txbf:4,
  2082. bw:4,
  2083. nss:4,
  2084. mcs:4,
  2085. preamble:4,
  2086. gi:4;
  2087. uint32_t channel;
  2088. uint8_t channel_num;
  2089. uint32_t ack_rssi;
  2090. uint32_t ldpc;
  2091. uint32_t tx_rate;
  2092. uint8_t mac_address[QDF_MAC_ADDR_SIZE];
  2093. uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
  2094. uint64_t ppdu_start_timestamp;
  2095. uint64_t ppdu_end_timestamp;
  2096. uint32_t ba_start_seq;
  2097. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  2098. uint16_t ppdu_cookie;
  2099. uint16_t long_retries:4,
  2100. short_retries:4,
  2101. completion_status:8;
  2102. uint16_t resp_type:4,
  2103. mprot_type:3,
  2104. rts_success:1,
  2105. rts_failure:1;
  2106. uint8_t usr_idx;
  2107. };
  2108. /**
  2109. * struct cdp_tx_indication_info - Tx capture information
  2110. * @radiotap_done: Flag to say radiotap already done or not
  2111. * 0 - radiotap not updated
  2112. * 1 - radiotap header updated
  2113. * @mpdu_info: Tx MPDU completion information
  2114. * @mpdu_nbuf: reconstructed mpdu packet
  2115. * @ppdu_desc: tx completion ppdu
  2116. * @osif_vdev: OS IF vdev handle
  2117. */
  2118. struct cdp_tx_indication_info {
  2119. bool radiotap_done;
  2120. struct cdp_tx_indication_mpdu_info mpdu_info;
  2121. qdf_nbuf_t mpdu_nbuf;
  2122. struct cdp_tx_completion_ppdu *ppdu_desc;
  2123. #ifdef QCA_SUPPORT_LITE_MONITOR
  2124. ol_osif_vdev_handle osif_vdev;
  2125. #endif
  2126. };
  2127. /**
  2128. * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
  2129. * @ppdu_id: ppdu_id
  2130. * @is_sgen_pkt: payload received from wmi or htt path
  2131. * @retries_count: retries count
  2132. * @tx_tsf: 64 bit timestamp
  2133. */
  2134. struct cdp_tx_mgmt_comp_info {
  2135. uint32_t ppdu_id;
  2136. bool is_sgen_pkt;
  2137. uint16_t retries_count;
  2138. uint64_t tx_tsf;
  2139. };
  2140. /**
  2141. * struct cdp_tx_completion_ppdu - Tx PPDU completion information
  2142. * @completion_status: completion status - OK/Filter/Abort/Timeout
  2143. * @ppdu_id: PPDU Id
  2144. * @ppdu_seq_id: ppdu sequence id for sojourn stats
  2145. * @vdev_id: VAP Id
  2146. * @bar_num_users: BA response user count, based on completion common TLV
  2147. * @num_users: Number of users
  2148. * @max_users: Number of users from USR_INFO TLV
  2149. * @last_usr_index:
  2150. * @drop_reason: drop reason from flush status
  2151. * @is_flush: is_flush is set based on flush tlv
  2152. * @flow_type: tx flow type from flush status
  2153. * @queue_type: queue type from flush status
  2154. * @num_mpdu: Number of MPDUs in PPDU
  2155. * @num_msdu: Number of MSDUs in PPDU
  2156. * @frame_type: frame SU or MU
  2157. * @htt_frame_type: frame type from htt
  2158. * @frame_ctrl: frame control of 80211 header
  2159. * @channel: Channel informartion
  2160. * @resp_type: response type
  2161. * @mprot_type: medium protection type
  2162. * @rts_success: rts success
  2163. * @rts_failure: rts failure
  2164. * @phy_mode: phy mode
  2165. * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
  2166. * @tx_duration: PPDU airtime
  2167. * @ppdu_start_timestamp: TSF at PPDU start
  2168. * @ppdu_end_timestamp: TSF at PPDU end
  2169. * @ack_timestamp: TSF at the reception of ACK
  2170. * @delayed_ba: Delayed ba flag
  2171. * @beam_change: beam change bit in ppdu for he-information
  2172. * @bss_color: 6 bit value for full bss color
  2173. * @doppler: value for doppler (will be 0 most of the times)
  2174. * @spatial_reuse: value for spatial reuse used in radiotap HE header
  2175. * @usr_nss_sum: Sum of user nss
  2176. * @usr_ru_tones_sum: Sum of user ru_tones
  2177. * @bar_ppdu_id: BAR ppdu_id
  2178. * @bar_tx_duration: BAR tx duration
  2179. * @bar_ppdu_start_timestamp: BAR start timestamp
  2180. * @bar_ppdu_end_timestamp: BAR end timestamp
  2181. * @tlv_bitmap: tlv_bitmap for the PPDU
  2182. * @sched_cmdid: schedule command id
  2183. * @phy_ppdu_tx_time_us: Phy per PPDU TX duration
  2184. * @ppdu_bytes: accumulated bytes per ppdu for mem limit feature
  2185. * @user: per-User stats (array of per-user structures)
  2186. */
  2187. struct cdp_tx_completion_ppdu {
  2188. uint32_t ppdu_id;
  2189. uint32_t ppdu_seq_id;
  2190. uint16_t vdev_id;
  2191. uint16_t bar_num_users;
  2192. uint32_t num_users;
  2193. uint8_t max_users;
  2194. uint8_t last_usr_index;
  2195. uint32_t drop_reason;
  2196. uint32_t is_flush:1,
  2197. flow_type:8,
  2198. queue_type:8;
  2199. uint32_t num_mpdu:9,
  2200. num_msdu:16;
  2201. uint16_t frame_type;
  2202. uint16_t htt_frame_type;
  2203. uint16_t frame_ctrl;
  2204. uint16_t channel;
  2205. uint16_t resp_type:4,
  2206. mprot_type:3,
  2207. rts_success:1,
  2208. rts_failure:1;
  2209. uint16_t phy_mode;
  2210. uint32_t ack_rssi;
  2211. uint32_t tx_duration;
  2212. uint64_t ppdu_start_timestamp;
  2213. uint64_t ppdu_end_timestamp;
  2214. uint64_t ack_timestamp;
  2215. bool delayed_ba;
  2216. uint8_t beam_change;
  2217. uint8_t bss_color;
  2218. uint8_t doppler;
  2219. uint8_t spatial_reuse;
  2220. uint8_t usr_nss_sum;
  2221. uint32_t usr_ru_tones_sum;
  2222. uint32_t bar_ppdu_id;
  2223. uint32_t bar_tx_duration;
  2224. uint64_t bar_ppdu_start_timestamp;
  2225. uint64_t bar_ppdu_end_timestamp;
  2226. uint32_t tlv_bitmap;
  2227. uint16_t sched_cmdid;
  2228. uint16_t phy_ppdu_tx_time_us;
  2229. uint32_t ppdu_bytes;
  2230. struct cdp_tx_completion_ppdu_user user[];
  2231. };
  2232. /**
  2233. * struct cdp_dev_stats - Network device stats structure
  2234. * @tx_packets: Tx total packets transmitted
  2235. * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
  2236. * @tx_dropped: Tx dropped is same as tx errors as above
  2237. * @rx_packets: Rx total packets transmitted
  2238. * @rx_errors : Rx errors
  2239. * @rx_dropped: Rx dropped stats
  2240. * @tx_bytes : Tx total bytes transmitted
  2241. * @rx_bytes : Rx total bytes transmitted
  2242. */
  2243. struct cdp_dev_stats {
  2244. uint32_t tx_packets;
  2245. uint32_t tx_errors;
  2246. uint32_t tx_dropped;
  2247. uint32_t rx_packets;
  2248. uint32_t rx_errors;
  2249. uint32_t rx_dropped;
  2250. uint64_t tx_bytes;
  2251. uint64_t rx_bytes;
  2252. };
  2253. /**
  2254. * struct cdp_rate_stats - Tx/Rx Rate statistics
  2255. * @rate_stats_info_valid: set if the stats are valid
  2256. * @bw: Indicates the BW of the upcoming transmission -
  2257. * <enum 2 transmit_bw_20_MHz>
  2258. * <enum 3 transmit_bw_40_MHz>
  2259. * <enum 4 transmit_bw_80_MHz>
  2260. * <enum 5 transmit_bw_160_MHz>
  2261. * @pkt_type: Transmit Packet Type
  2262. * @stbc: When set, STBC transmission rate was used
  2263. * @ldpc: When set, use LDPC transmission rates
  2264. * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
  2265. * <enum 1 0_4_us_sgi > Legacy short GI
  2266. * <enum 2 1_6_us_sgi > HE related GI
  2267. * <enum 3 3_2_us_sgi > HE
  2268. * @mcs: Transmit MCS Rate
  2269. * @ofdma: Set when the transmission was an OFDMA transmission
  2270. * @tones_in_ru: The number of tones in the RU used.
  2271. * @resvd0: reserved bits
  2272. * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
  2273. * @peer_id: Peer ID of the flow or MPDU queue
  2274. * @tid: TID of the flow or MPDU queue
  2275. */
  2276. struct cdp_rate_stats {
  2277. uint32_t rate_stats_info_valid:1,
  2278. bw:2,
  2279. pkt_type:4,
  2280. stbc:1,
  2281. ldpc:1,
  2282. sgi:2,
  2283. mcs:4,
  2284. ofdma:1,
  2285. tones_in_ru:12,
  2286. resvd0:4;
  2287. uint32_t tsf;
  2288. uint16_t peer_id;
  2289. uint8_t tid;
  2290. };
  2291. /**
  2292. * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
  2293. * @ppdu_id: PPDU to which this MSDU belongs
  2294. * @transmit_cnt: Number of times this frame has been transmitted
  2295. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  2296. * @resvd0: reserved bit
  2297. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  2298. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  2299. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  2300. * @extd: Extended structure containing rate statistics
  2301. * @resvd1: reserved bits
  2302. */
  2303. struct cdp_tx_completion_msdu {
  2304. uint32_t ppdu_id;
  2305. uint8_t transmit_cnt;
  2306. uint32_t ack_frame_rssi:8,
  2307. resvd0:1,
  2308. first_msdu:1,
  2309. last_msdu:1,
  2310. msdu_part_of_amsdu:1,
  2311. resvd1:20;
  2312. struct cdp_rate_stats extd;
  2313. };
  2314. /**
  2315. * struct cdp_rx_stats_ppdu_user -- per user RX stats
  2316. * @peer_id: Peer ID
  2317. * @vdev_id: VAP ID
  2318. * @is_ampdu: mpdu aggregate or non-aggregate?
  2319. * @mu_ul_info_valid: MU UL info valid
  2320. * @ofdma_ru_start_index: RU index number(0-73)
  2321. * @ofdma_ru_width: size of RU in units of 1(26tone)RU
  2322. * @nss: NSS 1,2, ...8
  2323. * @mcs: MCS index
  2324. * @user_index: user ID in multi-user case
  2325. * @is_bss_peer: is bss peer check
  2326. * @ast_index: ast index in multi-user case
  2327. * @tid: TID number
  2328. * @num_msdu: Number of MSDUs in PPDU
  2329. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  2330. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  2331. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  2332. * @frame_control: frame control field
  2333. * @frame_control_info_valid: frame_control valid
  2334. * @qos_control: qos control field
  2335. * @qos_control_info_valid: qos_control valid
  2336. * @data_sequence_control_info_valid: data_sequence_control_info valid
  2337. * @first_data_seq_ctrl: Sequence control field of first data frame
  2338. * @preamble_type: preamble
  2339. * @ht_flags: HT flags
  2340. * @vht_flags: VHT flags
  2341. * @he_flags: HE flags
  2342. * @mac_addr: Peer MAC Address
  2343. * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
  2344. * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
  2345. * @mpdu_fcs_ok_bitmap: MPDU with fcs ok bitmap
  2346. * @mpdu_ok_byte_count:
  2347. * @mpdu_err_byte_count:
  2348. * @retries: number of retries
  2349. * @rx_ratekbps: rx rate in kbps
  2350. * @rix: rate index
  2351. * @mpdu_retries: retries of mpdu in rx
  2352. * @rx_time_us: Rx duration
  2353. */
  2354. struct cdp_rx_stats_ppdu_user {
  2355. uint16_t peer_id;
  2356. uint8_t vdev_id;
  2357. bool is_ampdu;
  2358. uint32_t mu_ul_info_valid:1,
  2359. ofdma_ru_start_index:7,
  2360. ofdma_ru_width:7,
  2361. nss:4,
  2362. mcs:4;
  2363. /* user id */
  2364. uint8_t user_index;
  2365. uint8_t is_bss_peer;
  2366. uint32_t ast_index;
  2367. uint32_t tid;
  2368. uint32_t num_msdu;
  2369. uint16_t tcp_msdu_count;
  2370. uint16_t udp_msdu_count;
  2371. uint16_t other_msdu_count;
  2372. uint16_t frame_control;
  2373. uint8_t frame_control_info_valid;
  2374. uint16_t qos_control;
  2375. uint8_t qos_control_info_valid;
  2376. uint8_t data_sequence_control_info_valid;
  2377. uint16_t first_data_seq_ctrl;
  2378. uint32_t preamble_type;
  2379. uint16_t ht_flags;
  2380. uint16_t vht_flags;
  2381. uint16_t he_flags;
  2382. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2383. uint32_t mpdu_cnt_fcs_ok;
  2384. uint32_t mpdu_cnt_fcs_err;
  2385. uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
  2386. uint32_t mpdu_ok_byte_count;
  2387. uint32_t mpdu_err_byte_count;
  2388. uint32_t retries;
  2389. uint32_t rx_ratekbps;
  2390. uint32_t rix;
  2391. uint32_t mpdu_retries;
  2392. uint16_t rx_time_us;
  2393. };
  2394. /**
  2395. * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
  2396. * @ppdu_id: PPDU Id
  2397. * @is_ampdu: mpdu aggregate or non-aggregate?
  2398. * @num_mpdu: Number of MPDUs in PPDU
  2399. * @reserved: Reserved bits for future use
  2400. * @num_msdu: Number of MSDUs in PPDU
  2401. * @num_bytes: Number of bytes
  2402. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  2403. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  2404. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  2405. * @duration: PPDU duration
  2406. * @tid: TID number
  2407. * @peer_id: Peer ID
  2408. * @vdev_id: VAP ID
  2409. * @mac_addr: Peer MAC Address
  2410. * @first_data_seq_ctrl: Sequence control field of first data frame
  2411. * @u: union of rate information representations
  2412. * @rate_info: consolidated rate fields
  2413. * @ltf_size: ltf_size
  2414. * @stbc: When set, STBC rate was used
  2415. * @he_re: he_re (range extension)
  2416. * @bw: Bandwidth
  2417. * <enum 0 bw_20_MHz>
  2418. * <enum 1 bw_40_MHz>
  2419. * <enum 2 bw_80_MHz>
  2420. * <enum 3 bw_160_MHz>
  2421. * @nss: NSS 1,2, ...8
  2422. * @mcs: MCS index
  2423. * @preamble: preamble
  2424. * @gi: <enum 0 0_8_us_sgi > Legacy normal GI
  2425. * <enum 1 0_4_us_sgi > Legacy short GI
  2426. * <enum 2 1_6_us_sgi > HE related GI
  2427. * <enum 3 3_2_us_sgi > HE
  2428. * @dcm: dcm
  2429. * @ldpc: ldpc
  2430. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  2431. * UL_BSR_TRIG/UNKNOWN
  2432. * @rix: rate index
  2433. * @lsig_a: L-SIG in 802.11 PHY header
  2434. * @rssi: RSSI value (units = dB above noise floor)
  2435. * @timestamp: TSF at the reception of PPDU
  2436. * @length: PPDU length
  2437. * @channel: Channel information
  2438. * @beamformed:
  2439. * @rx_ratekbps:
  2440. * @ppdu_rx_rate:
  2441. * @retries:
  2442. * @rx_byte_count:
  2443. * @rx_ratecode:
  2444. * @fcs_error_mpdus:
  2445. * @frame_ctrl: frame control field
  2446. * @rssi_chain: rssi chain per nss per bw
  2447. * @evm_info:
  2448. * @rx_antenna:
  2449. * @num_users:
  2450. * @nf: noise floor
  2451. * @per_chain_rssi: rssi per antenna
  2452. * @is_mcast_bcast:
  2453. * @cfr_info:
  2454. * @punc_bw: punctured bw
  2455. * @phyrx_abort: rx aborted undecoded frame indication
  2456. * @phyrx_abort_reason: abort reason defined in phyrx_abort_request_info
  2457. * @l_sig_length: L SIG A length
  2458. * @l_sig_a_parity: L SIG A parity
  2459. * @l_sig_a_pkt_type: L SIG A info pkt type
  2460. * @l_sig_a_implicit_sounding: L SIG A info captured implicit sounding
  2461. * @vht_crc: Indicate vht crc
  2462. * @group_id:
  2463. * @ht_length: num of bytes in PSDU
  2464. * @ht_smoothing: Indicate ht_smoothing
  2465. * @ht_not_sounding: Indicate ht not sounding
  2466. * @ht_aggregation: Indicate ht aggregation
  2467. * @ht_stbc: Indicate ht stbc
  2468. * @ht_crc: Indicate ht crc
  2469. * @vht_no_txop_ps: Indicate TXOP power save mode
  2470. * @bss_color_id: Indicate BSS color ID
  2471. * @beam_change: Indicates whether spatial mapping is changed
  2472. * @dl_ul_flag: Differentiates between DL and UL transmission
  2473. * @transmit_mcs: Indicates the data MCS
  2474. * @ldpc_extra_sym: LDPC extra symbol
  2475. * @special_reuse: Spatial reuse
  2476. * @ltf_sym: Indictaes HE NSTS
  2477. * @txbf: Indicates whether beamforming is applied
  2478. * @pe_disambiguity: packet extension disambiguity
  2479. * @pre_fec_pad: packet extension a factor
  2480. * @dopplar: Doppler support
  2481. * @txop_duration: Indicates the remaining time in the current TXOP
  2482. * @sig_b_mcs: MCS of HE-SIG-B
  2483. * @sig_b_dcm: DCM of HE-SIG-B
  2484. * @sig_b_sym: Number of symbols of HE-SIG-B
  2485. * @sig_b_comp: Compression mode of HE-SIG-B
  2486. * @he_crc: CRC for HE-SIG contents
  2487. * @usr_nss_sum: Sum of user nss
  2488. * @usr_ru_tones_sum: Sum of user ru_tones
  2489. * @user: per user stats in MU-user case
  2490. */
  2491. struct cdp_rx_indication_ppdu {
  2492. uint32_t ppdu_id;
  2493. uint16_t is_ampdu:1,
  2494. num_mpdu:9,
  2495. reserved:6;
  2496. uint32_t num_msdu;
  2497. uint32_t num_bytes;
  2498. uint16_t udp_msdu_count;
  2499. uint16_t tcp_msdu_count;
  2500. uint16_t other_msdu_count;
  2501. uint16_t duration;
  2502. uint32_t tid:8,
  2503. peer_id:16;
  2504. uint8_t vdev_id;
  2505. uint8_t mac_addr[6];
  2506. uint16_t first_data_seq_ctrl;
  2507. union {
  2508. uint32_t rate_info;
  2509. struct {
  2510. uint32_t ltf_size:2,
  2511. stbc:1,
  2512. he_re:1,
  2513. bw:4,
  2514. nss:4,
  2515. mcs:4,
  2516. preamble:4,
  2517. gi:4,
  2518. dcm:1,
  2519. ldpc:1,
  2520. ppdu_type:5;
  2521. };
  2522. } u;
  2523. uint32_t rix;
  2524. uint32_t lsig_a;
  2525. uint32_t rssi;
  2526. uint64_t timestamp;
  2527. uint32_t length;
  2528. uint8_t channel;
  2529. uint8_t beamformed;
  2530. uint32_t rx_ratekbps;
  2531. uint32_t ppdu_rx_rate;
  2532. uint32_t retries;
  2533. uint32_t rx_byte_count;
  2534. uint16_t rx_ratecode;
  2535. uint8_t fcs_error_mpdus;
  2536. uint16_t frame_ctrl;
  2537. int8_t rssi_chain[SS_COUNT][MAX_BW];
  2538. struct cdp_rx_su_evm_info evm_info;
  2539. uint32_t rx_antenna;
  2540. uint8_t num_users;
  2541. uint32_t nf;
  2542. uint8_t per_chain_rssi[MAX_CHAIN];
  2543. uint8_t is_mcast_bcast;
  2544. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  2545. struct cdp_rx_ppdu_cfr_info cfr_info;
  2546. #endif
  2547. uint8_t punc_bw;
  2548. #ifdef QCA_UNDECODED_METADATA_SUPPORT
  2549. bool phyrx_abort;
  2550. uint8_t phyrx_abort_reason;
  2551. uint32_t l_sig_length:12,
  2552. l_sig_a_parity:1,
  2553. l_sig_a_pkt_type:4,
  2554. l_sig_a_implicit_sounding:1,
  2555. vht_crc:8,
  2556. group_id:6;
  2557. uint32_t ht_length:16,
  2558. ht_smoothing:1,
  2559. ht_not_sounding:1,
  2560. ht_aggregation:1,
  2561. ht_stbc:2,
  2562. ht_crc:8,
  2563. vht_no_txop_ps:1;
  2564. uint32_t bss_color_id:6,
  2565. beam_change:1,
  2566. dl_ul_flag:1,
  2567. transmit_mcs:4,
  2568. ldpc_extra_sym:1,
  2569. special_reuse:4,
  2570. ltf_sym:3,
  2571. txbf:1,
  2572. pe_disambiguity:1,
  2573. pre_fec_pad:4,
  2574. dopplar:1;
  2575. uint32_t txop_duration:7,
  2576. sig_b_mcs:3,
  2577. sig_b_dcm:1,
  2578. sig_b_sym:4,
  2579. sig_b_comp:1,
  2580. he_crc:4;
  2581. #endif
  2582. uint8_t usr_nss_sum;
  2583. uint32_t usr_ru_tones_sum;
  2584. struct cdp_rx_stats_ppdu_user user[];
  2585. };
  2586. /**
  2587. * struct cdp_rx_indication_msdu - Rx MSDU info
  2588. * @ppdu_id: PPDU to which the MSDU belongs
  2589. * @msdu_len: Length of MSDU in bytes
  2590. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  2591. * @resvd0: reserved bit
  2592. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  2593. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  2594. * @msdu_part_of_amsdu: Indicates this MSDU was part of an A-MSDU in MPDU
  2595. * @msdu_part_of_ampdu:
  2596. * @resvd1: reserved bit
  2597. * @extd: Extended structure containing rate statistics
  2598. */
  2599. struct cdp_rx_indication_msdu {
  2600. uint32_t ppdu_id;
  2601. uint16_t msdu_len;
  2602. uint32_t ack_frame_rssi:8,
  2603. resvd0:1,
  2604. first_msdu:1,
  2605. last_msdu:1,
  2606. msdu_part_of_amsdu:1,
  2607. msdu_part_of_ampdu:1,
  2608. resvd1:19;
  2609. struct cdp_rate_stats extd;
  2610. };
  2611. /**
  2612. * struct cdp_config_params - Propagate configuration parameters to datapath
  2613. * @tso_enable: Enable/Disable TSO
  2614. * @lro_enable: Enable/Disable LRO
  2615. * @gro_enable: Enable/Disable GRO
  2616. * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
  2617. * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P
  2618. * @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN
  2619. * @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload
  2620. * @legacy_mode_checksumoffload_disable: Disable TCP/UDP Checksum Offload for
  2621. * legacy modes.
  2622. * @napi_enable: Enable/Disable Napi
  2623. * @ipa_enable: Flag indicating if IPA is enabled or not
  2624. * @tx_flow_stop_queue_threshold: Value to Pause tx queues
  2625. * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
  2626. * tx queue
  2627. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  2628. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  2629. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  2630. */
  2631. struct cdp_config_params {
  2632. unsigned int tso_enable:1;
  2633. unsigned int lro_enable:1;
  2634. unsigned int gro_enable:1;
  2635. unsigned int flow_steering_enable:1;
  2636. unsigned int p2p_tcp_udp_checksumoffload:1;
  2637. unsigned int nan_tcp_udp_checksumoffload:1;
  2638. unsigned int tcp_udp_checksumoffload:1;
  2639. unsigned int legacy_mode_checksumoffload_disable:1;
  2640. unsigned int napi_enable:1;
  2641. unsigned int ipa_enable:1;
  2642. /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
  2643. uint8_t tx_flow_stop_queue_threshold;
  2644. uint8_t tx_flow_start_queue_offset;
  2645. uint32_t tx_comp_loop_pkt_limit;
  2646. uint32_t rx_reap_loop_pkt_limit;
  2647. uint32_t rx_hp_oos_update_limit;
  2648. };
  2649. /**
  2650. * struct cdp_txrx_stats_req - stats request wrapper
  2651. * used to pass request information to cdp layer
  2652. * @stats: type of stats requested
  2653. * @param0: opaque argument 0 to be passed to htt
  2654. * @param1: opaque argument 1 to be passed to htt
  2655. * @param2: opaque argument 2 to be passed to htt
  2656. * @param3: opaque argument 3 to be passed to htt
  2657. * @cookie_val: cookie
  2658. * @mac_id: mac id
  2659. * @peer_addr: peer address
  2660. */
  2661. struct cdp_txrx_stats_req {
  2662. enum cdp_stats stats;
  2663. uint32_t param0;
  2664. uint32_t param1;
  2665. uint32_t param2;
  2666. uint32_t param3;
  2667. uint32_t cookie_val;
  2668. uint8_t mac_id;
  2669. char *peer_addr;
  2670. };
  2671. /**
  2672. * struct cdp_monitor_filter - monitor filter info
  2673. * @mode: set filter mode
  2674. * @fp_mgmt: set Filter Pass MGMT Configuration
  2675. * @fp_ctrl: set Filter Pass CTRL Configuration
  2676. * @fp_data: set Filter Pass DATA Configuration
  2677. * @mo_mgmt: set Monitor Other MGMT Configuration
  2678. * @mo_ctrl: set Monitor Other CTRL Configuration
  2679. * @mo_data: set Monitor other DATA Configuration
  2680. *
  2681. */
  2682. struct cdp_monitor_filter {
  2683. uint16_t mode;
  2684. uint16_t fp_mgmt;
  2685. uint16_t fp_ctrl;
  2686. uint16_t fp_data;
  2687. uint16_t mo_mgmt;
  2688. uint16_t mo_ctrl;
  2689. uint16_t mo_data;
  2690. };
  2691. /**
  2692. * enum cdp_dp_cfg - CDP ENUMs to get to DP configation
  2693. * @cfg_dp_enable_data_stall: context passed to be used by consumer
  2694. * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config
  2695. * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config
  2696. * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others
  2697. * @cfg_dp_disable_legacy_mode_csum_offload: Disable checksum offload for
  2698. * legacy modes
  2699. * @cfg_dp_tso_enable: get TSO enable config
  2700. * @cfg_dp_lro_enable: get LRO enable config
  2701. * @cfg_dp_gro_enable: get GRO enable config
  2702. * @cfg_dp_tc_based_dyn_gro_enable: get TC based dynamic gro enable config
  2703. * @cfg_dp_tc_ingress_prio: priority value to be checked for tc filters
  2704. * @cfg_dp_sg_enable:
  2705. * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset
  2706. * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold
  2707. * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config
  2708. * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config
  2709. * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config
  2710. * @cfg_dp_enable_flow_steering: get flow steerint enable config
  2711. * @cfg_dp_reorder_offload_supported: get reorder offload support config
  2712. * @cfg_dp_ce_classify_enable: get CE classify enable config
  2713. * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config
  2714. * @cfg_dp_pktlog_buffer_size: get packet log buffer size config
  2715. * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config
  2716. */
  2717. enum cdp_dp_cfg {
  2718. cfg_dp_enable_data_stall,
  2719. cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload,
  2720. cfg_dp_enable_nan_ip_tcp_udp_checksum_offload,
  2721. cfg_dp_enable_ip_tcp_udp_checksum_offload,
  2722. cfg_dp_disable_legacy_mode_csum_offload,
  2723. cfg_dp_tso_enable,
  2724. cfg_dp_lro_enable,
  2725. cfg_dp_gro_enable,
  2726. cfg_dp_tc_based_dyn_gro_enable,
  2727. cfg_dp_tc_ingress_prio,
  2728. cfg_dp_sg_enable,
  2729. cfg_dp_tx_flow_start_queue_offset,
  2730. cfg_dp_tx_flow_stop_queue_threshold,
  2731. cfg_dp_ipa_uc_tx_buf_size,
  2732. cfg_dp_ipa_uc_tx_partition_base,
  2733. cfg_dp_ipa_uc_rx_ind_ring_count,
  2734. cfg_dp_enable_flow_steering,
  2735. cfg_dp_reorder_offload_supported,
  2736. cfg_dp_ce_classify_enable,
  2737. cfg_dp_disable_intra_bss_fwd,
  2738. cfg_dp_pktlog_buffer_size,
  2739. cfg_dp_wow_check_rx_pending,
  2740. };
  2741. /**
  2742. * struct cdp_peer_cookie - cookie used when creating peer
  2743. * @ctx: context passed to be used by consumer
  2744. * @mac_addr: MAC address of peer
  2745. * @peer_id: peer id
  2746. * @pdev_id: pdev_id
  2747. * @cookie: cookie to be used by consumer
  2748. */
  2749. struct cdp_peer_cookie {
  2750. struct cdp_stats_cookie *ctx;
  2751. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2752. uint8_t peer_id;
  2753. uint8_t pdev_id;
  2754. uint8_t cookie;
  2755. };
  2756. #ifdef WLAN_SUPPORT_RX_FISA
  2757. struct cdp_flow_stats {
  2758. uint32_t aggr_count;
  2759. uint32_t curr_aggr_count;
  2760. uint32_t flush_count;
  2761. uint32_t bytes_aggregated;
  2762. };
  2763. #else
  2764. /**
  2765. * struct cdp_flow_stats - Per-Flow (5-tuple) statistics
  2766. * @msdu_count: number of rx msdus matching this flow
  2767. * @mon_msdu_count: number of msdus matching this flow in mon path
  2768. *
  2769. * HW also includes msdu_byte_count and timestamp, which
  2770. * are not currently tracked in SW.
  2771. */
  2772. struct cdp_flow_stats {
  2773. uint32_t msdu_count;
  2774. uint32_t mon_msdu_count;
  2775. };
  2776. #endif
  2777. /**
  2778. * enum cdp_flow_fst_operation - RX FST operations allowed
  2779. * @CDP_FLOW_FST_ENTRY_ADD: Add entry
  2780. * @CDP_FLOW_FST_ENTRY_DEL: Delete entry
  2781. * @CDP_FLOW_FST_RX_BYPASS_ENABLE: RX bypass enable
  2782. * @CDP_FLOW_FST_RX_BYPASS_DISABLE: RX bypass disable
  2783. */
  2784. enum cdp_flow_fst_operation {
  2785. CDP_FLOW_FST_ENTRY_ADD,
  2786. CDP_FLOW_FST_ENTRY_DEL,
  2787. CDP_FLOW_FST_RX_BYPASS_ENABLE,
  2788. CDP_FLOW_FST_RX_BYPASS_DISABLE
  2789. };
  2790. /**
  2791. * enum cdp_flow_protocol_type - RX FST supported protocol types,
  2792. * mapped to HW spec
  2793. * @CDP_FLOW_PROTOCOL_TYPE_TCP: TCP
  2794. * @CDP_FLOW_PROTOCOL_TYPE_UDP: UDP
  2795. */
  2796. enum cdp_flow_protocol_type {
  2797. CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
  2798. CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
  2799. };
  2800. /**
  2801. * struct cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
  2802. * @tuple_populated:
  2803. * @is_exception: Flows which are added to flow table but not aggregated.
  2804. * @bypass_fisa: Flow which are not added to flow table.
  2805. * @dest_ip_127_96: destination IP address bit fields 96-127
  2806. * @dest_ip_95_64: destination IP address bit fields 64-95
  2807. * @dest_ip_63_32: destination IP address bit fields 32-63
  2808. * @dest_ip_31_0: destination IP address bit fields 0-31
  2809. * @src_ip_127_96: source IP address bit fields 96-127
  2810. * @src_ip_95_64: source IP address bit fields 64-95
  2811. * @src_ip_63_32: source IP address bit fields 32-63
  2812. * @src_ip_31_0: source IP address bit fields 0-31
  2813. * @dest_port: destination port of flow
  2814. * @src_port: source port of flow
  2815. * @l4_protocol: protocol type in flow (TCP/UDP)
  2816. */
  2817. struct cdp_rx_flow_tuple_info {
  2818. #ifdef WLAN_SUPPORT_RX_FISA
  2819. uint8_t tuple_populated;
  2820. uint8_t is_exception;
  2821. bool bypass_fisa;
  2822. #endif
  2823. uint32_t dest_ip_127_96;
  2824. uint32_t dest_ip_95_64;
  2825. uint32_t dest_ip_63_32;
  2826. uint32_t dest_ip_31_0;
  2827. uint32_t src_ip_127_96;
  2828. uint32_t src_ip_95_64;
  2829. uint32_t src_ip_63_32;
  2830. uint32_t src_ip_31_0;
  2831. uint16_t dest_port;
  2832. uint16_t src_port;
  2833. uint16_t l4_protocol;
  2834. };
  2835. /**
  2836. * struct cdp_rx_flow_info - RX flow info used for addition/deletion
  2837. * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
  2838. * @op_code: add/delete/enable/disable operation requested
  2839. * @flow_tuple_info: structure containing tuple info
  2840. * @fse_metadata: metadata to be set in RX flow
  2841. * @use_ppe_ds: use DS mode
  2842. * @priority_vld: is priority valid
  2843. * @service_code: service code for DS
  2844. */
  2845. struct cdp_rx_flow_info {
  2846. bool is_addr_ipv4;
  2847. enum cdp_flow_fst_operation op_code;
  2848. struct cdp_rx_flow_tuple_info flow_tuple_info;
  2849. uint16_t fse_metadata;
  2850. uint8_t use_ppe_ds;
  2851. uint8_t priority_vld;
  2852. uint16_t service_code;
  2853. };
  2854. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  2855. /**
  2856. * struct cdp_scan_spcl_vap_stats - Special vap statistics info
  2857. * @rx_ok_pkts: rx fcs ok pkts count
  2858. * @rx_ok_bytes: rx fcs ok bytes count
  2859. * @rx_err_pkts: rx fcs err pkts count
  2860. * @rx_err_bytes: rx fcs err bytes count
  2861. * @rx_mgmt_pkts: rx mgmt pkts count
  2862. * @rx_ctrl_pkts: rx ctrl pkts count
  2863. * @rx_data_pkts: rx data pkts count
  2864. */
  2865. struct cdp_scan_spcl_vap_stats {
  2866. uint64_t rx_ok_pkts;
  2867. uint64_t rx_ok_bytes;
  2868. uint64_t rx_err_pkts;
  2869. uint64_t rx_err_bytes;
  2870. uint64_t rx_mgmt_pkts;
  2871. uint64_t rx_ctrl_pkts;
  2872. uint64_t rx_data_pkts;
  2873. };
  2874. #endif
  2875. /**
  2876. * struct cdp_soc_attach_params
  2877. *
  2878. * @hif_handle: Opaque HIF handle
  2879. * @htc_handle: Opaque HTC handle
  2880. * @qdf_osdev: QDF device
  2881. * @ol_ops: Offload Operations
  2882. * @device_id: Device ID
  2883. * @ml_context: DP ML object context
  2884. * @mlo_chip_id: MLO chip id, for legacy SOCs chip_id need to 0
  2885. * @mlo_enabled: MLO enable bit
  2886. */
  2887. struct cdp_soc_attach_params {
  2888. struct hif_opaque_softc *hif_handle;
  2889. HTC_HANDLE htc_handle;
  2890. qdf_device_t qdf_osdev;
  2891. struct ol_if_ops *ol_ops;
  2892. uint16_t device_id;
  2893. struct cdp_mlo_ctxt *ml_context;
  2894. uint8_t mlo_chip_id;
  2895. uint8_t mlo_enabled;
  2896. };
  2897. /**
  2898. * struct cdp_pdev_attach_params - params for pdev attach
  2899. *
  2900. * @htc_handle: HTC handle for host-target interface
  2901. * @qdf_osdev: QDF OS device
  2902. * @pdev_id: PDEV ID
  2903. * @mlo_link_id: ML link id
  2904. */
  2905. struct cdp_pdev_attach_params {
  2906. HTC_HANDLE htc_handle;
  2907. qdf_device_t qdf_osdev;
  2908. uint8_t pdev_id;
  2909. uint32_t mlo_link_id;
  2910. };
  2911. #endif