cdp_txrx_cmn_struct.h 81 KB

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