cdp_txrx_cmn_struct.h 39 KB

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