cdp_txrx_cmn_struct.h 78 KB

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