hif.h 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  1. /*
  2. * Copyright (c) 2013-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. #ifndef _HIF_H_
  19. #define _HIF_H_
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif /* __cplusplus */
  23. /* Header files */
  24. #include <qdf_status.h>
  25. #include "qdf_nbuf.h"
  26. #include "qdf_lro.h"
  27. #include "ol_if_athvar.h"
  28. #include <linux/platform_device.h>
  29. #ifdef HIF_PCI
  30. #include <linux/pci.h>
  31. #endif /* HIF_PCI */
  32. #ifdef HIF_USB
  33. #include <linux/usb.h>
  34. #endif /* HIF_USB */
  35. #ifdef IPA_OFFLOAD
  36. #include <linux/ipa.h>
  37. #endif
  38. #define ENABLE_MBOX_DUMMY_SPACE_FEATURE 1
  39. typedef void __iomem *A_target_id_t;
  40. typedef void *hif_handle_t;
  41. #define HIF_TYPE_AR6002 2
  42. #define HIF_TYPE_AR6003 3
  43. #define HIF_TYPE_AR6004 5
  44. #define HIF_TYPE_AR9888 6
  45. #define HIF_TYPE_AR6320 7
  46. #define HIF_TYPE_AR6320V2 8
  47. /* For attaching Peregrine 2.0 board host_reg_tbl only */
  48. #define HIF_TYPE_AR9888V2 9
  49. #define HIF_TYPE_ADRASTEA 10
  50. #define HIF_TYPE_AR900B 11
  51. #define HIF_TYPE_QCA9984 12
  52. #define HIF_TYPE_IPQ4019 13
  53. #define HIF_TYPE_QCA9888 14
  54. #define HIF_TYPE_QCA8074 15
  55. #define HIF_TYPE_QCA6290 16
  56. #define HIF_TYPE_QCN7605 17
  57. #ifdef IPA_OFFLOAD
  58. #define DMA_COHERENT_MASK_IPA_VER_3_AND_ABOVE 37
  59. #define DMA_COHERENT_MASK_BELOW_IPA_VER_3 32
  60. #endif
  61. /* enum hif_ic_irq - enum defining integrated chip irq numbers
  62. * defining irq nubers that can be used by external modules like datapath
  63. */
  64. enum hif_ic_irq {
  65. host2wbm_desc_feed = 18,
  66. host2reo_re_injection,
  67. host2reo_command,
  68. host2rxdma_monitor_ring3,
  69. host2rxdma_monitor_ring2,
  70. host2rxdma_monitor_ring1,
  71. reo2host_exception,
  72. wbm2host_rx_release,
  73. reo2host_status,
  74. reo2host_destination_ring4,
  75. reo2host_destination_ring3,
  76. reo2host_destination_ring2,
  77. reo2host_destination_ring1,
  78. rxdma2host_monitor_destination_mac3,
  79. rxdma2host_monitor_destination_mac2,
  80. rxdma2host_monitor_destination_mac1,
  81. ppdu_end_interrupts_mac3,
  82. ppdu_end_interrupts_mac2,
  83. ppdu_end_interrupts_mac1,
  84. rxdma2host_monitor_status_ring_mac3,
  85. rxdma2host_monitor_status_ring_mac2,
  86. rxdma2host_monitor_status_ring_mac1,
  87. host2rxdma_host_buf_ring_mac3,
  88. host2rxdma_host_buf_ring_mac2,
  89. host2rxdma_host_buf_ring_mac1,
  90. rxdma2host_destination_ring_mac3,
  91. rxdma2host_destination_ring_mac2,
  92. rxdma2host_destination_ring_mac1,
  93. host2tcl_input_ring4,
  94. host2tcl_input_ring3,
  95. host2tcl_input_ring2,
  96. host2tcl_input_ring1,
  97. wbm2host_tx_completions_ring3,
  98. wbm2host_tx_completions_ring2,
  99. wbm2host_tx_completions_ring1,
  100. tcl2host_status_ring,
  101. };
  102. struct CE_state;
  103. #define CE_COUNT_MAX 12
  104. #define HIF_MAX_GRP_IRQ 16
  105. #define HIF_MAX_GROUP 8
  106. #ifdef CONFIG_SLUB_DEBUG_ON
  107. #ifndef CONFIG_WIN
  108. #define HIF_CONFIG_SLUB_DEBUG_ON
  109. #endif
  110. #endif
  111. #ifndef NAPI_YIELD_BUDGET_BASED
  112. #ifdef HIF_CONFIG_SLUB_DEBUG_ON
  113. #define QCA_NAPI_DEF_SCALE_BIN_SHIFT 1
  114. #else /* PERF build */
  115. #ifdef CONFIG_WIN
  116. #define QCA_NAPI_DEF_SCALE_BIN_SHIFT 1
  117. #else
  118. #define QCA_NAPI_DEF_SCALE_BIN_SHIFT 4
  119. #endif /* CONFIG_WIN */
  120. #endif /* SLUB_DEBUG_ON */
  121. #else /* NAPI_YIELD_BUDGET_BASED */
  122. #define QCA_NAPI_DEF_SCALE_BIN_SHIFT 2
  123. #endif /* NAPI_YIELD_BUDGET_BASED */
  124. #define QCA_NAPI_BUDGET 64
  125. #define QCA_NAPI_DEF_SCALE \
  126. (1 << QCA_NAPI_DEF_SCALE_BIN_SHIFT)
  127. #define HIF_NAPI_MAX_RECEIVES (QCA_NAPI_BUDGET * QCA_NAPI_DEF_SCALE)
  128. /* NOTE: "napi->scale" can be changed,
  129. * but this does not change the number of buckets
  130. */
  131. #define QCA_NAPI_NUM_BUCKETS 4
  132. /**
  133. * qca_napi_stat - stats structure for execution contexts
  134. * @napi_schedules - number of times the schedule function is called
  135. * @napi_polls - number of times the execution context runs
  136. * @napi_completes - number of times that the generating interrupt is reenabled
  137. * @napi_workdone - cumulative of all work done reported by handler
  138. * @cpu_corrected - incremented when execution context runs on a different core
  139. * than the one that its irq is affined to.
  140. * @napi_budget_uses - histogram of work done per execution run
  141. * @time_limit_reache - count of yields due to time limit threshholds
  142. * @rxpkt_thresh_reached - count of yields due to a work limit
  143. *
  144. * needs to be renamed
  145. */
  146. struct qca_napi_stat {
  147. uint32_t napi_schedules;
  148. uint32_t napi_polls;
  149. uint32_t napi_completes;
  150. uint32_t napi_workdone;
  151. uint32_t cpu_corrected;
  152. uint32_t napi_budget_uses[QCA_NAPI_NUM_BUCKETS];
  153. uint32_t time_limit_reached;
  154. uint32_t rxpkt_thresh_reached;
  155. unsigned long long napi_max_poll_time;
  156. };
  157. /**
  158. * per NAPI instance data structure
  159. * This data structure holds stuff per NAPI instance.
  160. * Note that, in the current implementation, though scale is
  161. * an instance variable, it is set to the same value for all
  162. * instances.
  163. */
  164. struct qca_napi_info {
  165. struct net_device netdev; /* dummy net_dev */
  166. void *hif_ctx;
  167. struct napi_struct napi;
  168. uint8_t scale; /* currently same on all instances */
  169. uint8_t id;
  170. uint8_t cpu;
  171. int irq;
  172. struct qca_napi_stat stats[NR_CPUS];
  173. #ifdef RECEIVE_OFFLOAD
  174. /* will only be present for data rx CE's */
  175. void (*offld_flush_cb)(void *);
  176. struct napi_struct rx_thread_napi;
  177. struct net_device rx_thread_netdev;
  178. #endif /* RECEIVE_OFFLOAD */
  179. qdf_lro_ctx_t lro_ctx;
  180. };
  181. enum qca_napi_tput_state {
  182. QCA_NAPI_TPUT_UNINITIALIZED,
  183. QCA_NAPI_TPUT_LO,
  184. QCA_NAPI_TPUT_HI
  185. };
  186. enum qca_napi_cpu_state {
  187. QCA_NAPI_CPU_UNINITIALIZED,
  188. QCA_NAPI_CPU_DOWN,
  189. QCA_NAPI_CPU_UP };
  190. /**
  191. * struct qca_napi_cpu - an entry of the napi cpu table
  192. * @core_id: physical core id of the core
  193. * @cluster_id: cluster this core belongs to
  194. * @core_mask: mask to match all core of this cluster
  195. * @thread_mask: mask for this core within the cluster
  196. * @max_freq: maximum clock this core can be clocked at
  197. * same for all cpus of the same core.
  198. * @napis: bitmap of napi instances on this core
  199. * @execs: bitmap of execution contexts on this core
  200. * cluster_nxt: chain to link cores within the same cluster
  201. *
  202. * This structure represents a single entry in the napi cpu
  203. * table. The table is part of struct qca_napi_data.
  204. * This table is initialized by the init function, called while
  205. * the first napi instance is being created, updated by hotplug
  206. * notifier and when cpu affinity decisions are made (by throughput
  207. * detection), and deleted when the last napi instance is removed.
  208. */
  209. struct qca_napi_cpu {
  210. enum qca_napi_cpu_state state;
  211. int core_id;
  212. int cluster_id;
  213. cpumask_t core_mask;
  214. cpumask_t thread_mask;
  215. unsigned int max_freq;
  216. uint32_t napis;
  217. uint32_t execs;
  218. int cluster_nxt; /* index, not pointer */
  219. };
  220. /**
  221. * struct qca_napi_data - collection of napi data for a single hif context
  222. * @hif_softc: pointer to the hif context
  223. * @lock: spinlock used in the event state machine
  224. * @state: state variable used in the napi stat machine
  225. * @ce_map: bit map indicating which ce's have napis running
  226. * @exec_map: bit map of instanciated exec contexts
  227. * @user_cpu_affin_map: CPU affinity map from INI config.
  228. * @napi_cpu: cpu info for irq affinty
  229. * @lilcl_head:
  230. * @bigcl_head:
  231. * @napi_mode: irq affinity & clock voting mode
  232. * @cpuhp_handler: CPU hotplug event registration handle
  233. */
  234. struct qca_napi_data {
  235. struct hif_softc *hif_softc;
  236. qdf_spinlock_t lock;
  237. uint32_t state;
  238. /* bitmap of created/registered NAPI instances, indexed by pipe_id,
  239. * not used by clients (clients use an id returned by create)
  240. */
  241. uint32_t ce_map;
  242. uint32_t exec_map;
  243. uint32_t user_cpu_affin_mask;
  244. struct qca_napi_info *napis[CE_COUNT_MAX];
  245. struct qca_napi_cpu napi_cpu[NR_CPUS];
  246. int lilcl_head, bigcl_head;
  247. enum qca_napi_tput_state napi_mode;
  248. struct qdf_cpuhp_handler *cpuhp_handler;
  249. uint8_t flags;
  250. };
  251. /**
  252. * struct hif_config_info - Place Holder for hif confiruation
  253. * @enable_self_recovery: Self Recovery
  254. *
  255. * Structure for holding hif ini parameters.
  256. */
  257. struct hif_config_info {
  258. bool enable_self_recovery;
  259. #ifdef FEATURE_RUNTIME_PM
  260. bool enable_runtime_pm;
  261. u_int32_t runtime_pm_delay;
  262. #endif
  263. };
  264. /**
  265. * struct hif_target_info - Target Information
  266. * @target_version: Target Version
  267. * @target_type: Target Type
  268. * @target_revision: Target Revision
  269. * @soc_version: SOC Version
  270. *
  271. * Structure to hold target information.
  272. */
  273. struct hif_target_info {
  274. uint32_t target_version;
  275. uint32_t target_type;
  276. uint32_t target_revision;
  277. uint32_t soc_version;
  278. char *hw_name;
  279. };
  280. struct hif_opaque_softc {
  281. };
  282. /**
  283. * enum HIF_DEVICE_POWER_CHANGE_TYPE: Device Power change type
  284. *
  285. * @HIF_DEVICE_POWER_UP: HIF layer should power up interface and/or module
  286. * @HIF_DEVICE_POWER_DOWN: HIF layer should initiate bus-specific measures to
  287. * minimize power
  288. * @HIF_DEVICE_POWER_CUT: HIF layer should initiate bus-specific AND/OR
  289. * platform-specific measures to completely power-off
  290. * the module and associated hardware (i.e. cut power
  291. * supplies)
  292. */
  293. enum HIF_DEVICE_POWER_CHANGE_TYPE {
  294. HIF_DEVICE_POWER_UP,
  295. HIF_DEVICE_POWER_DOWN,
  296. HIF_DEVICE_POWER_CUT
  297. };
  298. /**
  299. * enum hif_enable_type: what triggered the enabling of hif
  300. *
  301. * @HIF_ENABLE_TYPE_PROBE: probe triggered enable
  302. * @HIF_ENABLE_TYPE_REINIT: reinit triggered enable
  303. */
  304. enum hif_enable_type {
  305. HIF_ENABLE_TYPE_PROBE,
  306. HIF_ENABLE_TYPE_REINIT,
  307. HIF_ENABLE_TYPE_MAX
  308. };
  309. /**
  310. * enum hif_disable_type: what triggered the disabling of hif
  311. *
  312. * @HIF_DISABLE_TYPE_PROBE_ERROR: probe error triggered disable
  313. * @HIF_DISABLE_TYPE_REINIT_ERROR: reinit error triggered disable
  314. * @HIF_DISABLE_TYPE_REMOVE: remove triggered disable
  315. * @HIF_DISABLE_TYPE_SHUTDOWN: shutdown triggered disable
  316. */
  317. enum hif_disable_type {
  318. HIF_DISABLE_TYPE_PROBE_ERROR,
  319. HIF_DISABLE_TYPE_REINIT_ERROR,
  320. HIF_DISABLE_TYPE_REMOVE,
  321. HIF_DISABLE_TYPE_SHUTDOWN,
  322. HIF_DISABLE_TYPE_MAX
  323. };
  324. /**
  325. * enum hif_device_config_opcode: configure mode
  326. *
  327. * @HIF_DEVICE_POWER_STATE: device power state
  328. * @HIF_DEVICE_GET_MBOX_BLOCK_SIZE: get mbox block size
  329. * @HIF_DEVICE_GET_MBOX_ADDR: get mbox block address
  330. * @HIF_DEVICE_GET_PENDING_EVENTS_FUNC: get pending events functions
  331. * @HIF_DEVICE_GET_IRQ_PROC_MODE: get irq proc mode
  332. * @HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC: receive event function
  333. * @HIF_DEVICE_POWER_STATE_CHANGE: change power state
  334. * @HIF_DEVICE_GET_IRQ_YIELD_PARAMS: get yield params
  335. * @HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT: configure scatter request
  336. * @HIF_DEVICE_GET_OS_DEVICE: get OS device
  337. * @HIF_DEVICE_DEBUG_BUS_STATE: debug bus state
  338. * @HIF_BMI_DONE: bmi done
  339. * @HIF_DEVICE_SET_TARGET_TYPE: set target type
  340. * @HIF_DEVICE_SET_HTC_CONTEXT: set htc context
  341. * @HIF_DEVICE_GET_HTC_CONTEXT: get htc context
  342. */
  343. enum hif_device_config_opcode {
  344. HIF_DEVICE_POWER_STATE = 0,
  345. HIF_DEVICE_GET_BLOCK_SIZE,
  346. HIF_DEVICE_GET_FIFO_ADDR,
  347. HIF_DEVICE_GET_PENDING_EVENTS_FUNC,
  348. HIF_DEVICE_GET_IRQ_PROC_MODE,
  349. HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC,
  350. HIF_DEVICE_POWER_STATE_CHANGE,
  351. HIF_DEVICE_GET_IRQ_YIELD_PARAMS,
  352. HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT,
  353. HIF_DEVICE_GET_OS_DEVICE,
  354. HIF_DEVICE_DEBUG_BUS_STATE,
  355. HIF_BMI_DONE,
  356. HIF_DEVICE_SET_TARGET_TYPE,
  357. HIF_DEVICE_SET_HTC_CONTEXT,
  358. HIF_DEVICE_GET_HTC_CONTEXT,
  359. };
  360. #ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
  361. struct HID_ACCESS_LOG {
  362. uint32_t seqnum;
  363. bool is_write;
  364. void *addr;
  365. uint32_t value;
  366. };
  367. #endif
  368. void hif_reg_write(struct hif_opaque_softc *hif_ctx, uint32_t offset,
  369. uint32_t value);
  370. uint32_t hif_reg_read(struct hif_opaque_softc *hif_ctx, uint32_t offset);
  371. #define HIF_MAX_DEVICES 1
  372. /**
  373. * struct htc_callbacks - Structure for HTC Callbacks methods
  374. * @context: context to pass to the dsrhandler
  375. * note : rwCompletionHandler is provided the context
  376. * passed to hif_read_write
  377. * @rwCompletionHandler: Read / write completion handler
  378. * @dsrHandler: DSR Handler
  379. */
  380. struct htc_callbacks {
  381. void *context;
  382. QDF_STATUS(*rw_compl_handler)(void *rw_ctx, QDF_STATUS status);
  383. QDF_STATUS(*dsr_handler)(void *context);
  384. };
  385. /**
  386. * struct hif_driver_state_callbacks - Callbacks for HIF to query Driver state
  387. * @context: Private data context
  388. * @set_recovery_in_progress: To Set Driver state for recovery in progress
  389. * @is_recovery_in_progress: Query if driver state is recovery in progress
  390. * @is_load_unload_in_progress: Query if driver state Load/Unload in Progress
  391. * @is_driver_unloading: Query if driver is unloading.
  392. *
  393. * This Structure provides callback pointer for HIF to query hdd for driver
  394. * states.
  395. */
  396. struct hif_driver_state_callbacks {
  397. void *context;
  398. void (*set_recovery_in_progress)(void *context, uint8_t val);
  399. bool (*is_recovery_in_progress)(void *context);
  400. bool (*is_load_unload_in_progress)(void *context);
  401. bool (*is_driver_unloading)(void *context);
  402. bool (*is_target_ready)(void *context);
  403. };
  404. /* This API detaches the HTC layer from the HIF device */
  405. void hif_detach_htc(struct hif_opaque_softc *hif_ctx);
  406. /****************************************************************/
  407. /* BMI and Diag window abstraction */
  408. /****************************************************************/
  409. #define HIF_BMI_EXCHANGE_NO_TIMEOUT ((uint32_t)(0))
  410. #define DIAG_TRANSFER_LIMIT 2048U /* maximum number of bytes that can be
  411. * handled atomically by
  412. * DiagRead/DiagWrite
  413. */
  414. /*
  415. * API to handle HIF-specific BMI message exchanges, this API is synchronous
  416. * and only allowed to be called from a context that can block (sleep)
  417. */
  418. QDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx,
  419. qdf_dma_addr_t cmd, qdf_dma_addr_t rsp,
  420. uint8_t *pSendMessage, uint32_t Length,
  421. uint8_t *pResponseMessage,
  422. uint32_t *pResponseLength, uint32_t TimeoutMS);
  423. void hif_register_bmi_callbacks(struct hif_softc *hif_sc);
  424. /*
  425. * APIs to handle HIF specific diagnostic read accesses. These APIs are
  426. * synchronous and only allowed to be called from a context that
  427. * can block (sleep). They are not high performance APIs.
  428. *
  429. * hif_diag_read_access reads a 4 Byte aligned/length value from a
  430. * Target register or memory word.
  431. *
  432. * hif_diag_read_mem reads an arbitrary length of arbitrarily aligned memory.
  433. */
  434. QDF_STATUS hif_diag_read_access(struct hif_opaque_softc *hif_ctx,
  435. uint32_t address, uint32_t *data);
  436. QDF_STATUS hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address,
  437. uint8_t *data, int nbytes);
  438. void hif_dump_target_memory(struct hif_opaque_softc *hif_ctx,
  439. void *ramdump_base, uint32_t address, uint32_t size);
  440. /*
  441. * APIs to handle HIF specific diagnostic write accesses. These APIs are
  442. * synchronous and only allowed to be called from a context that
  443. * can block (sleep).
  444. * They are not high performance APIs.
  445. *
  446. * hif_diag_write_access writes a 4 Byte aligned/length value to a
  447. * Target register or memory word.
  448. *
  449. * hif_diag_write_mem writes an arbitrary length of arbitrarily aligned memory.
  450. */
  451. QDF_STATUS hif_diag_write_access(struct hif_opaque_softc *hif_ctx,
  452. uint32_t address, uint32_t data);
  453. QDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx,
  454. uint32_t address, uint8_t *data, int nbytes);
  455. typedef void (*fastpath_msg_handler)(void *, qdf_nbuf_t *, uint32_t);
  456. void hif_enable_polled_mode(struct hif_opaque_softc *hif_ctx);
  457. bool hif_is_polled_mode_enabled(struct hif_opaque_softc *hif_ctx);
  458. /*
  459. * Set the FASTPATH_mode_on flag in sc, for use by data path
  460. */
  461. #ifdef WLAN_FEATURE_FASTPATH
  462. void hif_enable_fastpath(struct hif_opaque_softc *hif_ctx);
  463. bool hif_is_fastpath_mode_enabled(struct hif_opaque_softc *hif_ctx);
  464. void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int ret);
  465. int hif_ce_fastpath_cb_register(struct hif_opaque_softc *hif_ctx,
  466. fastpath_msg_handler handler, void *context);
  467. #else
  468. static inline int hif_ce_fastpath_cb_register(struct hif_opaque_softc *hif_ctx,
  469. fastpath_msg_handler handler,
  470. void *context)
  471. {
  472. return QDF_STATUS_E_FAILURE;
  473. }
  474. static inline void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int ret)
  475. {
  476. return NULL;
  477. }
  478. #endif
  479. /*
  480. * Enable/disable CDC max performance workaround
  481. * For max-performace set this to 0
  482. * To allow SoC to enter sleep set this to 1
  483. */
  484. #define CONFIG_DISABLE_CDC_MAX_PERF_WAR 0
  485. void hif_ipa_get_ce_resource(struct hif_opaque_softc *hif_ctx,
  486. qdf_shared_mem_t **ce_sr,
  487. uint32_t *ce_sr_ring_size,
  488. qdf_dma_addr_t *ce_reg_paddr);
  489. /**
  490. * @brief List of callbacks - filled in by HTC.
  491. */
  492. struct hif_msg_callbacks {
  493. void *Context;
  494. /**< context meaningful to HTC */
  495. QDF_STATUS (*txCompletionHandler)(void *Context, qdf_nbuf_t wbuf,
  496. uint32_t transferID,
  497. uint32_t toeplitz_hash_result);
  498. QDF_STATUS (*rxCompletionHandler)(void *Context, qdf_nbuf_t wbuf,
  499. uint8_t pipeID);
  500. void (*txResourceAvailHandler)(void *context, uint8_t pipe);
  501. void (*fwEventHandler)(void *context, QDF_STATUS status);
  502. };
  503. enum hif_target_status {
  504. TARGET_STATUS_CONNECTED = 0, /* target connected */
  505. TARGET_STATUS_RESET, /* target got reset */
  506. TARGET_STATUS_EJECT, /* target got ejected */
  507. TARGET_STATUS_SUSPEND /*target got suspend */
  508. };
  509. /**
  510. * enum hif_attribute_flags: configure hif
  511. *
  512. * @HIF_LOWDESC_CE_CFG: Configure HIF with Low descriptor CE
  513. * @HIF_LOWDESC_CE_NO_PKTLOG_CFG: Configure HIF with Low descriptor
  514. * + No pktlog CE
  515. */
  516. enum hif_attribute_flags {
  517. HIF_LOWDESC_CE_CFG = 1,
  518. HIF_LOWDESC_CE_NO_PKTLOG_CFG
  519. };
  520. #define HIF_DATA_ATTR_SET_TX_CLASSIFY(attr, v) \
  521. (attr |= (v & 0x01) << 5)
  522. #define HIF_DATA_ATTR_SET_ENCAPSULATION_TYPE(attr, v) \
  523. (attr |= (v & 0x03) << 6)
  524. #define HIF_DATA_ATTR_SET_ADDR_X_SEARCH_DISABLE(attr, v) \
  525. (attr |= (v & 0x01) << 13)
  526. #define HIF_DATA_ATTR_SET_ADDR_Y_SEARCH_DISABLE(attr, v) \
  527. (attr |= (v & 0x01) << 14)
  528. #define HIF_DATA_ATTR_SET_TOEPLITZ_HASH_ENABLE(attr, v) \
  529. (attr |= (v & 0x01) << 15)
  530. #define HIF_DATA_ATTR_SET_PACKET_OR_RESULT_OFFSET(attr, v) \
  531. (attr |= (v & 0x0FFF) << 16)
  532. #define HIF_DATA_ATTR_SET_ENABLE_11H(attr, v) \
  533. (attr |= (v & 0x01) << 30)
  534. struct hif_ul_pipe_info {
  535. unsigned int nentries;
  536. unsigned int nentries_mask;
  537. unsigned int sw_index;
  538. unsigned int write_index; /* cached copy */
  539. unsigned int hw_index; /* cached copy */
  540. void *base_addr_owner_space; /* Host address space */
  541. qdf_dma_addr_t base_addr_CE_space; /* CE address space */
  542. };
  543. struct hif_dl_pipe_info {
  544. unsigned int nentries;
  545. unsigned int nentries_mask;
  546. unsigned int sw_index;
  547. unsigned int write_index; /* cached copy */
  548. unsigned int hw_index; /* cached copy */
  549. void *base_addr_owner_space; /* Host address space */
  550. qdf_dma_addr_t base_addr_CE_space; /* CE address space */
  551. };
  552. struct hif_pipe_addl_info {
  553. uint32_t pci_mem;
  554. uint32_t ctrl_addr;
  555. struct hif_ul_pipe_info ul_pipe;
  556. struct hif_dl_pipe_info dl_pipe;
  557. };
  558. #ifdef CONFIG_SLUB_DEBUG_ON
  559. #define MSG_FLUSH_NUM 16
  560. #else /* PERF build */
  561. #define MSG_FLUSH_NUM 32
  562. #endif /* SLUB_DEBUG_ON */
  563. struct hif_bus_id;
  564. void hif_claim_device(struct hif_opaque_softc *hif_ctx);
  565. QDF_STATUS hif_get_config_item(struct hif_opaque_softc *hif_ctx,
  566. int opcode, void *config, uint32_t config_len);
  567. void hif_set_mailbox_swap(struct hif_opaque_softc *hif_ctx);
  568. void hif_mask_interrupt_call(struct hif_opaque_softc *hif_ctx);
  569. void hif_post_init(struct hif_opaque_softc *hif_ctx, void *hHTC,
  570. struct hif_msg_callbacks *callbacks);
  571. QDF_STATUS hif_start(struct hif_opaque_softc *hif_ctx);
  572. void hif_stop(struct hif_opaque_softc *hif_ctx);
  573. void hif_flush_surprise_remove(struct hif_opaque_softc *hif_ctx);
  574. void hif_dump(struct hif_opaque_softc *hif_ctx, uint8_t CmdId, bool start);
  575. void hif_trigger_dump(struct hif_opaque_softc *hif_ctx,
  576. uint8_t cmd_id, bool start);
  577. QDF_STATUS hif_send_head(struct hif_opaque_softc *hif_ctx, uint8_t PipeID,
  578. uint32_t transferID, uint32_t nbytes,
  579. qdf_nbuf_t wbuf, uint32_t data_attr);
  580. void hif_send_complete_check(struct hif_opaque_softc *hif_ctx, uint8_t PipeID,
  581. int force);
  582. void hif_shut_down_device(struct hif_opaque_softc *hif_ctx);
  583. void hif_get_default_pipe(struct hif_opaque_softc *hif_ctx, uint8_t *ULPipe,
  584. uint8_t *DLPipe);
  585. int hif_map_service_to_pipe(struct hif_opaque_softc *hif_ctx, uint16_t svc_id,
  586. uint8_t *ul_pipe, uint8_t *dl_pipe, int *ul_is_polled,
  587. int *dl_is_polled);
  588. uint16_t
  589. hif_get_free_queue_number(struct hif_opaque_softc *hif_ctx, uint8_t PipeID);
  590. void *hif_get_targetdef(struct hif_opaque_softc *hif_ctx);
  591. uint32_t hif_hia_item_address(uint32_t target_type, uint32_t item_offset);
  592. void hif_set_target_sleep(struct hif_opaque_softc *hif_ctx, bool sleep_ok,
  593. bool wait_for_it);
  594. int hif_check_fw_reg(struct hif_opaque_softc *hif_ctx);
  595. #ifndef HIF_PCI
  596. static inline int hif_check_soc_status(struct hif_opaque_softc *hif_ctx)
  597. {
  598. return 0;
  599. }
  600. #else
  601. int hif_check_soc_status(struct hif_opaque_softc *hif_ctx);
  602. #endif
  603. void hif_get_hw_info(struct hif_opaque_softc *hif_ctx, u32 *version,
  604. u32 *revision, const char **target_name);
  605. #ifdef RECEIVE_OFFLOAD
  606. /**
  607. * hif_offld_flush_cb_register() - Register the offld flush callback
  608. * @scn: HIF opaque context
  609. * @offld_flush_handler: Flush callback is either ol_flush, incase of rx_thread
  610. * Or GRO/LRO flush when RxThread is not enabled. Called
  611. * with corresponding context for flush.
  612. * Return: None
  613. */
  614. void hif_offld_flush_cb_register(struct hif_opaque_softc *scn,
  615. void (offld_flush_handler)(void *ol_ctx));
  616. /**
  617. * hif_offld_flush_cb_deregister() - deRegister the offld flush callback
  618. * @scn: HIF opaque context
  619. *
  620. * Return: None
  621. */
  622. void hif_offld_flush_cb_deregister(struct hif_opaque_softc *scn);
  623. #endif
  624. void hif_disable_isr(struct hif_opaque_softc *hif_ctx);
  625. void hif_reset_soc(struct hif_opaque_softc *hif_ctx);
  626. void hif_save_htc_htt_config_endpoint(struct hif_opaque_softc *hif_ctx,
  627. int htc_htt_tx_endpoint);
  628. struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx, uint32_t mode,
  629. enum qdf_bus_type bus_type,
  630. struct hif_driver_state_callbacks *cbk);
  631. void hif_close(struct hif_opaque_softc *hif_ctx);
  632. QDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev,
  633. void *bdev, const struct hif_bus_id *bid,
  634. enum qdf_bus_type bus_type,
  635. enum hif_enable_type type);
  636. void hif_disable(struct hif_opaque_softc *hif_ctx, enum hif_disable_type type);
  637. void hif_display_stats(struct hif_opaque_softc *hif_ctx);
  638. void hif_clear_stats(struct hif_opaque_softc *hif_ctx);
  639. #ifdef FEATURE_RUNTIME_PM
  640. struct hif_pm_runtime_lock;
  641. void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx);
  642. int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx);
  643. void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx);
  644. int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx);
  645. int hif_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name);
  646. void hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx,
  647. struct hif_pm_runtime_lock *lock);
  648. int hif_pm_runtime_prevent_suspend(struct hif_opaque_softc *ol_sc,
  649. struct hif_pm_runtime_lock *lock);
  650. int hif_pm_runtime_allow_suspend(struct hif_opaque_softc *ol_sc,
  651. struct hif_pm_runtime_lock *lock);
  652. int hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc,
  653. struct hif_pm_runtime_lock *lock, unsigned int delay);
  654. #else
  655. struct hif_pm_runtime_lock {
  656. const char *name;
  657. };
  658. static inline void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx) {}
  659. static inline void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx)
  660. {}
  661. static inline int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx)
  662. { return 0; }
  663. static inline int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx)
  664. { return 0; }
  665. static inline int hif_runtime_lock_init(qdf_runtime_lock_t *lock,
  666. const char *name)
  667. { return 0; }
  668. static inline void
  669. hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx,
  670. struct hif_pm_runtime_lock *lock) {}
  671. static inline int hif_pm_runtime_prevent_suspend(struct hif_opaque_softc *ol_sc,
  672. struct hif_pm_runtime_lock *lock)
  673. { return 0; }
  674. static inline int hif_pm_runtime_allow_suspend(struct hif_opaque_softc *ol_sc,
  675. struct hif_pm_runtime_lock *lock)
  676. { return 0; }
  677. static inline int
  678. hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc,
  679. struct hif_pm_runtime_lock *lock, unsigned int delay)
  680. { return 0; }
  681. #endif
  682. void hif_enable_power_management(struct hif_opaque_softc *hif_ctx,
  683. bool is_packet_log_enabled);
  684. void hif_disable_power_management(struct hif_opaque_softc *hif_ctx);
  685. void hif_vote_link_down(struct hif_opaque_softc *hif_ctx);
  686. void hif_vote_link_up(struct hif_opaque_softc *hif_ctx);
  687. bool hif_can_suspend_link(struct hif_opaque_softc *hif_ctx);
  688. #ifdef IPA_OFFLOAD
  689. /**
  690. * hif_get_ipa_hw_type() - get IPA hw type
  691. *
  692. * This API return the IPA hw type.
  693. *
  694. * Return: IPA hw type
  695. */
  696. static inline
  697. enum ipa_hw_type hif_get_ipa_hw_type(void)
  698. {
  699. return ipa_get_hw_type();
  700. }
  701. /**
  702. * hif_get_ipa_present() - get IPA hw status
  703. *
  704. * This API return the IPA hw status.
  705. *
  706. * Return: true if IPA is present or false otherwise
  707. */
  708. static inline
  709. bool hif_get_ipa_present(void)
  710. {
  711. if (ipa_uc_reg_rdyCB(NULL) != -EPERM)
  712. return true;
  713. else
  714. return false;
  715. }
  716. #endif
  717. int hif_bus_resume(struct hif_opaque_softc *hif_ctx);
  718. /**
  719. * hif_bus_ealry_suspend() - stop non wmi tx traffic
  720. * @context: hif context
  721. */
  722. int hif_bus_early_suspend(struct hif_opaque_softc *hif_ctx);
  723. /**
  724. * hif_bus_late_resume() - resume non wmi traffic
  725. * @context: hif context
  726. */
  727. int hif_bus_late_resume(struct hif_opaque_softc *hif_ctx);
  728. int hif_bus_suspend(struct hif_opaque_softc *hif_ctx);
  729. int hif_bus_resume_noirq(struct hif_opaque_softc *hif_ctx);
  730. int hif_bus_suspend_noirq(struct hif_opaque_softc *hif_ctx);
  731. /**
  732. * hif_apps_irqs_enable() - Enables all irqs from the APPS side
  733. * @hif_ctx: an opaque HIF handle to use
  734. *
  735. * As opposed to the standard hif_irq_enable, this function always applies to
  736. * the APPS side kernel interrupt handling.
  737. *
  738. * Return: errno
  739. */
  740. int hif_apps_irqs_enable(struct hif_opaque_softc *hif_ctx);
  741. /**
  742. * hif_apps_irqs_disable() - Disables all irqs from the APPS side
  743. * @hif_ctx: an opaque HIF handle to use
  744. *
  745. * As opposed to the standard hif_irq_disable, this function always applies to
  746. * the APPS side kernel interrupt handling.
  747. *
  748. * Return: errno
  749. */
  750. int hif_apps_irqs_disable(struct hif_opaque_softc *hif_ctx);
  751. /**
  752. * hif_apps_wake_irq_enable() - Enables the wake irq from the APPS side
  753. * @hif_ctx: an opaque HIF handle to use
  754. *
  755. * As opposed to the standard hif_irq_enable, this function always applies to
  756. * the APPS side kernel interrupt handling.
  757. *
  758. * Return: errno
  759. */
  760. int hif_apps_wake_irq_enable(struct hif_opaque_softc *hif_ctx);
  761. /**
  762. * hif_apps_wake_irq_disable() - Disables the wake irq from the APPS side
  763. * @hif_ctx: an opaque HIF handle to use
  764. *
  765. * As opposed to the standard hif_irq_disable, this function always applies to
  766. * the APPS side kernel interrupt handling.
  767. *
  768. * Return: errno
  769. */
  770. int hif_apps_wake_irq_disable(struct hif_opaque_softc *hif_ctx);
  771. #ifdef FEATURE_RUNTIME_PM
  772. int hif_pre_runtime_suspend(struct hif_opaque_softc *hif_ctx);
  773. void hif_pre_runtime_resume(struct hif_opaque_softc *hif_ctx);
  774. int hif_runtime_suspend(struct hif_opaque_softc *hif_ctx);
  775. int hif_runtime_resume(struct hif_opaque_softc *hif_ctx);
  776. void hif_process_runtime_suspend_success(struct hif_opaque_softc *hif_ctx);
  777. void hif_process_runtime_suspend_failure(struct hif_opaque_softc *hif_ctx);
  778. void hif_process_runtime_resume_success(struct hif_opaque_softc *hif_ctx);
  779. #endif
  780. int hif_get_irq_num(struct hif_opaque_softc *scn, int *irq, uint32_t size);
  781. int hif_dump_registers(struct hif_opaque_softc *scn);
  782. int ol_copy_ramdump(struct hif_opaque_softc *scn);
  783. void hif_crash_shutdown(struct hif_opaque_softc *hif_ctx);
  784. void hif_get_hw_info(struct hif_opaque_softc *hif_ctx, u32 *version,
  785. u32 *revision, const char **target_name);
  786. bool hif_needs_bmi(struct hif_opaque_softc *hif_ctx);
  787. enum qdf_bus_type hif_get_bus_type(struct hif_opaque_softc *hif_hdl);
  788. struct hif_target_info *hif_get_target_info_handle(struct hif_opaque_softc *
  789. scn);
  790. struct hif_config_info *hif_get_ini_handle(struct hif_opaque_softc *hif_ctx);
  791. struct ramdump_info *hif_get_ramdump_ctx(struct hif_opaque_softc *hif_ctx);
  792. enum hif_target_status hif_get_target_status(struct hif_opaque_softc *hif_ctx);
  793. void hif_set_target_status(struct hif_opaque_softc *hif_ctx, enum
  794. hif_target_status);
  795. void hif_init_ini_config(struct hif_opaque_softc *hif_ctx,
  796. struct hif_config_info *cfg);
  797. void hif_update_tx_ring(struct hif_opaque_softc *osc, u_int32_t num_htt_cmpls);
  798. qdf_nbuf_t hif_batch_send(struct hif_opaque_softc *osc, qdf_nbuf_t msdu,
  799. uint32_t transfer_id, u_int32_t len, uint32_t sendhead);
  800. int hif_send_single(struct hif_opaque_softc *osc, qdf_nbuf_t msdu, uint32_t
  801. transfer_id, u_int32_t len);
  802. int hif_send_fast(struct hif_opaque_softc *osc, qdf_nbuf_t nbuf,
  803. uint32_t transfer_id, uint32_t download_len);
  804. void hif_pkt_dl_len_set(void *hif_sc, unsigned int pkt_download_len);
  805. void hif_ce_war_disable(void);
  806. void hif_ce_war_enable(void);
  807. void hif_disable_interrupt(struct hif_opaque_softc *osc, uint32_t pipe_num);
  808. #ifdef QCA_NSS_WIFI_OFFLOAD_SUPPORT
  809. struct hif_pipe_addl_info *hif_get_addl_pipe_info(struct hif_opaque_softc *osc,
  810. struct hif_pipe_addl_info *hif_info, uint32_t pipe_number);
  811. uint32_t hif_set_nss_wifiol_mode(struct hif_opaque_softc *osc,
  812. uint32_t pipe_num);
  813. int32_t hif_get_nss_wifiol_bypass_nw_process(struct hif_opaque_softc *osc);
  814. #endif /* QCA_NSS_WIFI_OFFLOAD_SUPPORT */
  815. void hif_set_bundle_mode(struct hif_opaque_softc *hif_ctx, bool enabled,
  816. int rx_bundle_cnt);
  817. int hif_bus_reset_resume(struct hif_opaque_softc *hif_ctx);
  818. void hif_set_attribute(struct hif_opaque_softc *osc, uint8_t hif_attrib);
  819. void *hif_get_lro_info(int ctx_id, struct hif_opaque_softc *hif_hdl);
  820. enum hif_exec_type {
  821. HIF_EXEC_NAPI_TYPE,
  822. HIF_EXEC_TASKLET_TYPE,
  823. };
  824. typedef uint32_t (*ext_intr_handler)(void *, uint32_t);
  825. uint32_t hif_configure_ext_group_interrupts(struct hif_opaque_softc *hif_ctx);
  826. uint32_t hif_register_ext_group(struct hif_opaque_softc *hif_ctx,
  827. uint32_t numirq, uint32_t irq[], ext_intr_handler handler,
  828. void *cb_ctx, const char *context_name,
  829. enum hif_exec_type type, uint32_t scale);
  830. void hif_deregister_exec_group(struct hif_opaque_softc *hif_ctx,
  831. const char *context_name);
  832. void hif_update_pipe_callback(struct hif_opaque_softc *osc,
  833. u_int8_t pipeid,
  834. struct hif_msg_callbacks *callbacks);
  835. void hif_print_napi_stats(struct hif_opaque_softc *hif_ctx);
  836. #ifdef __cplusplus
  837. }
  838. #endif
  839. void *hif_get_dev_ba(struct hif_opaque_softc *hif_handle);
  840. /**
  841. * hif_set_initial_wakeup_cb() - set the initial wakeup event handler function
  842. * @hif_ctx - the HIF context to assign the callback to
  843. * @callback - the callback to assign
  844. * @priv - the private data to pass to the callback when invoked
  845. *
  846. * Return: None
  847. */
  848. void hif_set_initial_wakeup_cb(struct hif_opaque_softc *hif_ctx,
  849. void (*callback)(void *),
  850. void *priv);
  851. #ifndef CONFIG_WIN
  852. #ifndef HIF_CE_DEBUG_DATA_BUF
  853. #define HIF_CE_DEBUG_DATA_BUF 0
  854. #endif
  855. #endif
  856. /*
  857. * Note: For MCL, #if defined (HIF_CONFIG_SLUB_DEBUG_ON) needs to be checked
  858. * for defined here
  859. */
  860. #if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
  861. ssize_t hif_dump_desc_trace_buf(struct device *dev,
  862. struct device_attribute *attr, char *buf);
  863. ssize_t hif_input_desc_trace_buf_index(struct hif_softc *scn,
  864. const char *buf, size_t size);
  865. ssize_t hif_ce_en_desc_hist(struct hif_softc *scn,
  866. const char *buf, size_t size);
  867. ssize_t hif_disp_ce_enable_desc_data_hist(struct hif_softc *scn, char *buf);
  868. ssize_t hif_dump_desc_event(struct hif_softc *scn, char *buf);
  869. #endif /* Note: for MCL, #if defined(HIF_CONFIG_SLUB_DEBUG_ON) || HIF_CE_DEBUG_DATA_BUF */
  870. /**
  871. * hif_set_ce_service_max_yield_time() - sets CE service max yield time
  872. * @hif: hif context
  873. * @ce_service_max_yield_time: CE service max yield time to set
  874. *
  875. * This API storess CE service max yield time in hif context based
  876. * on ini value.
  877. *
  878. * Return: void
  879. */
  880. void hif_set_ce_service_max_yield_time(struct hif_opaque_softc *hif,
  881. uint32_t ce_service_max_yield_time);
  882. /**
  883. * hif_get_ce_service_max_yield_time() - get CE service max yield time
  884. * @hif: hif context
  885. *
  886. * This API returns CE service max yield time.
  887. *
  888. * Return: CE service max yield time
  889. */
  890. unsigned long long
  891. hif_get_ce_service_max_yield_time(struct hif_opaque_softc *hif);
  892. /**
  893. * hif_set_ce_service_max_rx_ind_flush() - sets CE service max rx ind flush
  894. * @hif: hif context
  895. * @ce_service_max_rx_ind_flush: CE service max rx ind flush to set
  896. *
  897. * This API stores CE service max rx ind flush in hif context based
  898. * on ini value.
  899. *
  900. * Return: void
  901. */
  902. void hif_set_ce_service_max_rx_ind_flush(struct hif_opaque_softc *hif,
  903. uint8_t ce_service_max_rx_ind_flush);
  904. #ifdef OL_ATH_SMART_LOGGING
  905. /*
  906. * hif_log_ce_dump() - Copy all the CE DEST ring to buf
  907. * @scn : HIF handler
  908. * @buf_cur: Current pointer in ring buffer
  909. * @buf_init:Start of the ring buffer
  910. * @buf_sz: Size of the ring buffer
  911. * @ce: Copy Engine id
  912. * @skb_sz: Max size of the SKB buffer to be copied
  913. *
  914. * Calls the respective function to dump all the CE SRC/DEST ring descriptors
  915. * and buffers pointed by them in to the given buf
  916. *
  917. * Return: Current pointer in ring buffer
  918. */
  919. uint8_t *hif_log_dump_ce(struct hif_softc *scn, uint8_t *buf_cur,
  920. uint8_t *buf_init, uint32_t buf_sz,
  921. uint32_t ce, uint32_t skb_sz);
  922. #endif /* OL_ATH_SMART_LOGGING */
  923. #endif /* _HIF_H_ */