cdp_txrx_cmn_struct.h 95 KB

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