cdp_txrx_cmn_struct.h 36 KB

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