cdp_txrx_cmn_struct.h 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216
  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_tx_flow_control_fp - tx flow control notification
  396. * function from txrx to OS shim
  397. * @osif_dev - the virtual device's OS shim object
  398. * @tx_resume - tx os q should be resumed or not
  399. */
  400. typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
  401. bool tx_resume);
  402. /**
  403. * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
  404. * function from txrx to OS shim
  405. * @osif_dev - the virtual device's OS shim object
  406. *
  407. * Return: true if tx is paused by flow control
  408. */
  409. typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
  410. /**
  411. * ol_txrx_rx_fp - receive function to hand batches of data
  412. * frames from txrx to OS shim
  413. * @data_vdev - handle to the OSIF virtual device object
  414. * @msdu_list - list of network buffers
  415. */
  416. typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
  417. /**
  418. * ol_txrx_stats_rx_fp - receive function to hand batches of data
  419. * frames from txrx to OS shim
  420. * @skb: skb data
  421. * @osif_dev: the virtual device's OS shim object
  422. * @action: data packet type
  423. * @pkt_type: packet data type
  424. */
  425. typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
  426. void *osif_dev, enum connectivity_stats_pkt_status action,
  427. uint8_t *pkt_type);
  428. /**
  429. * ol_txrx_get_key_fp - function to gey key based on keyix and peer
  430. * mac address
  431. * @osif_dev - the virtual device's OS shim object
  432. * @key_buf - pointer to store key
  433. * @mac_addr - pointer to mac address
  434. * @keyix - key id
  435. */
  436. typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
  437. /**
  438. * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
  439. * packets in receive path.
  440. * @osif_dev - the virtual device's OS shim object
  441. * @list_head - poniter to head of receive packet queue to decap
  442. * @list_tail - poniter to tail of receive packet queue to decap
  443. * @peer - Peer handler
  444. */
  445. typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
  446. qdf_nbuf_t *list_head,
  447. qdf_nbuf_t *list_tail,
  448. struct cdp_peer *peer);
  449. /* ol_txrx_rx_fp - external tx free function to read per packet stats and
  450. * free tx buffer externally
  451. * @netbuf - tx network buffer
  452. */
  453. typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
  454. /**
  455. * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
  456. */
  457. typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
  458. qdf_nbuf_t mpdu_head,
  459. qdf_nbuf_t mpdu_tail);
  460. /**
  461. * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
  462. * MPDU (802.11 format)
  463. */
  464. typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
  465. qdf_nbuf_t mpdu,
  466. void *rx_status);
  467. /**
  468. * ol_txrx_proxy_arp_fp - proxy arp function pointer
  469. */
  470. typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
  471. qdf_nbuf_t netbuf);
  472. /*
  473. * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
  474. */
  475. typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
  476. qdf_nbuf_t netbuf);
  477. /**
  478. * ol_txrx_stats_callback - statistics notify callback
  479. */
  480. typedef void (*ol_txrx_stats_callback)(void *ctxt,
  481. enum htt_cmn_dbg_stats_type type,
  482. uint8_t *buf, int bytes);
  483. /**
  484. * ol_txrx_ops - (pointers to) the functions used for tx and rx
  485. * data xfer
  486. *
  487. * There are two portions of these txrx operations.
  488. * The rx portion is filled in by OSIF SW before calling
  489. * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
  490. * the txrx SW stores a copy of these rx function pointers, to use
  491. * as it delivers rx data frames to the OSIF SW.
  492. * The tx portion is filled in by the txrx SW inside
  493. * ol_txrx_osif_vdev_register; when the function call returns,
  494. * the OSIF SW stores a copy of these tx functions to use as it
  495. * delivers tx data frames to the txrx SW.
  496. *
  497. * @tx.std - the tx function pointer for standard data
  498. * frames This function pointer is set by the txrx SW
  499. * perform host-side transmit operations based on
  500. * whether a HL or LL host/target interface is in use.
  501. * @tx.flow_control_cb - the transmit flow control
  502. * function that is registered by the
  503. * OSIF which is called from txrx to
  504. * indicate whether the transmit OS
  505. * queues should be paused/resumed
  506. * @rx.std - the OS shim rx function to deliver rx data
  507. * frames to. This can have different values for
  508. * different virtual devices, e.g. so one virtual
  509. * device's OS shim directly hands rx frames to the OS,
  510. * but another virtual device's OS shim filters out P2P
  511. * messages before sending the rx frames to the OS. The
  512. * netbufs delivered to the osif_rx function are in the
  513. * format specified by the OS to use for tx and rx
  514. * frames (either 802.3 or native WiFi)
  515. * @rx.wai_check - the tx function pointer for WAPI frames
  516. * @rx.mon - the OS shim rx monitor function to deliver
  517. * monitor data to Though in practice, it is probable
  518. * that the same function will be used for delivering
  519. * rx monitor data for all virtual devices, in theory
  520. * each different virtual device can have a different
  521. * OS shim function for accepting rx monitor data. The
  522. * netbufs delivered to the osif_rx_mon function are in
  523. * 802.11 format. Each netbuf holds a 802.11 MPDU, not
  524. * an 802.11 MSDU. Depending on compile-time
  525. * configuration, each netbuf may also have a
  526. * monitor-mode encapsulation header such as a radiotap
  527. * header added before the MPDU contents.
  528. * @rx.std - the OS shim rx function to deliver rx data
  529. * @proxy_arp - proxy arp function pointer - specified by
  530. * OS shim, stored by txrx
  531. * @get_key - function pointer to get key of the peer with
  532. * specific key index
  533. */
  534. struct ol_txrx_ops {
  535. /* tx function pointers - specified by txrx, stored by OS shim */
  536. struct {
  537. ol_txrx_tx_fp tx;
  538. ol_txrx_tx_exc_fp tx_exception;
  539. ol_txrx_tx_free_ext_fp tx_free_ext;
  540. } tx;
  541. /* rx function pointers - specified by OS shim, stored by txrx */
  542. struct {
  543. ol_txrx_rx_fp rx;
  544. ol_txrx_rx_check_wai_fp wai_check;
  545. ol_txrx_rx_mon_fp mon;
  546. ol_txrx_stats_rx_fp stats_rx;
  547. ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
  548. } rx;
  549. /* proxy arp function pointer - specified by OS shim, stored by txrx */
  550. ol_txrx_proxy_arp_fp proxy_arp;
  551. ol_txrx_mcast_me_fp me_convert;
  552. ol_txrx_get_key_fp get_key;
  553. };
  554. /**
  555. * ol_txrx_stats_req - specifications of the requested
  556. * statistics
  557. */
  558. struct ol_txrx_stats_req {
  559. uint32_t stats_type_upload_mask; /* which stats to upload */
  560. uint32_t stats_type_reset_mask; /* which stats to reset */
  561. /* stats will be printed if either print element is set */
  562. struct {
  563. int verbose; /* verbose stats printout */
  564. int concise; /* concise stats printout (takes precedence) */
  565. } print; /* print uploaded stats */
  566. /* stats notify callback will be invoked if fp is non-NULL */
  567. struct {
  568. ol_txrx_stats_callback fp;
  569. void *ctxt;
  570. } callback;
  571. /* stats will be copied into the specified buffer if buf is non-NULL */
  572. struct {
  573. uint8_t *buf;
  574. int byte_limit; /* don't copy more than this */
  575. } copy;
  576. /*
  577. * If blocking is true, the caller will take the specified semaphore
  578. * to wait for the stats to be uploaded, and the driver will release
  579. * the semaphore when the stats are done being uploaded.
  580. */
  581. struct {
  582. int blocking;
  583. /*Note: this needs to change to some qdf_* type */
  584. qdf_semaphore_t *sem_ptr;
  585. } wait;
  586. };
  587. /* DP soc struct definition */
  588. struct cdp_soc_t {
  589. struct cdp_ops *ops;
  590. struct ol_if_ops *ol_ops;
  591. };
  592. /*
  593. * cdp_pdev_param_type: different types of parameters
  594. * to set values in pdev
  595. * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
  596. */
  597. enum cdp_pdev_param_type {
  598. CDP_CONFIG_DEBUG_SNIFFER,
  599. };
  600. /*
  601. * cdp_vdev_param_type: different types of parameters
  602. * to set values in vdev
  603. * @CDP_ENABLE_NAWDS: set nawds enable/disable
  604. * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
  605. * @CDP_ENABLE_WDS: wds sta
  606. * @CDP_ENABLE_PROXYSTA: proxy sta
  607. * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
  608. * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
  609. * @CDP_ENABLE_CIPHER : set cipher type based on security
  610. * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
  611. */
  612. enum cdp_vdev_param_type {
  613. CDP_ENABLE_NAWDS,
  614. CDP_ENABLE_MCAST_EN,
  615. CDP_ENABLE_WDS,
  616. CDP_ENABLE_PROXYSTA,
  617. CDP_UPDATE_TDLS_FLAGS,
  618. CDP_CFG_WDS_AGING_TIMER,
  619. CDP_ENABLE_AP_BRIDGE,
  620. CDP_ENABLE_CIPHER,
  621. CDP_ENABLE_QWRAP_ISOLATION
  622. };
  623. #define TXRX_FW_STATS_TXSTATS 1
  624. #define TXRX_FW_STATS_RXSTATS 2
  625. #define TXRX_FW_STATS_RX_RATE_INFO 3
  626. #define TXRX_FW_STATS_PHYSTATS 4
  627. #define TXRX_FW_STATS_PHYSTATS_CONCISE 5
  628. #define TXRX_FW_STATS_TX_RATE_INFO 6
  629. #define TXRX_FW_STATS_TID_STATE 7
  630. #define TXRX_FW_STATS_HOST_STATS 8
  631. #define TXRX_FW_STATS_CLEAR_HOST_STATS 9
  632. #define TXRX_FW_STATS_CE_STATS 10
  633. #define TXRX_FW_STATS_VOW_UMAC_COUNTER 11
  634. #define TXRX_FW_STATS_ME_STATS 12
  635. #define TXRX_FW_STATS_TXBF_INFO 13
  636. #define TXRX_FW_STATS_SND_INFO 14
  637. #define TXRX_FW_STATS_ERROR_INFO 15
  638. #define TXRX_FW_STATS_TX_SELFGEN_INFO 16
  639. #define TXRX_FW_STATS_TX_MU_INFO 17
  640. #define TXRX_FW_SIFS_RESP_INFO 18
  641. #define TXRX_FW_RESET_STATS 19
  642. #define TXRX_FW_MAC_WDOG_STATS 20
  643. #define TXRX_FW_MAC_DESC_STATS 21
  644. #define TXRX_FW_MAC_FETCH_MGR_STATS 22
  645. #define TXRX_FW_MAC_PREFETCH_MGR_STATS 23
  646. #define TXRX_FW_STATS_DURATION_INFO 24
  647. #define TXRX_FW_STATS_DURATION_INFO_RESET 25
  648. #define TXRX_FW_HALPHY_STATS 26
  649. #define TXRX_FW_COEX_STATS 27
  650. #define PER_RADIO_FW_STATS_REQUEST 0
  651. #define PER_VDEV_FW_STATS_REQUEST 1
  652. /**
  653. * enum data_stall_log_event_indicator - Module triggering data stall
  654. * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
  655. * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
  656. * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
  657. * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
  658. *
  659. * Enum indicating the module that indicates data stall event
  660. */
  661. enum data_stall_log_event_indicator {
  662. DATA_STALL_LOG_INDICATOR_UNUSED,
  663. DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
  664. DATA_STALL_LOG_INDICATOR_FIRMWARE,
  665. DATA_STALL_LOG_INDICATOR_FRAMEWORK,
  666. };
  667. /**
  668. * enum data_stall_log_event_type - data stall event type
  669. * @DATA_STALL_LOG_NONE
  670. * @DATA_STALL_LOG_FW_VDEV_PAUSE
  671. * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
  672. * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
  673. * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
  674. * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
  675. * @DATA_STALL_LOG_FW_WDOG_ERRORS
  676. * @DATA_STALL_LOG_BB_WDOG_ERROR
  677. * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
  678. * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
  679. * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
  680. * @DATA_STALL_LOG_NUD_FAILURE
  681. *
  682. * Enum indicating data stall event type
  683. */
  684. enum data_stall_log_event_type {
  685. DATA_STALL_LOG_NONE,
  686. DATA_STALL_LOG_FW_VDEV_PAUSE,
  687. DATA_STALL_LOG_HWSCHED_CMD_FILTER,
  688. DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
  689. DATA_STALL_LOG_FW_RX_REFILL_FAILED,
  690. DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
  691. DATA_STALL_LOG_FW_WDOG_ERRORS,
  692. DATA_STALL_LOG_BB_WDOG_ERROR,
  693. DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
  694. /* Stall events triggered by host/framework start from 0x100 onwards. */
  695. DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
  696. DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
  697. DATA_STALL_LOG_NUD_FAILURE,
  698. };
  699. /**
  700. * enum data_stall_log_recovery_type - data stall recovery type
  701. * @DATA_STALL_LOG_RECOVERY_NONE,
  702. * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  703. * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
  704. *
  705. * Enum indicating data stall recovery type
  706. */
  707. enum data_stall_log_recovery_type {
  708. DATA_STALL_LOG_RECOVERY_NONE = 0,
  709. DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  710. DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
  711. };
  712. /**
  713. * struct data_stall_event_info - data stall info
  714. * @indicator: Module triggering data stall
  715. * @data_stall_type: data stall event type
  716. * @vdev_id_bitmap: vdev_id_bitmap
  717. * @pdev_id: pdev id
  718. * @recovery_type: data stall recovery type
  719. */
  720. struct data_stall_event_info {
  721. uint32_t indicator;
  722. uint32_t data_stall_type;
  723. uint32_t vdev_id_bitmap;
  724. uint32_t pdev_id;
  725. uint32_t recovery_type;
  726. };
  727. typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
  728. /*
  729. * cdp_stats - options for host and firmware
  730. * statistics
  731. */
  732. enum cdp_stats {
  733. CDP_TXRX_STATS_0 = 0,
  734. CDP_TXRX_STATS_1,
  735. CDP_TXRX_STATS_2,
  736. CDP_TXRX_STATS_3,
  737. CDP_TXRX_STATS_4,
  738. CDP_TXRX_STATS_5,
  739. CDP_TXRX_STATS_6,
  740. CDP_TXRX_STATS_7,
  741. CDP_TXRX_STATS_8,
  742. CDP_TXRX_STATS_9,
  743. CDP_TXRX_STATS_10,
  744. CDP_TXRX_STATS_11,
  745. CDP_TXRX_STATS_12,
  746. CDP_TXRX_STATS_13,
  747. CDP_TXRX_STATS_14,
  748. CDP_TXRX_STATS_15,
  749. CDP_TXRX_STATS_16,
  750. CDP_TXRX_STATS_17,
  751. CDP_TXRX_STATS_18,
  752. CDP_TXRX_STATS_19,
  753. CDP_TXRX_STATS_20,
  754. CDP_TXRX_STATS_21,
  755. CDP_TXRX_STATS_22,
  756. CDP_TXRX_STATS_23,
  757. CDP_TXRX_STATS_24,
  758. CDP_TXRX_STATS_25,
  759. CDP_TXRX_STATS_26,
  760. CDP_TXRX_STATS_27,
  761. CDP_TXRX_STATS_HTT_MAX = 256,
  762. CDP_TXRX_MAX_STATS = 512,
  763. };
  764. /*
  765. * Different Stat update types sent to OL_IF
  766. * @UPDATE_PEER_STATS: update peer stats
  767. * @UPDATE_VDEV_STATS: update vdev stats
  768. * @UPDATE_PDE_STATS: Update pdev stats
  769. */
  770. enum cdp_stat_update_type {
  771. UPDATE_PEER_STATS = 0,
  772. UPDATE_VDEV_STATS = 1,
  773. UPDATE_PDEV_STATS = 2,
  774. };
  775. /**
  776. * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
  777. * @completion_status: completion status - OK/Filter/Abort/Timeout
  778. * @tid: TID number
  779. * @peer_id: Peer ID
  780. * @frame_ctrl: frame control field in 802.11 header
  781. * @qos_ctrl: QoS control field in 802.11 header
  782. * @mpdu_tried: number of mpdus tried
  783. * @mpdu_success: number of mpdus successfully transmitted
  784. * @long_retries: long retries
  785. * @short_retries: short retries
  786. * @is_ampdu: mpdu aggregate or non-aggregate?
  787. * @success_bytes: bytes successfully transmitted
  788. * @retry_bytes: bytes retried
  789. * @failed_msdus: MSDUs failed transmission
  790. * @duration: user duration in ppdu
  791. * @ltf_size: ltf_size
  792. * @stbc: stbc
  793. * @he_re: he_re (range extension)
  794. * @txbf: txbf
  795. * @bw: Transmission bandwidth
  796. * <enum 2 transmit_bw_20_MHz>
  797. * <enum 3 transmit_bw_40_MHz>
  798. * <enum 4 transmit_bw_80_MHz>
  799. * <enum 5 transmit_bw_160_MHz>
  800. * @nss: NSS 1,2, ...8
  801. * @mcs: MCS index
  802. * @preamble: preamble
  803. * @gi: guard interval 800/400/1600/3200 ns
  804. * @dcm: dcm
  805. * @ldpc: ldpc
  806. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  807. * UL_BSR_TRIG/UNKNOWN
  808. * @ba_seq_no: Block Ack sequence number
  809. * @ba_bitmap: Block Ack bitmap
  810. * @start_seqa: Sequence number of first MPDU
  811. * @enq_bitmap: Enqueue MPDU bitmap
  812. * @is_mcast: MCAST or UCAST
  813. * @tx_rate: Transmission Rate
  814. */
  815. struct cdp_tx_completion_ppdu_user {
  816. uint32_t completion_status:8,
  817. tid:8,
  818. peer_id:16;
  819. uint8_t mac_addr[6];
  820. uint32_t frame_ctrl:16,
  821. qos_ctrl:16;
  822. uint32_t mpdu_tried_ucast:16,
  823. mpdu_tried_mcast:16;
  824. uint16_t mpdu_success:16;
  825. uint32_t long_retries:4,
  826. short_retries:4,
  827. tx_ratecode:8,
  828. is_ampdu:1,
  829. ppdu_type:5;
  830. uint32_t success_bytes;
  831. uint32_t retry_bytes;
  832. uint32_t failed_bytes;
  833. uint32_t success_msdus:16,
  834. retry_msdus:16;
  835. uint32_t failed_msdus:16,
  836. duration:16;
  837. uint32_t ltf_size:2,
  838. stbc:1,
  839. he_re:1,
  840. txbf:4,
  841. bw:4,
  842. nss:4,
  843. mcs:4,
  844. preamble:4,
  845. gi:4,
  846. dcm:1,
  847. ldpc:1;
  848. uint32_t ba_seq_no;
  849. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  850. uint32_t start_seq;
  851. uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  852. uint32_t num_mpdu:9,
  853. num_msdu:16;
  854. uint32_t tx_duration;
  855. uint16_t ru_tones;
  856. bool is_mcast;
  857. uint32_t tx_rate;
  858. };
  859. /**
  860. * struct cdp_tx_completion_ppdu - Tx PPDU completion information
  861. * @completion_status: completion status - OK/Filter/Abort/Timeout
  862. * @ppdu_id: PPDU Id
  863. * @vdev_id: VAP Id
  864. * @num_users: Number of users
  865. * @num_mpdu: Number of MPDUs in PPDU
  866. * @num_msdu: Number of MSDUs in PPDU
  867. * @frame_type: frame SU or MU
  868. * @frame_ctrl: frame control of 80211 header
  869. * @channel: Channel informartion
  870. * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
  871. * @tx_duration: PPDU airtime
  872. * @ppdu_start_timestamp: TSF at PPDU start
  873. * @ppdu_end_timestamp: TSF at PPDU end
  874. * @ack_timestamp: TSF at the reception of ACK
  875. * @user: per-User stats (array of per-user structures)
  876. */
  877. struct cdp_tx_completion_ppdu {
  878. uint32_t ppdu_id;
  879. uint16_t vdev_id;
  880. uint32_t num_users;
  881. uint32_t num_mpdu:9,
  882. num_msdu:16;
  883. uint16_t frame_type;
  884. uint16_t frame_ctrl;
  885. uint16_t channel;
  886. uint16_t phy_mode;
  887. uint32_t ack_rssi;
  888. uint32_t tx_duration;
  889. uint32_t ppdu_start_timestamp;
  890. uint32_t ppdu_end_timestamp;
  891. uint32_t ack_timestamp;
  892. struct cdp_tx_completion_ppdu_user user[CDP_MU_MAX_USERS];
  893. };
  894. /**
  895. * struct cdp_dev_stats - Network device stats structure
  896. * @tx_packets: Tx total packets transmitted
  897. * @tx_bytes : Tx total bytes transmitted
  898. * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
  899. * @tx_dropped: Tx dropped is same as tx errors as above
  900. * @rx_packets: Rx total packets transmitted
  901. * @rx_bytes : Rx total bytes transmitted
  902. */
  903. struct cdp_dev_stats {
  904. uint32_t tx_packets;
  905. uint32_t tx_bytes;
  906. uint32_t tx_errors;
  907. uint32_t tx_dropped;
  908. uint32_t rx_packets;
  909. uint32_t rx_bytes;
  910. };
  911. /**
  912. * struct cdp_rate_stats - Tx/Rx Rate statistics
  913. * @bw: Indicates the BW of the upcoming transmission -
  914. * <enum 2 transmit_bw_20_MHz>
  915. * <enum 3 transmit_bw_40_MHz>
  916. * <enum 4 transmit_bw_80_MHz>
  917. * <enum 5 transmit_bw_160_MHz>
  918. * @pkt_type: Transmit Packet Type
  919. * @stbc: When set, STBC transmission rate was used
  920. * @ldpc: When set, use LDPC transmission rates
  921. * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
  922. * <enum 1 0_4_us_sgi > Legacy short GI
  923. * <enum 2 1_6_us_sgi > HE related GI
  924. * <enum 3 3_2_us_sgi > HE
  925. * @mcs: Transmit MCS Rate
  926. * @ofdma: Set when the transmission was an OFDMA transmission
  927. * @tones_in_ru: The number of tones in the RU used.
  928. * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
  929. * @peer_id: Peer ID of the flow or MPDU queue
  930. * @tid: TID of the flow or MPDU queue
  931. */
  932. struct cdp_rate_stats {
  933. uint32_t rate_stats_info_valid:1,
  934. bw:2,
  935. pkt_type:4,
  936. stbc:1,
  937. ldpc:1,
  938. sgi:2,
  939. mcs:4,
  940. ofdma:1,
  941. tones_in_ru:12,
  942. resvd0:4;
  943. uint32_t tsf;
  944. uint16_t peer_id;
  945. uint8_t tid;
  946. };
  947. /**
  948. * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
  949. * @ppdu_id: PPDU to which this MSDU belongs
  950. * @transmit_cnt: Number of times this frame has been transmitted
  951. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  952. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  953. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  954. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  955. * @extd: Extended structure containing rate statistics
  956. */
  957. struct cdp_tx_completion_msdu {
  958. uint32_t ppdu_id;
  959. uint8_t transmit_cnt;
  960. uint32_t ack_frame_rssi:8,
  961. resvd0:1,
  962. first_msdu:1,
  963. last_msdu:1,
  964. msdu_part_of_amsdu:1,
  965. resvd1:20;
  966. struct cdp_rate_stats extd;
  967. };
  968. /**
  969. * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
  970. * @ppdu_id: PPDU Id
  971. * @is_ampdu: mpdu aggregate or non-aggregate?
  972. * @num_mpdu: Number of MPDUs in PPDU
  973. * @reserved: Reserved bits for future use
  974. * @num_msdu: Number of MSDUs in PPDU
  975. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  976. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  977. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  978. * @duration: PPDU duration
  979. * @tid: TID number
  980. * @peer_id: Peer ID
  981. * @vdev_id: VAP ID
  982. * @mac_addr: Peer MAC Address
  983. * @first_data_seq_ctrl: Sequence control field of first data frame
  984. * @ltf_size: ltf_size
  985. * @stbc: When set, STBC rate was used
  986. * @he_re: he_re (range extension)
  987. * @bw: Bandwidth
  988. * <enum 0 bw_20_MHz>
  989. * <enum 1 bw_40_MHz>
  990. * <enum 2 bw_80_MHz>
  991. * <enum 3 bw_160_MHz>
  992. * @nss: NSS 1,2, ...8
  993. * @mcs: MCS index
  994. * @preamble: preamble
  995. * @gi: <enum 0 0_8_us_sgi > Legacy normal GI
  996. * <enum 1 0_4_us_sgi > Legacy short GI
  997. * <enum 2 1_6_us_sgi > HE related GI
  998. * <enum 3 3_2_us_sgi > HE
  999. * @dcm: dcm
  1000. * @ldpc: ldpc
  1001. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  1002. * UL_BSR_TRIG/UNKNOWN
  1003. * @rssi: RSSI value (units = dB above noise floor)
  1004. * @timestamp: TSF at the reception of PPDU
  1005. * @length: PPDU length
  1006. * @channel: Channel informartion
  1007. * @lsig_A: L-SIG in 802.11 PHY header
  1008. */
  1009. struct cdp_rx_indication_ppdu {
  1010. uint32_t ppdu_id;
  1011. uint16_t is_ampdu:1,
  1012. num_mpdu:9,
  1013. reserved:6;
  1014. uint32_t num_msdu;
  1015. uint16_t udp_msdu_count;
  1016. uint16_t tcp_msdu_count;
  1017. uint16_t other_msdu_count;
  1018. uint16_t duration;
  1019. uint32_t tid:8,
  1020. peer_id:16;
  1021. uint8_t vdev_id;
  1022. uint8_t mac_addr[6];
  1023. uint16_t first_data_seq_ctrl;
  1024. union {
  1025. uint32_t rate_info;
  1026. struct {
  1027. uint32_t ltf_size:2,
  1028. stbc:1,
  1029. he_re:1,
  1030. bw:4,
  1031. nss:4,
  1032. mcs:4,
  1033. preamble:4,
  1034. gi:4,
  1035. dcm:1,
  1036. ldpc:1,
  1037. ppdu_type:2;
  1038. };
  1039. } u;
  1040. uint32_t lsig_a;
  1041. uint32_t rssi;
  1042. uint64_t timestamp;
  1043. uint32_t length;
  1044. uint8_t channel;
  1045. uint8_t beamformed;
  1046. };
  1047. /**
  1048. * struct cdp_rx_indication_msdu - Rx MSDU info
  1049. * @ppdu_id: PPDU to which the MSDU belongs
  1050. * @msdu_len: Length of MSDU in bytes
  1051. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  1052. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  1053. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  1054. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  1055. * @extd: Extended structure containing rate statistics
  1056. */
  1057. struct cdp_rx_indication_msdu {
  1058. uint32_t ppdu_id;
  1059. uint16_t msdu_len;
  1060. uint32_t ack_frame_rssi:8,
  1061. resvd0:1,
  1062. first_msdu:1,
  1063. last_msdu:1,
  1064. msdu_part_of_amsdu:1,
  1065. msdu_part_of_ampdu:1,
  1066. resvd1:19;
  1067. struct cdp_rate_stats extd;
  1068. };
  1069. /**
  1070. * struct cdp_config_params - Propagate configuration parameters to datapath
  1071. * @tso_enable: Enable/Disable TSO
  1072. * @lro_enable: Enable/Disable LRO
  1073. * @flow_steering_enable: Enable/Disable Rx Hash
  1074. * @tcp_Udp_ChecksumOffload: Enable/Disable tcp-Udp checksum Offload
  1075. * @napi_enable: Enable/Disable Napi
  1076. * @tx_flow_stop_queue_threshold: Value to Pause tx queues
  1077. * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
  1078. * tx queue
  1079. */
  1080. struct cdp_config_params {
  1081. unsigned int tso_enable:1;
  1082. unsigned int lro_enable:1;
  1083. unsigned int flow_steering_enable:1;
  1084. unsigned int tcp_udp_checksumoffload:1;
  1085. unsigned int napi_enable:1;
  1086. /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
  1087. uint8_t tx_flow_stop_queue_threshold;
  1088. uint8_t tx_flow_start_queue_offset;
  1089. };
  1090. /**
  1091. * cdp_txrx_stats_req: stats request wrapper
  1092. * used to pass request information to cdp layer
  1093. * @stats: type of stats requested
  1094. * @param0: opaque argument 0 to be passed to htt
  1095. * @param1: opaque argument 1 to be passed to htt
  1096. * @param2: opaque argument 2 to be passed to htt
  1097. * @param3: opaque argument 3 to be passed to htt
  1098. * @mac id: mac_id
  1099. */
  1100. struct cdp_txrx_stats_req {
  1101. enum cdp_stats stats;
  1102. uint32_t param0;
  1103. uint32_t param1;
  1104. uint32_t param2;
  1105. uint32_t param3;
  1106. uint32_t cookie_val;
  1107. uint8_t mac_id;
  1108. };
  1109. /**
  1110. * struct cdp_monitor_filter - monitor filter info
  1111. * @mode: set filter mode
  1112. * @fp_mgmt: set Filter Pass MGMT Configuration
  1113. * @fp_ctrl: set Filter Pass CTRL Configuration
  1114. * @fp_data: set Filter Pass DATA Configuration
  1115. * @mo_mgmt: set Monitor Other MGMT Configuration
  1116. * @mo_ctrl: set Monitor Other CTRL Configuration
  1117. * @mo_data: set Monitor other DATA Configuration
  1118. *
  1119. */
  1120. struct cdp_monitor_filter {
  1121. uint16_t mode;
  1122. uint16_t fp_mgmt;
  1123. uint16_t fp_ctrl;
  1124. uint16_t fp_data;
  1125. uint16_t mo_mgmt;
  1126. uint16_t mo_ctrl;
  1127. uint16_t mo_data;
  1128. };
  1129. #endif