Skip to main content

fidl_next_fuchsia_hardware_cqhci/
fidl_next_fuchsia_hardware_cqhci.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![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/// The type corresponding to the Cqhci protocol.
28#[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::never::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::never::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::never::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::never::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::never::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::never::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::fuchsia::Status,
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::never::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::never::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        /// The client for the `Cqhci` protocol.
216        #[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        /// The server for the `Cqhci` protocol.
309        #[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
322/// A client handler for the Cqhci protocol.
323///
324/// See [`Cqhci`] for more details.
325pub 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        mut message: ::fidl_next::Message<___T>,
340    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
341        match *message.header().ordinal {
342            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
343        }
344    }
345}
346
347#[diagnostic::on_unimplemented(
348    note = "If {Self} implements the non-local CqhciServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
349)]
350
351/// A server handler for the Cqhci protocol.
352///
353/// See [`Cqhci`] for more details.
354pub trait CqhciLocalServerHandler<
355    #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
356    #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
357>
358{
359    #[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"]
360    fn initialize_command_queueing(
361        &mut self,
362
363        request: ::fidl_next::Request<cqhci::InitializeCommandQueueing, ___T>,
364
365        responder: ::fidl_next::Responder<cqhci::InitializeCommandQueueing, ___T>,
366    ) -> impl ::core::future::Future<Output = ()>;
367
368    #[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"]
369    fn enable_cqhci(
370        &mut self,
371
372        responder: ::fidl_next::Responder<cqhci::EnableCqhci, ___T>,
373    ) -> impl ::core::future::Future<Output = ()>;
374
375    #[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"]
376    fn disable_cqhci(
377        &mut self,
378
379        responder: ::fidl_next::Responder<cqhci::DisableCqhci, ___T>,
380    ) -> impl ::core::future::Future<Output = ()>;
381
382    #[doc = " Get host info.\n"]
383    fn host_info(
384        &mut self,
385
386        responder: ::fidl_next::Responder<cqhci::HostInfo, ___T>,
387    ) -> impl ::core::future::Future<Output = ()>;
388}
389
390impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Cqhci
391where
392    ___H: CqhciLocalServerHandler<___T> ,
393    ___T: ::fidl_next::Transport,
394
395
396            for<'de> ::fidl_next_fuchsia_hardware_sdmmc::wire::CqhciInitializeCommandQueueingRequest: ::fidl_next::Decode<
397                <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
398                Constraint = (),
399            >,
400
401
402
403
404
405
406
407
408{
409    async fn on_one_way(
410        handler: &mut ___H,
411        mut message: ::fidl_next::Message<___T>,
412    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
413        match *message.header().ordinal {
414
415
416
417
418
419
420
421
422
423
424
425
426
427            ordinal => {
428
429                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
430
431            }
432        }
433    }
434
435    async fn on_two_way(
436        handler: &mut ___H,
437        mut message: ::fidl_next::Message<___T>,
438        responder: ::fidl_next::protocol::Responder<___T>,
439    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
440        match *message.header().ordinal {
441
442
443
444                    359559202570093266 => {
445                        let responder = ::fidl_next::Responder::from_untyped(responder);
446
447                            match ::fidl_next::AsDecoderExt::into_decoded(message) {
448                                Ok(decoded) => {
449                                    handler.initialize_command_queueing(::fidl_next::Request::from_decoded(decoded), responder).await;
450                                    Ok(())
451                                }
452                                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
453                                    ordinal: 359559202570093266,
454                                    error,
455                                }),
456                            }
457
458                    }
459
460
461
462
463                    7267012061448928954 => {
464                        let responder = ::fidl_next::Responder::from_untyped(responder);
465
466                            handler.enable_cqhci(responder).await;
467                            Ok(())
468
469                    }
470
471
472
473
474                    4177196635683073751 => {
475                        let responder = ::fidl_next::Responder::from_untyped(responder);
476
477                            handler.disable_cqhci(responder).await;
478                            Ok(())
479
480                    }
481
482
483
484
485                    2518666591621344741 => {
486                        let responder = ::fidl_next::Responder::from_untyped(responder);
487
488                            handler.host_info(responder).await;
489                            Ok(())
490
491                    }
492
493
494            ordinal => {
495
496                        Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
497
498            }
499        }
500    }
501}
502
503/// A client handler for the Cqhci protocol.
504///
505/// See [`Cqhci`] for more details.
506pub trait CqhciClientHandler<
507    #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
508    #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
509>
510{
511}
512
513impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Cqhci
514where
515    ___H: CqhciClientHandler<___T> + ::core::marker::Send,
516    ___T: ::fidl_next::Transport,
517{
518    async fn on_event(
519        handler: &mut ___H,
520        mut message: ::fidl_next::Message<___T>,
521    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
522        match *message.header().ordinal {
523            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
524        }
525    }
526}
527
528/// A server handler for the Cqhci protocol.
529///
530/// See [`Cqhci`] for more details.
531pub trait CqhciServerHandler<
532    #[cfg(feature = "driver")] ___T: ::fidl_next::Transport = ::fdf_fidl::DriverChannel,
533    #[cfg(not(feature = "driver"))] ___T: ::fidl_next::Transport,
534>
535{
536    #[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"]
537    fn initialize_command_queueing(
538        &mut self,
539
540        request: ::fidl_next::Request<cqhci::InitializeCommandQueueing, ___T>,
541
542        responder: ::fidl_next::Responder<cqhci::InitializeCommandQueueing, ___T>,
543    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
544
545    #[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"]
546    fn enable_cqhci(
547        &mut self,
548
549        responder: ::fidl_next::Responder<cqhci::EnableCqhci, ___T>,
550    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
551
552    #[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"]
553    fn disable_cqhci(
554        &mut self,
555
556        responder: ::fidl_next::Responder<cqhci::DisableCqhci, ___T>,
557    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
558
559    #[doc = " Get host info.\n"]
560    fn host_info(
561        &mut self,
562
563        responder: ::fidl_next::Responder<cqhci::HostInfo, ___T>,
564    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
565}
566
567impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Cqhci
568where
569    ___H: CqhciServerHandler<___T> + ::core::marker::Send,
570    ___T: ::fidl_next::Transport,
571
572
573            for<'de> ::fidl_next_fuchsia_hardware_sdmmc::wire::CqhciInitializeCommandQueueingRequest: ::fidl_next::Decode<
574                <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
575                Constraint = (),
576            >,
577
578
579
580
581
582
583
584
585{
586    async fn on_one_way(
587        handler: &mut ___H,
588        mut message: ::fidl_next::Message<___T>,
589    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
590        match *message.header().ordinal {
591
592
593
594
595
596
597
598
599
600
601
602
603
604            ordinal => {
605
606                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
607
608            }
609        }
610    }
611
612    async fn on_two_way(
613        handler: &mut ___H,
614        mut message: ::fidl_next::Message<___T>,
615        responder: ::fidl_next::protocol::Responder<___T>,
616    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
617        match *message.header().ordinal {
618
619
620
621                    359559202570093266 => {
622                        let responder = ::fidl_next::Responder::from_untyped(responder);
623
624                            match ::fidl_next::AsDecoderExt::into_decoded(message) {
625                                Ok(decoded) => {
626                                    handler.initialize_command_queueing(::fidl_next::Request::from_decoded(decoded), responder).await;
627                                    Ok(())
628                                }
629                                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
630                                    ordinal: 359559202570093266,
631                                    error,
632                                }),
633                            }
634
635                    }
636
637
638
639
640                    7267012061448928954 => {
641                        let responder = ::fidl_next::Responder::from_untyped(responder);
642
643                            handler.enable_cqhci(responder).await;
644                            Ok(())
645
646                    }
647
648
649
650
651                    4177196635683073751 => {
652                        let responder = ::fidl_next::Responder::from_untyped(responder);
653
654                            handler.disable_cqhci(responder).await;
655                            Ok(())
656
657                    }
658
659
660
661
662                    2518666591621344741 => {
663                        let responder = ::fidl_next::Responder::from_untyped(responder);
664
665                            handler.host_info(responder).await;
666                            Ok(())
667
668                    }
669
670
671            ordinal => {
672
673                        Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
674
675            }
676        }
677    }
678}
679
680impl<___T> CqhciClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {}
681
682impl<___H, ___T> CqhciLocalClientHandler<___T> for ::fidl_next::Local<___H>
683where
684    ___H: CqhciClientHandler<___T>,
685    ___T: ::fidl_next::Transport,
686{
687}
688
689impl<___H, ___T> CqhciLocalServerHandler<___T> for ::fidl_next::Local<___H>
690where
691    ___H: CqhciServerHandler<___T>,
692    ___T: ::fidl_next::Transport,
693{
694    async fn initialize_command_queueing(
695        &mut self,
696
697        request: ::fidl_next::Request<cqhci::InitializeCommandQueueing, ___T>,
698
699        responder: ::fidl_next::Responder<cqhci::InitializeCommandQueueing, ___T>,
700    ) {
701        ___H::initialize_command_queueing(&mut self.0, request, responder).await
702    }
703
704    async fn enable_cqhci(&mut self, responder: ::fidl_next::Responder<cqhci::EnableCqhci, ___T>) {
705        ___H::enable_cqhci(&mut self.0, responder).await
706    }
707
708    async fn disable_cqhci(
709        &mut self,
710
711        responder: ::fidl_next::Responder<cqhci::DisableCqhci, ___T>,
712    ) {
713        ___H::disable_cqhci(&mut self.0, responder).await
714    }
715
716    async fn host_info(&mut self, responder: ::fidl_next::Responder<cqhci::HostInfo, ___T>) {
717        ___H::host_info(&mut self.0, responder).await
718    }
719}
720
721/// The type corresponding to the Service service.
722#[derive(Debug)]
723pub struct Service;
724
725impl ::fidl_next::DiscoverableService for Service {
726    const SERVICE_NAME: &'static str = "fuchsia.hardware.cqhci.Service";
727    const MEMBER_NAMES: &'static [&'static str] = &["cqhci", "rpmb", "inline_crypto"];
728}
729
730impl ::fidl_next::HasServiceRequest<::fdf_fidl::DriverChannel> for Service {}
731
732impl<___C> ::fidl_next::Service<___C> for Service
733where
734    ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
735    ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
736    ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
737{
738    type Connector = ServiceConnector<___C>;
739}
740
741/// A strongly-typed service connector for the `Service` service.
742#[repr(transparent)]
743pub struct ServiceConnector<___C> {
744    #[allow(dead_code)]
745    connector: ___C,
746}
747
748impl<___C> ServiceConnector<___C>
749where
750    ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
751    ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
752    ___C: ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>,
753{
754    /// Attempts to connect to the `cqhci` service member.
755    pub fn cqhci(
756        &self,
757        server_end: ::fidl_next::ServerEnd<crate::Cqhci, ::fdf_fidl::DriverChannel>,
758    ) -> ::core::result::Result<
759        (),
760        <___C as ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>>::Error,
761    > {
762        ::fidl_next::protocol::ServiceConnector::<::fdf_fidl::DriverChannel>::connect_to_member(
763            &self.connector,
764            "cqhci",
765            server_end.into_untyped(),
766        )
767    }
768
769    /// Attempts to connect to the `rpmb` service member.
770    pub fn rpmb(
771        &self,
772        server_end: ::fidl_next::ServerEnd<
773            ::fidl_next_fuchsia_hardware_rpmb::DriverRpmb,
774            ::fdf_fidl::DriverChannel,
775        >,
776    ) -> ::core::result::Result<
777        (),
778        <___C as ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>>::Error,
779    > {
780        ::fidl_next::protocol::ServiceConnector::<::fdf_fidl::DriverChannel>::connect_to_member(
781            &self.connector,
782            "rpmb",
783            server_end.into_untyped(),
784        )
785    }
786
787    /// Attempts to connect to the `inline_crypto` service member.
788    pub fn inline_crypto(
789        &self,
790        server_end: ::fidl_next::ServerEnd<
791            ::fidl_next_fuchsia_hardware_inlineencryption::DriverDevice,
792            ::fdf_fidl::DriverChannel,
793        >,
794    ) -> ::core::result::Result<
795        (),
796        <___C as ::fidl_next::protocol::ServiceConnector<::fdf_fidl::DriverChannel>>::Error,
797    > {
798        ::fidl_next::protocol::ServiceConnector::<::fdf_fidl::DriverChannel>::connect_to_member(
799            &self.connector,
800            "inline_crypto",
801            server_end.into_untyped(),
802        )
803    }
804}
805
806/// A service handler for the `Service` service.
807pub trait ServiceHandler {
808    /// Handles an attempt to connect to the `cqhci` member.
809    fn cqhci(&self, server_end: ::fidl_next::ServerEnd<crate::Cqhci, ::fdf_fidl::DriverChannel>);
810
811    /// Handles an attempt to connect to the `rpmb` member.
812    fn rpmb(
813        &self,
814        server_end: ::fidl_next::ServerEnd<
815            ::fidl_next_fuchsia_hardware_rpmb::DriverRpmb,
816            ::fdf_fidl::DriverChannel,
817        >,
818    );
819
820    /// Handles an attempt to connect to the `inline_crypto` member.
821    fn inline_crypto(
822        &self,
823        server_end: ::fidl_next::ServerEnd<
824            ::fidl_next_fuchsia_hardware_inlineencryption::DriverDevice,
825            ::fdf_fidl::DriverChannel,
826        >,
827    );
828}
829
830impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for Service
831where
832    ___H: ServiceHandler,
833    ::fdf_fidl::DriverChannel: ::fidl_next::InstanceFromServiceTransport<___T>,
834    ::fdf_fidl::DriverChannel: ::fidl_next::InstanceFromServiceTransport<___T>,
835    ::fdf_fidl::DriverChannel: ::fidl_next::InstanceFromServiceTransport<___T>,
836{
837    fn on_connection(handler: &___H, member: &str, server_end: ___T) {
838        use ::fidl_next::InstanceFromServiceTransport;
839        match member {
840            "cqhci" => handler.cqhci(::fidl_next::ServerEnd::from_untyped(
841                ::fdf_fidl::DriverChannel::from_service_transport(server_end),
842            )),
843
844            "rpmb" => handler.rpmb(::fidl_next::ServerEnd::from_untyped(
845                ::fdf_fidl::DriverChannel::from_service_transport(server_end),
846            )),
847
848            "inline_crypto" => handler.inline_crypto(::fidl_next::ServerEnd::from_untyped(
849                ::fdf_fidl::DriverChannel::from_service_transport(server_end),
850            )),
851
852            _ => unreachable!(),
853        }
854    }
855}
856
857pub use fidl_next_common_fuchsia_hardware_cqhci::*;