1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub use fidl_next_common_fuchsia_hardware_cqhci::natural::*;
8}
9
10pub mod wire {
11
12 pub use fidl_next_common_fuchsia_hardware_cqhci::wire::*;
13}
14
15pub mod wire_optional {
16
17 pub use fidl_next_common_fuchsia_hardware_cqhci::wire_optional::*;
18}
19
20pub mod generic {
21
22 pub use fidl_next_common_fuchsia_hardware_cqhci::generic::*;
23}
24
25pub use self::natural::*;
26
27#[derive(PartialEq, Debug)]
29pub struct Cqhci;
30
31impl ::fidl_next::Discoverable for Cqhci {
32 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.cqhci.Cqhci";
33}
34
35#[cfg(feature = "driver")]
36impl ::fidl_next::HasTransport for Cqhci {
37 type Transport = ::fdf_fidl::DriverChannel;
38}
39
40pub mod cqhci {
41 pub mod prelude {
42 pub use crate::{
43 Cqhci, CqhciClientHandler, CqhciLocalClientHandler, CqhciLocalServerHandler,
44 CqhciServerHandler, cqhci,
45 };
46
47 pub use crate::natural::CqhciHostInfoResponse;
48
49 pub use ::fidl_next_fuchsia_hardware_sdmmc::natural::CqhciInitializeCommandQueueingRequest;
50
51 pub use ::fidl_next_fuchsia_hardware_sdmmc::natural::CqhciDisableCqhciResponse;
52
53 pub use ::fidl_next_fuchsia_hardware_sdmmc::natural::CqhciEnableCqhciResponse;
54
55 pub use ::fidl_next_fuchsia_hardware_sdmmc::natural::CqhciInitializeCommandQueueingResponse;
56 }
57
58 pub struct InitializeCommandQueueing;
59
60 impl ::fidl_next::Method for InitializeCommandQueueing {
61 const ORDINAL: u64 = 359559202570093266;
62 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
63 ::fidl_next::protocol::Flexibility::Strict;
64
65 type Protocol = crate::Cqhci;
66
67 type Request =
68 ::fidl_next_fuchsia_hardware_sdmmc::wire::CqhciInitializeCommandQueueingRequest;
69 }
70
71 impl ::fidl_next::TwoWayMethod for InitializeCommandQueueing {
72 type Response = ::fidl_next::wire::Result<
73 'static,
74 ::fidl_next_fuchsia_hardware_sdmmc::wire::CqhciInitializeCommandQueueingResponse,
75 ::fidl_next::wire::Int32,
76 >;
77 }
78
79 impl<___R> ::fidl_next::Respond<___R> for InitializeCommandQueueing {
80 type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
81
82 fn respond(response: ___R) -> Self::Output {
83 ::core::result::Result::Ok(response)
84 }
85 }
86
87 impl<___R> ::fidl_next::RespondErr<___R> for InitializeCommandQueueing {
88 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
89
90 fn respond_err(response: ___R) -> Self::Output {
91 ::core::result::Result::Err(response)
92 }
93 }
94
95 pub struct EnableCqhci;
96
97 impl ::fidl_next::Method for EnableCqhci {
98 const ORDINAL: u64 = 7267012061448928954;
99 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
100 ::fidl_next::protocol::Flexibility::Strict;
101
102 type Protocol = crate::Cqhci;
103
104 type Request = ::fidl_next::wire::EmptyMessageBody;
105 }
106
107 impl ::fidl_next::TwoWayMethod for EnableCqhci {
108 type Response = ::fidl_next::wire::Result<
109 'static,
110 ::fidl_next_fuchsia_hardware_sdmmc::wire::CqhciEnableCqhciResponse,
111 ::fidl_next::wire::Int32,
112 >;
113 }
114
115 impl<___R> ::fidl_next::Respond<___R> for EnableCqhci {
116 type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
117
118 fn respond(response: ___R) -> Self::Output {
119 ::core::result::Result::Ok(response)
120 }
121 }
122
123 impl<___R> ::fidl_next::RespondErr<___R> for EnableCqhci {
124 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
125
126 fn respond_err(response: ___R) -> Self::Output {
127 ::core::result::Result::Err(response)
128 }
129 }
130
131 pub struct DisableCqhci;
132
133 impl ::fidl_next::Method for DisableCqhci {
134 const ORDINAL: u64 = 4177196635683073751;
135 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
136 ::fidl_next::protocol::Flexibility::Strict;
137
138 type Protocol = crate::Cqhci;
139
140 type Request = ::fidl_next::wire::EmptyMessageBody;
141 }
142
143 impl ::fidl_next::TwoWayMethod for DisableCqhci {
144 type Response = ::fidl_next::wire::Result<
145 'static,
146 ::fidl_next_fuchsia_hardware_sdmmc::wire::CqhciDisableCqhciResponse,
147 ::fidl_next::wire::Int32,
148 >;
149 }
150
151 impl<___R> ::fidl_next::Respond<___R> for DisableCqhci {
152 type Output = ::core::result::Result<___R, ::fidl_next::util::Never>;
153
154 fn respond(response: ___R) -> Self::Output {
155 ::core::result::Result::Ok(response)
156 }
157 }
158
159 impl<___R> ::fidl_next::RespondErr<___R> for DisableCqhci {
160 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
161
162 fn respond_err(response: ___R) -> Self::Output {
163 ::core::result::Result::Err(response)
164 }
165 }
166
167 pub struct HostInfo;
168
169 impl ::fidl_next::Method for HostInfo {
170 const ORDINAL: u64 = 2518666591621344741;
171 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
172 ::fidl_next::protocol::Flexibility::Strict;
173
174 type Protocol = crate::Cqhci;
175
176 type Request = ::fidl_next::wire::EmptyMessageBody;
177 }
178
179 impl ::fidl_next::TwoWayMethod for HostInfo {
180 type Response = ::fidl_next::wire::Result<
181 'static,
182 crate::wire::CqhciHostInfoResponse<'static>,
183 ::fidl_next::wire::Int32,
184 >;
185 }
186
187 impl<___R> ::fidl_next::Respond<___R> for HostInfo {
188 type Output = ::core::result::Result<
189 crate::generic::CqhciHostInfoResponse<___R>,
190 ::fidl_next::util::Never,
191 >;
192
193 fn respond(response: ___R) -> Self::Output {
194 ::core::result::Result::Ok(crate::generic::CqhciHostInfoResponse { info: response })
195 }
196 }
197
198 impl<___R> ::fidl_next::RespondErr<___R> for HostInfo {
199 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
200
201 fn respond_err(response: ___R) -> Self::Output {
202 ::core::result::Result::Err(response)
203 }
204 }
205
206 mod ___detail {
207 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Cqhci
208 where
209 ___T: ::fidl_next::Transport,
210 {
211 type Client = CqhciClient<___T>;
212 type Server = CqhciServer<___T>;
213 }
214
215 #[repr(transparent)]
217 pub struct CqhciClient<___T: ::fidl_next::Transport> {
218 #[allow(dead_code)]
219 client: ::fidl_next::protocol::Client<___T>,
220 }
221
222 impl<___T> CqhciClient<___T>
223 where
224 ___T: ::fidl_next::Transport,
225 {
226 #[doc = " Initializes the CQHCI driver, providing it with all necessary resources.\n\n This call is expected to be made once. The server should reject any additional calls\n until the peer end of `virtual_interrupt_lifeline` closes.\n\n # Interrupt Delegation\n\n While the CQHCI driver is running, it takes over the physical IRQ object from its underlying\n driver, and directly handles any CQHCI-specific interrupts. Interrupts which it cannot\n service (e.g. SDHCI interrupts) are forwarded to the underlying driver via\n `virtual_interrupt`. The server should service interrupts exactly as it normally would.\n The CQHCI driver will wait for the virtual IRQ to be acked before acking the physical IRQ.\n\n # Arguments\n\n * `virtual_interrupt` - A virtual interrupt to monitor instead of the physical IRQ.\n The CQHCI driver will use this to forward interrupts which it cannot directly service.\n * `virtual_interrupt_lifeline` - A lifeline for the virtual interrupt. The CQHCI\n driver will destroy the peer end upon shutdown, which should be handled by the server as a\n signal to stop monitoring the virtual interrupt and return to monitoring the physical\n interrupt.\n\n # Returns\n\n * `cqhci_mmio` and `cqhci_mmio_offset` - An MMIO for the CQHCI register block.\n MMIO size minus offset must be at least 512 bytes as per the CQHCI specification.\n * `sdhci_mmio` and `sdhci_mmio_offset` - An MMIO for the SDHCI register block.\n MMIO size minus offset must be at least 512 bytes as per the SDHCI specification.\n * `bti` - The BTI to use for pinning pages for DMA.\n * `interrupt` - The physical interrupt to monitor.\n"]
227 pub fn initialize_command_queueing(
228 &self,
229
230 virtual_interrupt: impl ::fidl_next::Encode<
231 ::fidl_next::wire::fuchsia::Interrupt,
232 <___T as ::fidl_next::Transport>::SendBuffer,
233 >,
234
235 virtual_interrupt_lifeline: impl ::fidl_next::Encode<
236 ::fidl_next::wire::fuchsia::EventPair,
237 <___T as ::fidl_next::Transport>::SendBuffer,
238 >,
239 ) -> ::fidl_next::TwoWayFuture<'_, super::InitializeCommandQueueing, ___T>
240 where
241 <___T as ::fidl_next::Transport>::SendBuffer:
242 ::fidl_next::encoder::InternalHandleEncoder,
243 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
244 {
245 self.initialize_command_queueing_with(::fidl_next_fuchsia_hardware_sdmmc::generic::CqhciInitializeCommandQueueingRequest {
246
247 virtual_interrupt,
248
249 virtual_interrupt_lifeline,
250
251 })
252 }
253
254 #[doc = " Initializes the CQHCI driver, providing it with all necessary resources.\n\n This call is expected to be made once. The server should reject any additional calls\n until the peer end of `virtual_interrupt_lifeline` closes.\n\n # Interrupt Delegation\n\n While the CQHCI driver is running, it takes over the physical IRQ object from its underlying\n driver, and directly handles any CQHCI-specific interrupts. Interrupts which it cannot\n service (e.g. SDHCI interrupts) are forwarded to the underlying driver via\n `virtual_interrupt`. The server should service interrupts exactly as it normally would.\n The CQHCI driver will wait for the virtual IRQ to be acked before acking the physical IRQ.\n\n # Arguments\n\n * `virtual_interrupt` - A virtual interrupt to monitor instead of the physical IRQ.\n The CQHCI driver will use this to forward interrupts which it cannot directly service.\n * `virtual_interrupt_lifeline` - A lifeline for the virtual interrupt. The CQHCI\n driver will destroy the peer end upon shutdown, which should be handled by the server as a\n signal to stop monitoring the virtual interrupt and return to monitoring the physical\n interrupt.\n\n # Returns\n\n * `cqhci_mmio` and `cqhci_mmio_offset` - An MMIO for the CQHCI register block.\n MMIO size minus offset must be at least 512 bytes as per the CQHCI specification.\n * `sdhci_mmio` and `sdhci_mmio_offset` - An MMIO for the SDHCI register block.\n MMIO size minus offset must be at least 512 bytes as per the SDHCI specification.\n * `bti` - The BTI to use for pinning pages for DMA.\n * `interrupt` - The physical interrupt to monitor.\n"]
255 pub fn initialize_command_queueing_with<___R>(
256 &self,
257 request: ___R,
258 ) -> ::fidl_next::TwoWayFuture<'_, super::InitializeCommandQueueing, ___T>
259 where
260 ___R: ::fidl_next::Encode<
261 ::fidl_next_fuchsia_hardware_sdmmc::wire::CqhciInitializeCommandQueueingRequest,
262 <___T as ::fidl_next::Transport>::SendBuffer,
263 >,
264 {
265 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
266 359559202570093266,
267 <super::InitializeCommandQueueing as ::fidl_next::Method>::FLEXIBILITY,
268 request,
269 ))
270 }
271
272 #[doc = " Enables the Command Queueing Engine. The CQHCI driver is expected to already have called\n [`InitializeCommandQueueing`] to handle interrupts.\n While CQHCI is enabled, it is the caller\'s responsibility to only submit regular requests\n (via [`Request`]) via DCMD, or after disabling CQHCI.\n"]
273 pub fn enable_cqhci(&self) -> ::fidl_next::TwoWayFuture<'_, super::EnableCqhci, ___T> {
274 ::fidl_next::TwoWayFuture::from_untyped(
275 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
276 7267012061448928954,
277 <super::EnableCqhci as ::fidl_next::Method>::FLEXIBILITY,
278 (),
279 ),
280 )
281 }
282
283 #[doc = " Disables the Command Queueing Engine. `EnableCqhci` must have previously been called. From\n this point onwards, regular requests can be submitted (until `EnableCqhci` is called again).\n"]
284 pub fn disable_cqhci(
285 &self,
286 ) -> ::fidl_next::TwoWayFuture<'_, super::DisableCqhci, ___T> {
287 ::fidl_next::TwoWayFuture::from_untyped(
288 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
289 4177196635683073751,
290 <super::DisableCqhci as ::fidl_next::Method>::FLEXIBILITY,
291 (),
292 ),
293 )
294 }
295
296 #[doc = " Get host info.\n"]
297 pub fn host_info(&self) -> ::fidl_next::TwoWayFuture<'_, super::HostInfo, ___T> {
298 ::fidl_next::TwoWayFuture::from_untyped(
299 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
300 2518666591621344741,
301 <super::HostInfo as ::fidl_next::Method>::FLEXIBILITY,
302 (),
303 ),
304 )
305 }
306 }
307
308 #[repr(transparent)]
310 pub struct CqhciServer<___T: ::fidl_next::Transport> {
311 server: ::fidl_next::protocol::Server<___T>,
312 }
313
314 impl<___T> CqhciServer<___T> where ___T: ::fidl_next::Transport {}
315 }
316}
317
318#[diagnostic::on_unimplemented(
319 note = "If {Self} implements the non-local CqhciClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
320)]
321
322pub trait CqhciLocalClientHandler<
326 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
327 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
328>
329{
330}
331
332impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Cqhci
333where
334 ___H: CqhciLocalClientHandler<___T>,
335 ___T: ::fidl_next::Transport,
336{
337 async fn on_event(
338 handler: &mut ___H,
339 ordinal: u64,
340 flexibility: ::fidl_next::protocol::Flexibility,
341 body: ::fidl_next::Body<___T>,
342 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
343 match ordinal {
344 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
345 }
346 }
347}
348
349#[diagnostic::on_unimplemented(
350 note = "If {Self} implements the non-local CqhciServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
351)]
352
353pub trait CqhciLocalServerHandler<
357 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
358 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
359>
360{
361 #[doc = " Initializes the CQHCI driver, providing it with all necessary resources.\n\n This call is expected to be made once. The server should reject any additional calls\n until the peer end of `virtual_interrupt_lifeline` closes.\n\n # Interrupt Delegation\n\n While the CQHCI driver is running, it takes over the physical IRQ object from its underlying\n driver, and directly handles any CQHCI-specific interrupts. Interrupts which it cannot\n service (e.g. SDHCI interrupts) are forwarded to the underlying driver via\n `virtual_interrupt`. The server should service interrupts exactly as it normally would.\n The CQHCI driver will wait for the virtual IRQ to be acked before acking the physical IRQ.\n\n # Arguments\n\n * `virtual_interrupt` - A virtual interrupt to monitor instead of the physical IRQ.\n The CQHCI driver will use this to forward interrupts which it cannot directly service.\n * `virtual_interrupt_lifeline` - A lifeline for the virtual interrupt. The CQHCI\n driver will destroy the peer end upon shutdown, which should be handled by the server as a\n signal to stop monitoring the virtual interrupt and return to monitoring the physical\n interrupt.\n\n # Returns\n\n * `cqhci_mmio` and `cqhci_mmio_offset` - An MMIO for the CQHCI register block.\n MMIO size minus offset must be at least 512 bytes as per the CQHCI specification.\n * `sdhci_mmio` and `sdhci_mmio_offset` - An MMIO for the SDHCI register block.\n MMIO size minus offset must be at least 512 bytes as per the SDHCI specification.\n * `bti` - The BTI to use for pinning pages for DMA.\n * `interrupt` - The physical interrupt to monitor.\n"]
362 fn initialize_command_queueing(
363 &mut self,
364
365 request: ::fidl_next::Request<cqhci::InitializeCommandQueueing, ___T>,
366
367 responder: ::fidl_next::Responder<cqhci::InitializeCommandQueueing, ___T>,
368 ) -> impl ::core::future::Future<Output = ()>;
369
370 #[doc = " Enables the Command Queueing Engine. The CQHCI driver is expected to already have called\n [`InitializeCommandQueueing`] to handle interrupts.\n While CQHCI is enabled, it is the caller\'s responsibility to only submit regular requests\n (via [`Request`]) via DCMD, or after disabling CQHCI.\n"]
371 fn enable_cqhci(
372 &mut self,
373
374 responder: ::fidl_next::Responder<cqhci::EnableCqhci, ___T>,
375 ) -> impl ::core::future::Future<Output = ()>;
376
377 #[doc = " Disables the Command Queueing Engine. `EnableCqhci` must have previously been called. From\n this point onwards, regular requests can be submitted (until `EnableCqhci` is called again).\n"]
378 fn disable_cqhci(
379 &mut self,
380
381 responder: ::fidl_next::Responder<cqhci::DisableCqhci, ___T>,
382 ) -> impl ::core::future::Future<Output = ()>;
383
384 #[doc = " Get host info.\n"]
385 fn host_info(
386 &mut self,
387
388 responder: ::fidl_next::Responder<cqhci::HostInfo, ___T>,
389 ) -> impl ::core::future::Future<Output = ()>;
390}
391
392impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Cqhci
393where
394 ___H: CqhciLocalServerHandler<___T> ,
395 ___T: ::fidl_next::Transport,
396
397
398 for<'de> ::fidl_next_fuchsia_hardware_sdmmc::wire::CqhciInitializeCommandQueueingRequest: ::fidl_next::Decode<
399 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
400 Constraint = (),
401 >,
402
403
404
405
406
407
408
409
410{
411 async fn on_one_way(
412 handler: &mut ___H,
413 ordinal: u64,
414 flexibility: ::fidl_next::protocol::Flexibility,
415 body: ::fidl_next::Body<___T>,
416 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
417 match ordinal {
418
419
420
421
422
423
424
425
426
427
428
429
430
431 ordinal => {
432
433 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
434
435 }
436 }
437 }
438
439 async fn on_two_way(
440 handler: &mut ___H,
441 ordinal: u64,
442 flexibility: ::fidl_next::protocol::Flexibility,
443 body: ::fidl_next::Body<___T>,
444 responder: ::fidl_next::protocol::Responder<___T>,
445 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
446 match ordinal {
447
448
449
450 359559202570093266 => {
451 let responder = ::fidl_next::Responder::from_untyped(responder);
452
453 match ::fidl_next::AsDecoderExt::into_decoded(body) {
454 Ok(decoded) => {
455 handler.initialize_command_queueing(::fidl_next::Request::from_decoded(decoded), responder).await;
456 Ok(())
457 }
458 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
459 ordinal: 359559202570093266,
460 error,
461 }),
462 }
463
464 }
465
466
467
468
469 7267012061448928954 => {
470 let responder = ::fidl_next::Responder::from_untyped(responder);
471
472 handler.enable_cqhci(responder).await;
473 Ok(())
474
475 }
476
477
478
479
480 4177196635683073751 => {
481 let responder = ::fidl_next::Responder::from_untyped(responder);
482
483 handler.disable_cqhci(responder).await;
484 Ok(())
485
486 }
487
488
489
490
491 2518666591621344741 => {
492 let responder = ::fidl_next::Responder::from_untyped(responder);
493
494 handler.host_info(responder).await;
495 Ok(())
496
497 }
498
499
500 ordinal => {
501
502 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
503
504 }
505 }
506 }
507}
508
509pub trait CqhciClientHandler<
513 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
514 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
515>
516{
517}
518
519impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Cqhci
520where
521 ___H: CqhciClientHandler<___T> + ::core::marker::Send,
522 ___T: ::fidl_next::Transport,
523{
524 async fn on_event(
525 handler: &mut ___H,
526 ordinal: u64,
527 flexibility: ::fidl_next::protocol::Flexibility,
528 body: ::fidl_next::Body<___T>,
529 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
530 match ordinal {
531 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
532 }
533 }
534}
535
536pub trait CqhciServerHandler<
540 #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
541 #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
542>
543{
544 #[doc = " Initializes the CQHCI driver, providing it with all necessary resources.\n\n This call is expected to be made once. The server should reject any additional calls\n until the peer end of `virtual_interrupt_lifeline` closes.\n\n # Interrupt Delegation\n\n While the CQHCI driver is running, it takes over the physical IRQ object from its underlying\n driver, and directly handles any CQHCI-specific interrupts. Interrupts which it cannot\n service (e.g. SDHCI interrupts) are forwarded to the underlying driver via\n `virtual_interrupt`. The server should service interrupts exactly as it normally would.\n The CQHCI driver will wait for the virtual IRQ to be acked before acking the physical IRQ.\n\n # Arguments\n\n * `virtual_interrupt` - A virtual interrupt to monitor instead of the physical IRQ.\n The CQHCI driver will use this to forward interrupts which it cannot directly service.\n * `virtual_interrupt_lifeline` - A lifeline for the virtual interrupt. The CQHCI\n driver will destroy the peer end upon shutdown, which should be handled by the server as a\n signal to stop monitoring the virtual interrupt and return to monitoring the physical\n interrupt.\n\n # Returns\n\n * `cqhci_mmio` and `cqhci_mmio_offset` - An MMIO for the CQHCI register block.\n MMIO size minus offset must be at least 512 bytes as per the CQHCI specification.\n * `sdhci_mmio` and `sdhci_mmio_offset` - An MMIO for the SDHCI register block.\n MMIO size minus offset must be at least 512 bytes as per the SDHCI specification.\n * `bti` - The BTI to use for pinning pages for DMA.\n * `interrupt` - The physical interrupt to monitor.\n"]
545 fn initialize_command_queueing(
546 &mut self,
547
548 request: ::fidl_next::Request<cqhci::InitializeCommandQueueing, ___T>,
549
550 responder: ::fidl_next::Responder<cqhci::InitializeCommandQueueing, ___T>,
551 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
552
553 #[doc = " Enables the Command Queueing Engine. The CQHCI driver is expected to already have called\n [`InitializeCommandQueueing`] to handle interrupts.\n While CQHCI is enabled, it is the caller\'s responsibility to only submit regular requests\n (via [`Request`]) via DCMD, or after disabling CQHCI.\n"]
554 fn enable_cqhci(
555 &mut self,
556
557 responder: ::fidl_next::Responder<cqhci::EnableCqhci, ___T>,
558 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
559
560 #[doc = " Disables the Command Queueing Engine. `EnableCqhci` must have previously been called. From\n this point onwards, regular requests can be submitted (until `EnableCqhci` is called again).\n"]
561 fn disable_cqhci(
562 &mut self,
563
564 responder: ::fidl_next::Responder<cqhci::DisableCqhci, ___T>,
565 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
566
567 #[doc = " Get host info.\n"]
568 fn host_info(
569 &mut self,
570
571 responder: ::fidl_next::Responder<cqhci::HostInfo, ___T>,
572 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
573}
574
575impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Cqhci
576where
577 ___H: CqhciServerHandler<___T> + ::core::marker::Send,
578 ___T: ::fidl_next::Transport,
579
580
581 for<'de> ::fidl_next_fuchsia_hardware_sdmmc::wire::CqhciInitializeCommandQueueingRequest: ::fidl_next::Decode<
582 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
583 Constraint = (),
584 >,
585
586
587
588
589
590
591
592
593{
594 async fn on_one_way(
595 handler: &mut ___H,
596 ordinal: u64,
597 flexibility: ::fidl_next::protocol::Flexibility,
598 body: ::fidl_next::Body<___T>,
599 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
600 match ordinal {
601
602
603
604
605
606
607
608
609
610
611
612
613
614 ordinal => {
615
616 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
617
618 }
619 }
620 }
621
622 async fn on_two_way(
623 handler: &mut ___H,
624 ordinal: u64,
625 flexibility: ::fidl_next::protocol::Flexibility,
626 body: ::fidl_next::Body<___T>,
627 responder: ::fidl_next::protocol::Responder<___T>,
628 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
629 match ordinal {
630
631
632
633 359559202570093266 => {
634 let responder = ::fidl_next::Responder::from_untyped(responder);
635
636 match ::fidl_next::AsDecoderExt::into_decoded(body) {
637 Ok(decoded) => {
638 handler.initialize_command_queueing(::fidl_next::Request::from_decoded(decoded), responder).await;
639 Ok(())
640 }
641 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
642 ordinal: 359559202570093266,
643 error,
644 }),
645 }
646
647 }
648
649
650
651
652 7267012061448928954 => {
653 let responder = ::fidl_next::Responder::from_untyped(responder);
654
655 handler.enable_cqhci(responder).await;
656 Ok(())
657
658 }
659
660
661
662
663 4177196635683073751 => {
664 let responder = ::fidl_next::Responder::from_untyped(responder);
665
666 handler.disable_cqhci(responder).await;
667 Ok(())
668
669 }
670
671
672
673
674 2518666591621344741 => {
675 let responder = ::fidl_next::Responder::from_untyped(responder);
676
677 handler.host_info(responder).await;
678 Ok(())
679
680 }
681
682
683 ordinal => {
684
685 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
686
687 }
688 }
689 }
690}
691
692impl<___T> CqhciClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {}
693
694impl<___H, ___T> CqhciLocalClientHandler<___T> for ::fidl_next::Local<___H>
695where
696 ___H: CqhciClientHandler<___T>,
697 ___T: ::fidl_next::Transport,
698{
699}
700
701impl<___H, ___T> CqhciLocalServerHandler<___T> for ::fidl_next::Local<___H>
702where
703 ___H: CqhciServerHandler<___T>,
704 ___T: ::fidl_next::Transport,
705{
706 async fn initialize_command_queueing(
707 &mut self,
708
709 request: ::fidl_next::Request<cqhci::InitializeCommandQueueing, ___T>,
710
711 responder: ::fidl_next::Responder<cqhci::InitializeCommandQueueing, ___T>,
712 ) {
713 ___H::initialize_command_queueing(&mut self.0, request, responder).await
714 }
715
716 async fn enable_cqhci(&mut self, responder: ::fidl_next::Responder<cqhci::EnableCqhci, ___T>) {
717 ___H::enable_cqhci(&mut self.0, responder).await
718 }
719
720 async fn disable_cqhci(
721 &mut self,
722
723 responder: ::fidl_next::Responder<cqhci::DisableCqhci, ___T>,
724 ) {
725 ___H::disable_cqhci(&mut self.0, responder).await
726 }
727
728 async fn host_info(&mut self, responder: ::fidl_next::Responder<cqhci::HostInfo, ___T>) {
729 ___H::host_info(&mut self.0, responder).await
730 }
731}
732
733#[derive(Debug)]
735pub struct Service;
736
737impl ::fidl_next::DiscoverableService for Service {
738 const SERVICE_NAME: &'static str = "fuchsia.hardware.cqhci.Service";
739 const MEMBER_NAMES: &'static [&'static str] = &["cqhci", "rpmb"];
740}
741
742impl ::fidl_next::HasServiceRequest<::fdf_fidl::DriverChannel> for Service {}
743
744impl<___C> ::fidl_next::Service<___C> for Service
745where
746 ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
747 ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
748{
749 type Connector = ServiceConnector<___C>;
750}
751
752#[repr(transparent)]
754pub struct ServiceConnector<___C> {
755 #[allow(dead_code)]
756 connector: ___C,
757}
758
759impl<___C> ServiceConnector<___C>
760where
761 ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
762 ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
763{
764 pub fn cqhci(
766 &self,
767 server_end: ::fidl_next::ServerEnd<crate::Cqhci, ::fdf_fidl::DriverChannel>,
768 ) -> ::core::result::Result<
769 (),
770 <___C as ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>>::Error,
771 > {
772 ::fidl_next::protocol::ServiceConnector::<::fdf_fidl::DriverChannel>::connect_to_member(
773 &self.connector,
774 "cqhci",
775 server_end.into_untyped(),
776 )
777 }
778
779 pub fn rpmb(
781 &self,
782 server_end: ::fidl_next::ServerEnd<
783 ::fidl_next_fuchsia_hardware_rpmb::DriverRpmb,
784 ::fdf_fidl::DriverChannel,
785 >,
786 ) -> ::core::result::Result<
787 (),
788 <___C as ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>>::Error,
789 > {
790 ::fidl_next::protocol::ServiceConnector::<::fdf_fidl::DriverChannel>::connect_to_member(
791 &self.connector,
792 "rpmb",
793 server_end.into_untyped(),
794 )
795 }
796}
797
798pub trait ServiceHandler {
800 fn cqhci(&self, server_end: ::fidl_next::ServerEnd<crate::Cqhci, ::fdf_fidl::DriverChannel>);
802
803 fn rpmb(
805 &self,
806 server_end: ::fidl_next::ServerEnd<
807 ::fidl_next_fuchsia_hardware_rpmb::DriverRpmb,
808 ::fdf_fidl::DriverChannel,
809 >,
810 );
811}
812
813impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for Service
814where
815 ___H: ServiceHandler,
816 ::fdf_fidl::DriverChannel: ::fidl_next::InstanceFromServiceTransport<___T>,
817 ::fdf_fidl::DriverChannel: ::fidl_next::InstanceFromServiceTransport<___T>,
818{
819 fn on_connection(handler: &___H, member: &str, server_end: ___T) {
820 use ::fidl_next::InstanceFromServiceTransport;
821 match member {
822 "cqhci" => handler.cqhci(::fidl_next::ServerEnd::from_untyped(
823 ::fdf_fidl::DriverChannel::from_service_transport(server_end),
824 )),
825
826 "rpmb" => handler.rpmb(::fidl_next::ServerEnd::from_untyped(
827 ::fdf_fidl::DriverChannel::from_service_transport(server_end),
828 )),
829
830 _ => unreachable!(),
831 }
832 }
833}
834
835pub use fidl_next_common_fuchsia_hardware_cqhci::*;