hif.h 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536
  1. /*
  2. * Copyright (c) 2013-2020 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. #include "cfg_ucfg_api.h"
  39. #include "qdf_dev.h"
  40. #define ENABLE_MBOX_DUMMY_SPACE_FEATURE 1
  41. typedef void __iomem *A_target_id_t;
  42. typedef void *hif_handle_t;
  43. #define HIF_TYPE_AR6002 2
  44. #define HIF_TYPE_AR6003 3
  45. #define HIF_TYPE_AR6004 5
  46. #define HIF_TYPE_AR9888 6
  47. #define HIF_TYPE_AR6320 7
  48. #define HIF_TYPE_AR6320V2 8
  49. /* For attaching Peregrine 2.0 board host_reg_tbl only */
  50. #define HIF_TYPE_AR9888V2 9
  51. #define HIF_TYPE_ADRASTEA 10
  52. #define HIF_TYPE_AR900B 11
  53. #define HIF_TYPE_QCA9984 12
  54. #define HIF_TYPE_IPQ4019 13
  55. #define HIF_TYPE_QCA9888 14
  56. #define HIF_TYPE_QCA8074 15
  57. #define HIF_TYPE_QCA6290 16
  58. #define HIF_TYPE_QCN7605 17
  59. #define HIF_TYPE_QCA6390 18
  60. #define HIF_TYPE_QCA8074V2 19
  61. #define HIF_TYPE_QCA6018 20
  62. #define HIF_TYPE_QCN9000 21
  63. #define HIF_TYPE_QCA6490 22
  64. #define HIF_TYPE_QCA6750 23
  65. #define HIF_TYPE_QCA5018 24
  66. #define DMA_COHERENT_MASK_DEFAULT 37
  67. #ifdef IPA_OFFLOAD
  68. #define DMA_COHERENT_MASK_BELOW_IPA_VER_3 32
  69. #endif
  70. /* enum hif_ic_irq - enum defining integrated chip irq numbers
  71. * defining irq nubers that can be used by external modules like datapath
  72. */
  73. enum hif_ic_irq {
  74. host2wbm_desc_feed = 16,
  75. host2reo_re_injection,
  76. host2reo_command,
  77. host2rxdma_monitor_ring3,
  78. host2rxdma_monitor_ring2,
  79. host2rxdma_monitor_ring1,
  80. reo2host_exception,
  81. wbm2host_rx_release,
  82. reo2host_status,
  83. reo2host_destination_ring4,
  84. reo2host_destination_ring3,
  85. reo2host_destination_ring2,
  86. reo2host_destination_ring1,
  87. rxdma2host_monitor_destination_mac3,
  88. rxdma2host_monitor_destination_mac2,
  89. rxdma2host_monitor_destination_mac1,
  90. ppdu_end_interrupts_mac3,
  91. ppdu_end_interrupts_mac2,
  92. ppdu_end_interrupts_mac1,
  93. rxdma2host_monitor_status_ring_mac3,
  94. rxdma2host_monitor_status_ring_mac2,
  95. rxdma2host_monitor_status_ring_mac1,
  96. host2rxdma_host_buf_ring_mac3,
  97. host2rxdma_host_buf_ring_mac2,
  98. host2rxdma_host_buf_ring_mac1,
  99. rxdma2host_destination_ring_mac3,
  100. rxdma2host_destination_ring_mac2,
  101. rxdma2host_destination_ring_mac1,
  102. host2tcl_input_ring4,
  103. host2tcl_input_ring3,
  104. host2tcl_input_ring2,
  105. host2tcl_input_ring1,
  106. wbm2host_tx_completions_ring3,
  107. wbm2host_tx_completions_ring2,
  108. wbm2host_tx_completions_ring1,
  109. tcl2host_status_ring,
  110. };
  111. struct CE_state;
  112. #define CE_COUNT_MAX 12
  113. #define HIF_MAX_GRP_IRQ 16
  114. #ifndef HIF_MAX_GROUP
  115. #define HIF_MAX_GROUP 7
  116. #endif
  117. #ifndef NAPI_YIELD_BUDGET_BASED
  118. #ifndef QCA_NAPI_DEF_SCALE_BIN_SHIFT
  119. #define QCA_NAPI_DEF_SCALE_BIN_SHIFT 4
  120. #endif
  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. * @poll_time_buckets - histogram of poll times for the napi
  144. *
  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. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  157. uint32_t poll_time_buckets[QCA_NAPI_NUM_BUCKETS];
  158. #endif
  159. };
  160. /**
  161. * per NAPI instance data structure
  162. * This data structure holds stuff per NAPI instance.
  163. * Note that, in the current implementation, though scale is
  164. * an instance variable, it is set to the same value for all
  165. * instances.
  166. */
  167. struct qca_napi_info {
  168. struct net_device netdev; /* dummy net_dev */
  169. void *hif_ctx;
  170. struct napi_struct napi;
  171. uint8_t scale; /* currently same on all instances */
  172. uint8_t id;
  173. uint8_t cpu;
  174. int irq;
  175. cpumask_t cpumask;
  176. struct qca_napi_stat stats[NR_CPUS];
  177. #ifdef RECEIVE_OFFLOAD
  178. /* will only be present for data rx CE's */
  179. void (*offld_flush_cb)(void *);
  180. struct napi_struct rx_thread_napi;
  181. struct net_device rx_thread_netdev;
  182. #endif /* RECEIVE_OFFLOAD */
  183. qdf_lro_ctx_t lro_ctx;
  184. };
  185. enum qca_napi_tput_state {
  186. QCA_NAPI_TPUT_UNINITIALIZED,
  187. QCA_NAPI_TPUT_LO,
  188. QCA_NAPI_TPUT_HI
  189. };
  190. enum qca_napi_cpu_state {
  191. QCA_NAPI_CPU_UNINITIALIZED,
  192. QCA_NAPI_CPU_DOWN,
  193. QCA_NAPI_CPU_UP };
  194. /**
  195. * struct qca_napi_cpu - an entry of the napi cpu table
  196. * @core_id: physical core id of the core
  197. * @cluster_id: cluster this core belongs to
  198. * @core_mask: mask to match all core of this cluster
  199. * @thread_mask: mask for this core within the cluster
  200. * @max_freq: maximum clock this core can be clocked at
  201. * same for all cpus of the same core.
  202. * @napis: bitmap of napi instances on this core
  203. * @execs: bitmap of execution contexts on this core
  204. * cluster_nxt: chain to link cores within the same cluster
  205. *
  206. * This structure represents a single entry in the napi cpu
  207. * table. The table is part of struct qca_napi_data.
  208. * This table is initialized by the init function, called while
  209. * the first napi instance is being created, updated by hotplug
  210. * notifier and when cpu affinity decisions are made (by throughput
  211. * detection), and deleted when the last napi instance is removed.
  212. */
  213. struct qca_napi_cpu {
  214. enum qca_napi_cpu_state state;
  215. int core_id;
  216. int cluster_id;
  217. cpumask_t core_mask;
  218. cpumask_t thread_mask;
  219. unsigned int max_freq;
  220. uint32_t napis;
  221. uint32_t execs;
  222. int cluster_nxt; /* index, not pointer */
  223. };
  224. /**
  225. * struct qca_napi_data - collection of napi data for a single hif context
  226. * @hif_softc: pointer to the hif context
  227. * @lock: spinlock used in the event state machine
  228. * @state: state variable used in the napi stat machine
  229. * @ce_map: bit map indicating which ce's have napis running
  230. * @exec_map: bit map of instanciated exec contexts
  231. * @user_cpu_affin_map: CPU affinity map from INI config.
  232. * @napi_cpu: cpu info for irq affinty
  233. * @lilcl_head:
  234. * @bigcl_head:
  235. * @napi_mode: irq affinity & clock voting mode
  236. * @cpuhp_handler: CPU hotplug event registration handle
  237. */
  238. struct qca_napi_data {
  239. struct hif_softc *hif_softc;
  240. qdf_spinlock_t lock;
  241. uint32_t state;
  242. /* bitmap of created/registered NAPI instances, indexed by pipe_id,
  243. * not used by clients (clients use an id returned by create)
  244. */
  245. uint32_t ce_map;
  246. uint32_t exec_map;
  247. uint32_t user_cpu_affin_mask;
  248. struct qca_napi_info *napis[CE_COUNT_MAX];
  249. struct qca_napi_cpu napi_cpu[NR_CPUS];
  250. int lilcl_head, bigcl_head;
  251. enum qca_napi_tput_state napi_mode;
  252. struct qdf_cpuhp_handler *cpuhp_handler;
  253. uint8_t flags;
  254. };
  255. /**
  256. * struct hif_config_info - Place Holder for HIF configuration
  257. * @enable_self_recovery: Self Recovery
  258. * @enable_runtime_pm: Enable Runtime PM
  259. * @runtime_pm_delay: Runtime PM Delay
  260. * @rx_softirq_max_yield_duration_ns: Max Yield time duration for RX Softirq
  261. *
  262. * Structure for holding HIF ini parameters.
  263. */
  264. struct hif_config_info {
  265. bool enable_self_recovery;
  266. #ifdef FEATURE_RUNTIME_PM
  267. uint8_t enable_runtime_pm;
  268. u_int32_t runtime_pm_delay;
  269. #endif
  270. uint64_t rx_softirq_max_yield_duration_ns;
  271. };
  272. /**
  273. * struct hif_target_info - Target Information
  274. * @target_version: Target Version
  275. * @target_type: Target Type
  276. * @target_revision: Target Revision
  277. * @soc_version: SOC Version
  278. * @hw_name: pointer to hardware name
  279. *
  280. * Structure to hold target information.
  281. */
  282. struct hif_target_info {
  283. uint32_t target_version;
  284. uint32_t target_type;
  285. uint32_t target_revision;
  286. uint32_t soc_version;
  287. char *hw_name;
  288. };
  289. struct hif_opaque_softc {
  290. };
  291. /**
  292. * enum hif_event_type - Type of DP events to be recorded
  293. * @HIF_EVENT_IRQ_TRIGGER: IRQ trigger event
  294. * @HIF_EVENT_TIMER_ENTRY: Monitor Timer entry event
  295. * @HIF_EVENT_TIMER_EXIT: Monitor Timer exit event
  296. * @HIF_EVENT_BH_SCHED: NAPI POLL scheduled event
  297. * @HIF_EVENT_SRNG_ACCESS_START: hal ring access start event
  298. * @HIF_EVENT_SRNG_ACCESS_END: hal ring access end event
  299. */
  300. enum hif_event_type {
  301. HIF_EVENT_IRQ_TRIGGER,
  302. HIF_EVENT_TIMER_ENTRY,
  303. HIF_EVENT_TIMER_EXIT,
  304. HIF_EVENT_BH_SCHED,
  305. HIF_EVENT_SRNG_ACCESS_START,
  306. HIF_EVENT_SRNG_ACCESS_END,
  307. };
  308. #ifdef WLAN_FEATURE_DP_EVENT_HISTORY
  309. /* HIF_EVENT_HIST_MAX should always be power of 2 */
  310. #define HIF_EVENT_HIST_MAX 512
  311. #define HIF_NUM_INT_CONTEXTS HIF_MAX_GROUP
  312. #define HIF_EVENT_HIST_DISABLE_MASK 0
  313. /**
  314. * struct hif_event_record - an entry of the DP event history
  315. * @hal_ring_id: ring id for which event is recorded
  316. * @hp: head pointer of the ring (may not be applicable for all events)
  317. * @tp: tail pointer of the ring (may not be applicable for all events)
  318. * @cpu_id: cpu id on which the event occurred
  319. * @timestamp: timestamp when event occurred
  320. * @type: type of the event
  321. *
  322. * This structure represents the information stored for every datapath
  323. * event which is logged in the history.
  324. */
  325. struct hif_event_record {
  326. uint8_t hal_ring_id;
  327. uint32_t hp;
  328. uint32_t tp;
  329. int cpu_id;
  330. uint64_t timestamp;
  331. enum hif_event_type type;
  332. };
  333. /**
  334. * struct hif_event_history - history for one interrupt group
  335. * @index: index to store new event
  336. * @event: event entry
  337. *
  338. * This structure represents the datapath history for one
  339. * interrupt group.
  340. */
  341. struct hif_event_history {
  342. qdf_atomic_t index;
  343. struct hif_event_record event[HIF_EVENT_HIST_MAX];
  344. };
  345. /**
  346. * hif_hist_record_event() - Record one datapath event in history
  347. * @hif_ctx: HIF opaque context
  348. * @event: DP event entry
  349. * @intr_grp_id: interrupt group ID registered with hif
  350. *
  351. * Return: None
  352. */
  353. void hif_hist_record_event(struct hif_opaque_softc *hif_ctx,
  354. struct hif_event_record *event,
  355. uint8_t intr_grp_id);
  356. /**
  357. * hif_event_history_init() - Initialize SRNG event history buffers
  358. * @hif_ctx: HIF opaque context
  359. * @id: context group ID for which history is recorded
  360. *
  361. * Returns: None
  362. */
  363. void hif_event_history_init(struct hif_opaque_softc *hif_ctx, uint8_t id);
  364. /**
  365. * hif_event_history_deinit() - De-initialize SRNG event history buffers
  366. * @hif_ctx: HIF opaque context
  367. * @id: context group ID for which history is recorded
  368. *
  369. * Returns: None
  370. */
  371. void hif_event_history_deinit(struct hif_opaque_softc *hif_ctx, uint8_t id);
  372. /**
  373. * hif_record_event() - Wrapper function to form and record DP event
  374. * @hif_ctx: HIF opaque context
  375. * @intr_grp_id: interrupt group ID registered with hif
  376. * @hal_ring_id: ring id for which event is recorded
  377. * @hp: head pointer index of the srng
  378. * @tp: tail pointer index of the srng
  379. * @type: type of the event to be logged in history
  380. *
  381. * Return: None
  382. */
  383. static inline void hif_record_event(struct hif_opaque_softc *hif_ctx,
  384. uint8_t intr_grp_id,
  385. uint8_t hal_ring_id,
  386. uint32_t hp,
  387. uint32_t tp,
  388. enum hif_event_type type)
  389. {
  390. struct hif_event_record event;
  391. event.hal_ring_id = hal_ring_id;
  392. event.hp = hp;
  393. event.tp = tp;
  394. event.type = type;
  395. return hif_hist_record_event(hif_ctx, &event,
  396. intr_grp_id);
  397. }
  398. #else
  399. static inline void hif_record_event(struct hif_opaque_softc *hif_ctx,
  400. uint8_t intr_grp_id,
  401. uint8_t hal_ring_id,
  402. uint32_t hp,
  403. uint32_t tp,
  404. enum hif_event_type type)
  405. {
  406. }
  407. static inline void hif_event_history_init(struct hif_opaque_softc *hif_ctx,
  408. uint8_t id)
  409. {
  410. }
  411. static inline void hif_event_history_deinit(struct hif_opaque_softc *hif_ctx,
  412. uint8_t id)
  413. {
  414. }
  415. #endif /* WLAN_FEATURE_DP_EVENT_HISTORY */
  416. /**
  417. * enum HIF_DEVICE_POWER_CHANGE_TYPE: Device Power change type
  418. *
  419. * @HIF_DEVICE_POWER_UP: HIF layer should power up interface and/or module
  420. * @HIF_DEVICE_POWER_DOWN: HIF layer should initiate bus-specific measures to
  421. * minimize power
  422. * @HIF_DEVICE_POWER_CUT: HIF layer should initiate bus-specific AND/OR
  423. * platform-specific measures to completely power-off
  424. * the module and associated hardware (i.e. cut power
  425. * supplies)
  426. */
  427. enum HIF_DEVICE_POWER_CHANGE_TYPE {
  428. HIF_DEVICE_POWER_UP,
  429. HIF_DEVICE_POWER_DOWN,
  430. HIF_DEVICE_POWER_CUT
  431. };
  432. /**
  433. * enum hif_enable_type: what triggered the enabling of hif
  434. *
  435. * @HIF_ENABLE_TYPE_PROBE: probe triggered enable
  436. * @HIF_ENABLE_TYPE_REINIT: reinit triggered enable
  437. */
  438. enum hif_enable_type {
  439. HIF_ENABLE_TYPE_PROBE,
  440. HIF_ENABLE_TYPE_REINIT,
  441. HIF_ENABLE_TYPE_MAX
  442. };
  443. /**
  444. * enum hif_disable_type: what triggered the disabling of hif
  445. *
  446. * @HIF_DISABLE_TYPE_PROBE_ERROR: probe error triggered disable
  447. * @HIF_DISABLE_TYPE_REINIT_ERROR: reinit error triggered disable
  448. * @HIF_DISABLE_TYPE_REMOVE: remove triggered disable
  449. * @HIF_DISABLE_TYPE_SHUTDOWN: shutdown triggered disable
  450. */
  451. enum hif_disable_type {
  452. HIF_DISABLE_TYPE_PROBE_ERROR,
  453. HIF_DISABLE_TYPE_REINIT_ERROR,
  454. HIF_DISABLE_TYPE_REMOVE,
  455. HIF_DISABLE_TYPE_SHUTDOWN,
  456. HIF_DISABLE_TYPE_MAX
  457. };
  458. /**
  459. * enum hif_device_config_opcode: configure mode
  460. *
  461. * @HIF_DEVICE_POWER_STATE: device power state
  462. * @HIF_DEVICE_GET_BLOCK_SIZE: get block size
  463. * @HIF_DEVICE_GET_ADDR: get block address
  464. * @HIF_DEVICE_GET_PENDING_EVENTS_FUNC: get pending events functions
  465. * @HIF_DEVICE_GET_IRQ_PROC_MODE: get irq proc mode
  466. * @HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC: receive event function
  467. * @HIF_DEVICE_POWER_STATE_CHANGE: change power state
  468. * @HIF_DEVICE_GET_IRQ_YIELD_PARAMS: get yield params
  469. * @HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT: configure scatter request
  470. * @HIF_DEVICE_GET_OS_DEVICE: get OS device
  471. * @HIF_DEVICE_DEBUG_BUS_STATE: debug bus state
  472. * @HIF_BMI_DONE: bmi done
  473. * @HIF_DEVICE_SET_TARGET_TYPE: set target type
  474. * @HIF_DEVICE_SET_HTC_CONTEXT: set htc context
  475. * @HIF_DEVICE_GET_HTC_CONTEXT: get htc context
  476. */
  477. enum hif_device_config_opcode {
  478. HIF_DEVICE_POWER_STATE = 0,
  479. HIF_DEVICE_GET_BLOCK_SIZE,
  480. HIF_DEVICE_GET_FIFO_ADDR,
  481. HIF_DEVICE_GET_PENDING_EVENTS_FUNC,
  482. HIF_DEVICE_GET_IRQ_PROC_MODE,
  483. HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC,
  484. HIF_DEVICE_POWER_STATE_CHANGE,
  485. HIF_DEVICE_GET_IRQ_YIELD_PARAMS,
  486. HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT,
  487. HIF_DEVICE_GET_OS_DEVICE,
  488. HIF_DEVICE_DEBUG_BUS_STATE,
  489. HIF_BMI_DONE,
  490. HIF_DEVICE_SET_TARGET_TYPE,
  491. HIF_DEVICE_SET_HTC_CONTEXT,
  492. HIF_DEVICE_GET_HTC_CONTEXT,
  493. };
  494. #ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
  495. struct HID_ACCESS_LOG {
  496. uint32_t seqnum;
  497. bool is_write;
  498. void *addr;
  499. uint32_t value;
  500. };
  501. #endif
  502. void hif_reg_write(struct hif_opaque_softc *hif_ctx, uint32_t offset,
  503. uint32_t value);
  504. uint32_t hif_reg_read(struct hif_opaque_softc *hif_ctx, uint32_t offset);
  505. #define HIF_MAX_DEVICES 1
  506. /**
  507. * struct htc_callbacks - Structure for HTC Callbacks methods
  508. * @context: context to pass to the dsrhandler
  509. * note : rwCompletionHandler is provided the context
  510. * passed to hif_read_write
  511. * @rwCompletionHandler: Read / write completion handler
  512. * @dsrHandler: DSR Handler
  513. */
  514. struct htc_callbacks {
  515. void *context;
  516. QDF_STATUS(*rw_compl_handler)(void *rw_ctx, QDF_STATUS status);
  517. QDF_STATUS(*dsr_handler)(void *context);
  518. };
  519. /**
  520. * struct hif_driver_state_callbacks - Callbacks for HIF to query Driver state
  521. * @context: Private data context
  522. * @set_recovery_in_progress: To Set Driver state for recovery in progress
  523. * @is_recovery_in_progress: Query if driver state is recovery in progress
  524. * @is_load_unload_in_progress: Query if driver state Load/Unload in Progress
  525. * @is_driver_unloading: Query if driver is unloading.
  526. * @get_bandwidth_level: Query current bandwidth level for the driver
  527. * This Structure provides callback pointer for HIF to query hdd for driver
  528. * states.
  529. */
  530. struct hif_driver_state_callbacks {
  531. void *context;
  532. void (*set_recovery_in_progress)(void *context, uint8_t val);
  533. bool (*is_recovery_in_progress)(void *context);
  534. bool (*is_load_unload_in_progress)(void *context);
  535. bool (*is_driver_unloading)(void *context);
  536. bool (*is_target_ready)(void *context);
  537. int (*get_bandwidth_level)(void *context);
  538. };
  539. /* This API detaches the HTC layer from the HIF device */
  540. void hif_detach_htc(struct hif_opaque_softc *hif_ctx);
  541. /****************************************************************/
  542. /* BMI and Diag window abstraction */
  543. /****************************************************************/
  544. #define HIF_BMI_EXCHANGE_NO_TIMEOUT ((uint32_t)(0))
  545. #define DIAG_TRANSFER_LIMIT 2048U /* maximum number of bytes that can be
  546. * handled atomically by
  547. * DiagRead/DiagWrite
  548. */
  549. #ifdef WLAN_FEATURE_BMI
  550. /*
  551. * API to handle HIF-specific BMI message exchanges, this API is synchronous
  552. * and only allowed to be called from a context that can block (sleep)
  553. */
  554. QDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx,
  555. qdf_dma_addr_t cmd, qdf_dma_addr_t rsp,
  556. uint8_t *pSendMessage, uint32_t Length,
  557. uint8_t *pResponseMessage,
  558. uint32_t *pResponseLength, uint32_t TimeoutMS);
  559. void hif_register_bmi_callbacks(struct hif_opaque_softc *hif_ctx);
  560. bool hif_needs_bmi(struct hif_opaque_softc *hif_ctx);
  561. #else /* WLAN_FEATURE_BMI */
  562. static inline void
  563. hif_register_bmi_callbacks(struct hif_opaque_softc *hif_ctx)
  564. {
  565. }
  566. static inline bool
  567. hif_needs_bmi(struct hif_opaque_softc *hif_ctx)
  568. {
  569. return false;
  570. }
  571. #endif /* WLAN_FEATURE_BMI */
  572. /*
  573. * APIs to handle HIF specific diagnostic read accesses. These APIs are
  574. * synchronous and only allowed to be called from a context that
  575. * can block (sleep). They are not high performance APIs.
  576. *
  577. * hif_diag_read_access reads a 4 Byte aligned/length value from a
  578. * Target register or memory word.
  579. *
  580. * hif_diag_read_mem reads an arbitrary length of arbitrarily aligned memory.
  581. */
  582. QDF_STATUS hif_diag_read_access(struct hif_opaque_softc *hif_ctx,
  583. uint32_t address, uint32_t *data);
  584. QDF_STATUS hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address,
  585. uint8_t *data, int nbytes);
  586. void hif_dump_target_memory(struct hif_opaque_softc *hif_ctx,
  587. void *ramdump_base, uint32_t address, uint32_t size);
  588. /*
  589. * APIs to handle HIF specific diagnostic write accesses. These APIs are
  590. * synchronous and only allowed to be called from a context that
  591. * can block (sleep).
  592. * They are not high performance APIs.
  593. *
  594. * hif_diag_write_access writes a 4 Byte aligned/length value to a
  595. * Target register or memory word.
  596. *
  597. * hif_diag_write_mem writes an arbitrary length of arbitrarily aligned memory.
  598. */
  599. QDF_STATUS hif_diag_write_access(struct hif_opaque_softc *hif_ctx,
  600. uint32_t address, uint32_t data);
  601. QDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx,
  602. uint32_t address, uint8_t *data, int nbytes);
  603. typedef void (*fastpath_msg_handler)(void *, qdf_nbuf_t *, uint32_t);
  604. void hif_enable_polled_mode(struct hif_opaque_softc *hif_ctx);
  605. bool hif_is_polled_mode_enabled(struct hif_opaque_softc *hif_ctx);
  606. /*
  607. * Set the FASTPATH_mode_on flag in sc, for use by data path
  608. */
  609. #ifdef WLAN_FEATURE_FASTPATH
  610. void hif_enable_fastpath(struct hif_opaque_softc *hif_ctx);
  611. bool hif_is_fastpath_mode_enabled(struct hif_opaque_softc *hif_ctx);
  612. void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int ret);
  613. /**
  614. * hif_ce_fastpath_cb_register() - Register callback for fastpath msg handler
  615. * @handler: Callback funtcion
  616. * @context: handle for callback function
  617. *
  618. * Return: QDF_STATUS_SUCCESS on success or QDF_STATUS_E_FAILURE
  619. */
  620. QDF_STATUS hif_ce_fastpath_cb_register(
  621. struct hif_opaque_softc *hif_ctx,
  622. fastpath_msg_handler handler, void *context);
  623. #else
  624. static inline QDF_STATUS hif_ce_fastpath_cb_register(
  625. struct hif_opaque_softc *hif_ctx,
  626. fastpath_msg_handler handler, void *context)
  627. {
  628. return QDF_STATUS_E_FAILURE;
  629. }
  630. static inline void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int ret)
  631. {
  632. return NULL;
  633. }
  634. #endif
  635. /*
  636. * Enable/disable CDC max performance workaround
  637. * For max-performace set this to 0
  638. * To allow SoC to enter sleep set this to 1
  639. */
  640. #define CONFIG_DISABLE_CDC_MAX_PERF_WAR 0
  641. void hif_ipa_get_ce_resource(struct hif_opaque_softc *hif_ctx,
  642. qdf_shared_mem_t **ce_sr,
  643. uint32_t *ce_sr_ring_size,
  644. qdf_dma_addr_t *ce_reg_paddr);
  645. /**
  646. * @brief List of callbacks - filled in by HTC.
  647. */
  648. struct hif_msg_callbacks {
  649. void *Context;
  650. /**< context meaningful to HTC */
  651. QDF_STATUS (*txCompletionHandler)(void *Context, qdf_nbuf_t wbuf,
  652. uint32_t transferID,
  653. uint32_t toeplitz_hash_result);
  654. QDF_STATUS (*rxCompletionHandler)(void *Context, qdf_nbuf_t wbuf,
  655. uint8_t pipeID);
  656. void (*txResourceAvailHandler)(void *context, uint8_t pipe);
  657. void (*fwEventHandler)(void *context, QDF_STATUS status);
  658. void (*update_bundle_stats)(void *context, uint8_t no_of_pkt_in_bundle);
  659. };
  660. enum hif_target_status {
  661. TARGET_STATUS_CONNECTED = 0, /* target connected */
  662. TARGET_STATUS_RESET, /* target got reset */
  663. TARGET_STATUS_EJECT, /* target got ejected */
  664. TARGET_STATUS_SUSPEND /*target got suspend */
  665. };
  666. /**
  667. * enum hif_attribute_flags: configure hif
  668. *
  669. * @HIF_LOWDESC_CE_CFG: Configure HIF with Low descriptor CE
  670. * @HIF_LOWDESC_CE_NO_PKTLOG_CFG: Configure HIF with Low descriptor
  671. * + No pktlog CE
  672. */
  673. enum hif_attribute_flags {
  674. HIF_LOWDESC_CE_CFG = 1,
  675. HIF_LOWDESC_CE_NO_PKTLOG_CFG
  676. };
  677. #define HIF_DATA_ATTR_SET_TX_CLASSIFY(attr, v) \
  678. (attr |= (v & 0x01) << 5)
  679. #define HIF_DATA_ATTR_SET_ENCAPSULATION_TYPE(attr, v) \
  680. (attr |= (v & 0x03) << 6)
  681. #define HIF_DATA_ATTR_SET_ADDR_X_SEARCH_DISABLE(attr, v) \
  682. (attr |= (v & 0x01) << 13)
  683. #define HIF_DATA_ATTR_SET_ADDR_Y_SEARCH_DISABLE(attr, v) \
  684. (attr |= (v & 0x01) << 14)
  685. #define HIF_DATA_ATTR_SET_TOEPLITZ_HASH_ENABLE(attr, v) \
  686. (attr |= (v & 0x01) << 15)
  687. #define HIF_DATA_ATTR_SET_PACKET_OR_RESULT_OFFSET(attr, v) \
  688. (attr |= (v & 0x0FFF) << 16)
  689. #define HIF_DATA_ATTR_SET_ENABLE_11H(attr, v) \
  690. (attr |= (v & 0x01) << 30)
  691. struct hif_ul_pipe_info {
  692. unsigned int nentries;
  693. unsigned int nentries_mask;
  694. unsigned int sw_index;
  695. unsigned int write_index; /* cached copy */
  696. unsigned int hw_index; /* cached copy */
  697. void *base_addr_owner_space; /* Host address space */
  698. qdf_dma_addr_t base_addr_CE_space; /* CE address space */
  699. };
  700. struct hif_dl_pipe_info {
  701. unsigned int nentries;
  702. unsigned int nentries_mask;
  703. unsigned int sw_index;
  704. unsigned int write_index; /* cached copy */
  705. unsigned int hw_index; /* cached copy */
  706. void *base_addr_owner_space; /* Host address space */
  707. qdf_dma_addr_t base_addr_CE_space; /* CE address space */
  708. };
  709. struct hif_pipe_addl_info {
  710. uint32_t pci_mem;
  711. uint32_t ctrl_addr;
  712. struct hif_ul_pipe_info ul_pipe;
  713. struct hif_dl_pipe_info dl_pipe;
  714. };
  715. #ifdef CONFIG_SLUB_DEBUG_ON
  716. #define MSG_FLUSH_NUM 16
  717. #else /* PERF build */
  718. #define MSG_FLUSH_NUM 32
  719. #endif /* SLUB_DEBUG_ON */
  720. struct hif_bus_id;
  721. void hif_claim_device(struct hif_opaque_softc *hif_ctx);
  722. QDF_STATUS hif_get_config_item(struct hif_opaque_softc *hif_ctx,
  723. int opcode, void *config, uint32_t config_len);
  724. void hif_set_mailbox_swap(struct hif_opaque_softc *hif_ctx);
  725. void hif_mask_interrupt_call(struct hif_opaque_softc *hif_ctx);
  726. void hif_post_init(struct hif_opaque_softc *hif_ctx, void *hHTC,
  727. struct hif_msg_callbacks *callbacks);
  728. QDF_STATUS hif_start(struct hif_opaque_softc *hif_ctx);
  729. void hif_stop(struct hif_opaque_softc *hif_ctx);
  730. void hif_flush_surprise_remove(struct hif_opaque_softc *hif_ctx);
  731. void hif_dump(struct hif_opaque_softc *hif_ctx, uint8_t CmdId, bool start);
  732. void hif_trigger_dump(struct hif_opaque_softc *hif_ctx,
  733. uint8_t cmd_id, bool start);
  734. QDF_STATUS hif_send_head(struct hif_opaque_softc *hif_ctx, uint8_t PipeID,
  735. uint32_t transferID, uint32_t nbytes,
  736. qdf_nbuf_t wbuf, uint32_t data_attr);
  737. void hif_send_complete_check(struct hif_opaque_softc *hif_ctx, uint8_t PipeID,
  738. int force);
  739. void hif_shut_down_device(struct hif_opaque_softc *hif_ctx);
  740. void hif_get_default_pipe(struct hif_opaque_softc *hif_ctx, uint8_t *ULPipe,
  741. uint8_t *DLPipe);
  742. int hif_map_service_to_pipe(struct hif_opaque_softc *hif_ctx, uint16_t svc_id,
  743. uint8_t *ul_pipe, uint8_t *dl_pipe, int *ul_is_polled,
  744. int *dl_is_polled);
  745. uint16_t
  746. hif_get_free_queue_number(struct hif_opaque_softc *hif_ctx, uint8_t PipeID);
  747. void *hif_get_targetdef(struct hif_opaque_softc *hif_ctx);
  748. uint32_t hif_hia_item_address(uint32_t target_type, uint32_t item_offset);
  749. void hif_set_target_sleep(struct hif_opaque_softc *hif_ctx, bool sleep_ok,
  750. bool wait_for_it);
  751. int hif_check_fw_reg(struct hif_opaque_softc *hif_ctx);
  752. #ifndef HIF_PCI
  753. static inline int hif_check_soc_status(struct hif_opaque_softc *hif_ctx)
  754. {
  755. return 0;
  756. }
  757. #else
  758. int hif_check_soc_status(struct hif_opaque_softc *hif_ctx);
  759. #endif
  760. void hif_get_hw_info(struct hif_opaque_softc *hif_ctx, u32 *version,
  761. u32 *revision, const char **target_name);
  762. #ifdef RECEIVE_OFFLOAD
  763. /**
  764. * hif_offld_flush_cb_register() - Register the offld flush callback
  765. * @scn: HIF opaque context
  766. * @offld_flush_handler: Flush callback is either ol_flush, incase of rx_thread
  767. * Or GRO/LRO flush when RxThread is not enabled. Called
  768. * with corresponding context for flush.
  769. * Return: None
  770. */
  771. void hif_offld_flush_cb_register(struct hif_opaque_softc *scn,
  772. void (offld_flush_handler)(void *ol_ctx));
  773. /**
  774. * hif_offld_flush_cb_deregister() - deRegister the offld flush callback
  775. * @scn: HIF opaque context
  776. *
  777. * Return: None
  778. */
  779. void hif_offld_flush_cb_deregister(struct hif_opaque_softc *scn);
  780. #endif
  781. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  782. /**
  783. * hif_exec_should_yield() - Check if hif napi context should yield
  784. * @hif_ctx - HIF opaque context
  785. * @grp_id - grp_id of the napi for which check needs to be done
  786. *
  787. * The function uses grp_id to look for NAPI and checks if NAPI needs to
  788. * yield. HIF_EXT_GROUP_MAX_YIELD_DURATION_NS is the duration used for
  789. * yield decision.
  790. *
  791. * Return: true if NAPI needs to yield, else false
  792. */
  793. bool hif_exec_should_yield(struct hif_opaque_softc *hif_ctx, uint grp_id);
  794. #else
  795. static inline bool hif_exec_should_yield(struct hif_opaque_softc *hif_ctx,
  796. uint grp_id)
  797. {
  798. return false;
  799. }
  800. #endif
  801. void hif_disable_isr(struct hif_opaque_softc *hif_ctx);
  802. void hif_reset_soc(struct hif_opaque_softc *hif_ctx);
  803. void hif_save_htc_htt_config_endpoint(struct hif_opaque_softc *hif_ctx,
  804. int htc_htt_tx_endpoint);
  805. /**
  806. * hif_open() - Create hif handle
  807. * @qdf_ctx: qdf context
  808. * @mode: Driver Mode
  809. * @bus_type: Bus Type
  810. * @cbk: CDS Callbacks
  811. * @psoc: psoc object manager
  812. *
  813. * API to open HIF Context
  814. *
  815. * Return: HIF Opaque Pointer
  816. */
  817. struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx,
  818. uint32_t mode,
  819. enum qdf_bus_type bus_type,
  820. struct hif_driver_state_callbacks *cbk,
  821. struct wlan_objmgr_psoc *psoc);
  822. void hif_close(struct hif_opaque_softc *hif_ctx);
  823. QDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev,
  824. void *bdev, const struct hif_bus_id *bid,
  825. enum qdf_bus_type bus_type,
  826. enum hif_enable_type type);
  827. void hif_disable(struct hif_opaque_softc *hif_ctx, enum hif_disable_type type);
  828. #ifdef CE_TASKLET_DEBUG_ENABLE
  829. void hif_enable_ce_latency_stats(struct hif_opaque_softc *hif_ctx,
  830. uint8_t value);
  831. #endif
  832. void hif_display_stats(struct hif_opaque_softc *hif_ctx);
  833. void hif_clear_stats(struct hif_opaque_softc *hif_ctx);
  834. /**
  835. * enum wlan_rtpm_dbgid - runtime pm put/get debug id
  836. * @RTPM_ID_RESVERD: Reserved
  837. * @RTPM_ID_WMI: WMI sending msg, expect put happen at
  838. * tx completion from CE level directly.
  839. * @RTPM_ID_HTC: pkt sending by HTT_DATA_MSG_SVC, expect
  840. * put from fw response or just in
  841. * htc_issue_packets
  842. * @RTPM_ID_QOS_NOTIFY: pm qos notifer
  843. * @RTPM_ID_DP_TX_DESC_ALLOC_FREE: tx desc alloc/free
  844. * @RTPM_ID_CE_SEND_FAST: operation in ce_send_fast, not include
  845. * the pkt put happens outside this function
  846. * @RTPM_ID_SUSPEND_RESUME: suspend/resume in hdd
  847. * @RTPM_ID_DW_TX_HW_ENQUEUE: operation in functin dp_tx_hw_enqueue
  848. * @RTPM_ID_HAL_REO_CMD: HAL_REO_CMD operation
  849. * @RTPM_ID_DP_PRINT_RING_STATS: operation in dp_print_ring_stats
  850. */
  851. /* New value added to the enum must also be reflected in function
  852. * rtpm_string_from_dbgid()
  853. */
  854. typedef enum {
  855. RTPM_ID_RESVERD = 0,
  856. RTPM_ID_WMI = 1,
  857. RTPM_ID_HTC = 2,
  858. RTPM_ID_QOS_NOTIFY = 3,
  859. RTPM_ID_DP_TX_DESC_ALLOC_FREE = 4,
  860. RTPM_ID_CE_SEND_FAST = 5,
  861. RTPM_ID_SUSPEND_RESUME = 6,
  862. RTPM_ID_DW_TX_HW_ENQUEUE = 7,
  863. RTPM_ID_HAL_REO_CMD = 8,
  864. RTPM_ID_DP_PRINT_RING_STATS = 9,
  865. RTPM_ID_MAX,
  866. } wlan_rtpm_dbgid;
  867. /**
  868. * rtpm_string_from_dbgid() - Convert dbgid to respective string
  869. * @id - debug id
  870. *
  871. * Debug support function to convert dbgid to string.
  872. * Please note to add new string in the array at index equal to
  873. * its enum value in wlan_rtpm_dbgid.
  874. */
  875. static inline char *rtpm_string_from_dbgid(wlan_rtpm_dbgid id)
  876. {
  877. static const char *strings[] = { "RTPM_ID_RESVERD",
  878. "RTPM_ID_WMI",
  879. "RTPM_ID_HTC",
  880. "RTPM_ID_QOS_NOTIFY",
  881. "RTPM_ID_DP_TX_DESC_ALLOC_FREE",
  882. "RTPM_ID_CE_SEND_FAST",
  883. "RTPM_ID_SUSPEND_RESUME",
  884. "RTPM_ID_DW_TX_HW_ENQUEUE",
  885. "RTPM_ID_HAL_REO_CMD",
  886. "RTPM_ID_DP_PRINT_RING_STATS",
  887. "RTPM_ID_MAX"};
  888. return (char *)strings[id];
  889. }
  890. #ifdef FEATURE_RUNTIME_PM
  891. struct hif_pm_runtime_lock;
  892. void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx);
  893. int hif_pm_runtime_get_sync(struct hif_opaque_softc *hif_ctx,
  894. wlan_rtpm_dbgid rtpm_dbgid);
  895. int hif_pm_runtime_put_sync_suspend(struct hif_opaque_softc *hif_ctx,
  896. wlan_rtpm_dbgid rtpm_dbgid);
  897. int hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx);
  898. int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx,
  899. wlan_rtpm_dbgid rtpm_dbgid);
  900. void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx,
  901. wlan_rtpm_dbgid rtpm_dbgid);
  902. int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx,
  903. wlan_rtpm_dbgid rtpm_dbgid);
  904. int hif_pm_runtime_put_noidle(struct hif_opaque_softc *hif_ctx,
  905. wlan_rtpm_dbgid rtpm_dbgid);
  906. void hif_pm_runtime_mark_last_busy(struct hif_opaque_softc *hif_ctx);
  907. int hif_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name);
  908. void hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx,
  909. struct hif_pm_runtime_lock *lock);
  910. int hif_pm_runtime_prevent_suspend(struct hif_opaque_softc *ol_sc,
  911. struct hif_pm_runtime_lock *lock);
  912. int hif_pm_runtime_allow_suspend(struct hif_opaque_softc *ol_sc,
  913. struct hif_pm_runtime_lock *lock);
  914. int hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc,
  915. struct hif_pm_runtime_lock *lock, unsigned int delay);
  916. bool hif_pm_runtime_is_suspended(struct hif_opaque_softc *hif_ctx);
  917. int hif_pm_runtime_get_monitor_wake_intr(struct hif_opaque_softc *hif_ctx);
  918. void hif_pm_runtime_set_monitor_wake_intr(struct hif_opaque_softc *hif_ctx,
  919. int val);
  920. void hif_pm_runtime_check_and_request_resume(struct hif_opaque_softc *hif_ctx);
  921. void hif_pm_runtime_mark_dp_rx_busy(struct hif_opaque_softc *hif_ctx);
  922. int hif_pm_runtime_is_dp_rx_busy(struct hif_opaque_softc *hif_ctx);
  923. qdf_time_t hif_pm_runtime_get_dp_rx_busy_mark(struct hif_opaque_softc *hif_ctx);
  924. int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx);
  925. #else
  926. struct hif_pm_runtime_lock {
  927. const char *name;
  928. };
  929. static inline void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx) {}
  930. static inline int
  931. hif_pm_runtime_get_sync(struct hif_opaque_softc *hif_ctx,
  932. wlan_rtpm_dbgid rtpm_dbgid)
  933. { return 0; }
  934. static inline int
  935. hif_pm_runtime_put_sync_suspend(struct hif_opaque_softc *hif_ctx,
  936. wlan_rtpm_dbgid rtpm_dbgid)
  937. { return 0; }
  938. static inline int
  939. hif_pm_runtime_request_resume(struct hif_opaque_softc *hif_ctx)
  940. { return 0; }
  941. static inline void
  942. hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx,
  943. wlan_rtpm_dbgid rtpm_dbgid)
  944. {}
  945. static inline int
  946. hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx, wlan_rtpm_dbgid rtpm_dbgid)
  947. { return 0; }
  948. static inline int
  949. hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx, wlan_rtpm_dbgid rtpm_dbgid)
  950. { return 0; }
  951. static inline int
  952. hif_pm_runtime_put_noidle(struct hif_opaque_softc *hif_ctx,
  953. wlan_rtpm_dbgid rtpm_dbgid)
  954. { return 0; }
  955. static inline void
  956. hif_pm_runtime_mark_last_busy(struct hif_opaque_softc *hif_ctx) {};
  957. static inline int hif_runtime_lock_init(qdf_runtime_lock_t *lock,
  958. const char *name)
  959. { return 0; }
  960. static inline void
  961. hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx,
  962. struct hif_pm_runtime_lock *lock) {}
  963. static inline int hif_pm_runtime_prevent_suspend(struct hif_opaque_softc *ol_sc,
  964. struct hif_pm_runtime_lock *lock)
  965. { return 0; }
  966. static inline int hif_pm_runtime_allow_suspend(struct hif_opaque_softc *ol_sc,
  967. struct hif_pm_runtime_lock *lock)
  968. { return 0; }
  969. static inline int
  970. hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc,
  971. struct hif_pm_runtime_lock *lock, unsigned int delay)
  972. { return 0; }
  973. static inline bool hif_pm_runtime_is_suspended(struct hif_opaque_softc *hif_ctx)
  974. { return false; }
  975. static inline int
  976. hif_pm_runtime_get_monitor_wake_intr(struct hif_opaque_softc *hif_ctx)
  977. { return 0; }
  978. static inline void
  979. hif_pm_runtime_set_monitor_wake_intr(struct hif_opaque_softc *hif_ctx, int val)
  980. { return; }
  981. static inline void
  982. hif_pm_runtime_check_and_request_resume(struct hif_opaque_softc *hif_ctx)
  983. { return; }
  984. static inline void
  985. hif_pm_runtime_mark_dp_rx_busy(struct hif_opaque_softc *hif_ctx) {};
  986. static inline int
  987. hif_pm_runtime_is_dp_rx_busy(struct hif_opaque_softc *hif_ctx)
  988. { return 0; }
  989. static inline qdf_time_t
  990. hif_pm_runtime_get_dp_rx_busy_mark(struct hif_opaque_softc *hif_ctx)
  991. { return 0; }
  992. static inline int hif_pm_runtime_sync_resume(struct hif_opaque_softc *hif_ctx)
  993. { return 0; }
  994. #endif
  995. void hif_enable_power_management(struct hif_opaque_softc *hif_ctx,
  996. bool is_packet_log_enabled);
  997. void hif_disable_power_management(struct hif_opaque_softc *hif_ctx);
  998. void hif_vote_link_down(struct hif_opaque_softc *hif_ctx);
  999. void hif_vote_link_up(struct hif_opaque_softc *hif_ctx);
  1000. bool hif_can_suspend_link(struct hif_opaque_softc *hif_ctx);
  1001. #ifdef IPA_OFFLOAD
  1002. /**
  1003. * hif_get_ipa_hw_type() - get IPA hw type
  1004. *
  1005. * This API return the IPA hw type.
  1006. *
  1007. * Return: IPA hw type
  1008. */
  1009. static inline
  1010. enum ipa_hw_type hif_get_ipa_hw_type(void)
  1011. {
  1012. return ipa_get_hw_type();
  1013. }
  1014. /**
  1015. * hif_get_ipa_present() - get IPA hw status
  1016. *
  1017. * This API return the IPA hw status.
  1018. *
  1019. * Return: true if IPA is present or false otherwise
  1020. */
  1021. static inline
  1022. bool hif_get_ipa_present(void)
  1023. {
  1024. if (ipa_uc_reg_rdyCB(NULL) != -EPERM)
  1025. return true;
  1026. else
  1027. return false;
  1028. }
  1029. #endif
  1030. int hif_bus_resume(struct hif_opaque_softc *hif_ctx);
  1031. /**
  1032. * hif_bus_ealry_suspend() - stop non wmi tx traffic
  1033. * @context: hif context
  1034. */
  1035. int hif_bus_early_suspend(struct hif_opaque_softc *hif_ctx);
  1036. /**
  1037. * hif_bus_late_resume() - resume non wmi traffic
  1038. * @context: hif context
  1039. */
  1040. int hif_bus_late_resume(struct hif_opaque_softc *hif_ctx);
  1041. int hif_bus_suspend(struct hif_opaque_softc *hif_ctx);
  1042. int hif_bus_resume_noirq(struct hif_opaque_softc *hif_ctx);
  1043. int hif_bus_suspend_noirq(struct hif_opaque_softc *hif_ctx);
  1044. /**
  1045. * hif_apps_irqs_enable() - Enables all irqs from the APPS side
  1046. * @hif_ctx: an opaque HIF handle to use
  1047. *
  1048. * As opposed to the standard hif_irq_enable, this function always applies to
  1049. * the APPS side kernel interrupt handling.
  1050. *
  1051. * Return: errno
  1052. */
  1053. int hif_apps_irqs_enable(struct hif_opaque_softc *hif_ctx);
  1054. /**
  1055. * hif_apps_irqs_disable() - Disables all irqs from the APPS side
  1056. * @hif_ctx: an opaque HIF handle to use
  1057. *
  1058. * As opposed to the standard hif_irq_disable, this function always applies to
  1059. * the APPS side kernel interrupt handling.
  1060. *
  1061. * Return: errno
  1062. */
  1063. int hif_apps_irqs_disable(struct hif_opaque_softc *hif_ctx);
  1064. /**
  1065. * hif_apps_wake_irq_enable() - Enables the wake irq from the APPS side
  1066. * @hif_ctx: an opaque HIF handle to use
  1067. *
  1068. * As opposed to the standard hif_irq_enable, this function always applies to
  1069. * the APPS side kernel interrupt handling.
  1070. *
  1071. * Return: errno
  1072. */
  1073. int hif_apps_wake_irq_enable(struct hif_opaque_softc *hif_ctx);
  1074. /**
  1075. * hif_apps_wake_irq_disable() - Disables the wake irq from the APPS side
  1076. * @hif_ctx: an opaque HIF handle to use
  1077. *
  1078. * As opposed to the standard hif_irq_disable, this function always applies to
  1079. * the APPS side kernel interrupt handling.
  1080. *
  1081. * Return: errno
  1082. */
  1083. int hif_apps_wake_irq_disable(struct hif_opaque_softc *hif_ctx);
  1084. /**
  1085. * hif_apps_enable_irq_wake() - Enables the irq wake from the APPS side
  1086. * @hif_ctx: an opaque HIF handle to use
  1087. *
  1088. * This function always applies to the APPS side kernel interrupt handling
  1089. * to wake the system from suspend.
  1090. *
  1091. * Return: errno
  1092. */
  1093. int hif_apps_enable_irq_wake(struct hif_opaque_softc *hif_ctx);
  1094. /**
  1095. * hif_apps_disable_irq_wake() - Disables the wake irq from the APPS side
  1096. * @hif_ctx: an opaque HIF handle to use
  1097. *
  1098. * This function always applies to the APPS side kernel interrupt handling
  1099. * to disable the wake irq.
  1100. *
  1101. * Return: errno
  1102. */
  1103. int hif_apps_disable_irq_wake(struct hif_opaque_softc *hif_ctx);
  1104. #ifdef FEATURE_RUNTIME_PM
  1105. int hif_pre_runtime_suspend(struct hif_opaque_softc *hif_ctx);
  1106. void hif_pre_runtime_resume(struct hif_opaque_softc *hif_ctx);
  1107. int hif_runtime_suspend(struct hif_opaque_softc *hif_ctx);
  1108. int hif_runtime_resume(struct hif_opaque_softc *hif_ctx);
  1109. void hif_process_runtime_suspend_success(struct hif_opaque_softc *hif_ctx);
  1110. void hif_process_runtime_suspend_failure(struct hif_opaque_softc *hif_ctx);
  1111. void hif_process_runtime_resume_success(struct hif_opaque_softc *hif_ctx);
  1112. #endif
  1113. int hif_get_irq_num(struct hif_opaque_softc *scn, int *irq, uint32_t size);
  1114. int hif_dump_registers(struct hif_opaque_softc *scn);
  1115. int ol_copy_ramdump(struct hif_opaque_softc *scn);
  1116. void hif_crash_shutdown(struct hif_opaque_softc *hif_ctx);
  1117. void hif_get_hw_info(struct hif_opaque_softc *hif_ctx, u32 *version,
  1118. u32 *revision, const char **target_name);
  1119. enum qdf_bus_type hif_get_bus_type(struct hif_opaque_softc *hif_hdl);
  1120. struct hif_target_info *hif_get_target_info_handle(struct hif_opaque_softc *
  1121. scn);
  1122. struct hif_config_info *hif_get_ini_handle(struct hif_opaque_softc *hif_ctx);
  1123. struct ramdump_info *hif_get_ramdump_ctx(struct hif_opaque_softc *hif_ctx);
  1124. enum hif_target_status hif_get_target_status(struct hif_opaque_softc *hif_ctx);
  1125. void hif_set_target_status(struct hif_opaque_softc *hif_ctx, enum
  1126. hif_target_status);
  1127. void hif_init_ini_config(struct hif_opaque_softc *hif_ctx,
  1128. struct hif_config_info *cfg);
  1129. void hif_update_tx_ring(struct hif_opaque_softc *osc, u_int32_t num_htt_cmpls);
  1130. qdf_nbuf_t hif_batch_send(struct hif_opaque_softc *osc, qdf_nbuf_t msdu,
  1131. uint32_t transfer_id, u_int32_t len, uint32_t sendhead);
  1132. QDF_STATUS hif_send_single(struct hif_opaque_softc *osc, qdf_nbuf_t msdu,
  1133. uint32_t transfer_id, u_int32_t len);
  1134. int hif_send_fast(struct hif_opaque_softc *osc, qdf_nbuf_t nbuf,
  1135. uint32_t transfer_id, uint32_t download_len);
  1136. void hif_pkt_dl_len_set(void *hif_sc, unsigned int pkt_download_len);
  1137. void hif_ce_war_disable(void);
  1138. void hif_ce_war_enable(void);
  1139. void hif_disable_interrupt(struct hif_opaque_softc *osc, uint32_t pipe_num);
  1140. #ifdef QCA_NSS_WIFI_OFFLOAD_SUPPORT
  1141. struct hif_pipe_addl_info *hif_get_addl_pipe_info(struct hif_opaque_softc *osc,
  1142. struct hif_pipe_addl_info *hif_info, uint32_t pipe_number);
  1143. uint32_t hif_set_nss_wifiol_mode(struct hif_opaque_softc *osc,
  1144. uint32_t pipe_num);
  1145. int32_t hif_get_nss_wifiol_bypass_nw_process(struct hif_opaque_softc *osc);
  1146. #endif /* QCA_NSS_WIFI_OFFLOAD_SUPPORT */
  1147. void hif_set_bundle_mode(struct hif_opaque_softc *hif_ctx, bool enabled,
  1148. int rx_bundle_cnt);
  1149. int hif_bus_reset_resume(struct hif_opaque_softc *hif_ctx);
  1150. void hif_set_attribute(struct hif_opaque_softc *osc, uint8_t hif_attrib);
  1151. void *hif_get_lro_info(int ctx_id, struct hif_opaque_softc *hif_hdl);
  1152. enum hif_exec_type {
  1153. HIF_EXEC_NAPI_TYPE,
  1154. HIF_EXEC_TASKLET_TYPE,
  1155. };
  1156. typedef uint32_t (*ext_intr_handler)(void *, uint32_t);
  1157. /**
  1158. * hif_get_int_ctx_irq_num() - retrieve an irq num for an interrupt context id
  1159. * @softc: hif opaque context owning the exec context
  1160. * @id: the id of the interrupt context
  1161. *
  1162. * Return: IRQ number of the first (zero'th) IRQ within the interrupt context ID
  1163. * 'id' registered with the OS
  1164. */
  1165. int32_t hif_get_int_ctx_irq_num(struct hif_opaque_softc *softc,
  1166. uint8_t id);
  1167. uint32_t hif_configure_ext_group_interrupts(struct hif_opaque_softc *hif_ctx);
  1168. uint32_t hif_register_ext_group(struct hif_opaque_softc *hif_ctx,
  1169. uint32_t numirq, uint32_t irq[], ext_intr_handler handler,
  1170. void *cb_ctx, const char *context_name,
  1171. enum hif_exec_type type, uint32_t scale);
  1172. void hif_deregister_exec_group(struct hif_opaque_softc *hif_ctx,
  1173. const char *context_name);
  1174. void hif_update_pipe_callback(struct hif_opaque_softc *osc,
  1175. u_int8_t pipeid,
  1176. struct hif_msg_callbacks *callbacks);
  1177. /**
  1178. * hif_print_napi_stats() - Display HIF NAPI stats
  1179. * @hif_ctx - HIF opaque context
  1180. *
  1181. * Return: None
  1182. */
  1183. void hif_print_napi_stats(struct hif_opaque_softc *hif_ctx);
  1184. /* hif_clear_napi_stats() - function clears the stats of the
  1185. * latency when called.
  1186. * @hif_ctx - the HIF context to assign the callback to
  1187. *
  1188. * Return: None
  1189. */
  1190. void hif_clear_napi_stats(struct hif_opaque_softc *hif_ctx);
  1191. #ifdef __cplusplus
  1192. }
  1193. #endif
  1194. #ifdef FORCE_WAKE
  1195. /**
  1196. * hif_force_wake_request() - Function to wake from power collapse
  1197. * @handle: HIF opaque handle
  1198. *
  1199. * Description: API to check if the device is awake or not before
  1200. * read/write to BAR + 4K registers. If device is awake return
  1201. * success otherwise write '1' to
  1202. * PCIE_PCIE_LOCAL_REG_PCIE_SOC_WAKE_PCIE_LOCAL_REG which will interrupt
  1203. * the device and does wakeup the PCI and MHI within 50ms
  1204. * and then the device writes a value to
  1205. * PCIE_SOC_PCIE_REG_PCIE_SCRATCH_0_SOC_PCIE_REG to complete the
  1206. * handshake process to let the host know the device is awake.
  1207. *
  1208. * Return: zero - success/non-zero - failure
  1209. */
  1210. int hif_force_wake_request(struct hif_opaque_softc *handle);
  1211. /**
  1212. * hif_force_wake_release() - API to release/reset the SOC wake register
  1213. * from interrupting the device.
  1214. * @handle: HIF opaque handle
  1215. *
  1216. * Description: API to set the
  1217. * PCIE_PCIE_LOCAL_REG_PCIE_SOC_WAKE_PCIE_LOCAL_REG to '0'
  1218. * to release the interrupt line.
  1219. *
  1220. * Return: zero - success/non-zero - failure
  1221. */
  1222. int hif_force_wake_release(struct hif_opaque_softc *handle);
  1223. #else
  1224. static inline
  1225. int hif_force_wake_request(struct hif_opaque_softc *handle)
  1226. {
  1227. return 0;
  1228. }
  1229. static inline
  1230. int hif_force_wake_release(struct hif_opaque_softc *handle)
  1231. {
  1232. return 0;
  1233. }
  1234. #endif /* FORCE_WAKE */
  1235. #ifdef FEATURE_HAL_DELAYED_REG_WRITE
  1236. /**
  1237. * hif_prevent_link_low_power_states() - Prevent from going to low power states
  1238. * @hif - HIF opaque context
  1239. *
  1240. * Return: 0 on success. Error code on failure.
  1241. */
  1242. int hif_prevent_link_low_power_states(struct hif_opaque_softc *hif);
  1243. /**
  1244. * hif_allow_link_low_power_states() - Allow link to go to low power states
  1245. * @hif - HIF opaque context
  1246. *
  1247. * Return: None
  1248. */
  1249. void hif_allow_link_low_power_states(struct hif_opaque_softc *hif);
  1250. #else
  1251. static inline
  1252. int hif_prevent_link_low_power_states(struct hif_opaque_softc *hif)
  1253. {
  1254. return 0;
  1255. }
  1256. static inline
  1257. void hif_allow_link_low_power_states(struct hif_opaque_softc *hif)
  1258. {
  1259. }
  1260. #endif
  1261. void *hif_get_dev_ba(struct hif_opaque_softc *hif_handle);
  1262. void *hif_get_dev_ba_ce(struct hif_opaque_softc *hif_handle);
  1263. /**
  1264. * hif_set_initial_wakeup_cb() - set the initial wakeup event handler function
  1265. * @hif_ctx - the HIF context to assign the callback to
  1266. * @callback - the callback to assign
  1267. * @priv - the private data to pass to the callback when invoked
  1268. *
  1269. * Return: None
  1270. */
  1271. void hif_set_initial_wakeup_cb(struct hif_opaque_softc *hif_ctx,
  1272. void (*callback)(void *),
  1273. void *priv);
  1274. /*
  1275. * Note: For MCL, #if defined (HIF_CONFIG_SLUB_DEBUG_ON) needs to be checked
  1276. * for defined here
  1277. */
  1278. #if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
  1279. ssize_t hif_dump_desc_trace_buf(struct device *dev,
  1280. struct device_attribute *attr, char *buf);
  1281. ssize_t hif_input_desc_trace_buf_index(struct hif_softc *scn,
  1282. const char *buf, size_t size);
  1283. ssize_t hif_ce_en_desc_hist(struct hif_softc *scn,
  1284. const char *buf, size_t size);
  1285. ssize_t hif_disp_ce_enable_desc_data_hist(struct hif_softc *scn, char *buf);
  1286. ssize_t hif_dump_desc_event(struct hif_softc *scn, char *buf);
  1287. #endif/*#if defined(HIF_CONFIG_SLUB_DEBUG_ON)||defined(HIF_CE_DEBUG_DATA_BUF)*/
  1288. /**
  1289. * hif_set_ce_service_max_yield_time() - sets CE service max yield time
  1290. * @hif: hif context
  1291. * @ce_service_max_yield_time: CE service max yield time to set
  1292. *
  1293. * This API storess CE service max yield time in hif context based
  1294. * on ini value.
  1295. *
  1296. * Return: void
  1297. */
  1298. void hif_set_ce_service_max_yield_time(struct hif_opaque_softc *hif,
  1299. uint32_t ce_service_max_yield_time);
  1300. /**
  1301. * hif_get_ce_service_max_yield_time() - get CE service max yield time
  1302. * @hif: hif context
  1303. *
  1304. * This API returns CE service max yield time.
  1305. *
  1306. * Return: CE service max yield time
  1307. */
  1308. unsigned long long
  1309. hif_get_ce_service_max_yield_time(struct hif_opaque_softc *hif);
  1310. /**
  1311. * hif_set_ce_service_max_rx_ind_flush() - sets CE service max rx ind flush
  1312. * @hif: hif context
  1313. * @ce_service_max_rx_ind_flush: CE service max rx ind flush to set
  1314. *
  1315. * This API stores CE service max rx ind flush in hif context based
  1316. * on ini value.
  1317. *
  1318. * Return: void
  1319. */
  1320. void hif_set_ce_service_max_rx_ind_flush(struct hif_opaque_softc *hif,
  1321. uint8_t ce_service_max_rx_ind_flush);
  1322. #ifdef OL_ATH_SMART_LOGGING
  1323. /*
  1324. * hif_log_ce_dump() - Copy all the CE DEST ring to buf
  1325. * @scn : HIF handler
  1326. * @buf_cur: Current pointer in ring buffer
  1327. * @buf_init:Start of the ring buffer
  1328. * @buf_sz: Size of the ring buffer
  1329. * @ce: Copy Engine id
  1330. * @skb_sz: Max size of the SKB buffer to be copied
  1331. *
  1332. * Calls the respective function to dump all the CE SRC/DEST ring descriptors
  1333. * and buffers pointed by them in to the given buf
  1334. *
  1335. * Return: Current pointer in ring buffer
  1336. */
  1337. uint8_t *hif_log_dump_ce(struct hif_softc *scn, uint8_t *buf_cur,
  1338. uint8_t *buf_init, uint32_t buf_sz,
  1339. uint32_t ce, uint32_t skb_sz);
  1340. #endif /* OL_ATH_SMART_LOGGING */
  1341. /*
  1342. * hif_softc_to_hif_opaque_softc - API to convert hif_softc handle
  1343. * to hif_opaque_softc handle
  1344. * @hif_handle - hif_softc type
  1345. *
  1346. * Return: hif_opaque_softc type
  1347. */
  1348. static inline struct hif_opaque_softc *
  1349. hif_softc_to_hif_opaque_softc(struct hif_softc *hif_handle)
  1350. {
  1351. return (struct hif_opaque_softc *)hif_handle;
  1352. }
  1353. #ifdef FORCE_WAKE
  1354. /**
  1355. * hif_srng_init_phase(): Indicate srng initialization phase
  1356. * to avoid force wake as UMAC power collapse is not yet
  1357. * enabled
  1358. * @hif_ctx: hif opaque handle
  1359. * @init_phase: initialization phase
  1360. *
  1361. * Return: None
  1362. */
  1363. void hif_srng_init_phase(struct hif_opaque_softc *hif_ctx,
  1364. bool init_phase);
  1365. #else
  1366. static inline
  1367. void hif_srng_init_phase(struct hif_opaque_softc *hif_ctx,
  1368. bool init_phase)
  1369. {
  1370. }
  1371. #endif /* FORCE_WAKE */
  1372. #ifdef HIF_CE_LOG_INFO
  1373. /**
  1374. * hif_log_ce_info() - API to log ce info
  1375. * @scn: hif handle
  1376. * @data: hang event data buffer
  1377. * @offset: offset at which data needs to be written
  1378. *
  1379. * Return: None
  1380. */
  1381. void hif_log_ce_info(struct hif_softc *scn, uint8_t *data,
  1382. unsigned int *offset);
  1383. #else
  1384. static inline
  1385. void hif_log_ce_info(struct hif_softc *scn, uint8_t *data,
  1386. unsigned int *offset)
  1387. {
  1388. }
  1389. #endif
  1390. #ifdef HIF_CPU_PERF_AFFINE_MASK
  1391. /**
  1392. * hif_config_irq_set_perf_affinity_hint() - API to set affinity
  1393. * @hif_ctx: hif opaque handle
  1394. *
  1395. * This function is used to move the WLAN IRQs to perf cores in
  1396. * case of defconfig builds.
  1397. *
  1398. * Return: None
  1399. */
  1400. void hif_config_irq_set_perf_affinity_hint(
  1401. struct hif_opaque_softc *hif_ctx);
  1402. #else
  1403. static inline void hif_config_irq_set_perf_affinity_hint(
  1404. struct hif_opaque_softc *hif_ctx)
  1405. {
  1406. }
  1407. #endif
  1408. #endif /* _HIF_H_ */