cdp_txrx_cmn_struct.h 42 KB

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