hif.h 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764
  1. /*
  2. * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef _HIF_H_
  20. #define _HIF_H_
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif /* __cplusplus */
  24. /* Header files */
  25. #include <qdf_status.h>
  26. #include "qdf_ipa.h"
  27. #include "qdf_nbuf.h"
  28. #include "qdf_lro.h"
  29. #include "ol_if_athvar.h"
  30. #include <linux/platform_device.h>
  31. #ifdef HIF_PCI
  32. #include <linux/pci.h>
  33. #endif /* HIF_PCI */
  34. #ifdef HIF_USB
  35. #include <linux/usb.h>
  36. #endif /* HIF_USB */
  37. #ifdef IPA_OFFLOAD
  38. #include <linux/ipa.h>
  39. #endif
  40. #include "cfg_ucfg_api.h"
  41. #include "qdf_dev.h"
  42. #include <wlan_init_cfg.h>
  43. #define ENABLE_MBOX_DUMMY_SPACE_FEATURE 1
  44. typedef void __iomem *A_target_id_t;
  45. typedef void *hif_handle_t;
  46. #if defined(HIF_IPCI) && defined(FEATURE_HAL_DELAYED_REG_WRITE)
  47. #define HIF_WORK_DRAIN_WAIT_CNT 50
  48. #define HIF_EP_WAKE_RESET_WAIT_CNT 10
  49. #endif
  50. #define HIF_TYPE_AR6002 2
  51. #define HIF_TYPE_AR6003 3
  52. #define HIF_TYPE_AR6004 5
  53. #define HIF_TYPE_AR9888 6
  54. #define HIF_TYPE_AR6320 7
  55. #define HIF_TYPE_AR6320V2 8
  56. /* For attaching Peregrine 2.0 board host_reg_tbl only */
  57. #define HIF_TYPE_AR9888V2 9
  58. #define HIF_TYPE_ADRASTEA 10
  59. #define HIF_TYPE_AR900B 11
  60. #define HIF_TYPE_QCA9984 12
  61. #define HIF_TYPE_QCA9888 14
  62. #define HIF_TYPE_QCA8074 15
  63. #define HIF_TYPE_QCA6290 16
  64. #define HIF_TYPE_QCN7605 17
  65. #define HIF_TYPE_QCA6390 18
  66. #define HIF_TYPE_QCA8074V2 19
  67. #define HIF_TYPE_QCA6018 20
  68. #define HIF_TYPE_QCN9000 21
  69. #define HIF_TYPE_QCA6490 22
  70. #define HIF_TYPE_QCA6750 23
  71. #define HIF_TYPE_QCA5018 24
  72. #define HIF_TYPE_QCN6122 25
  73. #define HIF_TYPE_KIWI 26
  74. #define HIF_TYPE_QCN9224 27
  75. #define HIF_TYPE_QCA9574 28
  76. #define HIF_TYPE_MANGO 29
  77. #define HIF_TYPE_QCA5332 30
  78. #define HIF_TYPE_QCN9160 31
  79. #define HIF_TYPE_PEACH 32
  80. #define HIF_TYPE_WCN6450 33
  81. #define HIF_TYPE_QCN6432 34
  82. #define DMA_COHERENT_MASK_DEFAULT 37
  83. #ifdef IPA_OFFLOAD
  84. #define DMA_COHERENT_MASK_BELOW_IPA_VER_3 32
  85. #endif
  86. /* enum hif_ic_irq - enum defining integrated chip irq numbers
  87. * defining irq nubers that can be used by external modules like datapath
  88. */
  89. enum hif_ic_irq {
  90. host2wbm_desc_feed = 16,
  91. host2reo_re_injection,
  92. host2reo_command,
  93. host2rxdma_monitor_ring3,
  94. host2rxdma_monitor_ring2,
  95. host2rxdma_monitor_ring1,
  96. reo2host_exception,
  97. wbm2host_rx_release,
  98. reo2host_status,
  99. reo2host_destination_ring4,
  100. reo2host_destination_ring3,
  101. reo2host_destination_ring2,
  102. reo2host_destination_ring1,
  103. rxdma2host_monitor_destination_mac3,
  104. rxdma2host_monitor_destination_mac2,
  105. rxdma2host_monitor_destination_mac1,
  106. ppdu_end_interrupts_mac3,
  107. ppdu_end_interrupts_mac2,
  108. ppdu_end_interrupts_mac1,
  109. rxdma2host_monitor_status_ring_mac3,
  110. rxdma2host_monitor_status_ring_mac2,
  111. rxdma2host_monitor_status_ring_mac1,
  112. host2rxdma_host_buf_ring_mac3,
  113. host2rxdma_host_buf_ring_mac2,
  114. host2rxdma_host_buf_ring_mac1,
  115. rxdma2host_destination_ring_mac3,
  116. rxdma2host_destination_ring_mac2,
  117. rxdma2host_destination_ring_mac1,
  118. host2tcl_input_ring4,
  119. host2tcl_input_ring3,
  120. host2tcl_input_ring2,
  121. host2tcl_input_ring1,
  122. wbm2host_tx_completions_ring4,
  123. wbm2host_tx_completions_ring3,
  124. wbm2host_tx_completions_ring2,
  125. wbm2host_tx_completions_ring1,
  126. tcl2host_status_ring,
  127. txmon2host_monitor_destination_mac3,
  128. txmon2host_monitor_destination_mac2,
  129. txmon2host_monitor_destination_mac1,
  130. host2tx_monitor_ring1,
  131. };
  132. #ifdef QCA_SUPPORT_LEGACY_INTERRUPTS
  133. enum hif_legacy_pci_irq {
  134. ce0,
  135. ce1,
  136. ce2,
  137. ce3,
  138. ce4,
  139. ce5,
  140. ce6,
  141. ce7,
  142. ce8,
  143. ce9,
  144. ce10,
  145. ce11,
  146. ce12,
  147. ce13,
  148. ce14,
  149. ce15,
  150. reo2sw8_intr2,
  151. reo2sw7_intr2,
  152. reo2sw6_intr2,
  153. reo2sw5_intr2,
  154. reo2sw4_intr2,
  155. reo2sw3_intr2,
  156. reo2sw2_intr2,
  157. reo2sw1_intr2,
  158. reo2sw0_intr2,
  159. reo2sw8_intr,
  160. reo2sw7_intr,
  161. reo2sw6_inrr,
  162. reo2sw5_intr,
  163. reo2sw4_intr,
  164. reo2sw3_intr,
  165. reo2sw2_intr,
  166. reo2sw1_intr,
  167. reo2sw0_intr,
  168. reo2status_intr2,
  169. reo_status,
  170. reo2rxdma_out_2,
  171. reo2rxdma_out_1,
  172. reo_cmd,
  173. sw2reo6,
  174. sw2reo5,
  175. sw2reo1,
  176. sw2reo,
  177. rxdma2reo_mlo_0_dst_ring1,
  178. rxdma2reo_mlo_0_dst_ring0,
  179. rxdma2reo_mlo_1_dst_ring1,
  180. rxdma2reo_mlo_1_dst_ring0,
  181. rxdma2reo_dst_ring1,
  182. rxdma2reo_dst_ring0,
  183. rxdma2sw_dst_ring1,
  184. rxdma2sw_dst_ring0,
  185. rxdma2release_dst_ring1,
  186. rxdma2release_dst_ring0,
  187. sw2rxdma_2_src_ring,
  188. sw2rxdma_1_src_ring,
  189. sw2rxdma_0,
  190. wbm2sw6_release2,
  191. wbm2sw5_release2,
  192. wbm2sw4_release2,
  193. wbm2sw3_release2,
  194. wbm2sw2_release2,
  195. wbm2sw1_release2,
  196. wbm2sw0_release2,
  197. wbm2sw6_release,
  198. wbm2sw5_release,
  199. wbm2sw4_release,
  200. wbm2sw3_release,
  201. wbm2sw2_release,
  202. wbm2sw1_release,
  203. wbm2sw0_release,
  204. wbm2sw_link,
  205. wbm_error_release,
  206. sw2txmon_src_ring,
  207. sw2rxmon_src_ring,
  208. txmon2sw_p1_intr1,
  209. txmon2sw_p1_intr0,
  210. txmon2sw_p0_dest1,
  211. txmon2sw_p0_dest0,
  212. rxmon2sw_p1_intr1,
  213. rxmon2sw_p1_intr0,
  214. rxmon2sw_p0_dest1,
  215. rxmon2sw_p0_dest0,
  216. sw_release,
  217. sw2tcl_credit2,
  218. sw2tcl_credit,
  219. sw2tcl4,
  220. sw2tcl5,
  221. sw2tcl3,
  222. sw2tcl2,
  223. sw2tcl1,
  224. sw2wbm1,
  225. misc_8,
  226. misc_7,
  227. misc_6,
  228. misc_5,
  229. misc_4,
  230. misc_3,
  231. misc_2,
  232. misc_1,
  233. misc_0,
  234. };
  235. #endif
  236. struct CE_state;
  237. #ifdef QCA_WIFI_QCN9224
  238. #define CE_COUNT_MAX 16
  239. #else
  240. #define CE_COUNT_MAX 12
  241. #endif
  242. #ifndef HIF_MAX_GROUP
  243. #define HIF_MAX_GROUP WLAN_CFG_INT_NUM_CONTEXTS
  244. #endif
  245. #ifdef CONFIG_BERYLLIUM
  246. #define HIF_MAX_GRP_IRQ 25
  247. #else
  248. #define HIF_MAX_GRP_IRQ 16
  249. #endif
  250. #ifndef NAPI_YIELD_BUDGET_BASED
  251. #ifndef QCA_NAPI_DEF_SCALE_BIN_SHIFT
  252. #define QCA_NAPI_DEF_SCALE_BIN_SHIFT 4
  253. #endif
  254. #else /* NAPI_YIELD_BUDGET_BASED */
  255. #define QCA_NAPI_DEF_SCALE_BIN_SHIFT 2
  256. #endif /* NAPI_YIELD_BUDGET_BASED */
  257. #define QCA_NAPI_BUDGET 64
  258. #define QCA_NAPI_DEF_SCALE \
  259. (1 << QCA_NAPI_DEF_SCALE_BIN_SHIFT)
  260. #define HIF_NAPI_MAX_RECEIVES (QCA_NAPI_BUDGET * QCA_NAPI_DEF_SCALE)
  261. /* NOTE: "napi->scale" can be changed,
  262. * but this does not change the number of buckets
  263. */
  264. #define QCA_NAPI_NUM_BUCKETS 4
  265. /**
  266. * struct qca_napi_stat - stats structure for execution contexts
  267. * @napi_schedules: number of times the schedule function is called
  268. * @napi_polls: number of times the execution context runs
  269. * @napi_completes: number of times that the generating interrupt is re-enabled
  270. * @napi_workdone: cumulative of all work done reported by handler
  271. * @cpu_corrected: incremented when execution context runs on a different core
  272. * than the one that its irq is affined to.
  273. * @napi_budget_uses: histogram of work done per execution run
  274. * @time_limit_reached: count of yields due to time limit thresholds
  275. * @rxpkt_thresh_reached: count of yields due to a work limit
  276. * @napi_max_poll_time:
  277. * @poll_time_buckets: histogram of poll times for the napi
  278. *
  279. */
  280. struct qca_napi_stat {
  281. uint32_t napi_schedules;
  282. uint32_t napi_polls;
  283. uint32_t napi_completes;
  284. uint32_t napi_workdone;
  285. uint32_t cpu_corrected;
  286. uint32_t napi_budget_uses[QCA_NAPI_NUM_BUCKETS];
  287. uint32_t time_limit_reached;
  288. uint32_t rxpkt_thresh_reached;
  289. unsigned long long napi_max_poll_time;
  290. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  291. uint32_t poll_time_buckets[QCA_NAPI_NUM_BUCKETS];
  292. #endif
  293. };
  294. /*Number of buckets for latency*/
  295. #define HIF_SCHED_LATENCY_BUCKETS 8
  296. /*Buckets for latency between 0 to 2 ms*/
  297. #define HIF_SCHED_LATENCY_BUCKET_0_2 2
  298. /*Buckets for latency between 3 to 10 ms*/
  299. #define HIF_SCHED_LATENCY_BUCKET_3_10 10
  300. /*Buckets for latency between 11 to 20 ms*/
  301. #define HIF_SCHED_LATENCY_BUCKET_11_20 20
  302. /*Buckets for latency between 21 to 50 ms*/
  303. #define HIF_SCHED_LATENCY_BUCKET_21_50 50
  304. /*Buckets for latency between 50 to 100 ms*/
  305. #define HIF_SCHED_LATENCY_BUCKET_51_100 100
  306. /*Buckets for latency between 100 to 250 ms*/
  307. #define HIF_SCHED_LATENCY_BUCKET_101_250 250
  308. /*Buckets for latency between 250 to 500 ms*/
  309. #define HIF_SCHED_LATENCY_BUCKET_251_500 500
  310. /**
  311. * struct qca_napi_info - per NAPI instance data structure
  312. * @netdev: dummy net_dev
  313. * @hif_ctx:
  314. * @napi:
  315. * @scale:
  316. * @id:
  317. * @cpu:
  318. * @irq:
  319. * @cpumask:
  320. * @stats:
  321. * @offld_flush_cb:
  322. * @rx_thread_napi:
  323. * @rx_thread_netdev:
  324. * @lro_ctx:
  325. * @poll_start_time: napi poll service start time
  326. * @sched_latency_stats: napi schedule latency stats
  327. * @tstamp: napi schedule start timestamp
  328. *
  329. * This data structure holds stuff per NAPI instance.
  330. * Note that, in the current implementation, though scale is
  331. * an instance variable, it is set to the same value for all
  332. * instances.
  333. */
  334. struct qca_napi_info {
  335. struct net_device netdev; /* dummy net_dev */
  336. void *hif_ctx;
  337. struct napi_struct napi;
  338. uint8_t scale; /* currently same on all instances */
  339. uint8_t id;
  340. uint8_t cpu;
  341. int irq;
  342. cpumask_t cpumask;
  343. struct qca_napi_stat stats[NR_CPUS];
  344. #ifdef RECEIVE_OFFLOAD
  345. /* will only be present for data rx CE's */
  346. void (*offld_flush_cb)(void *);
  347. struct napi_struct rx_thread_napi;
  348. struct net_device rx_thread_netdev;
  349. #endif /* RECEIVE_OFFLOAD */
  350. qdf_lro_ctx_t lro_ctx;
  351. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  352. unsigned long long poll_start_time;
  353. #endif
  354. #ifdef HIF_LATENCY_PROFILE_ENABLE
  355. uint64_t sched_latency_stats[HIF_SCHED_LATENCY_BUCKETS];
  356. uint64_t tstamp;
  357. #endif
  358. };
  359. enum qca_napi_tput_state {
  360. QCA_NAPI_TPUT_UNINITIALIZED,
  361. QCA_NAPI_TPUT_LO,
  362. QCA_NAPI_TPUT_HI
  363. };
  364. enum qca_napi_cpu_state {
  365. QCA_NAPI_CPU_UNINITIALIZED,
  366. QCA_NAPI_CPU_DOWN,
  367. QCA_NAPI_CPU_UP };
  368. /**
  369. * struct qca_napi_cpu - an entry of the napi cpu table
  370. * @state:
  371. * @core_id: physical core id of the core
  372. * @cluster_id: cluster this core belongs to
  373. * @core_mask: mask to match all core of this cluster
  374. * @thread_mask: mask for this core within the cluster
  375. * @max_freq: maximum clock this core can be clocked at
  376. * same for all cpus of the same core.
  377. * @napis: bitmap of napi instances on this core
  378. * @execs: bitmap of execution contexts on this core
  379. * @cluster_nxt: chain to link cores within the same cluster
  380. *
  381. * This structure represents a single entry in the napi cpu
  382. * table. The table is part of struct qca_napi_data.
  383. * This table is initialized by the init function, called while
  384. * the first napi instance is being created, updated by hotplug
  385. * notifier and when cpu affinity decisions are made (by throughput
  386. * detection), and deleted when the last napi instance is removed.
  387. */
  388. struct qca_napi_cpu {
  389. enum qca_napi_cpu_state state;
  390. int core_id;
  391. int cluster_id;
  392. cpumask_t core_mask;
  393. cpumask_t thread_mask;
  394. unsigned int max_freq;
  395. uint32_t napis;
  396. uint32_t execs;
  397. int cluster_nxt; /* index, not pointer */
  398. };
  399. /**
  400. * struct qca_napi_data - collection of napi data for a single hif context
  401. * @hif_softc: pointer to the hif context
  402. * @lock: spinlock used in the event state machine
  403. * @state: state variable used in the napi stat machine
  404. * @ce_map: bit map indicating which ce's have napis running
  405. * @exec_map: bit map of instantiated exec contexts
  406. * @user_cpu_affin_mask: CPU affinity mask from INI config.
  407. * @napis:
  408. * @napi_cpu: cpu info for irq affinty
  409. * @lilcl_head:
  410. * @bigcl_head:
  411. * @napi_mode: irq affinity & clock voting mode
  412. * @cpuhp_handler: CPU hotplug event registration handle
  413. * @flags:
  414. */
  415. struct qca_napi_data {
  416. struct hif_softc *hif_softc;
  417. qdf_spinlock_t lock;
  418. uint32_t state;
  419. /* bitmap of created/registered NAPI instances, indexed by pipe_id,
  420. * not used by clients (clients use an id returned by create)
  421. */
  422. uint32_t ce_map;
  423. uint32_t exec_map;
  424. uint32_t user_cpu_affin_mask;
  425. struct qca_napi_info *napis[CE_COUNT_MAX];
  426. struct qca_napi_cpu napi_cpu[NR_CPUS];
  427. int lilcl_head, bigcl_head;
  428. enum qca_napi_tput_state napi_mode;
  429. struct qdf_cpuhp_handler *cpuhp_handler;
  430. uint8_t flags;
  431. };
  432. /**
  433. * struct hif_config_info - Place Holder for HIF configuration
  434. * @enable_self_recovery: Self Recovery
  435. * @enable_runtime_pm: Enable Runtime PM
  436. * @runtime_pm_delay: Runtime PM Delay
  437. * @rx_softirq_max_yield_duration_ns: Max Yield time duration for RX Softirq
  438. *
  439. * Structure for holding HIF ini parameters.
  440. */
  441. struct hif_config_info {
  442. bool enable_self_recovery;
  443. #ifdef FEATURE_RUNTIME_PM
  444. uint8_t enable_runtime_pm;
  445. u_int32_t runtime_pm_delay;
  446. #endif
  447. uint64_t rx_softirq_max_yield_duration_ns;
  448. };
  449. /**
  450. * struct hif_target_info - Target Information
  451. * @target_version: Target Version
  452. * @target_type: Target Type
  453. * @target_revision: Target Revision
  454. * @soc_version: SOC Version
  455. * @hw_name: pointer to hardware name
  456. *
  457. * Structure to hold target information.
  458. */
  459. struct hif_target_info {
  460. uint32_t target_version;
  461. uint32_t target_type;
  462. uint32_t target_revision;
  463. uint32_t soc_version;
  464. char *hw_name;
  465. };
  466. struct hif_opaque_softc {
  467. };
  468. /**
  469. * struct hif_ce_ring_info - CE ring information
  470. * @ring_id: ring id
  471. * @ring_dir: ring direction
  472. * @num_entries: number of entries in ring
  473. * @entry_size: ring entry size
  474. * @ring_base_paddr: srng base physical address
  475. * @hp_paddr: head pointer physical address
  476. * @tp_paddr: tail pointer physical address
  477. */
  478. struct hif_ce_ring_info {
  479. uint8_t ring_id;
  480. uint8_t ring_dir;
  481. uint32_t num_entries;
  482. uint32_t entry_size;
  483. uint64_t ring_base_paddr;
  484. uint64_t hp_paddr;
  485. uint64_t tp_paddr;
  486. };
  487. /**
  488. * struct hif_direct_link_ce_info - Direct Link CE information
  489. * @ce_id: CE ide
  490. * @pipe_dir: Pipe direction
  491. * @ring_info: ring information
  492. */
  493. struct hif_direct_link_ce_info {
  494. uint8_t ce_id;
  495. uint8_t pipe_dir;
  496. struct hif_ce_ring_info ring_info;
  497. };
  498. /**
  499. * enum hif_event_type - Type of DP events to be recorded
  500. * @HIF_EVENT_IRQ_TRIGGER: IRQ trigger event
  501. * @HIF_EVENT_TIMER_ENTRY: Monitor Timer entry event
  502. * @HIF_EVENT_TIMER_EXIT: Monitor Timer exit event
  503. * @HIF_EVENT_BH_SCHED: NAPI POLL scheduled event
  504. * @HIF_EVENT_SRNG_ACCESS_START: hal ring access start event
  505. * @HIF_EVENT_SRNG_ACCESS_END: hal ring access end event
  506. * @HIF_EVENT_BH_COMPLETE: NAPI POLL completion event
  507. * @HIF_EVENT_BH_FORCE_BREAK: NAPI POLL force break event
  508. * @HIF_EVENT_IRQ_DISABLE_EXPIRED: IRQ disable expired event
  509. */
  510. enum hif_event_type {
  511. HIF_EVENT_IRQ_TRIGGER,
  512. HIF_EVENT_TIMER_ENTRY,
  513. HIF_EVENT_TIMER_EXIT,
  514. HIF_EVENT_BH_SCHED,
  515. HIF_EVENT_SRNG_ACCESS_START,
  516. HIF_EVENT_SRNG_ACCESS_END,
  517. HIF_EVENT_BH_COMPLETE,
  518. HIF_EVENT_BH_FORCE_BREAK,
  519. HIF_EVENT_IRQ_DISABLE_EXPIRED,
  520. /* Do check hif_hist_skip_event_record when adding new events */
  521. };
  522. /**
  523. * enum hif_system_pm_state - System PM state
  524. * @HIF_SYSTEM_PM_STATE_ON: System in active state
  525. * @HIF_SYSTEM_PM_STATE_BUS_RESUMING: bus resume in progress as part of
  526. * system resume
  527. * @HIF_SYSTEM_PM_STATE_BUS_SUSPENDING: bus suspend in progress as part of
  528. * system suspend
  529. * @HIF_SYSTEM_PM_STATE_BUS_SUSPENDED: bus suspended as part of system suspend
  530. */
  531. enum hif_system_pm_state {
  532. HIF_SYSTEM_PM_STATE_ON,
  533. HIF_SYSTEM_PM_STATE_BUS_RESUMING,
  534. HIF_SYSTEM_PM_STATE_BUS_SUSPENDING,
  535. HIF_SYSTEM_PM_STATE_BUS_SUSPENDED,
  536. };
  537. #ifdef WLAN_FEATURE_DP_EVENT_HISTORY
  538. #define HIF_NUM_INT_CONTEXTS HIF_MAX_GROUP
  539. #if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
  540. /* HIF_EVENT_HIST_MAX should always be power of 2 */
  541. #define HIF_EVENT_HIST_MAX 512
  542. #define HIF_EVENT_HIST_ENABLE_MASK 0xFF
  543. static inline uint64_t hif_get_log_timestamp(void)
  544. {
  545. return qdf_get_log_timestamp();
  546. }
  547. #else
  548. #define HIF_EVENT_HIST_MAX 32
  549. /* Enable IRQ TRIGGER, NAPI SCHEDULE, SRNG ACCESS START */
  550. #define HIF_EVENT_HIST_ENABLE_MASK 0x19
  551. static inline uint64_t hif_get_log_timestamp(void)
  552. {
  553. return qdf_sched_clock();
  554. }
  555. #endif
  556. /**
  557. * struct hif_event_record - an entry of the DP event history
  558. * @hal_ring_id: ring id for which event is recorded
  559. * @hp: head pointer of the ring (may not be applicable for all events)
  560. * @tp: tail pointer of the ring (may not be applicable for all events)
  561. * @cpu_id: cpu id on which the event occurred
  562. * @timestamp: timestamp when event occurred
  563. * @type: type of the event
  564. *
  565. * This structure represents the information stored for every datapath
  566. * event which is logged in the history.
  567. */
  568. struct hif_event_record {
  569. uint8_t hal_ring_id;
  570. uint32_t hp;
  571. uint32_t tp;
  572. int cpu_id;
  573. uint64_t timestamp;
  574. enum hif_event_type type;
  575. };
  576. /**
  577. * struct hif_event_misc - history related misc info
  578. * @last_irq_index: last irq event index in history
  579. * @last_irq_ts: last irq timestamp
  580. */
  581. struct hif_event_misc {
  582. int32_t last_irq_index;
  583. uint64_t last_irq_ts;
  584. };
  585. /**
  586. * struct hif_event_history - history for one interrupt group
  587. * @index: index to store new event
  588. * @misc: event misc information
  589. * @event: event entry
  590. *
  591. * This structure represents the datapath history for one
  592. * interrupt group.
  593. */
  594. struct hif_event_history {
  595. qdf_atomic_t index;
  596. struct hif_event_misc misc;
  597. struct hif_event_record event[HIF_EVENT_HIST_MAX];
  598. };
  599. /**
  600. * hif_hist_record_event() - Record one datapath event in history
  601. * @hif_ctx: HIF opaque context
  602. * @event: DP event entry
  603. * @intr_grp_id: interrupt group ID registered with hif
  604. *
  605. * Return: None
  606. */
  607. void hif_hist_record_event(struct hif_opaque_softc *hif_ctx,
  608. struct hif_event_record *event,
  609. uint8_t intr_grp_id);
  610. /**
  611. * hif_event_history_init() - Initialize SRNG event history buffers
  612. * @hif_ctx: HIF opaque context
  613. * @id: context group ID for which history is recorded
  614. *
  615. * Returns: None
  616. */
  617. void hif_event_history_init(struct hif_opaque_softc *hif_ctx, uint8_t id);
  618. /**
  619. * hif_event_history_deinit() - De-initialize SRNG event history buffers
  620. * @hif_ctx: HIF opaque context
  621. * @id: context group ID for which history is recorded
  622. *
  623. * Returns: None
  624. */
  625. void hif_event_history_deinit(struct hif_opaque_softc *hif_ctx, uint8_t id);
  626. /**
  627. * hif_record_event() - Wrapper function to form and record DP event
  628. * @hif_ctx: HIF opaque context
  629. * @intr_grp_id: interrupt group ID registered with hif
  630. * @hal_ring_id: ring id for which event is recorded
  631. * @hp: head pointer index of the srng
  632. * @tp: tail pointer index of the srng
  633. * @type: type of the event to be logged in history
  634. *
  635. * Return: None
  636. */
  637. static inline void hif_record_event(struct hif_opaque_softc *hif_ctx,
  638. uint8_t intr_grp_id,
  639. uint8_t hal_ring_id,
  640. uint32_t hp,
  641. uint32_t tp,
  642. enum hif_event_type type)
  643. {
  644. struct hif_event_record event;
  645. event.hal_ring_id = hal_ring_id;
  646. event.hp = hp;
  647. event.tp = tp;
  648. event.type = type;
  649. hif_hist_record_event(hif_ctx, &event, intr_grp_id);
  650. return;
  651. }
  652. #else
  653. static inline void hif_record_event(struct hif_opaque_softc *hif_ctx,
  654. uint8_t intr_grp_id,
  655. uint8_t hal_ring_id,
  656. uint32_t hp,
  657. uint32_t tp,
  658. enum hif_event_type type)
  659. {
  660. }
  661. static inline void hif_event_history_init(struct hif_opaque_softc *hif_ctx,
  662. uint8_t id)
  663. {
  664. }
  665. static inline void hif_event_history_deinit(struct hif_opaque_softc *hif_ctx,
  666. uint8_t id)
  667. {
  668. }
  669. #endif /* WLAN_FEATURE_DP_EVENT_HISTORY */
  670. void hif_display_ctrl_traffic_pipes_state(struct hif_opaque_softc *hif_ctx);
  671. #if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
  672. void hif_display_latest_desc_hist(struct hif_opaque_softc *hif_ctx);
  673. #else
  674. static
  675. inline void hif_display_latest_desc_hist(struct hif_opaque_softc *hif_ctx) {}
  676. #endif
  677. /**
  678. * enum HIF_DEVICE_POWER_CHANGE_TYPE: Device Power change type
  679. *
  680. * @HIF_DEVICE_POWER_UP: HIF layer should power up interface and/or module
  681. * @HIF_DEVICE_POWER_DOWN: HIF layer should initiate bus-specific measures to
  682. * minimize power
  683. * @HIF_DEVICE_POWER_CUT: HIF layer should initiate bus-specific AND/OR
  684. * platform-specific measures to completely power-off
  685. * the module and associated hardware (i.e. cut power
  686. * supplies)
  687. */
  688. enum HIF_DEVICE_POWER_CHANGE_TYPE {
  689. HIF_DEVICE_POWER_UP,
  690. HIF_DEVICE_POWER_DOWN,
  691. HIF_DEVICE_POWER_CUT
  692. };
  693. /**
  694. * enum hif_enable_type: what triggered the enabling of hif
  695. *
  696. * @HIF_ENABLE_TYPE_PROBE: probe triggered enable
  697. * @HIF_ENABLE_TYPE_REINIT: reinit triggered enable
  698. * @HIF_ENABLE_TYPE_MAX: Max value
  699. */
  700. enum hif_enable_type {
  701. HIF_ENABLE_TYPE_PROBE,
  702. HIF_ENABLE_TYPE_REINIT,
  703. HIF_ENABLE_TYPE_MAX
  704. };
  705. /**
  706. * enum hif_disable_type: what triggered the disabling of hif
  707. *
  708. * @HIF_DISABLE_TYPE_PROBE_ERROR: probe error triggered disable
  709. * @HIF_DISABLE_TYPE_REINIT_ERROR: reinit error triggered disable
  710. * @HIF_DISABLE_TYPE_REMOVE: remove triggered disable
  711. * @HIF_DISABLE_TYPE_SHUTDOWN: shutdown triggered disable
  712. * @HIF_DISABLE_TYPE_MAX: Max value
  713. */
  714. enum hif_disable_type {
  715. HIF_DISABLE_TYPE_PROBE_ERROR,
  716. HIF_DISABLE_TYPE_REINIT_ERROR,
  717. HIF_DISABLE_TYPE_REMOVE,
  718. HIF_DISABLE_TYPE_SHUTDOWN,
  719. HIF_DISABLE_TYPE_MAX
  720. };
  721. /**
  722. * enum hif_device_config_opcode: configure mode
  723. *
  724. * @HIF_DEVICE_POWER_STATE: device power state
  725. * @HIF_DEVICE_GET_BLOCK_SIZE: get block size
  726. * @HIF_DEVICE_GET_FIFO_ADDR: get block address
  727. * @HIF_DEVICE_GET_PENDING_EVENTS_FUNC: get pending events functions
  728. * @HIF_DEVICE_GET_IRQ_PROC_MODE: get irq proc mode
  729. * @HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC: receive event function
  730. * @HIF_DEVICE_POWER_STATE_CHANGE: change power state
  731. * @HIF_DEVICE_GET_IRQ_YIELD_PARAMS: get yield params
  732. * @HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT: configure scatter request
  733. * @HIF_DEVICE_GET_OS_DEVICE: get OS device
  734. * @HIF_DEVICE_DEBUG_BUS_STATE: debug bus state
  735. * @HIF_BMI_DONE: bmi done
  736. * @HIF_DEVICE_SET_TARGET_TYPE: set target type
  737. * @HIF_DEVICE_SET_HTC_CONTEXT: set htc context
  738. * @HIF_DEVICE_GET_HTC_CONTEXT: get htc context
  739. */
  740. enum hif_device_config_opcode {
  741. HIF_DEVICE_POWER_STATE = 0,
  742. HIF_DEVICE_GET_BLOCK_SIZE,
  743. HIF_DEVICE_GET_FIFO_ADDR,
  744. HIF_DEVICE_GET_PENDING_EVENTS_FUNC,
  745. HIF_DEVICE_GET_IRQ_PROC_MODE,
  746. HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC,
  747. HIF_DEVICE_POWER_STATE_CHANGE,
  748. HIF_DEVICE_GET_IRQ_YIELD_PARAMS,
  749. HIF_CONFIGURE_QUERY_SCATTER_REQUEST_SUPPORT,
  750. HIF_DEVICE_GET_OS_DEVICE,
  751. HIF_DEVICE_DEBUG_BUS_STATE,
  752. HIF_BMI_DONE,
  753. HIF_DEVICE_SET_TARGET_TYPE,
  754. HIF_DEVICE_SET_HTC_CONTEXT,
  755. HIF_DEVICE_GET_HTC_CONTEXT,
  756. };
  757. #ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
  758. struct HID_ACCESS_LOG {
  759. uint32_t seqnum;
  760. bool is_write;
  761. void *addr;
  762. uint32_t value;
  763. };
  764. #endif
  765. void hif_reg_write(struct hif_opaque_softc *hif_ctx, uint32_t offset,
  766. uint32_t value);
  767. uint32_t hif_reg_read(struct hif_opaque_softc *hif_ctx, uint32_t offset);
  768. #define HIF_MAX_DEVICES 1
  769. /**
  770. * struct htc_callbacks - Structure for HTC Callbacks methods
  771. * @context: context to pass to the @dsr_handler
  772. * note : @rw_compl_handler is provided the context
  773. * passed to hif_read_write
  774. * @rw_compl_handler: Read / write completion handler
  775. * @dsr_handler: DSR Handler
  776. */
  777. struct htc_callbacks {
  778. void *context;
  779. QDF_STATUS(*rw_compl_handler)(void *rw_ctx, QDF_STATUS status);
  780. QDF_STATUS(*dsr_handler)(void *context);
  781. };
  782. /**
  783. * struct hif_driver_state_callbacks - Callbacks for HIF to query Driver state
  784. * @context: Private data context
  785. * @set_recovery_in_progress: To Set Driver state for recovery in progress
  786. * @is_recovery_in_progress: Query if driver state is recovery in progress
  787. * @is_load_unload_in_progress: Query if driver state Load/Unload in Progress
  788. * @is_driver_unloading: Query if driver is unloading.
  789. * @is_target_ready:
  790. * @get_bandwidth_level: Query current bandwidth level for the driver
  791. * @prealloc_get_consistent_mem_unaligned: get prealloc unaligned consistent mem
  792. * @prealloc_put_consistent_mem_unaligned: put unaligned consistent mem to pool
  793. * This Structure provides callback pointer for HIF to query hdd for driver
  794. * states.
  795. */
  796. struct hif_driver_state_callbacks {
  797. void *context;
  798. void (*set_recovery_in_progress)(void *context, uint8_t val);
  799. bool (*is_recovery_in_progress)(void *context);
  800. bool (*is_load_unload_in_progress)(void *context);
  801. bool (*is_driver_unloading)(void *context);
  802. bool (*is_target_ready)(void *context);
  803. int (*get_bandwidth_level)(void *context);
  804. void *(*prealloc_get_consistent_mem_unaligned)(qdf_size_t size,
  805. qdf_dma_addr_t *paddr,
  806. uint32_t ring_type);
  807. void (*prealloc_put_consistent_mem_unaligned)(void *vaddr);
  808. };
  809. /* This API detaches the HTC layer from the HIF device */
  810. void hif_detach_htc(struct hif_opaque_softc *hif_ctx);
  811. /****************************************************************/
  812. /* BMI and Diag window abstraction */
  813. /****************************************************************/
  814. #define HIF_BMI_EXCHANGE_NO_TIMEOUT ((uint32_t)(0))
  815. #define DIAG_TRANSFER_LIMIT 2048U /* maximum number of bytes that can be
  816. * handled atomically by
  817. * DiagRead/DiagWrite
  818. */
  819. #ifdef WLAN_FEATURE_BMI
  820. /*
  821. * API to handle HIF-specific BMI message exchanges, this API is synchronous
  822. * and only allowed to be called from a context that can block (sleep)
  823. */
  824. QDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx,
  825. qdf_dma_addr_t cmd, qdf_dma_addr_t rsp,
  826. uint8_t *pSendMessage, uint32_t Length,
  827. uint8_t *pResponseMessage,
  828. uint32_t *pResponseLength, uint32_t TimeoutMS);
  829. void hif_register_bmi_callbacks(struct hif_opaque_softc *hif_ctx);
  830. bool hif_needs_bmi(struct hif_opaque_softc *hif_ctx);
  831. #else /* WLAN_FEATURE_BMI */
  832. static inline void
  833. hif_register_bmi_callbacks(struct hif_opaque_softc *hif_ctx)
  834. {
  835. }
  836. static inline bool
  837. hif_needs_bmi(struct hif_opaque_softc *hif_ctx)
  838. {
  839. return false;
  840. }
  841. #endif /* WLAN_FEATURE_BMI */
  842. #ifdef HIF_CPU_CLEAR_AFFINITY
  843. /**
  844. * hif_config_irq_clear_cpu_affinity() - Remove cpu affinity of IRQ
  845. * @scn: HIF handle
  846. * @intr_ctxt_id: interrupt group index
  847. * @cpu: CPU core to clear
  848. *
  849. * Return: None
  850. */
  851. void hif_config_irq_clear_cpu_affinity(struct hif_opaque_softc *scn,
  852. int intr_ctxt_id, int cpu);
  853. #else
  854. static inline
  855. void hif_config_irq_clear_cpu_affinity(struct hif_opaque_softc *scn,
  856. int intr_ctxt_id, int cpu)
  857. {
  858. }
  859. #endif
  860. /*
  861. * APIs to handle HIF specific diagnostic read accesses. These APIs are
  862. * synchronous and only allowed to be called from a context that
  863. * can block (sleep). They are not high performance APIs.
  864. *
  865. * hif_diag_read_access reads a 4 Byte aligned/length value from a
  866. * Target register or memory word.
  867. *
  868. * hif_diag_read_mem reads an arbitrary length of arbitrarily aligned memory.
  869. */
  870. QDF_STATUS hif_diag_read_access(struct hif_opaque_softc *hif_ctx,
  871. uint32_t address, uint32_t *data);
  872. QDF_STATUS hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address,
  873. uint8_t *data, int nbytes);
  874. void hif_dump_target_memory(struct hif_opaque_softc *hif_ctx,
  875. void *ramdump_base, uint32_t address, uint32_t size);
  876. /*
  877. * APIs to handle HIF specific diagnostic write accesses. These APIs are
  878. * synchronous and only allowed to be called from a context that
  879. * can block (sleep).
  880. * They are not high performance APIs.
  881. *
  882. * hif_diag_write_access writes a 4 Byte aligned/length value to a
  883. * Target register or memory word.
  884. *
  885. * hif_diag_write_mem writes an arbitrary length of arbitrarily aligned memory.
  886. */
  887. QDF_STATUS hif_diag_write_access(struct hif_opaque_softc *hif_ctx,
  888. uint32_t address, uint32_t data);
  889. QDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx,
  890. uint32_t address, uint8_t *data, int nbytes);
  891. typedef void (*fastpath_msg_handler)(void *, qdf_nbuf_t *, uint32_t);
  892. void hif_enable_polled_mode(struct hif_opaque_softc *hif_ctx);
  893. bool hif_is_polled_mode_enabled(struct hif_opaque_softc *hif_ctx);
  894. /*
  895. * Set the FASTPATH_mode_on flag in sc, for use by data path
  896. */
  897. #ifdef WLAN_FEATURE_FASTPATH
  898. void hif_enable_fastpath(struct hif_opaque_softc *hif_ctx);
  899. bool hif_is_fastpath_mode_enabled(struct hif_opaque_softc *hif_ctx);
  900. void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int ret);
  901. /**
  902. * hif_ce_fastpath_cb_register() - Register callback for fastpath msg handler
  903. * @hif_ctx: HIF opaque context
  904. * @handler: Callback function
  905. * @context: handle for callback function
  906. *
  907. * Return: QDF_STATUS_SUCCESS on success or QDF_STATUS_E_FAILURE
  908. */
  909. QDF_STATUS hif_ce_fastpath_cb_register(
  910. struct hif_opaque_softc *hif_ctx,
  911. fastpath_msg_handler handler, void *context);
  912. #else
  913. static inline QDF_STATUS hif_ce_fastpath_cb_register(
  914. struct hif_opaque_softc *hif_ctx,
  915. fastpath_msg_handler handler, void *context)
  916. {
  917. return QDF_STATUS_E_FAILURE;
  918. }
  919. static inline void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int ret)
  920. {
  921. return NULL;
  922. }
  923. #endif
  924. /*
  925. * Enable/disable CDC max performance workaround
  926. * For max-performance set this to 0
  927. * To allow SoC to enter sleep set this to 1
  928. */
  929. #define CONFIG_DISABLE_CDC_MAX_PERF_WAR 0
  930. void hif_ipa_get_ce_resource(struct hif_opaque_softc *hif_ctx,
  931. qdf_shared_mem_t **ce_sr,
  932. uint32_t *ce_sr_ring_size,
  933. qdf_dma_addr_t *ce_reg_paddr);
  934. /**
  935. * struct hif_msg_callbacks - List of callbacks - filled in by HTC.
  936. * @Context: context meaningful to HTC
  937. * @txCompletionHandler:
  938. * @rxCompletionHandler:
  939. * @txResourceAvailHandler:
  940. * @fwEventHandler:
  941. * @update_bundle_stats:
  942. */
  943. struct hif_msg_callbacks {
  944. void *Context;
  945. /**< context meaningful to HTC */
  946. QDF_STATUS (*txCompletionHandler)(void *Context, qdf_nbuf_t wbuf,
  947. uint32_t transferID,
  948. uint32_t toeplitz_hash_result);
  949. QDF_STATUS (*rxCompletionHandler)(void *Context, qdf_nbuf_t wbuf,
  950. uint8_t pipeID);
  951. void (*txResourceAvailHandler)(void *context, uint8_t pipe);
  952. void (*fwEventHandler)(void *context, QDF_STATUS status);
  953. void (*update_bundle_stats)(void *context, uint8_t no_of_pkt_in_bundle);
  954. };
  955. enum hif_target_status {
  956. TARGET_STATUS_CONNECTED = 0, /* target connected */
  957. TARGET_STATUS_RESET, /* target got reset */
  958. TARGET_STATUS_EJECT, /* target got ejected */
  959. TARGET_STATUS_SUSPEND /*target got suspend */
  960. };
  961. /**
  962. * enum hif_attribute_flags: configure hif
  963. *
  964. * @HIF_LOWDESC_CE_CFG: Configure HIF with Low descriptor CE
  965. * @HIF_LOWDESC_CE_NO_PKTLOG_CFG: Configure HIF with Low descriptor
  966. * + No pktlog CE
  967. */
  968. enum hif_attribute_flags {
  969. HIF_LOWDESC_CE_CFG = 1,
  970. HIF_LOWDESC_CE_NO_PKTLOG_CFG
  971. };
  972. #define HIF_DATA_ATTR_SET_TX_CLASSIFY(attr, v) \
  973. (attr |= (v & 0x01) << 5)
  974. #define HIF_DATA_ATTR_SET_ENCAPSULATION_TYPE(attr, v) \
  975. (attr |= (v & 0x03) << 6)
  976. #define HIF_DATA_ATTR_SET_ADDR_X_SEARCH_DISABLE(attr, v) \
  977. (attr |= (v & 0x01) << 13)
  978. #define HIF_DATA_ATTR_SET_ADDR_Y_SEARCH_DISABLE(attr, v) \
  979. (attr |= (v & 0x01) << 14)
  980. #define HIF_DATA_ATTR_SET_TOEPLITZ_HASH_ENABLE(attr, v) \
  981. (attr |= (v & 0x01) << 15)
  982. #define HIF_DATA_ATTR_SET_PACKET_OR_RESULT_OFFSET(attr, v) \
  983. (attr |= (v & 0x0FFF) << 16)
  984. #define HIF_DATA_ATTR_SET_ENABLE_11H(attr, v) \
  985. (attr |= (v & 0x01) << 30)
  986. struct hif_ul_pipe_info {
  987. unsigned int nentries;
  988. unsigned int nentries_mask;
  989. unsigned int sw_index;
  990. unsigned int write_index; /* cached copy */
  991. unsigned int hw_index; /* cached copy */
  992. void *base_addr_owner_space; /* Host address space */
  993. qdf_dma_addr_t base_addr_CE_space; /* CE address space */
  994. };
  995. struct hif_dl_pipe_info {
  996. unsigned int nentries;
  997. unsigned int nentries_mask;
  998. unsigned int sw_index;
  999. unsigned int write_index; /* cached copy */
  1000. unsigned int hw_index; /* cached copy */
  1001. void *base_addr_owner_space; /* Host address space */
  1002. qdf_dma_addr_t base_addr_CE_space; /* CE address space */
  1003. };
  1004. struct hif_pipe_addl_info {
  1005. uint32_t pci_mem;
  1006. uint32_t ctrl_addr;
  1007. struct hif_ul_pipe_info ul_pipe;
  1008. struct hif_dl_pipe_info dl_pipe;
  1009. };
  1010. #ifdef CONFIG_SLUB_DEBUG_ON
  1011. #define MSG_FLUSH_NUM 16
  1012. #else /* PERF build */
  1013. #define MSG_FLUSH_NUM 32
  1014. #endif /* SLUB_DEBUG_ON */
  1015. struct hif_bus_id;
  1016. #ifdef CUSTOM_CB_SCHEDULER_SUPPORT
  1017. /**
  1018. * hif_register_ce_custom_cb() - Helper API to register the custom callback
  1019. * @hif_ctx: HIF opaque context
  1020. * @pipe: Pipe number
  1021. * @custom_cb: Custom call back function pointer
  1022. * @custom_cb_context: Custom callback context
  1023. *
  1024. * return: QDF_STATUS
  1025. */
  1026. QDF_STATUS
  1027. hif_register_ce_custom_cb(struct hif_opaque_softc *hif_ctx, uint8_t pipe,
  1028. void (*custom_cb)(void *), void *custom_cb_context);
  1029. /**
  1030. * hif_unregister_ce_custom_cb() - Helper API to unregister the custom callback
  1031. * @hif_ctx: HIF opaque context
  1032. * @pipe: Pipe number
  1033. *
  1034. * return: QDF_STATUS
  1035. */
  1036. QDF_STATUS
  1037. hif_unregister_ce_custom_cb(struct hif_opaque_softc *hif_ctx, uint8_t pipe);
  1038. /**
  1039. * hif_enable_ce_custom_cb() - Helper API to enable the custom callback
  1040. * @hif_ctx: HIF opaque context
  1041. * @pipe: Pipe number
  1042. *
  1043. * return: QDF_STATUS
  1044. */
  1045. QDF_STATUS
  1046. hif_enable_ce_custom_cb(struct hif_opaque_softc *hif_ctx, uint8_t pipe);
  1047. /**
  1048. * hif_disable_ce_custom_cb() - Helper API to disable the custom callback
  1049. * @hif_ctx: HIF opaque context
  1050. * @pipe: Pipe number
  1051. *
  1052. * return: QDF_STATUS
  1053. */
  1054. QDF_STATUS
  1055. hif_disable_ce_custom_cb(struct hif_opaque_softc *hif_ctx, uint8_t pipe);
  1056. #endif /* CUSTOM_CB_SCHEDULER_SUPPORT */
  1057. void hif_claim_device(struct hif_opaque_softc *hif_ctx);
  1058. QDF_STATUS hif_get_config_item(struct hif_opaque_softc *hif_ctx,
  1059. int opcode, void *config, uint32_t config_len);
  1060. void hif_set_mailbox_swap(struct hif_opaque_softc *hif_ctx);
  1061. void hif_mask_interrupt_call(struct hif_opaque_softc *hif_ctx);
  1062. void hif_post_init(struct hif_opaque_softc *hif_ctx, void *hHTC,
  1063. struct hif_msg_callbacks *callbacks);
  1064. QDF_STATUS hif_start(struct hif_opaque_softc *hif_ctx);
  1065. void hif_stop(struct hif_opaque_softc *hif_ctx);
  1066. void hif_flush_surprise_remove(struct hif_opaque_softc *hif_ctx);
  1067. void hif_dump(struct hif_opaque_softc *hif_ctx, uint8_t CmdId, bool start);
  1068. void hif_trigger_dump(struct hif_opaque_softc *hif_ctx,
  1069. uint8_t cmd_id, bool start);
  1070. QDF_STATUS hif_send_head(struct hif_opaque_softc *hif_ctx, uint8_t PipeID,
  1071. uint32_t transferID, uint32_t nbytes,
  1072. qdf_nbuf_t wbuf, uint32_t data_attr);
  1073. void hif_send_complete_check(struct hif_opaque_softc *hif_ctx, uint8_t PipeID,
  1074. int force);
  1075. void hif_schedule_ce_tasklet(struct hif_opaque_softc *hif_ctx, uint8_t PipeID);
  1076. void hif_shut_down_device(struct hif_opaque_softc *hif_ctx);
  1077. void hif_get_default_pipe(struct hif_opaque_softc *hif_ctx, uint8_t *ULPipe,
  1078. uint8_t *DLPipe);
  1079. int hif_map_service_to_pipe(struct hif_opaque_softc *hif_ctx, uint16_t svc_id,
  1080. uint8_t *ul_pipe, uint8_t *dl_pipe, int *ul_is_polled,
  1081. int *dl_is_polled);
  1082. uint16_t
  1083. hif_get_free_queue_number(struct hif_opaque_softc *hif_ctx, uint8_t PipeID);
  1084. void *hif_get_targetdef(struct hif_opaque_softc *hif_ctx);
  1085. uint32_t hif_hia_item_address(uint32_t target_type, uint32_t item_offset);
  1086. void hif_set_target_sleep(struct hif_opaque_softc *hif_ctx, bool sleep_ok,
  1087. bool wait_for_it);
  1088. int hif_check_fw_reg(struct hif_opaque_softc *hif_ctx);
  1089. #ifndef HIF_PCI
  1090. static inline int hif_check_soc_status(struct hif_opaque_softc *hif_ctx)
  1091. {
  1092. return 0;
  1093. }
  1094. #else
  1095. int hif_check_soc_status(struct hif_opaque_softc *hif_ctx);
  1096. #endif
  1097. void hif_get_hw_info(struct hif_opaque_softc *hif_ctx, u32 *version,
  1098. u32 *revision, const char **target_name);
  1099. #ifdef RECEIVE_OFFLOAD
  1100. /**
  1101. * hif_offld_flush_cb_register() - Register the offld flush callback
  1102. * @scn: HIF opaque context
  1103. * @offld_flush_handler: Flush callback is either ol_flush, incase of rx_thread
  1104. * Or GRO/LRO flush when RxThread is not enabled. Called
  1105. * with corresponding context for flush.
  1106. * Return: None
  1107. */
  1108. void hif_offld_flush_cb_register(struct hif_opaque_softc *scn,
  1109. void (offld_flush_handler)(void *ol_ctx));
  1110. /**
  1111. * hif_offld_flush_cb_deregister() - deRegister the offld flush callback
  1112. * @scn: HIF opaque context
  1113. *
  1114. * Return: None
  1115. */
  1116. void hif_offld_flush_cb_deregister(struct hif_opaque_softc *scn);
  1117. #endif
  1118. #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
  1119. /**
  1120. * hif_exec_should_yield() - Check if hif napi context should yield
  1121. * @hif_ctx: HIF opaque context
  1122. * @grp_id: grp_id of the napi for which check needs to be done
  1123. *
  1124. * The function uses grp_id to look for NAPI and checks if NAPI needs to
  1125. * yield. HIF_EXT_GROUP_MAX_YIELD_DURATION_NS is the duration used for
  1126. * yield decision.
  1127. *
  1128. * Return: true if NAPI needs to yield, else false
  1129. */
  1130. bool hif_exec_should_yield(struct hif_opaque_softc *hif_ctx, uint grp_id);
  1131. #else
  1132. static inline bool hif_exec_should_yield(struct hif_opaque_softc *hif_ctx,
  1133. uint grp_id)
  1134. {
  1135. return false;
  1136. }
  1137. #endif
  1138. void hif_disable_isr(struct hif_opaque_softc *hif_ctx);
  1139. void hif_reset_soc(struct hif_opaque_softc *hif_ctx);
  1140. void hif_save_htc_htt_config_endpoint(struct hif_opaque_softc *hif_ctx,
  1141. int htc_htt_tx_endpoint);
  1142. /**
  1143. * hif_open() - Create hif handle
  1144. * @qdf_ctx: qdf context
  1145. * @mode: Driver Mode
  1146. * @bus_type: Bus Type
  1147. * @cbk: CDS Callbacks
  1148. * @psoc: psoc object manager
  1149. *
  1150. * API to open HIF Context
  1151. *
  1152. * Return: HIF Opaque Pointer
  1153. */
  1154. struct hif_opaque_softc *hif_open(qdf_device_t qdf_ctx,
  1155. uint32_t mode,
  1156. enum qdf_bus_type bus_type,
  1157. struct hif_driver_state_callbacks *cbk,
  1158. struct wlan_objmgr_psoc *psoc);
  1159. /**
  1160. * hif_init_dma_mask() - Set dma mask for the dev
  1161. * @dev: dev for which DMA mask is to be set
  1162. * @bus_type: bus type for the target
  1163. *
  1164. * This API sets the DMA mask for the device. before the datapath
  1165. * memory pre-allocation is done. If the DMA mask is not set before
  1166. * requesting the DMA memory, kernel defaults to a 32-bit DMA mask,
  1167. * and does not utilize the full device capability.
  1168. *
  1169. * Return: 0 - success, non-zero on failure.
  1170. */
  1171. int hif_init_dma_mask(struct device *dev, enum qdf_bus_type bus_type);
  1172. void hif_close(struct hif_opaque_softc *hif_ctx);
  1173. QDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev,
  1174. void *bdev, const struct hif_bus_id *bid,
  1175. enum qdf_bus_type bus_type,
  1176. enum hif_enable_type type);
  1177. void hif_disable(struct hif_opaque_softc *hif_ctx, enum hif_disable_type type);
  1178. #ifdef CE_TASKLET_DEBUG_ENABLE
  1179. void hif_enable_ce_latency_stats(struct hif_opaque_softc *hif_ctx,
  1180. uint8_t value);
  1181. #endif
  1182. void hif_display_stats(struct hif_opaque_softc *hif_ctx);
  1183. void hif_clear_stats(struct hif_opaque_softc *hif_ctx);
  1184. /**
  1185. * enum hif_pm_wake_irq_type - Wake interrupt type for Power Management
  1186. * @HIF_PM_INVALID_WAKE: Wake irq is invalid or not configured
  1187. * @HIF_PM_MSI_WAKE: Wake irq is MSI interrupt
  1188. * @HIF_PM_CE_WAKE: Wake irq is CE interrupt
  1189. */
  1190. typedef enum {
  1191. HIF_PM_INVALID_WAKE,
  1192. HIF_PM_MSI_WAKE,
  1193. HIF_PM_CE_WAKE,
  1194. } hif_pm_wake_irq_type;
  1195. /**
  1196. * hif_pm_get_wake_irq_type - Get wake irq type for Power Management
  1197. * @hif_ctx: HIF context
  1198. *
  1199. * Return: enum hif_pm_wake_irq_type
  1200. */
  1201. hif_pm_wake_irq_type hif_pm_get_wake_irq_type(struct hif_opaque_softc *hif_ctx);
  1202. /**
  1203. * enum hif_ep_vote_type - hif ep vote type
  1204. * @HIF_EP_VOTE_DP_ACCESS: vote type is specific DP
  1205. * @HIF_EP_VOTE_NONDP_ACCESS: ep vote for over all access
  1206. */
  1207. enum hif_ep_vote_type {
  1208. HIF_EP_VOTE_DP_ACCESS,
  1209. HIF_EP_VOTE_NONDP_ACCESS
  1210. };
  1211. /**
  1212. * enum hif_ep_vote_access - hif ep vote access
  1213. * @HIF_EP_VOTE_ACCESS_ENABLE: Enable ep voting
  1214. * @HIF_EP_VOTE_INTERMEDIATE_ACCESS: allow during transition
  1215. * @HIF_EP_VOTE_ACCESS_DISABLE: disable ep voting
  1216. */
  1217. enum hif_ep_vote_access {
  1218. HIF_EP_VOTE_ACCESS_ENABLE,
  1219. HIF_EP_VOTE_INTERMEDIATE_ACCESS,
  1220. HIF_EP_VOTE_ACCESS_DISABLE
  1221. };
  1222. /**
  1223. * enum hif_rtpm_client_id - modules registered with runtime pm module
  1224. * @HIF_RTPM_ID_RESERVED: Reserved ID
  1225. * @HIF_RTPM_ID_HAL_REO_CMD: HAL REO commands
  1226. * @HIF_RTPM_ID_WMI: WMI commands Tx
  1227. * @HIF_RTPM_ID_HTT: HTT commands Tx
  1228. * @HIF_RTPM_ID_DP: Datapath Tx path
  1229. * @HIF_RTPM_ID_DP_RING_STATS: Datapath ring stats
  1230. * @HIF_RTPM_ID_CE: CE Tx buffer posting
  1231. * @HIF_RTPM_ID_FORCE_WAKE: Force wake request
  1232. * @HIF_RTPM_ID_PM_QOS_NOTIFY:
  1233. * @HIF_RTPM_ID_WIPHY_SUSPEND:
  1234. * @HIF_RTPM_ID_MAX: Max id
  1235. */
  1236. enum hif_rtpm_client_id {
  1237. HIF_RTPM_ID_RESERVED,
  1238. HIF_RTPM_ID_HAL_REO_CMD,
  1239. HIF_RTPM_ID_WMI,
  1240. HIF_RTPM_ID_HTT,
  1241. HIF_RTPM_ID_DP,
  1242. HIF_RTPM_ID_DP_RING_STATS,
  1243. HIF_RTPM_ID_CE,
  1244. HIF_RTPM_ID_FORCE_WAKE,
  1245. HIF_RTPM_ID_PM_QOS_NOTIFY,
  1246. HIF_RTPM_ID_WIPHY_SUSPEND,
  1247. HIF_RTPM_ID_MAX
  1248. };
  1249. /**
  1250. * enum rpm_type - Get and Put calls types
  1251. * @HIF_RTPM_GET_ASYNC: Increment usage count and when system is suspended
  1252. * schedule resume process, return depends on pm state.
  1253. * @HIF_RTPM_GET_FORCE: Increment usage count and when system is suspended
  1254. * schedule resume process, returns success irrespective of
  1255. * pm_state.
  1256. * @HIF_RTPM_GET_SYNC: Increment usage count and when system is suspended,
  1257. * wait till process is resumed.
  1258. * @HIF_RTPM_GET_NORESUME: Only increments usage count.
  1259. * @HIF_RTPM_PUT_ASYNC: Decrements usage count and puts system in idle state.
  1260. * @HIF_RTPM_PUT_SYNC_SUSPEND: Decrements usage count and puts system in
  1261. * suspended state.
  1262. * @HIF_RTPM_PUT_NOIDLE: Decrements usage count.
  1263. */
  1264. enum rpm_type {
  1265. HIF_RTPM_GET_ASYNC,
  1266. HIF_RTPM_GET_FORCE,
  1267. HIF_RTPM_GET_SYNC,
  1268. HIF_RTPM_GET_NORESUME,
  1269. HIF_RTPM_PUT_ASYNC,
  1270. HIF_RTPM_PUT_SYNC_SUSPEND,
  1271. HIF_RTPM_PUT_NOIDLE,
  1272. };
  1273. /**
  1274. * struct hif_pm_runtime_lock - data structure for preventing runtime suspend
  1275. * @list: global list of runtime locks
  1276. * @active: true if this lock is preventing suspend
  1277. * @name: character string for tracking this lock
  1278. */
  1279. struct hif_pm_runtime_lock {
  1280. struct list_head list;
  1281. bool active;
  1282. const char *name;
  1283. };
  1284. #ifdef FEATURE_RUNTIME_PM
  1285. /**
  1286. * hif_rtpm_register() - Register a module with runtime PM.
  1287. * @id: ID of the module which needs to be registered
  1288. * @hif_rpm_cbk: callback to be called when get was called in suspended state.
  1289. *
  1290. * Return: success status if successfully registered
  1291. */
  1292. QDF_STATUS hif_rtpm_register(uint32_t id, void (*hif_rpm_cbk)(void));
  1293. /**
  1294. * hif_rtpm_deregister() - Deregister the module
  1295. * @id: ID of the module which needs to be de-registered
  1296. */
  1297. QDF_STATUS hif_rtpm_deregister(uint32_t id);
  1298. /**
  1299. * hif_rtpm_set_autosuspend_delay() - Set delay to trigger RTPM suspend
  1300. * @delay: delay in ms to be set
  1301. *
  1302. * Return: Success if delay is set successfully
  1303. */
  1304. QDF_STATUS hif_rtpm_set_autosuspend_delay(int delay);
  1305. /**
  1306. * hif_rtpm_restore_autosuspend_delay() - Restore delay value to default value
  1307. *
  1308. * Return: Success if reset done. E_ALREADY if delay same as config value
  1309. */
  1310. QDF_STATUS hif_rtpm_restore_autosuspend_delay(void);
  1311. /**
  1312. * hif_rtpm_get_autosuspend_delay() -Get delay to trigger RTPM suspend
  1313. *
  1314. * Return: Delay in ms
  1315. */
  1316. int hif_rtpm_get_autosuspend_delay(void);
  1317. /**
  1318. * hif_runtime_lock_init() - API to initialize Runtime PM context
  1319. * @lock: QDF lock context
  1320. * @name: Context name
  1321. *
  1322. * This API initializes the Runtime PM context of the caller and
  1323. * return the pointer.
  1324. *
  1325. * Return: None
  1326. */
  1327. int hif_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name);
  1328. /**
  1329. * hif_runtime_lock_deinit() - This API frees the runtime pm context
  1330. * @data: Runtime PM context
  1331. *
  1332. * Return: void
  1333. */
  1334. void hif_runtime_lock_deinit(struct hif_pm_runtime_lock *data);
  1335. /**
  1336. * hif_rtpm_get() - Increment usage_count on the device to avoid suspend.
  1337. * @type: get call types from hif_rpm_type
  1338. * @id: ID of the module calling get()
  1339. *
  1340. * A get operation will prevent a runtime suspend until a
  1341. * corresponding put is done. This api should be used when accessing bus.
  1342. *
  1343. * CONTRARY TO THE REGULAR RUNTIME PM, WHEN THE BUS IS SUSPENDED,
  1344. * THIS API WILL ONLY REQUEST THE RESUME AND NOT DO A GET!!!
  1345. *
  1346. * return: success if a get has been issued, else error code.
  1347. */
  1348. QDF_STATUS hif_rtpm_get(uint8_t type, uint32_t id);
  1349. /**
  1350. * hif_rtpm_put() - do a put operation on the device
  1351. * @type: put call types from hif_rpm_type
  1352. * @id: ID of the module calling put()
  1353. *
  1354. * A put operation will allow a runtime suspend after a corresponding
  1355. * get was done. This api should be used when finished accessing bus.
  1356. *
  1357. * This api will return a failure if runtime pm is stopped
  1358. * This api will return failure if it would decrement the usage count below 0.
  1359. *
  1360. * return: QDF_STATUS_SUCCESS if the put is performed
  1361. */
  1362. QDF_STATUS hif_rtpm_put(uint8_t type, uint32_t id);
  1363. /**
  1364. * hif_pm_runtime_prevent_suspend() - Prevent Runtime suspend
  1365. * @data: runtime PM lock
  1366. *
  1367. * This function will prevent runtime suspend, by incrementing
  1368. * device's usage count.
  1369. *
  1370. * Return: status
  1371. */
  1372. int hif_pm_runtime_prevent_suspend(struct hif_pm_runtime_lock *data);
  1373. /**
  1374. * hif_pm_runtime_prevent_suspend_sync() - Synchronized prevent Runtime suspend
  1375. * @data: runtime PM lock
  1376. *
  1377. * This function will prevent runtime suspend, by incrementing
  1378. * device's usage count.
  1379. *
  1380. * Return: status
  1381. */
  1382. int hif_pm_runtime_prevent_suspend_sync(struct hif_pm_runtime_lock *data);
  1383. /**
  1384. * hif_pm_runtime_allow_suspend() - Allow Runtime suspend
  1385. * @data: runtime PM lock
  1386. *
  1387. * This function will allow runtime suspend, by decrementing
  1388. * device's usage count.
  1389. *
  1390. * Return: status
  1391. */
  1392. int hif_pm_runtime_allow_suspend(struct hif_pm_runtime_lock *data);
  1393. /**
  1394. * hif_rtpm_request_resume() - Request resume if bus is suspended
  1395. *
  1396. * Return: None
  1397. */
  1398. void hif_rtpm_request_resume(void);
  1399. /**
  1400. * hif_rtpm_sync_resume() - Invoke synchronous runtime resume.
  1401. *
  1402. * This function will invoke synchronous runtime resume.
  1403. *
  1404. * Return: status
  1405. */
  1406. QDF_STATUS hif_rtpm_sync_resume(void);
  1407. /**
  1408. * hif_rtpm_check_and_request_resume() - check if bus is suspended and
  1409. * request resume.
  1410. *
  1411. * Return: void
  1412. */
  1413. void hif_rtpm_check_and_request_resume(void);
  1414. /**
  1415. * hif_rtpm_set_client_job() - Set job for the client.
  1416. * @client_id: Client id for which job needs to be set
  1417. *
  1418. * If get failed due to system being in suspended state, set the client job so
  1419. * when system resumes the client's job is called.
  1420. *
  1421. * Return: None
  1422. */
  1423. void hif_rtpm_set_client_job(uint32_t client_id);
  1424. /**
  1425. * hif_rtpm_mark_last_busy() - Mark last busy to delay retry to suspend
  1426. * @id: ID marking last busy
  1427. *
  1428. * Return: None
  1429. */
  1430. void hif_rtpm_mark_last_busy(uint32_t id);
  1431. /**
  1432. * hif_rtpm_get_monitor_wake_intr() - API to get monitor_wake_intr
  1433. *
  1434. * monitor_wake_intr variable can be used to indicate if driver expects wake
  1435. * MSI for runtime PM
  1436. *
  1437. * Return: monitor_wake_intr variable
  1438. */
  1439. int hif_rtpm_get_monitor_wake_intr(void);
  1440. /**
  1441. * hif_rtpm_set_monitor_wake_intr() - API to set monitor_wake_intr
  1442. * @val: value to set
  1443. *
  1444. * monitor_wake_intr variable can be used to indicate if driver expects wake
  1445. * MSI for runtime PM
  1446. *
  1447. * Return: void
  1448. */
  1449. void hif_rtpm_set_monitor_wake_intr(int val);
  1450. /**
  1451. * hif_pre_runtime_suspend() - book keeping before beginning runtime suspend.
  1452. * @hif_ctx: HIF context
  1453. *
  1454. * Makes sure that the pci link will be taken down by the suspend operation.
  1455. * If the hif layer is configured to leave the bus on, runtime suspend will
  1456. * not save any power.
  1457. *
  1458. * Set the runtime suspend state to SUSPENDING.
  1459. *
  1460. * return -EINVAL if the bus won't go down. otherwise return 0
  1461. */
  1462. int hif_pre_runtime_suspend(struct hif_opaque_softc *hif_ctx);
  1463. /**
  1464. * hif_pre_runtime_resume() - bookkeeping before beginning runtime resume
  1465. *
  1466. * update the runtime pm state to RESUMING.
  1467. * Return: void
  1468. */
  1469. void hif_pre_runtime_resume(void);
  1470. /**
  1471. * hif_process_runtime_suspend_success() - bookkeeping of suspend success
  1472. *
  1473. * Record the success.
  1474. * update the runtime_pm state to SUSPENDED
  1475. * Return: void
  1476. */
  1477. void hif_process_runtime_suspend_success(void);
  1478. /**
  1479. * hif_process_runtime_suspend_failure() - bookkeeping of suspend failure
  1480. *
  1481. * Record the failure.
  1482. * mark last busy to delay a retry.
  1483. * update the runtime_pm state back to ON
  1484. *
  1485. * Return: void
  1486. */
  1487. void hif_process_runtime_suspend_failure(void);
  1488. /**
  1489. * hif_process_runtime_resume_linkup() - bookkeeping of resuming link up
  1490. *
  1491. * update the runtime_pm state to RESUMING_LINKUP
  1492. * Return: void
  1493. */
  1494. void hif_process_runtime_resume_linkup(void);
  1495. /**
  1496. * hif_process_runtime_resume_success() - bookkeeping after a runtime resume
  1497. *
  1498. * record the success.
  1499. * update the runtime_pm state to SUSPENDED
  1500. * Return: void
  1501. */
  1502. void hif_process_runtime_resume_success(void);
  1503. /**
  1504. * hif_rtpm_print_prevent_list() - list the clients preventing suspend.
  1505. *
  1506. * Return: None
  1507. */
  1508. void hif_rtpm_print_prevent_list(void);
  1509. /**
  1510. * hif_rtpm_suspend_lock() - spin_lock on marking runtime suspend
  1511. *
  1512. * Return: void
  1513. */
  1514. void hif_rtpm_suspend_lock(void);
  1515. /**
  1516. * hif_rtpm_suspend_unlock() - spin_unlock on marking runtime suspend
  1517. *
  1518. * Return: void
  1519. */
  1520. void hif_rtpm_suspend_unlock(void);
  1521. /**
  1522. * hif_runtime_suspend() - do the bus suspend part of a runtime suspend
  1523. * @hif_ctx: HIF context
  1524. *
  1525. * Return: 0 for success and non-zero error code for failure
  1526. */
  1527. int hif_runtime_suspend(struct hif_opaque_softc *hif_ctx);
  1528. /**
  1529. * hif_runtime_resume() - do the bus resume part of a runtime resume
  1530. * @hif_ctx: HIF context
  1531. *
  1532. * Return: 0 for success and non-zero error code for failure
  1533. */
  1534. int hif_runtime_resume(struct hif_opaque_softc *hif_ctx);
  1535. /**
  1536. * hif_fastpath_resume() - resume fastpath for runtimepm
  1537. * @hif_ctx: HIF context
  1538. *
  1539. * ensure that the fastpath write index register is up to date
  1540. * since runtime pm may cause ce_send_fast to skip the register
  1541. * write.
  1542. *
  1543. * fastpath only applicable to legacy copy engine
  1544. */
  1545. void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx);
  1546. /**
  1547. * hif_rtpm_get_state(): get rtpm link state
  1548. *
  1549. * Return: state
  1550. */
  1551. int hif_rtpm_get_state(void);
  1552. /**
  1553. * hif_rtpm_display_last_busy_hist() - Display runtimepm last busy history
  1554. * @hif_ctx: HIF context
  1555. *
  1556. * Return: None
  1557. */
  1558. void hif_rtpm_display_last_busy_hist(struct hif_opaque_softc *hif_ctx);
  1559. /**
  1560. * hif_rtpm_record_ce_last_busy_evt() - Record CE runtimepm last busy event
  1561. * @scn: HIF context
  1562. * @ce_id: CE id
  1563. *
  1564. * Return: None
  1565. */
  1566. void hif_rtpm_record_ce_last_busy_evt(struct hif_softc *scn,
  1567. unsigned long ce_id);
  1568. #else
  1569. /**
  1570. * hif_rtpm_display_last_busy_hist() - Display runtimepm last busy history
  1571. * @hif_ctx: HIF context
  1572. *
  1573. * Return: None
  1574. */
  1575. static inline
  1576. void hif_rtpm_display_last_busy_hist(struct hif_opaque_softc *hif_ctx) { }
  1577. /**
  1578. * hif_rtpm_record_ce_last_busy_evt() - Record CE runtimepm last busy event
  1579. * @scn: HIF context
  1580. * @ce_id: CE id
  1581. *
  1582. * Return: None
  1583. */
  1584. static inline
  1585. void hif_rtpm_record_ce_last_busy_evt(struct hif_softc *scn,
  1586. unsigned long ce_id)
  1587. { }
  1588. static inline
  1589. QDF_STATUS hif_rtpm_register(uint32_t id, void (*hif_rpm_cbk)(void))
  1590. { return QDF_STATUS_SUCCESS; }
  1591. static inline
  1592. QDF_STATUS hif_rtpm_deregister(uint32_t id)
  1593. { return QDF_STATUS_SUCCESS; }
  1594. static inline
  1595. QDF_STATUS hif_rtpm_set_autosuspend_delay(int delay)
  1596. { return QDF_STATUS_SUCCESS; }
  1597. static inline QDF_STATUS hif_rtpm_restore_autosuspend_delay(void)
  1598. { return QDF_STATUS_SUCCESS; }
  1599. static inline int hif_rtpm_get_autosuspend_delay(void)
  1600. { return 0; }
  1601. static inline
  1602. int hif_runtime_lock_init(qdf_runtime_lock_t *lock, const char *name)
  1603. { return 0; }
  1604. static inline
  1605. void hif_runtime_lock_deinit(struct hif_pm_runtime_lock *data)
  1606. {}
  1607. static inline
  1608. int hif_rtpm_get(uint8_t type, uint32_t id)
  1609. { return QDF_STATUS_SUCCESS; }
  1610. static inline
  1611. QDF_STATUS hif_rtpm_put(uint8_t type, uint32_t id)
  1612. { return QDF_STATUS_SUCCESS; }
  1613. static inline
  1614. int hif_pm_runtime_allow_suspend(struct hif_pm_runtime_lock *data)
  1615. { return 0; }
  1616. static inline
  1617. int hif_pm_runtime_prevent_suspend(struct hif_pm_runtime_lock *data)
  1618. { return 0; }
  1619. static inline
  1620. int hif_pm_runtime_prevent_suspend_sync(struct hif_pm_runtime_lock *data)
  1621. { return 0; }
  1622. static inline
  1623. QDF_STATUS hif_rtpm_sync_resume(void)
  1624. { return QDF_STATUS_SUCCESS; }
  1625. static inline
  1626. void hif_rtpm_request_resume(void)
  1627. {}
  1628. static inline
  1629. void hif_rtpm_check_and_request_resume(void)
  1630. {}
  1631. static inline
  1632. void hif_rtpm_set_client_job(uint32_t client_id)
  1633. {}
  1634. static inline
  1635. void hif_rtpm_print_prevent_list(void)
  1636. {}
  1637. static inline
  1638. void hif_rtpm_suspend_unlock(void)
  1639. {}
  1640. static inline
  1641. void hif_rtpm_suspend_lock(void)
  1642. {}
  1643. static inline
  1644. int hif_rtpm_get_monitor_wake_intr(void)
  1645. { return 0; }
  1646. static inline
  1647. void hif_rtpm_set_monitor_wake_intr(int val)
  1648. {}
  1649. static inline
  1650. void hif_rtpm_mark_last_busy(uint32_t id)
  1651. {}
  1652. #endif
  1653. void hif_enable_power_management(struct hif_opaque_softc *hif_ctx,
  1654. bool is_packet_log_enabled);
  1655. void hif_disable_power_management(struct hif_opaque_softc *hif_ctx);
  1656. void hif_vote_link_up(struct hif_opaque_softc *hif_ctx);
  1657. void hif_vote_link_down(struct hif_opaque_softc *hif_ctx);
  1658. bool hif_can_suspend_link(struct hif_opaque_softc *hif_ctx);
  1659. #ifdef IPA_OFFLOAD
  1660. /**
  1661. * hif_get_ipa_hw_type() - get IPA hw type
  1662. *
  1663. * This API return the IPA hw type.
  1664. *
  1665. * Return: IPA hw type
  1666. */
  1667. static inline
  1668. enum ipa_hw_type hif_get_ipa_hw_type(void)
  1669. {
  1670. return ipa_get_hw_type();
  1671. }
  1672. /**
  1673. * hif_get_ipa_present() - get IPA hw status
  1674. *
  1675. * This API return the IPA hw status.
  1676. *
  1677. * Return: true if IPA is present or false otherwise
  1678. */
  1679. static inline
  1680. bool hif_get_ipa_present(void)
  1681. {
  1682. if (qdf_ipa_uc_reg_rdyCB(NULL) != -EPERM)
  1683. return true;
  1684. else
  1685. return false;
  1686. }
  1687. #endif
  1688. int hif_bus_resume(struct hif_opaque_softc *hif_ctx);
  1689. /**
  1690. * hif_bus_early_suspend() - stop non wmi tx traffic
  1691. * @hif_ctx: hif context
  1692. */
  1693. int hif_bus_early_suspend(struct hif_opaque_softc *hif_ctx);
  1694. /**
  1695. * hif_bus_late_resume() - resume non wmi traffic
  1696. * @hif_ctx: hif context
  1697. */
  1698. int hif_bus_late_resume(struct hif_opaque_softc *hif_ctx);
  1699. int hif_bus_suspend(struct hif_opaque_softc *hif_ctx);
  1700. int hif_bus_resume_noirq(struct hif_opaque_softc *hif_ctx);
  1701. int hif_bus_suspend_noirq(struct hif_opaque_softc *hif_ctx);
  1702. /**
  1703. * hif_apps_irqs_enable() - Enables all irqs from the APPS side
  1704. * @hif_ctx: an opaque HIF handle to use
  1705. *
  1706. * As opposed to the standard hif_irq_enable, this function always applies to
  1707. * the APPS side kernel interrupt handling.
  1708. *
  1709. * Return: errno
  1710. */
  1711. int hif_apps_irqs_enable(struct hif_opaque_softc *hif_ctx);
  1712. /**
  1713. * hif_apps_irqs_disable() - Disables all irqs from the APPS side
  1714. * @hif_ctx: an opaque HIF handle to use
  1715. *
  1716. * As opposed to the standard hif_irq_disable, this function always applies to
  1717. * the APPS side kernel interrupt handling.
  1718. *
  1719. * Return: errno
  1720. */
  1721. int hif_apps_irqs_disable(struct hif_opaque_softc *hif_ctx);
  1722. /**
  1723. * hif_apps_wake_irq_enable() - Enables the wake irq from the APPS side
  1724. * @hif_ctx: an opaque HIF handle to use
  1725. *
  1726. * As opposed to the standard hif_irq_enable, this function always applies to
  1727. * the APPS side kernel interrupt handling.
  1728. *
  1729. * Return: errno
  1730. */
  1731. int hif_apps_wake_irq_enable(struct hif_opaque_softc *hif_ctx);
  1732. /**
  1733. * hif_apps_wake_irq_disable() - Disables the wake irq from the APPS side
  1734. * @hif_ctx: an opaque HIF handle to use
  1735. *
  1736. * As opposed to the standard hif_irq_disable, this function always applies to
  1737. * the APPS side kernel interrupt handling.
  1738. *
  1739. * Return: errno
  1740. */
  1741. int hif_apps_wake_irq_disable(struct hif_opaque_softc *hif_ctx);
  1742. /**
  1743. * hif_apps_enable_irq_wake() - Enables the irq wake from the APPS side
  1744. * @hif_ctx: an opaque HIF handle to use
  1745. *
  1746. * This function always applies to the APPS side kernel interrupt handling
  1747. * to wake the system from suspend.
  1748. *
  1749. * Return: errno
  1750. */
  1751. int hif_apps_enable_irq_wake(struct hif_opaque_softc *hif_ctx);
  1752. /**
  1753. * hif_apps_disable_irq_wake() - Disables the wake irq from the APPS side
  1754. * @hif_ctx: an opaque HIF handle to use
  1755. *
  1756. * This function always applies to the APPS side kernel interrupt handling
  1757. * to disable the wake irq.
  1758. *
  1759. * Return: errno
  1760. */
  1761. int hif_apps_disable_irq_wake(struct hif_opaque_softc *hif_ctx);
  1762. /**
  1763. * hif_apps_enable_irqs_except_wake_irq() - Enables all irqs except wake_irq
  1764. * @hif_ctx: an opaque HIF handle to use
  1765. *
  1766. * As opposed to the standard hif_irq_enable, this function always applies to
  1767. * the APPS side kernel interrupt handling.
  1768. *
  1769. * Return: errno
  1770. */
  1771. int hif_apps_enable_irqs_except_wake_irq(struct hif_opaque_softc *hif_ctx);
  1772. /**
  1773. * hif_apps_disable_irqs_except_wake_irq() - Disables all irqs except wake_irq
  1774. * @hif_ctx: an opaque HIF handle to use
  1775. *
  1776. * As opposed to the standard hif_irq_disable, this function always applies to
  1777. * the APPS side kernel interrupt handling.
  1778. *
  1779. * Return: errno
  1780. */
  1781. int hif_apps_disable_irqs_except_wake_irq(struct hif_opaque_softc *hif_ctx);
  1782. int hif_get_irq_num(struct hif_opaque_softc *scn, int *irq, uint32_t size);
  1783. int hif_dump_registers(struct hif_opaque_softc *scn);
  1784. int ol_copy_ramdump(struct hif_opaque_softc *scn);
  1785. void hif_crash_shutdown(struct hif_opaque_softc *hif_ctx);
  1786. void hif_get_hw_info(struct hif_opaque_softc *hif_ctx, u32 *version,
  1787. u32 *revision, const char **target_name);
  1788. enum qdf_bus_type hif_get_bus_type(struct hif_opaque_softc *hif_hdl);
  1789. struct hif_target_info *hif_get_target_info_handle(struct hif_opaque_softc *
  1790. scn);
  1791. struct hif_config_info *hif_get_ini_handle(struct hif_opaque_softc *hif_ctx);
  1792. struct ramdump_info *hif_get_ramdump_ctx(struct hif_opaque_softc *hif_ctx);
  1793. enum hif_target_status hif_get_target_status(struct hif_opaque_softc *hif_ctx);
  1794. void hif_set_target_status(struct hif_opaque_softc *hif_ctx, enum
  1795. hif_target_status);
  1796. void hif_init_ini_config(struct hif_opaque_softc *hif_ctx,
  1797. struct hif_config_info *cfg);
  1798. void hif_update_tx_ring(struct hif_opaque_softc *osc, u_int32_t num_htt_cmpls);
  1799. qdf_nbuf_t hif_batch_send(struct hif_opaque_softc *osc, qdf_nbuf_t msdu,
  1800. uint32_t transfer_id, u_int32_t len, uint32_t sendhead);
  1801. QDF_STATUS hif_send_single(struct hif_opaque_softc *osc, qdf_nbuf_t msdu,
  1802. uint32_t transfer_id, u_int32_t len);
  1803. int hif_send_fast(struct hif_opaque_softc *osc, qdf_nbuf_t nbuf,
  1804. uint32_t transfer_id, uint32_t download_len);
  1805. void hif_pkt_dl_len_set(void *hif_sc, unsigned int pkt_download_len);
  1806. void hif_ce_war_disable(void);
  1807. void hif_ce_war_enable(void);
  1808. void hif_disable_interrupt(struct hif_opaque_softc *osc, uint32_t pipe_num);
  1809. #ifdef QCA_NSS_WIFI_OFFLOAD_SUPPORT
  1810. struct hif_pipe_addl_info *hif_get_addl_pipe_info(struct hif_opaque_softc *osc,
  1811. struct hif_pipe_addl_info *hif_info, uint32_t pipe_number);
  1812. uint32_t hif_set_nss_wifiol_mode(struct hif_opaque_softc *osc,
  1813. uint32_t pipe_num);
  1814. int32_t hif_get_nss_wifiol_bypass_nw_process(struct hif_opaque_softc *osc);
  1815. #endif /* QCA_NSS_WIFI_OFFLOAD_SUPPORT */
  1816. void hif_set_bundle_mode(struct hif_opaque_softc *hif_ctx, bool enabled,
  1817. int rx_bundle_cnt);
  1818. int hif_bus_reset_resume(struct hif_opaque_softc *hif_ctx);
  1819. void hif_set_attribute(struct hif_opaque_softc *osc, uint8_t hif_attrib);
  1820. void *hif_get_lro_info(int ctx_id, struct hif_opaque_softc *hif_hdl);
  1821. enum hif_exec_type {
  1822. HIF_EXEC_NAPI_TYPE,
  1823. HIF_EXEC_TASKLET_TYPE,
  1824. };
  1825. typedef uint32_t (*ext_intr_handler)(void *, uint32_t, int);
  1826. /**
  1827. * hif_get_int_ctx_irq_num() - retrieve an irq num for an interrupt context id
  1828. * @softc: hif opaque context owning the exec context
  1829. * @id: the id of the interrupt context
  1830. *
  1831. * Return: IRQ number of the first (zero'th) IRQ within the interrupt context ID
  1832. * 'id' registered with the OS
  1833. */
  1834. int32_t hif_get_int_ctx_irq_num(struct hif_opaque_softc *softc,
  1835. uint8_t id);
  1836. /**
  1837. * hif_configure_ext_group_interrupts() - Configure ext group interrupts
  1838. * @hif_ctx: hif opaque context
  1839. *
  1840. * Return: QDF_STATUS
  1841. */
  1842. QDF_STATUS hif_configure_ext_group_interrupts(struct hif_opaque_softc *hif_ctx);
  1843. /**
  1844. * hif_deconfigure_ext_group_interrupts() - Deconfigure ext group interrupts
  1845. * @hif_ctx: hif opaque context
  1846. *
  1847. * Return: None
  1848. */
  1849. void hif_deconfigure_ext_group_interrupts(struct hif_opaque_softc *hif_ctx);
  1850. /**
  1851. * hif_register_ext_group() - API to register external group
  1852. * interrupt handler.
  1853. * @hif_ctx : HIF Context
  1854. * @numirq: number of irq's in the group
  1855. * @irq: array of irq values
  1856. * @handler: callback interrupt handler function
  1857. * @cb_ctx: context to passed in callback
  1858. * @context_name: text name of the context
  1859. * @type: napi vs tasklet
  1860. * @scale:
  1861. *
  1862. * Return: QDF_STATUS
  1863. */
  1864. QDF_STATUS hif_register_ext_group(struct hif_opaque_softc *hif_ctx,
  1865. uint32_t numirq, uint32_t irq[],
  1866. ext_intr_handler handler,
  1867. void *cb_ctx, const char *context_name,
  1868. enum hif_exec_type type, uint32_t scale);
  1869. void hif_deregister_exec_group(struct hif_opaque_softc *hif_ctx,
  1870. const char *context_name);
  1871. void hif_update_pipe_callback(struct hif_opaque_softc *osc,
  1872. u_int8_t pipeid,
  1873. struct hif_msg_callbacks *callbacks);
  1874. /**
  1875. * hif_print_napi_stats() - Display HIF NAPI stats
  1876. * @hif_ctx: HIF opaque context
  1877. *
  1878. * Return: None
  1879. */
  1880. void hif_print_napi_stats(struct hif_opaque_softc *hif_ctx);
  1881. /**
  1882. * hif_clear_napi_stats() - function clears the stats of the
  1883. * latency when called.
  1884. * @hif_ctx: the HIF context to assign the callback to
  1885. *
  1886. * Return: None
  1887. */
  1888. void hif_clear_napi_stats(struct hif_opaque_softc *hif_ctx);
  1889. #ifdef __cplusplus
  1890. }
  1891. #endif
  1892. #ifdef FORCE_WAKE
  1893. /**
  1894. * hif_force_wake_request() - Function to wake from power collapse
  1895. * @handle: HIF opaque handle
  1896. *
  1897. * Description: API to check if the device is awake or not before
  1898. * read/write to BAR + 4K registers. If device is awake return
  1899. * success otherwise write '1' to
  1900. * PCIE_PCIE_LOCAL_REG_PCIE_SOC_WAKE_PCIE_LOCAL_REG which will interrupt
  1901. * the device and does wakeup the PCI and MHI within 50ms
  1902. * and then the device writes a value to
  1903. * PCIE_SOC_PCIE_REG_PCIE_SCRATCH_0_SOC_PCIE_REG to complete the
  1904. * handshake process to let the host know the device is awake.
  1905. *
  1906. * Return: zero - success/non-zero - failure
  1907. */
  1908. int hif_force_wake_request(struct hif_opaque_softc *handle);
  1909. /**
  1910. * hif_force_wake_release() - API to release/reset the SOC wake register
  1911. * from interrupting the device.
  1912. * @handle: HIF opaque handle
  1913. *
  1914. * Description: API to set the
  1915. * PCIE_PCIE_LOCAL_REG_PCIE_SOC_WAKE_PCIE_LOCAL_REG to '0'
  1916. * to release the interrupt line.
  1917. *
  1918. * Return: zero - success/non-zero - failure
  1919. */
  1920. int hif_force_wake_release(struct hif_opaque_softc *handle);
  1921. #else
  1922. static inline
  1923. int hif_force_wake_request(struct hif_opaque_softc *handle)
  1924. {
  1925. return 0;
  1926. }
  1927. static inline
  1928. int hif_force_wake_release(struct hif_opaque_softc *handle)
  1929. {
  1930. return 0;
  1931. }
  1932. #endif /* FORCE_WAKE */
  1933. #ifdef FEATURE_HAL_DELAYED_REG_WRITE
  1934. /**
  1935. * hif_prevent_link_low_power_states() - Prevent from going to low power states
  1936. * @hif: HIF opaque context
  1937. *
  1938. * Return: 0 on success. Error code on failure.
  1939. */
  1940. int hif_prevent_link_low_power_states(struct hif_opaque_softc *hif);
  1941. /**
  1942. * hif_allow_link_low_power_states() - Allow link to go to low power states
  1943. * @hif: HIF opaque context
  1944. *
  1945. * Return: None
  1946. */
  1947. void hif_allow_link_low_power_states(struct hif_opaque_softc *hif);
  1948. #else
  1949. static inline
  1950. int hif_prevent_link_low_power_states(struct hif_opaque_softc *hif)
  1951. {
  1952. return 0;
  1953. }
  1954. static inline
  1955. void hif_allow_link_low_power_states(struct hif_opaque_softc *hif)
  1956. {
  1957. }
  1958. #endif
  1959. #ifdef IPA_OPT_WIFI_DP
  1960. /**
  1961. * hif_prevent_l1() - Prevent from going to low power states
  1962. * @hif: HIF opaque context
  1963. *
  1964. * Return: 0 on success. Error code on failure.
  1965. */
  1966. int hif_prevent_l1(struct hif_opaque_softc *hif);
  1967. /**
  1968. * hif_allow_l1() - Allow link to go to low power states
  1969. * @hif: HIF opaque context
  1970. *
  1971. * Return: None
  1972. */
  1973. void hif_allow_l1(struct hif_opaque_softc *hif);
  1974. #else
  1975. static inline
  1976. int hif_prevent_l1(struct hif_opaque_softc *hif)
  1977. {
  1978. return 0;
  1979. }
  1980. static inline
  1981. void hif_allow_l1(struct hif_opaque_softc *hif)
  1982. {
  1983. }
  1984. #endif
  1985. void *hif_get_dev_ba(struct hif_opaque_softc *hif_handle);
  1986. void *hif_get_dev_ba_ce(struct hif_opaque_softc *hif_handle);
  1987. void *hif_get_dev_ba_pmm(struct hif_opaque_softc *hif_handle);
  1988. /**
  1989. * hif_get_dev_ba_cmem() - get base address of CMEM
  1990. * @hif_handle: the HIF context
  1991. *
  1992. */
  1993. void *hif_get_dev_ba_cmem(struct hif_opaque_softc *hif_handle);
  1994. /**
  1995. * hif_get_soc_version() - get soc major version from target info
  1996. * @hif_handle: the HIF context
  1997. *
  1998. * Return: version number
  1999. */
  2000. uint32_t hif_get_soc_version(struct hif_opaque_softc *hif_handle);
  2001. /**
  2002. * hif_set_initial_wakeup_cb() - set the initial wakeup event handler function
  2003. * @hif_ctx: the HIF context to assign the callback to
  2004. * @callback: the callback to assign
  2005. * @priv: the private data to pass to the callback when invoked
  2006. *
  2007. * Return: None
  2008. */
  2009. void hif_set_initial_wakeup_cb(struct hif_opaque_softc *hif_ctx,
  2010. void (*callback)(void *),
  2011. void *priv);
  2012. /*
  2013. * Note: For MCL, #if defined (HIF_CONFIG_SLUB_DEBUG_ON) needs to be checked
  2014. * for defined here
  2015. */
  2016. #if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
  2017. ssize_t hif_dump_desc_trace_buf(struct device *dev,
  2018. struct device_attribute *attr, char *buf);
  2019. ssize_t hif_input_desc_trace_buf_index(struct hif_softc *scn,
  2020. const char *buf, size_t size);
  2021. ssize_t hif_ce_en_desc_hist(struct hif_softc *scn,
  2022. const char *buf, size_t size);
  2023. ssize_t hif_disp_ce_enable_desc_data_hist(struct hif_softc *scn, char *buf);
  2024. ssize_t hif_dump_desc_event(struct hif_softc *scn, char *buf);
  2025. #endif/*#if defined(HIF_CONFIG_SLUB_DEBUG_ON)||defined(HIF_CE_DEBUG_DATA_BUF)*/
  2026. /**
  2027. * hif_set_ce_service_max_yield_time() - sets CE service max yield time
  2028. * @hif: hif context
  2029. * @ce_service_max_yield_time: CE service max yield time to set
  2030. *
  2031. * This API storess CE service max yield time in hif context based
  2032. * on ini value.
  2033. *
  2034. * Return: void
  2035. */
  2036. void hif_set_ce_service_max_yield_time(struct hif_opaque_softc *hif,
  2037. uint32_t ce_service_max_yield_time);
  2038. /**
  2039. * hif_get_ce_service_max_yield_time() - get CE service max yield time
  2040. * @hif: hif context
  2041. *
  2042. * This API returns CE service max yield time.
  2043. *
  2044. * Return: CE service max yield time
  2045. */
  2046. unsigned long long
  2047. hif_get_ce_service_max_yield_time(struct hif_opaque_softc *hif);
  2048. /**
  2049. * hif_set_ce_service_max_rx_ind_flush() - sets CE service max rx ind flush
  2050. * @hif: hif context
  2051. * @ce_service_max_rx_ind_flush: CE service max rx ind flush to set
  2052. *
  2053. * This API stores CE service max rx ind flush in hif context based
  2054. * on ini value.
  2055. *
  2056. * Return: void
  2057. */
  2058. void hif_set_ce_service_max_rx_ind_flush(struct hif_opaque_softc *hif,
  2059. uint8_t ce_service_max_rx_ind_flush);
  2060. #ifdef OL_ATH_SMART_LOGGING
  2061. /**
  2062. * hif_log_dump_ce() - Copy all the CE DEST ring to buf
  2063. * @scn: HIF handler
  2064. * @buf_cur: Current pointer in ring buffer
  2065. * @buf_init:Start of the ring buffer
  2066. * @buf_sz: Size of the ring buffer
  2067. * @ce: Copy Engine id
  2068. * @skb_sz: Max size of the SKB buffer to be copied
  2069. *
  2070. * Calls the respective function to dump all the CE SRC/DEST ring descriptors
  2071. * and buffers pointed by them in to the given buf
  2072. *
  2073. * Return: Current pointer in ring buffer
  2074. */
  2075. uint8_t *hif_log_dump_ce(struct hif_softc *scn, uint8_t *buf_cur,
  2076. uint8_t *buf_init, uint32_t buf_sz,
  2077. uint32_t ce, uint32_t skb_sz);
  2078. #endif /* OL_ATH_SMART_LOGGING */
  2079. /**
  2080. * hif_softc_to_hif_opaque_softc() - API to convert hif_softc handle
  2081. * to hif_opaque_softc handle
  2082. * @hif_handle: hif_softc type
  2083. *
  2084. * Return: hif_opaque_softc type
  2085. */
  2086. static inline struct hif_opaque_softc *
  2087. hif_softc_to_hif_opaque_softc(struct hif_softc *hif_handle)
  2088. {
  2089. return (struct hif_opaque_softc *)hif_handle;
  2090. }
  2091. #if defined(HIF_IPCI) && defined(FEATURE_HAL_DELAYED_REG_WRITE)
  2092. QDF_STATUS hif_try_prevent_ep_vote_access(struct hif_opaque_softc *hif_ctx);
  2093. void hif_set_ep_intermediate_vote_access(struct hif_opaque_softc *hif_ctx);
  2094. void hif_allow_ep_vote_access(struct hif_opaque_softc *hif_ctx);
  2095. void hif_set_ep_vote_access(struct hif_opaque_softc *hif_ctx,
  2096. uint8_t type, uint8_t access);
  2097. uint8_t hif_get_ep_vote_access(struct hif_opaque_softc *hif_ctx,
  2098. uint8_t type);
  2099. #else
  2100. static inline QDF_STATUS
  2101. hif_try_prevent_ep_vote_access(struct hif_opaque_softc *hif_ctx)
  2102. {
  2103. return QDF_STATUS_SUCCESS;
  2104. }
  2105. static inline void
  2106. hif_set_ep_intermediate_vote_access(struct hif_opaque_softc *hif_ctx)
  2107. {
  2108. }
  2109. static inline void
  2110. hif_allow_ep_vote_access(struct hif_opaque_softc *hif_ctx)
  2111. {
  2112. }
  2113. static inline void
  2114. hif_set_ep_vote_access(struct hif_opaque_softc *hif_ctx,
  2115. uint8_t type, uint8_t access)
  2116. {
  2117. }
  2118. static inline uint8_t
  2119. hif_get_ep_vote_access(struct hif_opaque_softc *hif_ctx,
  2120. uint8_t type)
  2121. {
  2122. return HIF_EP_VOTE_ACCESS_ENABLE;
  2123. }
  2124. #endif
  2125. #ifdef FORCE_WAKE
  2126. /**
  2127. * hif_srng_init_phase(): Indicate srng initialization phase
  2128. * to avoid force wake as UMAC power collapse is not yet
  2129. * enabled
  2130. * @hif_ctx: hif opaque handle
  2131. * @init_phase: initialization phase
  2132. *
  2133. * Return: None
  2134. */
  2135. void hif_srng_init_phase(struct hif_opaque_softc *hif_ctx,
  2136. bool init_phase);
  2137. #else
  2138. static inline
  2139. void hif_srng_init_phase(struct hif_opaque_softc *hif_ctx,
  2140. bool init_phase)
  2141. {
  2142. }
  2143. #endif /* FORCE_WAKE */
  2144. #ifdef HIF_IPCI
  2145. /**
  2146. * hif_shutdown_notifier_cb - Call back for shutdown notifier
  2147. * @ctx: hif handle
  2148. *
  2149. * Return: None
  2150. */
  2151. void hif_shutdown_notifier_cb(void *ctx);
  2152. #else
  2153. static inline
  2154. void hif_shutdown_notifier_cb(void *ctx)
  2155. {
  2156. }
  2157. #endif /* HIF_IPCI */
  2158. #ifdef HIF_CE_LOG_INFO
  2159. /**
  2160. * hif_log_ce_info() - API to log ce info
  2161. * @scn: hif handle
  2162. * @data: hang event data buffer
  2163. * @offset: offset at which data needs to be written
  2164. *
  2165. * Return: None
  2166. */
  2167. void hif_log_ce_info(struct hif_softc *scn, uint8_t *data,
  2168. unsigned int *offset);
  2169. #else
  2170. static inline
  2171. void hif_log_ce_info(struct hif_softc *scn, uint8_t *data,
  2172. unsigned int *offset)
  2173. {
  2174. }
  2175. #endif
  2176. #ifdef HIF_CPU_PERF_AFFINE_MASK
  2177. /**
  2178. * hif_config_irq_set_perf_affinity_hint() - API to set affinity
  2179. * @hif_ctx: hif opaque handle
  2180. *
  2181. * This function is used to move the WLAN IRQs to perf cores in
  2182. * case of defconfig builds.
  2183. *
  2184. * Return: None
  2185. */
  2186. void hif_config_irq_set_perf_affinity_hint(
  2187. struct hif_opaque_softc *hif_ctx);
  2188. #else
  2189. static inline void hif_config_irq_set_perf_affinity_hint(
  2190. struct hif_opaque_softc *hif_ctx)
  2191. {
  2192. }
  2193. #endif
  2194. /**
  2195. * hif_apps_grp_irqs_enable() - enable ext grp irqs
  2196. * @hif_ctx: HIF opaque context
  2197. *
  2198. * Return: 0 on success. Error code on failure.
  2199. */
  2200. int hif_apps_grp_irqs_enable(struct hif_opaque_softc *hif_ctx);
  2201. /**
  2202. * hif_apps_grp_irqs_disable() - disable ext grp irqs
  2203. * @hif_ctx: HIF opaque context
  2204. *
  2205. * Return: 0 on success. Error code on failure.
  2206. */
  2207. int hif_apps_grp_irqs_disable(struct hif_opaque_softc *hif_ctx);
  2208. /**
  2209. * hif_disable_grp_irqs() - disable ext grp irqs
  2210. * @scn: HIF opaque context
  2211. *
  2212. * Return: 0 on success. Error code on failure.
  2213. */
  2214. int hif_disable_grp_irqs(struct hif_opaque_softc *scn);
  2215. /**
  2216. * hif_enable_grp_irqs() - enable ext grp irqs
  2217. * @scn: HIF opaque context
  2218. *
  2219. * Return: 0 on success. Error code on failure.
  2220. */
  2221. int hif_enable_grp_irqs(struct hif_opaque_softc *scn);
  2222. enum hif_credit_exchange_type {
  2223. HIF_REQUEST_CREDIT,
  2224. HIF_PROCESS_CREDIT_REPORT,
  2225. };
  2226. enum hif_detect_latency_type {
  2227. HIF_DETECT_TASKLET,
  2228. HIF_DETECT_CREDIT,
  2229. HIF_DETECT_UNKNOWN
  2230. };
  2231. #ifdef HIF_DETECTION_LATENCY_ENABLE
  2232. void hif_latency_detect_credit_record_time(
  2233. enum hif_credit_exchange_type type,
  2234. struct hif_opaque_softc *hif_ctx);
  2235. void hif_latency_detect_timer_start(struct hif_opaque_softc *hif_ctx);
  2236. void hif_latency_detect_timer_stop(struct hif_opaque_softc *hif_ctx);
  2237. void hif_check_detection_latency(struct hif_softc *scn,
  2238. bool from_timer,
  2239. uint32_t bitmap_type);
  2240. void hif_set_enable_detection(struct hif_opaque_softc *hif_ctx, bool value);
  2241. #else
  2242. static inline
  2243. void hif_latency_detect_timer_start(struct hif_opaque_softc *hif_ctx)
  2244. {}
  2245. static inline
  2246. void hif_latency_detect_timer_stop(struct hif_opaque_softc *hif_ctx)
  2247. {}
  2248. static inline
  2249. void hif_latency_detect_credit_record_time(
  2250. enum hif_credit_exchange_type type,
  2251. struct hif_opaque_softc *hif_ctx)
  2252. {}
  2253. static inline
  2254. void hif_check_detection_latency(struct hif_softc *scn,
  2255. bool from_timer,
  2256. uint32_t bitmap_type)
  2257. {}
  2258. static inline
  2259. void hif_set_enable_detection(struct hif_opaque_softc *hif_ctx, bool value)
  2260. {}
  2261. #endif
  2262. #ifdef SYSTEM_PM_CHECK
  2263. /**
  2264. * __hif_system_pm_set_state() - Set system pm state
  2265. * @hif: hif opaque handle
  2266. * @state: system state
  2267. *
  2268. * Return: None
  2269. */
  2270. void __hif_system_pm_set_state(struct hif_opaque_softc *hif,
  2271. enum hif_system_pm_state state);
  2272. /**
  2273. * hif_system_pm_set_state_on() - Set system pm state to ON
  2274. * @hif: hif opaque handle
  2275. *
  2276. * Return: None
  2277. */
  2278. static inline
  2279. void hif_system_pm_set_state_on(struct hif_opaque_softc *hif)
  2280. {
  2281. __hif_system_pm_set_state(hif, HIF_SYSTEM_PM_STATE_ON);
  2282. }
  2283. /**
  2284. * hif_system_pm_set_state_resuming() - Set system pm state to resuming
  2285. * @hif: hif opaque handle
  2286. *
  2287. * Return: None
  2288. */
  2289. static inline
  2290. void hif_system_pm_set_state_resuming(struct hif_opaque_softc *hif)
  2291. {
  2292. __hif_system_pm_set_state(hif, HIF_SYSTEM_PM_STATE_BUS_RESUMING);
  2293. }
  2294. /**
  2295. * hif_system_pm_set_state_suspending() - Set system pm state to suspending
  2296. * @hif: hif opaque handle
  2297. *
  2298. * Return: None
  2299. */
  2300. static inline
  2301. void hif_system_pm_set_state_suspending(struct hif_opaque_softc *hif)
  2302. {
  2303. __hif_system_pm_set_state(hif, HIF_SYSTEM_PM_STATE_BUS_SUSPENDING);
  2304. }
  2305. /**
  2306. * hif_system_pm_set_state_suspended() - Set system pm state to suspended
  2307. * @hif: hif opaque handle
  2308. *
  2309. * Return: None
  2310. */
  2311. static inline
  2312. void hif_system_pm_set_state_suspended(struct hif_opaque_softc *hif)
  2313. {
  2314. __hif_system_pm_set_state(hif, HIF_SYSTEM_PM_STATE_BUS_SUSPENDED);
  2315. }
  2316. /**
  2317. * hif_system_pm_get_state() - Get system pm state
  2318. * @hif: hif opaque handle
  2319. *
  2320. * Return: system state
  2321. */
  2322. int32_t hif_system_pm_get_state(struct hif_opaque_softc *hif);
  2323. /**
  2324. * hif_system_pm_state_check() - Check system state and trigger resume
  2325. * if required
  2326. * @hif: hif opaque handle
  2327. *
  2328. * Return: 0 if system is in on state else error code
  2329. */
  2330. int hif_system_pm_state_check(struct hif_opaque_softc *hif);
  2331. #else
  2332. static inline
  2333. void __hif_system_pm_set_state(struct hif_opaque_softc *hif,
  2334. enum hif_system_pm_state state)
  2335. {
  2336. }
  2337. static inline
  2338. void hif_system_pm_set_state_on(struct hif_opaque_softc *hif)
  2339. {
  2340. }
  2341. static inline
  2342. void hif_system_pm_set_state_resuming(struct hif_opaque_softc *hif)
  2343. {
  2344. }
  2345. static inline
  2346. void hif_system_pm_set_state_suspending(struct hif_opaque_softc *hif)
  2347. {
  2348. }
  2349. static inline
  2350. void hif_system_pm_set_state_suspended(struct hif_opaque_softc *hif)
  2351. {
  2352. }
  2353. static inline
  2354. int32_t hif_system_pm_get_state(struct hif_opaque_softc *hif)
  2355. {
  2356. return 0;
  2357. }
  2358. static inline int hif_system_pm_state_check(struct hif_opaque_softc *hif)
  2359. {
  2360. return 0;
  2361. }
  2362. #endif
  2363. #ifdef FEATURE_IRQ_AFFINITY
  2364. /**
  2365. * hif_set_grp_intr_affinity() - API to set affinity for grp
  2366. * intrs set in the bitmap
  2367. * @scn: hif handle
  2368. * @grp_intr_bitmask: grp intrs for which perf affinity should be
  2369. * applied
  2370. * @perf: affine to perf or non-perf cluster
  2371. *
  2372. * Return: None
  2373. */
  2374. void hif_set_grp_intr_affinity(struct hif_opaque_softc *scn,
  2375. uint32_t grp_intr_bitmask, bool perf);
  2376. #else
  2377. static inline
  2378. void hif_set_grp_intr_affinity(struct hif_opaque_softc *scn,
  2379. uint32_t grp_intr_bitmask, bool perf)
  2380. {
  2381. }
  2382. #endif
  2383. /**
  2384. * hif_get_max_wmi_ep() - Get max WMI EPs configured in target svc map
  2385. * @scn: hif opaque handle
  2386. *
  2387. * Description:
  2388. * Gets number of WMI EPs configured in target svc map. Since EP map
  2389. * include IN and OUT direction pipes, count only OUT pipes to get EPs
  2390. * configured for WMI service.
  2391. *
  2392. * Return:
  2393. * uint8_t: count for WMI eps in target svc map
  2394. */
  2395. uint8_t hif_get_max_wmi_ep(struct hif_opaque_softc *scn);
  2396. #ifdef DP_UMAC_HW_RESET_SUPPORT
  2397. /**
  2398. * hif_register_umac_reset_handler() - Register UMAC HW reset handler
  2399. * @hif_scn: hif opaque handle
  2400. * @irq_handler: irq callback handler function
  2401. * @tl_handler: tasklet callback handler function
  2402. * @cb_ctx: context to passed to @handler
  2403. * @irq: irq number to be used for UMAC HW reset interrupt
  2404. *
  2405. * Return: QDF_STATUS of operation
  2406. */
  2407. QDF_STATUS hif_register_umac_reset_handler(struct hif_opaque_softc *hif_scn,
  2408. bool (*irq_handler)(void *cb_ctx),
  2409. int (*tl_handler)(void *cb_ctx),
  2410. void *cb_ctx, int irq);
  2411. /**
  2412. * hif_unregister_umac_reset_handler() - Unregister UMAC HW reset handler
  2413. * @hif_scn: hif opaque handle
  2414. *
  2415. * Return: QDF_STATUS of operation
  2416. */
  2417. QDF_STATUS hif_unregister_umac_reset_handler(struct hif_opaque_softc *hif_scn);
  2418. QDF_STATUS hif_get_umac_reset_irq(struct hif_opaque_softc *hif_scn,
  2419. int *umac_reset_irq);
  2420. #else
  2421. static inline
  2422. QDF_STATUS hif_register_umac_reset_handler(struct hif_opaque_softc *hif_scn,
  2423. bool (*irq_handler)(void *cb_ctx),
  2424. int (*tl_handler)(void *cb_ctx),
  2425. void *cb_ctx, int irq)
  2426. {
  2427. return QDF_STATUS_SUCCESS;
  2428. }
  2429. static inline
  2430. QDF_STATUS hif_unregister_umac_reset_handler(struct hif_opaque_softc *hif_scn)
  2431. {
  2432. return QDF_STATUS_SUCCESS;
  2433. }
  2434. static inline
  2435. QDF_STATUS hif_get_umac_reset_irq(struct hif_opaque_softc *hif_scn,
  2436. int *umac_reset_irq)
  2437. {
  2438. return QDF_STATUS_SUCCESS;
  2439. }
  2440. #endif /* DP_UMAC_HW_RESET_SUPPORT */
  2441. #ifdef FEATURE_DIRECT_LINK
  2442. /**
  2443. * hif_set_irq_config_by_ceid() - Set irq configuration for CE given by id
  2444. * @scn: hif opaque handle
  2445. * @ce_id: CE id
  2446. * @addr: irq trigger address
  2447. * @data: irq trigger data
  2448. *
  2449. * Return: QDF status
  2450. */
  2451. QDF_STATUS
  2452. hif_set_irq_config_by_ceid(struct hif_opaque_softc *scn, uint8_t ce_id,
  2453. uint64_t addr, uint32_t data);
  2454. /**
  2455. * hif_get_direct_link_ce_dest_srng_buffers() - Get Direct Link ce dest srng
  2456. * buffer information
  2457. * @scn: hif opaque handle
  2458. * @dma_addr: pointer to array of dma addresses
  2459. * @buf_size: ce dest ring buffer size
  2460. *
  2461. * Return: Number of buffers attached to the dest srng.
  2462. */
  2463. uint16_t hif_get_direct_link_ce_dest_srng_buffers(struct hif_opaque_softc *scn,
  2464. uint64_t **dma_addr,
  2465. uint32_t *buf_size);
  2466. /**
  2467. * hif_get_direct_link_ce_srng_info() - Get Direct Link CE srng information
  2468. * @scn: hif opaque handle
  2469. * @info: Direct Link CEs information
  2470. * @max_ce_info_len: max array size of ce info
  2471. *
  2472. * Return: QDF status
  2473. */
  2474. QDF_STATUS
  2475. hif_get_direct_link_ce_srng_info(struct hif_opaque_softc *scn,
  2476. struct hif_direct_link_ce_info *info,
  2477. uint8_t max_ce_info_len);
  2478. #else
  2479. static inline QDF_STATUS
  2480. hif_set_irq_config_by_ceid(struct hif_opaque_softc *scn, uint8_t ce_id,
  2481. uint64_t addr, uint32_t data)
  2482. {
  2483. return QDF_STATUS_SUCCESS;
  2484. }
  2485. static inline
  2486. uint16_t hif_get_direct_link_ce_dest_srng_buffers(struct hif_opaque_softc *scn,
  2487. uint64_t **dma_addr,
  2488. uint32_t *buf_size)
  2489. {
  2490. return 0;
  2491. }
  2492. static inline QDF_STATUS
  2493. hif_get_direct_link_ce_srng_info(struct hif_opaque_softc *scn,
  2494. struct hif_direct_link_ce_info *info,
  2495. uint8_t max_ce_info_len)
  2496. {
  2497. return QDF_STATUS_SUCCESS;
  2498. }
  2499. #endif
  2500. #endif /* _HIF_H_ */