cdp_txrx_cmn_struct.h 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651
  1. /*
  2. * Copyright (c) 2011-2019 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 CONFIG_MCL
  35. #include <cdp_txrx_mob_def.h>
  36. #endif
  37. #include <cdp_txrx_handle.h>
  38. #include <cdp_txrx_stats_struct.h>
  39. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  40. #include "cdp_txrx_extd_struct.h"
  41. #endif
  42. #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
  43. /*
  44. * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode.
  45. * Clients will be assigned max 32 IDs.
  46. * STA(associated)/P2P DEV(self-PEER) will get one ID.
  47. */
  48. #define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1)
  49. #endif
  50. #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
  51. #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
  52. #define CDP_RSSI_CHAIN_LEN 8
  53. #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
  54. #define CDP_INVALID_VDEV_ID 0xff
  55. /* Options for Dump Statistics */
  56. #define CDP_HDD_STATS 0
  57. #define CDP_TXRX_PATH_STATS 1
  58. #define CDP_TXRX_HIST_STATS 2
  59. #define CDP_TXRX_TSO_STATS 3
  60. #define CDP_HDD_NETIF_OPER_HISTORY 4
  61. #define CDP_DUMP_TX_FLOW_POOL_INFO 5
  62. #define CDP_TXRX_DESC_STATS 6
  63. #define CDP_HIF_STATS 7
  64. #define CDP_LRO_STATS 8
  65. #define CDP_NAPI_STATS 9
  66. #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
  67. #define CDP_RX_RING_STATS 11
  68. #define CDP_DP_NAPI_STATS 12
  69. #define CDP_DP_RX_THREAD_STATS 13
  70. #define CDP_SCHEDULER_STATS 21
  71. #define CDP_TX_QUEUE_STATS 22
  72. #define CDP_BUNDLE_STATS 23
  73. #define CDP_CREDIT_STATS 24
  74. #define CDP_DISCONNECT_STATS 25
  75. #define WME_AC_TO_TID(_ac) ( \
  76. ((_ac) == WME_AC_VO) ? 6 : \
  77. ((_ac) == WME_AC_VI) ? 5 : \
  78. ((_ac) == WME_AC_BK) ? 1 : \
  79. 0)
  80. #define TID_TO_WME_AC(_tid) ( \
  81. (((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
  82. (((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
  83. (((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
  84. WME_AC_VO)
  85. #define CDP_MU_MAX_USERS 37
  86. #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
  87. #define CDP_INVALID_PEER 0xffff
  88. #define CDP_INVALID_TID 31
  89. #define CDP_INVALID_TX_ENCAP_TYPE 6
  90. #define CDP_INVALID_SEC_TYPE 12
  91. #define CDP_DATA_TID_MAX 8
  92. #define CDP_DATA_NON_QOS_TID 16
  93. /*
  94. * advance rx monitor filter
  95. * */
  96. #define MON_FILTER_PASS 0x0001
  97. #define MON_FILTER_OTHER 0x0002
  98. #define MON_FILTER_ALL 0x0003
  99. #define FILTER_MGMT_ALL 0xFFFF
  100. #define FILTER_MGMT_ASSOC_REQ 0x0001
  101. #define FILTER_MGMT_ASSOC_RES 0x0002
  102. #define FILTER_MGMT_REASSOC_REQ 0x0004
  103. #define FILTER_MGMT_REASSOC_RES 0x0008
  104. #define FILTER_MGMT_PROBE_REQ 0x0010
  105. #define FILTER_MGMT_PROBE_RES 0x0020
  106. #define FILTER_MGMT_TIM_ADVT 0x0040
  107. #define FILTER_MGMT_RESERVED_7 0x0080
  108. #define FILTER_MGMT_BEACON 0x0100
  109. #define FILTER_MGMT_ATIM 0x0200
  110. #define FILTER_MGMT_DISASSOC 0x0400
  111. #define FILTER_MGMT_AUTH 0x0800
  112. #define FILTER_MGMT_DEAUTH 0x1000
  113. #define FILTER_MGMT_ACTION 0x2000
  114. #define FILTER_MGMT_ACT_NO_ACK 0x4000
  115. #define FILTER_MGMT_RESERVED_15 0x8000
  116. #define FILTER_CTRL_ALL 0xFFFF
  117. #define FILTER_CTRL_RESERVED_1 0x0001
  118. #define FILTER_CTRL_RESERVED_2 0x0002
  119. #define FILTER_CTRL_TRIGGER 0x0004
  120. #define FILTER_CTRL_RESERVED_4 0x0008
  121. #define FILTER_CTRL_BF_REP_POLL 0x0010
  122. #define FILTER_CTRL_VHT_NDP 0x0020
  123. #define FILTER_CTRL_FRAME_EXT 0x0040
  124. #define FILTER_CTRL_CTRLWRAP 0x0080
  125. #define FILTER_CTRL_BA_REQ 0x0100
  126. #define FILTER_CTRL_BA 0x0200
  127. #define FILTER_CTRL_PSPOLL 0x0400
  128. #define FILTER_CTRL_RTS 0x0800
  129. #define FILTER_CTRL_CTS 0x1000
  130. #define FILTER_CTRL_ACK 0x2000
  131. #define FILTER_CTRL_CFEND 0x4000
  132. #define FILTER_CTRL_CFEND_CFACK 0x8000
  133. #define FILTER_DATA_ALL 0xFFFF
  134. #define FILTER_DATA_MCAST 0x4000
  135. #define FILTER_DATA_UCAST 0x8000
  136. #define FILTER_DATA_DATA 0x0001
  137. #define FILTER_DATA_NULL 0x0008
  138. QDF_DECLARE_EWMA(tx_lag, 1024, 8)
  139. struct cdp_stats_cookie;
  140. /*
  141. * DP configuration parameters
  142. */
  143. enum cdp_cfg_param_type {
  144. CDP_CFG_MAX_PEER_ID,
  145. CDP_CFG_CCE_DISABLE,
  146. CDP_CFG_NUM_PARAMS
  147. };
  148. /*
  149. * htt_dbg_stats_type -
  150. * bit positions for each stats type within a stats type bitmask
  151. * The bitmask contains 24 bits.
  152. */
  153. enum htt_cmn_dbg_stats_type {
  154. HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  155. HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  156. HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  157. HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  158. HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  159. HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  160. HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  161. HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  162. HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  163. HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  164. HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  165. HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  166. HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */
  167. HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */
  168. HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */
  169. HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */
  170. HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */
  171. HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
  172. /* bits 18-23 currently reserved */
  173. /* keep this last */
  174. HTT_DBG_CMN_NUM_STATS,
  175. HTT_DBG_CMN_NUM_STATS_INVALID = 31, /* bit 31 -> 0x80000000 */
  176. };
  177. /*
  178. * cdp_host_txrx_stats: Different types of host stats
  179. * @TXRX_HOST_STATS_INVALID: Invalid option
  180. * @TXRX_RX_RATE_STATS: Rx rate info
  181. * @TXRX_TX_RATE_STATS: Tx rate info
  182. * @TXRX_TX_HOST_STATS: Print Tx stats
  183. * @TXRX_RX_HOST_STATS: Print host Rx stats
  184. * @TXRX_CLEAR_STATS: clear all host stats
  185. * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
  186. * @TXRX_RX_MON_STATS: Print monitor mode stats
  187. * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
  188. * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
  189. * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
  190. * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
  191. * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
  192. */
  193. enum cdp_host_txrx_stats {
  194. TXRX_HOST_STATS_INVALID = -1,
  195. TXRX_CLEAR_STATS = 0,
  196. TXRX_RX_RATE_STATS = 1,
  197. TXRX_TX_RATE_STATS = 2,
  198. TXRX_TX_HOST_STATS = 3,
  199. TXRX_RX_HOST_STATS = 4,
  200. TXRX_AST_STATS = 5,
  201. TXRX_SRNG_PTR_STATS = 6,
  202. TXRX_RX_MON_STATS = 7,
  203. TXRX_REO_QUEUE_STATS = 8,
  204. TXRX_SOC_CFG_PARAMS = 9,
  205. TXRX_PDEV_CFG_PARAMS = 10,
  206. TXRX_NAPI_STATS = 11,
  207. TXRX_SOC_INTERRUPT_STATS = 12,
  208. TXRX_HOST_STATS_MAX,
  209. };
  210. /*
  211. * cdp_ppdu_ftype: PPDU Frame Type
  212. * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
  213. * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
  214. * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
  215. */
  216. enum cdp_ppdu_ftype {
  217. CDP_PPDU_FTYPE_CTRL,
  218. CDP_PPDU_FTYPE_DATA,
  219. CDP_PPDU_FTYPE_BAR,
  220. CDP_PPDU_FTYPE_MAX
  221. };
  222. /**
  223. * @brief General specification of the tx frame contents
  224. *
  225. * @details
  226. * for efficiency, the HTT packet type values correspond
  227. * to the bit positions of the WAL packet type values, so the
  228. * translation is a simple shift operation.
  229. */
  230. enum htt_cmn_pkt_type {
  231. htt_cmn_pkt_type_raw = 0,
  232. htt_cmn_pkt_type_native_wifi = 1,
  233. htt_cmn_pkt_type_ethernet = 2,
  234. htt_cmn_pkt_type_mgmt = 3,
  235. htt_cmn_pkt_type_eth2 = 4,
  236. /* keep this last */
  237. htt_cmn_pkt_num_types
  238. };
  239. /**
  240. * @General description of HTT received packets status
  241. * It is similar to htt_rx_status enum
  242. * but is added as a cdp enum can be freely used in OL_IF layer
  243. */
  244. enum htt_cmn_rx_status {
  245. htt_cmn_rx_status_unknown = 0x0,
  246. htt_cmn_rx_status_ok,
  247. htt_cmn_rx_status_err_fcs,
  248. htt_cmn_rx_status_err_dup,
  249. htt_cmn_rx_status_err_replay,
  250. htt_cmn_rx_status_inv_peer,
  251. htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
  252. htt_cmn_rx_status_tkip_mic_err = 0x09,
  253. htt_cmn_rx_status_decrypt_err = 0x0A,
  254. htt_cmn_rx_status_mpdu_length_err = 0x0B,
  255. htt_cmn_rx_status_err_misc = 0xFF
  256. };
  257. enum cdp_host_reo_dest_ring {
  258. cdp_host_reo_dest_ring_unknown = 0,
  259. cdp_host_reo_dest_ring_1 = 1,
  260. cdp_host_reo_dest_ring_2 = 2,
  261. cdp_host_reo_dest_ring_3 = 3,
  262. cdp_host_reo_dest_ring_4 = 4,
  263. };
  264. enum htt_cmn_t2h_en_stats_type {
  265. /* keep this alwyas first */
  266. HTT_CMN_T2H_EN_STATS_TYPE_START = 0,
  267. /** ppdu_common_stats is the payload */
  268. HTT_CMN_T2H_EN_STATS_TYPE_COMMON = 1,
  269. /** ppdu_sant_stats is the payload */
  270. HTT_CMN_T2H_EN_STATS_TYPE_SANT = 2,
  271. /** ppdu_common_stats_v2 is the payload */
  272. HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
  273. /* Keep this last */
  274. HTT_CMN_T2H_EN_STATS_TYPE_END = 0x1f,
  275. };
  276. enum htt_cmn_t2h_en_stats_status {
  277. /* Keep this first always */
  278. HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL = 0,
  279. HTT_CMN_T2H_EN_STATS_STATUS_PRESENT = 1,
  280. HTT_CMN_T2H_EN_STATS_STATUS_ERROR = 2,
  281. HTT_CMN_T2H_EN_STATS_STATUS_INVALID = 3,
  282. /* keep this always last */
  283. HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE = 7,
  284. };
  285. /**
  286. * struct ol_txrx_peer_state - Peer state information
  287. */
  288. enum ol_txrx_peer_state {
  289. OL_TXRX_PEER_STATE_INVALID,
  290. OL_TXRX_PEER_STATE_DISC, /* initial state */
  291. OL_TXRX_PEER_STATE_CONN, /* authentication in progress */
  292. OL_TXRX_PEER_STATE_AUTH, /* authentication successful */
  293. };
  294. /**
  295. * struct ol_txrx_ast_type - AST entry type information
  296. */
  297. enum cdp_txrx_ast_entry_type {
  298. CDP_TXRX_AST_TYPE_NONE, /* static ast entry for connected peer */
  299. CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */
  300. CDP_TXRX_AST_TYPE_SELF, /* static ast entry for self peer (STA mode) */
  301. CDP_TXRX_AST_TYPE_WDS, /* WDS peer ast entry type*/
  302. CDP_TXRX_AST_TYPE_MEC, /* Multicast echo ast entry type */
  303. CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */
  304. CDP_TXRX_AST_TYPE_STA_BSS, /* BSS entry(STA mode) */
  305. CDP_TXRX_AST_TYPE_DA, /* AST entry based on Destination address */
  306. CDP_TXRX_AST_TYPE_WDS_HM_SEC, /* HM WDS entry for secondary radio */
  307. CDP_TXRX_AST_TYPE_MAX
  308. };
  309. /*
  310. * cdp_ast_free_status: status passed to callback function before freeing ast
  311. * @CDP_TXRX_AST_DELETED - AST is deleted from FW and delete response received
  312. * @CDP_TXRX_AST_DELETE_IN_PROGRESS - AST delete command sent to FW and host
  313. * is waiting for FW response
  314. */
  315. enum cdp_ast_free_status {
  316. CDP_TXRX_AST_DELETED,
  317. CDP_TXRX_AST_DELETE_IN_PROGRESS,
  318. };
  319. /**
  320. * txrx_ast_free_cb - callback registered for ast free
  321. * @ctrl_soc: control path soc context
  322. * @cdp_soc: DP soc context
  323. * @cookie: cookie
  324. * @cdp_ast_free_status: ast free status
  325. */
  326. typedef void (*txrx_ast_free_cb)(void *ctrl_soc,
  327. void *cdp_soc,
  328. void *cookie,
  329. enum cdp_ast_free_status);
  330. /**
  331. * struct cdp_ast_entry_info - AST entry information
  332. * @peer_mac_addr: mac address of peer on which AST entry is added
  333. * @type: ast entry type
  334. * @vdev_id: vdev_id
  335. * @pdev_id: pdev_id
  336. * @peer_id: peer_id
  337. *
  338. * This structure holds the ast entry information
  339. *
  340. */
  341. struct cdp_ast_entry_info {
  342. uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
  343. enum cdp_txrx_ast_entry_type type;
  344. uint8_t vdev_id;
  345. uint8_t pdev_id;
  346. uint16_t peer_id;
  347. };
  348. /**
  349. * struct cdp_sec_type - security type information
  350. */
  351. enum cdp_sec_type {
  352. cdp_sec_type_none,
  353. cdp_sec_type_wep128,
  354. cdp_sec_type_wep104,
  355. cdp_sec_type_wep40,
  356. cdp_sec_type_tkip,
  357. cdp_sec_type_tkip_nomic,
  358. cdp_sec_type_aes_ccmp,
  359. cdp_sec_type_wapi,
  360. cdp_sec_type_aes_ccmp_256,
  361. cdp_sec_type_aes_gcmp,
  362. cdp_sec_type_aes_gcmp_256,
  363. /* keep this last! */
  364. cdp_num_sec_types
  365. };
  366. /**
  367. * struct cdp_tx_exception_metadata - Exception path parameters
  368. * @peer_id: Peer id of the peer
  369. * @tid: Transmit Identifier
  370. * @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
  371. * @sec_type: sec_type to be passed to HAL
  372. * @is_tx_sniffer: Indicates if the packet has to be sniffed
  373. * @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions
  374. *
  375. * This structure holds the parameters needed in the exception path of tx
  376. *
  377. */
  378. struct cdp_tx_exception_metadata {
  379. uint16_t peer_id;
  380. uint8_t tid;
  381. uint16_t tx_encap_type;
  382. enum cdp_sec_type sec_type;
  383. uint8_t is_tx_sniffer;
  384. uint16_t ppdu_cookie;
  385. };
  386. typedef struct cdp_soc_t *ol_txrx_soc_handle;
  387. /**
  388. * ol_txrx_vdev_delete_cb - callback registered during vdev
  389. * detach
  390. */
  391. typedef void (*ol_txrx_vdev_delete_cb)(void *context);
  392. /**
  393. * ol_txrx_peer_unmap_sync_cb - callback registered during peer detach sync
  394. */
  395. typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
  396. uint32_t peer_id_cnt,
  397. uint16_t *peer_id_list);
  398. /**
  399. * ol_txrx_pkt_direction - Packet Direction
  400. * @rx_direction: rx path packet
  401. * @tx_direction: tx path packet
  402. */
  403. enum txrx_direction {
  404. rx_direction = 1,
  405. tx_direction = 0,
  406. };
  407. /**
  408. * cdp_capabilities- DP capabilities
  409. */
  410. enum cdp_capabilities {
  411. CDP_CFG_DP_TSO,
  412. CDP_CFG_DP_LRO,
  413. CDP_CFG_DP_SG,
  414. CDP_CFG_DP_GRO,
  415. CDP_CFG_DP_OL_TX_CSUM,
  416. CDP_CFG_DP_OL_RX_CSUM,
  417. CDP_CFG_DP_RAWMODE,
  418. CDP_CFG_DP_PEER_FLOW_CTRL,
  419. };
  420. /**
  421. * ol_txrx_nbuf_classify - Packet classification object
  422. * @peer_id: unique peer identifier from fw
  423. * @tid: traffic identifier(could be overridden)
  424. * @pkt_tid: traffic identifier(cannot be overridden)
  425. * @pkt_tos: ip header tos value
  426. * @pkt_dscp: ip header dscp value
  427. * @tos: index value in map
  428. * @dscp: DSCP_TID map index
  429. * @is_mcast: multicast pkt check
  430. * @is_eap: eapol pkt check
  431. * @is_arp: arp pkt check
  432. * @is_tcp: tcp pkt check
  433. * @is_dhcp: dhcp pkt check
  434. * @is_igmp: igmp pkt check
  435. * @is_ipv4: ip version 4 pkt check
  436. * @is_ipv6: ip version 6 pkt check
  437. */
  438. struct ol_txrx_nbuf_classify {
  439. uint16_t peer_id;
  440. uint8_t tid;
  441. uint8_t pkt_tid;
  442. uint8_t pkt_tos;
  443. uint8_t pkt_dscp;
  444. uint8_t tos;
  445. uint8_t dscp;
  446. uint8_t is_mcast;
  447. uint8_t is_eap;
  448. uint8_t is_arp;
  449. uint8_t is_tcp;
  450. uint8_t is_dhcp;
  451. uint8_t is_igmp;
  452. uint8_t is_ipv4;
  453. uint8_t is_ipv6;
  454. };
  455. /**
  456. * ol_osif_vdev_handle - paque handle for OS shim virtual device
  457. * object
  458. */
  459. struct ol_osif_vdev_t;
  460. typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
  461. /**
  462. * wlan_op_mode - Virtual device operation mode
  463. * @wlan_op_mode_unknown: Unknown mode
  464. * @wlan_op_mode_ap: AP mode
  465. * @wlan_op_mode_ibss: IBSS mode
  466. * @wlan_op_mode_sta: STA (client) mode
  467. * @wlan_op_mode_monitor: Monitor mode
  468. * @wlan_op_mode_ocb: OCB mode
  469. */
  470. enum wlan_op_mode {
  471. wlan_op_mode_unknown,
  472. wlan_op_mode_ap,
  473. wlan_op_mode_ibss,
  474. wlan_op_mode_sta,
  475. wlan_op_mode_monitor,
  476. wlan_op_mode_ocb,
  477. wlan_op_mode_ndi,
  478. };
  479. /**
  480. * connectivity_stats_pkt_status - data pkt type
  481. * @PKT_TYPE_REQ: Request packet
  482. * @PKT_TYPE_RSP: Response packet
  483. * @PKT_TYPE_TX_DROPPED: TX packet dropped
  484. * @PKT_TYPE_RX_DROPPED: RX packet dropped
  485. * @PKT_TYPE_RX_DELIVERED: RX packet delivered
  486. * @PKT_TYPE_RX_REFUSED: RX packet refused
  487. * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
  488. * @PKT_TYPE_TX_ACK_CNT:TC packet acked
  489. * @PKT_TYPE_NONE: Invalid packet
  490. */
  491. enum connectivity_stats_pkt_status {
  492. PKT_TYPE_REQ,
  493. PKT_TYPE_RSP,
  494. PKT_TYPE_TX_DROPPED,
  495. PKT_TYPE_RX_DROPPED,
  496. PKT_TYPE_RX_DELIVERED,
  497. PKT_TYPE_RX_REFUSED,
  498. PKT_TYPE_TX_HOST_FW_SENT,
  499. PKT_TYPE_TX_ACK_CNT,
  500. PKT_TYPE_NONE,
  501. };
  502. /**
  503. * ol_txrx_mgmt_tx_cb - tx management delivery notification
  504. * callback function
  505. */
  506. typedef void
  507. (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
  508. /**
  509. * ol_txrx_data_tx_cb - Function registered with the data path
  510. * that is called when tx frames marked as "no free" are
  511. * done being transmitted
  512. */
  513. typedef void
  514. (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
  515. /**
  516. * ol_txrx_tx_fp - top-level transmit function
  517. * @data_vdev - handle to the virtual device object
  518. * @msdu_list - list of network buffers
  519. */
  520. typedef qdf_nbuf_t (*ol_txrx_tx_fp)(void *data_vdev,
  521. qdf_nbuf_t msdu_list);
  522. /**
  523. * ol_txrx_tx_exc_fp - top-level transmit function on exception path
  524. * @data_vdev - handle to the virtual device object
  525. * @msdu_list - list of network buffers
  526. * @tx_exc_metadata - structure that holds parameters to exception path
  527. */
  528. typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(void *data_vdev,
  529. qdf_nbuf_t msdu_list,
  530. struct cdp_tx_exception_metadata
  531. *tx_exc_metadata);
  532. /**
  533. * ol_txrx_completion_fp - top-level transmit function
  534. * for tx completion
  535. * @skb: skb data
  536. * @osif_dev: the virtual device's OS shim object
  537. */
  538. typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
  539. void *osif_dev);
  540. /**
  541. * ol_txrx_tx_flow_control_fp - tx flow control notification
  542. * function from txrx to OS shim
  543. * @osif_dev - the virtual device's OS shim object
  544. * @tx_resume - tx os q should be resumed or not
  545. */
  546. typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
  547. bool tx_resume);
  548. /**
  549. * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
  550. * function from txrx to OS shim
  551. * @osif_dev - the virtual device's OS shim object
  552. *
  553. * Return: true if tx is paused by flow control
  554. */
  555. typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
  556. /**
  557. * ol_txrx_rx_fp - receive function to hand batches of data
  558. * frames from txrx to OS shim
  559. * @data_vdev - handle to the OSIF virtual device object
  560. * @msdu_list - list of network buffers
  561. */
  562. typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
  563. /**
  564. * ol_txrx_stats_rx_fp - receive function to hand batches of data
  565. * frames from txrx to OS shim
  566. * @skb: skb data
  567. * @osif_dev: the virtual device's OS shim object
  568. * @action: data packet type
  569. * @pkt_type: packet data type
  570. */
  571. typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
  572. void *osif_dev, enum connectivity_stats_pkt_status action,
  573. uint8_t *pkt_type);
  574. /**
  575. * ol_txrx_get_key_fp - function to gey key based on keyix and peer
  576. * mac address
  577. * @osif_dev - the virtual device's OS shim object
  578. * @key_buf - pointer to store key
  579. * @mac_addr - pointer to mac address
  580. * @keyix - key id
  581. */
  582. typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
  583. /**
  584. * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
  585. * packets in receive path.
  586. * @osif_dev - the virtual device's OS shim object
  587. * @list_head - poniter to head of receive packet queue to decap
  588. * @list_tail - poniter to tail of receive packet queue to decap
  589. * @peer - Peer handler
  590. */
  591. typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
  592. qdf_nbuf_t *list_head,
  593. qdf_nbuf_t *list_tail,
  594. struct cdp_peer *peer);
  595. /* ol_txrx_rx_fp - external tx free function to read per packet stats and
  596. * free tx buffer externally
  597. * @netbuf - tx network buffer
  598. */
  599. typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
  600. /**
  601. * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
  602. */
  603. typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
  604. qdf_nbuf_t mpdu_head,
  605. qdf_nbuf_t mpdu_tail);
  606. /**
  607. * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
  608. * MPDU (802.11 format)
  609. */
  610. typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
  611. qdf_nbuf_t mpdu,
  612. void *rx_status);
  613. /**
  614. * ol_txrx_proxy_arp_fp - proxy arp function pointer
  615. */
  616. typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
  617. qdf_nbuf_t netbuf);
  618. /*
  619. * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
  620. */
  621. typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
  622. qdf_nbuf_t netbuf);
  623. /**
  624. * ol_txrx_stats_callback - statistics notify callback
  625. */
  626. typedef void (*ol_txrx_stats_callback)(void *ctxt,
  627. enum htt_cmn_dbg_stats_type type,
  628. uint8_t *buf, int bytes);
  629. /**
  630. * ol_txrx_pktdump_cb - callback for packet dump feature
  631. */
  632. typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
  633. struct cdp_vdev *vdev,
  634. qdf_nbuf_t netbuf,
  635. uint8_t status,
  636. uint8_t type);
  637. /**
  638. * ol_txrx_ops - (pointers to) the functions used for tx and rx
  639. * data xfer
  640. *
  641. * There are two portions of these txrx operations.
  642. * The rx portion is filled in by OSIF SW before calling
  643. * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
  644. * the txrx SW stores a copy of these rx function pointers, to use
  645. * as it delivers rx data frames to the OSIF SW.
  646. * The tx portion is filled in by the txrx SW inside
  647. * ol_txrx_osif_vdev_register; when the function call returns,
  648. * the OSIF SW stores a copy of these tx functions to use as it
  649. * delivers tx data frames to the txrx SW.
  650. *
  651. * @tx.std - the tx function pointer for standard data
  652. * frames This function pointer is set by the txrx SW
  653. * perform host-side transmit operations based on
  654. * whether a HL or LL host/target interface is in use.
  655. * @tx.flow_control_cb - the transmit flow control
  656. * function that is registered by the
  657. * OSIF which is called from txrx to
  658. * indicate whether the transmit OS
  659. * queues should be paused/resumed
  660. * @rx.rx - the OS shim rx function to deliver rx data
  661. * frames to. This can have different values for
  662. * different virtual devices, e.g. so one virtual
  663. * device's OS shim directly hands rx frames to the OS,
  664. * but another virtual device's OS shim filters out P2P
  665. * messages before sending the rx frames to the OS. The
  666. * netbufs delivered to the osif_rx function are in the
  667. * format specified by the OS to use for tx and rx
  668. * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
  669. * are given to the thread, instead of the stack via this pointer.
  670. * @rx.stack - function to give packets to the stack. Differs from @rx.rx.
  671. * In case RX Threads are enabled, this pointer holds the callback to give
  672. * packets to the stack.
  673. * @rx.wai_check - the tx function pointer for WAPI frames
  674. * @rx.mon - the OS shim rx monitor function to deliver
  675. * monitor data to Though in practice, it is probable
  676. * that the same function will be used for delivering
  677. * rx monitor data for all virtual devices, in theory
  678. * each different virtual device can have a different
  679. * OS shim function for accepting rx monitor data. The
  680. * netbufs delivered to the osif_rx_mon function are in
  681. * 802.11 format. Each netbuf holds a 802.11 MPDU, not
  682. * an 802.11 MSDU. Depending on compile-time
  683. * configuration, each netbuf may also have a
  684. * monitor-mode encapsulation header such as a radiotap
  685. * header added before the MPDU contents.
  686. * @rx.std - the OS shim rx function to deliver rx data
  687. * @proxy_arp - proxy arp function pointer - specified by
  688. * OS shim, stored by txrx
  689. * @get_key - function pointer to get key of the peer with
  690. * specific key index
  691. */
  692. struct ol_txrx_ops {
  693. /* tx function pointers - specified by txrx, stored by OS shim */
  694. struct {
  695. ol_txrx_tx_fp tx;
  696. ol_txrx_tx_exc_fp tx_exception;
  697. ol_txrx_tx_free_ext_fp tx_free_ext;
  698. ol_txrx_completion_fp tx_comp;
  699. } tx;
  700. /* rx function pointers - specified by OS shim, stored by txrx */
  701. struct {
  702. ol_txrx_rx_fp rx;
  703. ol_txrx_rx_fp rx_stack;
  704. ol_txrx_rx_check_wai_fp wai_check;
  705. ol_txrx_rx_mon_fp mon;
  706. ol_txrx_stats_rx_fp stats_rx;
  707. ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
  708. } rx;
  709. /* proxy arp function pointer - specified by OS shim, stored by txrx */
  710. ol_txrx_proxy_arp_fp proxy_arp;
  711. ol_txrx_mcast_me_fp me_convert;
  712. ol_txrx_get_key_fp get_key;
  713. };
  714. /**
  715. * ol_txrx_stats_req - specifications of the requested
  716. * statistics
  717. */
  718. struct ol_txrx_stats_req {
  719. uint32_t stats_type_upload_mask; /* which stats to upload */
  720. uint32_t stats_type_reset_mask; /* which stats to reset */
  721. /* stats will be printed if either print element is set */
  722. struct {
  723. int verbose; /* verbose stats printout */
  724. int concise; /* concise stats printout (takes precedence) */
  725. } print; /* print uploaded stats */
  726. /* stats notify callback will be invoked if fp is non-NULL */
  727. struct {
  728. ol_txrx_stats_callback fp;
  729. void *ctxt;
  730. } callback;
  731. /* stats will be copied into the specified buffer if buf is non-NULL */
  732. struct {
  733. uint8_t *buf;
  734. int byte_limit; /* don't copy more than this */
  735. } copy;
  736. /*
  737. * If blocking is true, the caller will take the specified semaphore
  738. * to wait for the stats to be uploaded, and the driver will release
  739. * the semaphore when the stats are done being uploaded.
  740. */
  741. struct {
  742. int blocking;
  743. /*Note: this needs to change to some qdf_* type */
  744. qdf_semaphore_t *sem_ptr;
  745. } wait;
  746. };
  747. /* DP soc struct definition */
  748. struct cdp_soc_t {
  749. struct cdp_ops *ops;
  750. struct ol_if_ops *ol_ops;
  751. };
  752. /*
  753. * cdp_pdev_param_type: different types of parameters
  754. * to set values in pdev
  755. * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
  756. * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
  757. * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
  758. * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
  759. * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
  760. * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
  761. * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
  762. * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
  763. * @CDP_INGRESS_STATS: Accumulate ingress statistics
  764. * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
  765. * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
  766. */
  767. enum cdp_pdev_param_type {
  768. CDP_CONFIG_DEBUG_SNIFFER,
  769. CDP_CONFIG_BPR_ENABLE,
  770. CDP_CONFIG_PRIMARY_RADIO,
  771. CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
  772. CDP_CONFIG_IGMPMLD_OVERRIDE,
  773. CDP_CONFIG_IGMPMLD_TID,
  774. CDP_CONFIG_ARP_DBG_CONF,
  775. CDP_CONFIG_CAPTURE_LATENCY,
  776. CDP_INGRESS_STATS,
  777. CDP_OSIF_DROP,
  778. CDP_CONFIG_ENH_RX_CAPTURE,
  779. CDP_CONFIG_TX_CAPTURE,
  780. };
  781. /**
  782. * cdp_rx_enh_capture_mode - Rx enhanced capture modes
  783. * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
  784. * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
  785. * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
  786. */
  787. enum cdp_rx_enh_capture_mode {
  788. CDP_RX_ENH_CAPTURE_DISABLED = 0,
  789. CDP_RX_ENH_CAPTURE_MPDU,
  790. CDP_RX_ENH_CAPTURE_MPDU_MSDU,
  791. };
  792. /*
  793. * enum cdp_pdev_bpr_param - different types of parameters
  794. * to set value in pdev
  795. * @CDP_BPR_DISABLE: Set bpr to disable state
  796. * @CDP_BPR_ENABLE: set bpr to enable state
  797. *
  798. * Enum indicating bpr state to enable/disable.
  799. */
  800. enum cdp_pdev_bpr_param {
  801. CDP_BPR_DISABLE,
  802. CDP_BPR_ENABLE,
  803. };
  804. /*
  805. * cdp_vdev_param_type: different types of parameters
  806. * to set values in vdev
  807. * @CDP_ENABLE_NAWDS: set nawds enable/disable
  808. * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
  809. * @CDP_ENABLE_WDS: wds sta
  810. * @CDP_ENABLE_MEC: MEC enable flags
  811. * @CDP_ENABLE_PROXYSTA: proxy sta
  812. * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
  813. * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
  814. * @CDP_ENABLE_CIPHER : set cipher type based on security
  815. * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
  816. */
  817. enum cdp_vdev_param_type {
  818. CDP_ENABLE_NAWDS,
  819. CDP_ENABLE_MCAST_EN,
  820. CDP_ENABLE_WDS,
  821. CDP_ENABLE_MEC,
  822. CDP_ENABLE_DA_WAR,
  823. CDP_ENABLE_PROXYSTA,
  824. CDP_UPDATE_TDLS_FLAGS,
  825. CDP_CFG_WDS_AGING_TIMER,
  826. CDP_ENABLE_AP_BRIDGE,
  827. CDP_ENABLE_CIPHER,
  828. CDP_ENABLE_QWRAP_ISOLATION
  829. };
  830. #define TXRX_FW_STATS_TXSTATS 1
  831. #define TXRX_FW_STATS_RXSTATS 2
  832. #define TXRX_FW_STATS_RX_RATE_INFO 3
  833. #define TXRX_FW_STATS_PHYSTATS 4
  834. #define TXRX_FW_STATS_PHYSTATS_CONCISE 5
  835. #define TXRX_FW_STATS_TX_RATE_INFO 6
  836. #define TXRX_FW_STATS_TID_STATE 7
  837. #define TXRX_FW_STATS_HOST_STATS 8
  838. #define TXRX_FW_STATS_CLEAR_HOST_STATS 9
  839. #define TXRX_FW_STATS_CE_STATS 10
  840. #define TXRX_FW_STATS_VOW_UMAC_COUNTER 11
  841. #define TXRX_FW_STATS_ME_STATS 12
  842. #define TXRX_FW_STATS_TXBF_INFO 13
  843. #define TXRX_FW_STATS_SND_INFO 14
  844. #define TXRX_FW_STATS_ERROR_INFO 15
  845. #define TXRX_FW_STATS_TX_SELFGEN_INFO 16
  846. #define TXRX_FW_STATS_TX_MU_INFO 17
  847. #define TXRX_FW_SIFS_RESP_INFO 18
  848. #define TXRX_FW_RESET_STATS 19
  849. #define TXRX_FW_MAC_WDOG_STATS 20
  850. #define TXRX_FW_MAC_DESC_STATS 21
  851. #define TXRX_FW_MAC_FETCH_MGR_STATS 22
  852. #define TXRX_FW_MAC_PREFETCH_MGR_STATS 23
  853. #define TXRX_FW_STATS_DURATION_INFO 24
  854. #define TXRX_FW_STATS_DURATION_INFO_RESET 25
  855. #define TXRX_FW_HALPHY_STATS 26
  856. #define TXRX_FW_COEX_STATS 27
  857. #define PER_RADIO_FW_STATS_REQUEST 0
  858. #define PER_VDEV_FW_STATS_REQUEST 1
  859. /**
  860. * enum data_stall_log_event_indicator - Module triggering data stall
  861. * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
  862. * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
  863. * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
  864. * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
  865. *
  866. * Enum indicating the module that indicates data stall event
  867. */
  868. enum data_stall_log_event_indicator {
  869. DATA_STALL_LOG_INDICATOR_UNUSED,
  870. DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
  871. DATA_STALL_LOG_INDICATOR_FIRMWARE,
  872. DATA_STALL_LOG_INDICATOR_FRAMEWORK,
  873. };
  874. /**
  875. * enum data_stall_log_event_type - data stall event type
  876. * @DATA_STALL_LOG_NONE
  877. * @DATA_STALL_LOG_FW_VDEV_PAUSE
  878. * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
  879. * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
  880. * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
  881. * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
  882. * @DATA_STALL_LOG_FW_WDOG_ERRORS
  883. * @DATA_STALL_LOG_BB_WDOG_ERROR
  884. * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
  885. * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
  886. * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
  887. * @DATA_STALL_LOG_NUD_FAILURE
  888. *
  889. * Enum indicating data stall event type
  890. */
  891. enum data_stall_log_event_type {
  892. DATA_STALL_LOG_NONE,
  893. DATA_STALL_LOG_FW_VDEV_PAUSE,
  894. DATA_STALL_LOG_HWSCHED_CMD_FILTER,
  895. DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
  896. DATA_STALL_LOG_FW_RX_REFILL_FAILED,
  897. DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
  898. DATA_STALL_LOG_FW_WDOG_ERRORS,
  899. DATA_STALL_LOG_BB_WDOG_ERROR,
  900. DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
  901. /* Stall events triggered by host/framework start from 0x100 onwards. */
  902. DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
  903. DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
  904. DATA_STALL_LOG_NUD_FAILURE,
  905. };
  906. /**
  907. * enum data_stall_log_recovery_type - data stall recovery type
  908. * @DATA_STALL_LOG_RECOVERY_NONE,
  909. * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  910. * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
  911. *
  912. * Enum indicating data stall recovery type
  913. */
  914. enum data_stall_log_recovery_type {
  915. DATA_STALL_LOG_RECOVERY_NONE = 0,
  916. DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  917. DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
  918. };
  919. /**
  920. * struct data_stall_event_info - data stall info
  921. * @indicator: Module triggering data stall
  922. * @data_stall_type: data stall event type
  923. * @vdev_id_bitmap: vdev_id_bitmap
  924. * @pdev_id: pdev id
  925. * @recovery_type: data stall recovery type
  926. */
  927. struct data_stall_event_info {
  928. uint32_t indicator;
  929. uint32_t data_stall_type;
  930. uint32_t vdev_id_bitmap;
  931. uint32_t pdev_id;
  932. uint32_t recovery_type;
  933. };
  934. typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
  935. /*
  936. * enum cdp_stats - options for host and firmware
  937. * statistics
  938. * @CDP_TXRX_STATS_1: HTT Pdev tx stats
  939. * @CDP_TXRX_STATS_2: HTT Pdev rx stats
  940. * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
  941. * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
  942. * @CDP_TXRX_STATS_5: HTT Pdev error stats
  943. * @CDP_TXRX_STATS_6: HTT TQM stats
  944. * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
  945. * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
  946. * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
  947. * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
  948. * @CDP_TXRX_STATS_11: HTT Peer stats
  949. * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
  950. * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
  951. * @CDP_TXRX_STATS_14: HTT Ring interface info stats
  952. * @CDP_TXRX_STATS_15: HTT SRNG info stats
  953. * @CDP_TXRX_STATS_16: HTT SFM info stats
  954. * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
  955. * @CDP_TXRX_STATS_18: HTT Peer list details
  956. * @CDP_TXRX_STATS_19: Reserved
  957. * @CDP_TXRX_STATS_20: Reset Host stats
  958. * @CDP_TXRX_STATS_21: Host Rx rate stats
  959. * @CDP_TXRX_STATS_22: Host Tx rate stats
  960. * @CDP_TXRX_STATS_23: Host Tx stats
  961. * @CDP_TXRX_STATS_24: Host Rx stats
  962. * @CDP_TXRX_STATS_25: Host Ast stats
  963. * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
  964. * @CDP_TXRX_STATS_27: Host Monitor mode stats
  965. * @CDP_TXRX_STATS_28: Host Peer entry stats
  966. * @CDP_TXRX_STATS_29: Host Soc config params info
  967. * @CDP_TXRX_STATS_30: Host Pdev config params info
  968. * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
  969. */
  970. enum cdp_stats {
  971. CDP_TXRX_STATS_0 = 0,
  972. CDP_TXRX_STATS_1,
  973. CDP_TXRX_STATS_2,
  974. CDP_TXRX_STATS_3,
  975. CDP_TXRX_STATS_4,
  976. CDP_TXRX_STATS_5,
  977. CDP_TXRX_STATS_6,
  978. CDP_TXRX_STATS_7,
  979. CDP_TXRX_STATS_8,
  980. CDP_TXRX_STATS_9,
  981. CDP_TXRX_STATS_10,
  982. CDP_TXRX_STATS_11,
  983. CDP_TXRX_STATS_12,
  984. CDP_TXRX_STATS_13,
  985. CDP_TXRX_STATS_14,
  986. CDP_TXRX_STATS_15,
  987. CDP_TXRX_STATS_16,
  988. CDP_TXRX_STATS_17,
  989. CDP_TXRX_STATS_18,
  990. CDP_TXRX_STATS_19,
  991. CDP_TXRX_STATS_20,
  992. CDP_TXRX_STATS_21,
  993. CDP_TXRX_STATS_22,
  994. CDP_TXRX_STATS_23,
  995. CDP_TXRX_STATS_24,
  996. CDP_TXRX_STATS_25,
  997. CDP_TXRX_STATS_26,
  998. CDP_TXRX_STATS_27,
  999. CDP_TXRX_STATS_28,
  1000. CDP_TXRX_STATS_29,
  1001. CDP_TXRX_STATS_30,
  1002. CDP_TXRX_STATS_31,
  1003. CDP_TXRX_STATS_HTT_MAX = 256,
  1004. CDP_TXRX_MAX_STATS = 265,
  1005. };
  1006. /*
  1007. * Different Stat update types sent to OL_IF
  1008. * @UPDATE_PEER_STATS: update peer stats
  1009. * @UPDATE_VDEV_STATS: update vdev stats
  1010. * @UPDATE_PDE_STATS: Update pdev stats
  1011. */
  1012. enum cdp_stat_update_type {
  1013. UPDATE_PEER_STATS = 0,
  1014. UPDATE_VDEV_STATS = 1,
  1015. UPDATE_PDEV_STATS = 2,
  1016. };
  1017. /*
  1018. * struct cdp_tx_sojourn_stats - Tx sojourn stats
  1019. * @ppdu_seq_id: ppdu_seq_id from tx completion
  1020. * @avg_sojourn_msdu: average sojourn msdu time
  1021. * @sum_sojourn_msdu: sum sojourn msdu time
  1022. * @num_msdu: number of msdus per ppdu
  1023. * @cookie: cookie to be used by upper layer
  1024. */
  1025. struct cdp_tx_sojourn_stats {
  1026. uint32_t ppdu_seq_id;
  1027. qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
  1028. uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
  1029. uint32_t num_msdus[CDP_DATA_TID_MAX];
  1030. struct cdp_stats_cookie *cookie;
  1031. };
  1032. /**
  1033. * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
  1034. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1035. * @tid: TID number
  1036. * @peer_id: Peer ID
  1037. * @frame_ctrl: frame control field in 802.11 header
  1038. * @qos_ctrl: QoS control field in 802.11 header
  1039. * @mpdu_tried: number of mpdus tried
  1040. * @mpdu_success: number of mpdus successfully transmitted
  1041. * @long_retries: long retries
  1042. * @short_retries: short retries
  1043. * @is_ampdu: mpdu aggregate or non-aggregate?
  1044. * @success_bytes: bytes successfully transmitted
  1045. * @retry_bytes: bytes retried
  1046. * @failed_msdus: MSDUs failed transmission
  1047. * @duration: user duration in ppdu
  1048. * @ltf_size: ltf_size
  1049. * @stbc: stbc
  1050. * @he_re: he_re (range extension)
  1051. * @txbf: txbf
  1052. * @bw: Transmission bandwidth
  1053. * <enum 2 transmit_bw_20_MHz>
  1054. * <enum 3 transmit_bw_40_MHz>
  1055. * <enum 4 transmit_bw_80_MHz>
  1056. * <enum 5 transmit_bw_160_MHz>
  1057. * @nss: NSS 1,2, ...8
  1058. * @mcs: MCS index
  1059. * @preamble: preamble
  1060. * @gi: guard interval 800/400/1600/3200 ns
  1061. * @dcm: dcm
  1062. * @ldpc: ldpc
  1063. * @delayed_ba: delayed ba bit
  1064. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  1065. * UL_BSR_TRIG/UNKNOWN
  1066. * @ba_seq_no: Block Ack sequence number
  1067. * @ba_bitmap: Block Ack bitmap
  1068. * @start_seqa: Sequence number of first MPDU
  1069. * @enq_bitmap: Enqueue MPDU bitmap
  1070. * @ru_start: RU start index
  1071. * @ru_tones: RU tones length
  1072. * @is_mcast: MCAST or UCAST
  1073. * @tx_rate: Transmission Rate
  1074. * @user_pos: user position
  1075. * @mu_group_id: mu group id
  1076. * @rix: rate index
  1077. * @cookie: cookie to used by upper layer
  1078. * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
  1079. * @ppdu_cookie: 16-bit ppdu_cookie
  1080. */
  1081. struct cdp_tx_completion_ppdu_user {
  1082. uint32_t completion_status:8,
  1083. tid:8,
  1084. peer_id:16;
  1085. uint8_t mac_addr[6];
  1086. uint32_t frame_ctrl:16,
  1087. qos_ctrl:16;
  1088. uint32_t mpdu_tried_ucast:16,
  1089. mpdu_tried_mcast:16;
  1090. uint16_t mpdu_success:16;
  1091. uint16_t mpdu_failed:16;
  1092. uint32_t long_retries:4,
  1093. short_retries:4,
  1094. tx_ratecode:8,
  1095. is_ampdu:1,
  1096. ppdu_type:5;
  1097. uint32_t success_bytes;
  1098. uint32_t retry_bytes;
  1099. uint32_t failed_bytes;
  1100. uint32_t success_msdus:16,
  1101. retry_msdus:16;
  1102. uint32_t failed_msdus:16,
  1103. duration:16;
  1104. uint32_t ltf_size:2,
  1105. stbc:1,
  1106. he_re:1,
  1107. txbf:4,
  1108. bw:4,
  1109. nss:4,
  1110. mcs:4,
  1111. preamble:4,
  1112. gi:4,
  1113. dcm:1,
  1114. ldpc:1,
  1115. delayed_ba:1;
  1116. uint32_t ba_seq_no;
  1117. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1118. uint32_t start_seq;
  1119. uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1120. uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1121. uint32_t num_mpdu:9,
  1122. num_msdu:16;
  1123. uint32_t tx_duration;
  1124. uint16_t ru_start;
  1125. uint16_t ru_tones;
  1126. bool is_mcast;
  1127. uint32_t tx_rate;
  1128. uint32_t tx_ratekbps;
  1129. /*ack rssi for separate chains*/
  1130. uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
  1131. bool ack_rssi_valid;
  1132. uint32_t user_pos;
  1133. uint32_t mu_group_id;
  1134. uint32_t rix;
  1135. struct cdp_stats_cookie *cookie;
  1136. uint8_t is_ppdu_cookie_valid;
  1137. uint16_t ppdu_cookie;
  1138. };
  1139. /**
  1140. * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
  1141. * @ppdu_id: PPDU id
  1142. * @duration: user duration in ppdu
  1143. * @frame_type: frame type MGMT/CTRL/DATA/BAR
  1144. * @frame_ctrl: frame control field in 802.11 header
  1145. * @qos_ctrl: QoS control field in 802.11 header
  1146. * @tid: TID number
  1147. * @num_msdu: number of msdu in MPDU
  1148. * @seq_no: Sequence number of first MPDU
  1149. * @ltf_size: ltf_size
  1150. * @stbc: stbc
  1151. * @he_re: he_re (range extension)
  1152. * @txbf: txbf
  1153. * @bw: Transmission bandwidth
  1154. * <enum 2 transmit_bw_20_MHz>
  1155. * <enum 3 transmit_bw_40_MHz>
  1156. * <enum 4 transmit_bw_80_MHz>
  1157. * <enum 5 transmit_bw_160_MHz>
  1158. * @nss: NSS 1,2, ...8
  1159. * @mcs: MCS index
  1160. * @preamble: preamble
  1161. * @gi: guard interval 800/400/1600/3200 ns
  1162. * @channel: frequency
  1163. * @channel_num: channel number
  1164. * @ack_rssi: ack rssi
  1165. * @ldpc: ldpc
  1166. * @tx_rate: Transmission Rate
  1167. * @mac_address: peer mac address
  1168. * @bss_mac_address: bss mac address
  1169. * @ppdu_start_timestamp: TSF at PPDU start
  1170. * @ppdu_end_timestamp: TSF at PPDU end
  1171. * @ba_start_seq: Block Ack sequence number
  1172. * @ba_bitmap: Block Ack bitmap
  1173. * @ppdu_cookie: 16-bit ppdu_cookie
  1174. */
  1175. struct cdp_tx_indication_mpdu_info {
  1176. uint32_t ppdu_id;
  1177. uint32_t tx_duration;
  1178. uint16_t frame_type;
  1179. uint16_t frame_ctrl;
  1180. uint16_t qos_ctrl;
  1181. uint8_t tid;
  1182. uint32_t num_msdu;
  1183. uint32_t seq_no;
  1184. uint32_t ltf_size:2,
  1185. he_re:1,
  1186. txbf:4,
  1187. bw:4,
  1188. nss:4,
  1189. mcs:4,
  1190. preamble:4,
  1191. gi:4;
  1192. uint32_t channel;
  1193. uint8_t channel_num;
  1194. uint32_t ack_rssi;
  1195. uint32_t ldpc;
  1196. uint32_t tx_rate;
  1197. uint8_t mac_address[QDF_MAC_ADDR_SIZE];
  1198. uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
  1199. uint32_t ppdu_start_timestamp;
  1200. uint32_t ppdu_end_timestamp;
  1201. uint32_t ba_start_seq;
  1202. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1203. uint16_t ppdu_cookie;
  1204. };
  1205. /**
  1206. * struct cdp_tx_indication_info - Tx capture information
  1207. * @mpdu_info: Tx MPDU completion information
  1208. * @mpdu_nbuf: reconstructed mpdu packet
  1209. */
  1210. struct cdp_tx_indication_info {
  1211. struct cdp_tx_indication_mpdu_info mpdu_info;
  1212. qdf_nbuf_t mpdu_nbuf;
  1213. };
  1214. /**
  1215. * struct cdp_tx_completion_ppdu - Tx PPDU completion information
  1216. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1217. * @ppdu_id: PPDU Id
  1218. * @ppdu_seq_id: ppdu sequence id for sojourn stats
  1219. * @vdev_id: VAP Id
  1220. * @num_users: Number of users
  1221. * @num_mpdu: Number of MPDUs in PPDU
  1222. * @num_msdu: Number of MSDUs in PPDU
  1223. * @frame_type: frame SU or MU
  1224. * @frame_ctrl: frame control of 80211 header
  1225. * @channel: Channel informartion
  1226. * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
  1227. * @tx_duration: PPDU airtime
  1228. * @ppdu_start_timestamp: TSF at PPDU start
  1229. * @ppdu_end_timestamp: TSF at PPDU end
  1230. * @ack_timestamp: TSF at the reception of ACK
  1231. * @user: per-User stats (array of per-user structures)
  1232. * @mpdu_q: queue of mpdu in a ppdu
  1233. */
  1234. struct cdp_tx_completion_ppdu {
  1235. uint32_t ppdu_id;
  1236. uint32_t ppdu_seq_id;
  1237. uint16_t vdev_id;
  1238. uint32_t num_users;
  1239. uint8_t last_usr_index;
  1240. uint32_t num_mpdu:9,
  1241. num_msdu:16;
  1242. uint16_t frame_type;
  1243. uint16_t frame_ctrl;
  1244. uint16_t channel;
  1245. uint16_t phy_mode;
  1246. uint32_t ack_rssi;
  1247. uint32_t tx_duration;
  1248. uint32_t ppdu_start_timestamp;
  1249. uint32_t ppdu_end_timestamp;
  1250. uint32_t ack_timestamp;
  1251. struct cdp_tx_completion_ppdu_user user[CDP_MU_MAX_USERS];
  1252. qdf_nbuf_queue_t mpdu_q;
  1253. };
  1254. /**
  1255. * struct cdp_dev_stats - Network device stats structure
  1256. * @tx_packets: Tx total packets transmitted
  1257. * @tx_bytes : Tx total bytes transmitted
  1258. * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
  1259. * @tx_dropped: Tx dropped is same as tx errors as above
  1260. * @rx_packets: Rx total packets transmitted
  1261. * @rx_bytes : Rx total bytes transmitted
  1262. */
  1263. struct cdp_dev_stats {
  1264. uint32_t tx_packets;
  1265. uint32_t tx_bytes;
  1266. uint32_t tx_errors;
  1267. uint32_t tx_dropped;
  1268. uint32_t rx_packets;
  1269. uint32_t rx_bytes;
  1270. };
  1271. /**
  1272. * struct cdp_rate_stats - Tx/Rx Rate statistics
  1273. * @bw: Indicates the BW of the upcoming transmission -
  1274. * <enum 2 transmit_bw_20_MHz>
  1275. * <enum 3 transmit_bw_40_MHz>
  1276. * <enum 4 transmit_bw_80_MHz>
  1277. * <enum 5 transmit_bw_160_MHz>
  1278. * @pkt_type: Transmit Packet Type
  1279. * @stbc: When set, STBC transmission rate was used
  1280. * @ldpc: When set, use LDPC transmission rates
  1281. * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
  1282. * <enum 1 0_4_us_sgi > Legacy short GI
  1283. * <enum 2 1_6_us_sgi > HE related GI
  1284. * <enum 3 3_2_us_sgi > HE
  1285. * @mcs: Transmit MCS Rate
  1286. * @ofdma: Set when the transmission was an OFDMA transmission
  1287. * @tones_in_ru: The number of tones in the RU used.
  1288. * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
  1289. * @peer_id: Peer ID of the flow or MPDU queue
  1290. * @tid: TID of the flow or MPDU queue
  1291. */
  1292. struct cdp_rate_stats {
  1293. uint32_t rate_stats_info_valid:1,
  1294. bw:2,
  1295. pkt_type:4,
  1296. stbc:1,
  1297. ldpc:1,
  1298. sgi:2,
  1299. mcs:4,
  1300. ofdma:1,
  1301. tones_in_ru:12,
  1302. resvd0:4;
  1303. uint32_t tsf;
  1304. uint16_t peer_id;
  1305. uint8_t tid;
  1306. };
  1307. /**
  1308. * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
  1309. * @ppdu_id: PPDU to which this MSDU belongs
  1310. * @transmit_cnt: Number of times this frame has been transmitted
  1311. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  1312. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  1313. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  1314. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  1315. * @extd: Extended structure containing rate statistics
  1316. */
  1317. struct cdp_tx_completion_msdu {
  1318. uint32_t ppdu_id;
  1319. uint8_t transmit_cnt;
  1320. uint32_t ack_frame_rssi:8,
  1321. resvd0:1,
  1322. first_msdu:1,
  1323. last_msdu:1,
  1324. msdu_part_of_amsdu:1,
  1325. resvd1:20;
  1326. struct cdp_rate_stats extd;
  1327. };
  1328. /**
  1329. * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
  1330. * @ppdu_id: PPDU Id
  1331. * @is_ampdu: mpdu aggregate or non-aggregate?
  1332. * @num_mpdu: Number of MPDUs in PPDU
  1333. * @reserved: Reserved bits for future use
  1334. * @num_msdu: Number of MSDUs in PPDU
  1335. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  1336. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  1337. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  1338. * @duration: PPDU duration
  1339. * @tid: TID number
  1340. * @peer_id: Peer ID
  1341. * @vdev_id: VAP ID
  1342. * @mac_addr: Peer MAC Address
  1343. * @first_data_seq_ctrl: Sequence control field of first data frame
  1344. * @ltf_size: ltf_size
  1345. * @stbc: When set, STBC rate was used
  1346. * @he_re: he_re (range extension)
  1347. * @bw: Bandwidth
  1348. * <enum 0 bw_20_MHz>
  1349. * <enum 1 bw_40_MHz>
  1350. * <enum 2 bw_80_MHz>
  1351. * <enum 3 bw_160_MHz>
  1352. * @nss: NSS 1,2, ...8
  1353. * @mcs: MCS index
  1354. * @preamble: preamble
  1355. * @gi: <enum 0 0_8_us_sgi > Legacy normal GI
  1356. * <enum 1 0_4_us_sgi > Legacy short GI
  1357. * <enum 2 1_6_us_sgi > HE related GI
  1358. * <enum 3 3_2_us_sgi > HE
  1359. * @dcm: dcm
  1360. * @ldpc: ldpc
  1361. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  1362. * UL_BSR_TRIG/UNKNOWN
  1363. * @rssi: RSSI value (units = dB above noise floor)
  1364. * @timestamp: TSF at the reception of PPDU
  1365. * @length: PPDU length
  1366. * @channel: Channel informartion
  1367. * @lsig_A: L-SIG in 802.11 PHY header
  1368. * @frame_ctrl: frame control field
  1369. * @rix: rate index
  1370. * @rssi_chain: rssi chain per nss per bw
  1371. * @cookie: cookie to used by upper layer
  1372. */
  1373. struct cdp_rx_indication_ppdu {
  1374. uint32_t ppdu_id;
  1375. uint16_t is_ampdu:1,
  1376. num_mpdu:9,
  1377. reserved:6;
  1378. uint32_t num_msdu;
  1379. uint32_t num_bytes;
  1380. uint16_t udp_msdu_count;
  1381. uint16_t tcp_msdu_count;
  1382. uint16_t other_msdu_count;
  1383. uint16_t duration;
  1384. uint32_t tid:8,
  1385. peer_id:16;
  1386. uint8_t vdev_id;
  1387. uint8_t mac_addr[6];
  1388. uint16_t first_data_seq_ctrl;
  1389. union {
  1390. uint32_t rate_info;
  1391. struct {
  1392. uint32_t ltf_size:2,
  1393. stbc:1,
  1394. he_re:1,
  1395. bw:4,
  1396. nss:4,
  1397. mcs:4,
  1398. preamble:4,
  1399. gi:4,
  1400. dcm:1,
  1401. ldpc:1,
  1402. ppdu_type:5;
  1403. };
  1404. } u;
  1405. uint32_t rix;
  1406. uint32_t lsig_a;
  1407. uint32_t rssi;
  1408. uint64_t timestamp;
  1409. uint32_t length;
  1410. uint8_t channel;
  1411. uint8_t beamformed;
  1412. uint32_t rx_ratekbps;
  1413. uint32_t ppdu_rx_rate;
  1414. uint32_t retries;
  1415. uint32_t rx_byte_count;
  1416. uint8_t rx_ratecode;
  1417. uint8_t fcs_error_mpdus;
  1418. uint16_t frame_ctrl;
  1419. int8_t rssi_chain[SS_COUNT][MAX_BW];
  1420. struct cdp_stats_cookie *cookie;
  1421. };
  1422. /**
  1423. * struct cdp_rx_indication_msdu - Rx MSDU info
  1424. * @ppdu_id: PPDU to which the MSDU belongs
  1425. * @msdu_len: Length of MSDU in bytes
  1426. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  1427. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  1428. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  1429. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  1430. * @extd: Extended structure containing rate statistics
  1431. */
  1432. struct cdp_rx_indication_msdu {
  1433. uint32_t ppdu_id;
  1434. uint16_t msdu_len;
  1435. uint32_t ack_frame_rssi:8,
  1436. resvd0:1,
  1437. first_msdu:1,
  1438. last_msdu:1,
  1439. msdu_part_of_amsdu:1,
  1440. msdu_part_of_ampdu:1,
  1441. resvd1:19;
  1442. struct cdp_rate_stats extd;
  1443. };
  1444. /**
  1445. * struct cdp_config_params - Propagate configuration parameters to datapath
  1446. * @tso_enable: Enable/Disable TSO
  1447. * @lro_enable: Enable/Disable LRO
  1448. * @gro_enable: Enable/Disable GRO
  1449. * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
  1450. * @tcp_Udp_ChecksumOffload: Enable/Disable tcp-Udp checksum Offload
  1451. * @napi_enable: Enable/Disable Napi
  1452. * @ipa_enable: Flag indicating if IPA is enabled or not
  1453. * @tx_flow_stop_queue_threshold: Value to Pause tx queues
  1454. * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
  1455. * tx queue
  1456. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  1457. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  1458. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  1459. */
  1460. struct cdp_config_params {
  1461. unsigned int tso_enable:1;
  1462. unsigned int lro_enable:1;
  1463. unsigned int gro_enable:1;
  1464. unsigned int flow_steering_enable:1;
  1465. unsigned int tcp_udp_checksumoffload:1;
  1466. unsigned int napi_enable:1;
  1467. unsigned int ipa_enable:1;
  1468. /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
  1469. uint8_t tx_flow_stop_queue_threshold;
  1470. uint8_t tx_flow_start_queue_offset;
  1471. uint32_t tx_comp_loop_pkt_limit;
  1472. uint32_t rx_reap_loop_pkt_limit;
  1473. uint32_t rx_hp_oos_update_limit;
  1474. };
  1475. /**
  1476. * cdp_txrx_stats_req: stats request wrapper
  1477. * used to pass request information to cdp layer
  1478. * @stats: type of stats requested
  1479. * @param0: opaque argument 0 to be passed to htt
  1480. * @param1: opaque argument 1 to be passed to htt
  1481. * @param2: opaque argument 2 to be passed to htt
  1482. * @param3: opaque argument 3 to be passed to htt
  1483. * @mac id: mac_id
  1484. */
  1485. struct cdp_txrx_stats_req {
  1486. enum cdp_stats stats;
  1487. uint32_t param0;
  1488. uint32_t param1;
  1489. uint32_t param2;
  1490. uint32_t param3;
  1491. uint32_t cookie_val;
  1492. uint8_t mac_id;
  1493. char *peer_addr;
  1494. };
  1495. /**
  1496. * struct cdp_monitor_filter - monitor filter info
  1497. * @mode: set filter mode
  1498. * @fp_mgmt: set Filter Pass MGMT Configuration
  1499. * @fp_ctrl: set Filter Pass CTRL Configuration
  1500. * @fp_data: set Filter Pass DATA Configuration
  1501. * @mo_mgmt: set Monitor Other MGMT Configuration
  1502. * @mo_ctrl: set Monitor Other CTRL Configuration
  1503. * @mo_data: set Monitor other DATA Configuration
  1504. *
  1505. */
  1506. struct cdp_monitor_filter {
  1507. uint16_t mode;
  1508. uint16_t fp_mgmt;
  1509. uint16_t fp_ctrl;
  1510. uint16_t fp_data;
  1511. uint16_t mo_mgmt;
  1512. uint16_t mo_ctrl;
  1513. uint16_t mo_data;
  1514. };
  1515. /**
  1516. * cdp_dp_cfg - dp ini config enum
  1517. */
  1518. enum cdp_dp_cfg {
  1519. cfg_dp_enable_data_stall,
  1520. cfg_dp_enable_ip_tcp_udp_checksum_offload,
  1521. cfg_dp_tso_enable,
  1522. cfg_dp_lro_enable,
  1523. cfg_dp_gro_enable,
  1524. cfg_dp_tx_flow_start_queue_offset,
  1525. cfg_dp_tx_flow_stop_queue_threshold,
  1526. cfg_dp_ipa_uc_tx_buf_size,
  1527. cfg_dp_ipa_uc_tx_partition_base,
  1528. cfg_dp_ipa_uc_rx_ind_ring_count,
  1529. cfg_dp_enable_flow_steering,
  1530. cfg_dp_reorder_offload_supported,
  1531. cfg_dp_ce_classify_enable,
  1532. cfg_dp_disable_intra_bss_fwd,
  1533. };
  1534. /**
  1535. * struct cdp_peer_cookie - cookie used when creating peer
  1536. * @peer_id: peer id
  1537. * @mac_addr: MAC address of peer
  1538. * @cookie: cookie to be used by consumer
  1539. * @ctx: context passed to be used by consumer
  1540. */
  1541. struct cdp_peer_cookie {
  1542. uint8_t peer_id;
  1543. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  1544. uint8_t cookie;
  1545. struct cdp_stats_cookie *ctx;
  1546. };
  1547. #endif