pub trait SdmmcLocalServerHandler<___T: Transport = DriverChannel> {
Show 15 methods
// Required methods
fn initialize_command_queueing(
&mut self,
request: Request<InitializeCommandQueueing, ___T>,
responder: Responder<InitializeCommandQueueing, ___T>,
) -> impl Future<Output = ()>;
fn enable_cqhci(
&mut self,
responder: Responder<EnableCqhci, ___T>,
) -> impl Future<Output = ()>;
fn disable_cqhci(
&mut self,
responder: Responder<DisableCqhci, ___T>,
) -> impl Future<Output = ()>;
fn host_info(
&mut self,
responder: Responder<HostInfo, ___T>,
) -> impl Future<Output = ()>;
fn set_signal_voltage(
&mut self,
request: Request<SetSignalVoltage, ___T>,
responder: Responder<SetSignalVoltage, ___T>,
) -> impl Future<Output = ()>;
fn set_bus_width(
&mut self,
request: Request<SetBusWidth, ___T>,
responder: Responder<SetBusWidth, ___T>,
) -> impl Future<Output = ()>;
fn set_bus_freq(
&mut self,
request: Request<SetBusFreq, ___T>,
responder: Responder<SetBusFreq, ___T>,
) -> impl Future<Output = ()>;
fn set_timing(
&mut self,
request: Request<SetTiming, ___T>,
responder: Responder<SetTiming, ___T>,
) -> impl Future<Output = ()>;
fn hw_reset(
&mut self,
responder: Responder<HwReset, ___T>,
) -> impl Future<Output = ()>;
fn perform_tuning(
&mut self,
request: Request<PerformTuning, ___T>,
responder: Responder<PerformTuning, ___T>,
) -> impl Future<Output = ()>;
fn register_in_band_interrupt(
&mut self,
request: Request<RegisterInBandInterrupt, ___T>,
responder: Responder<RegisterInBandInterrupt, ___T>,
) -> impl Future<Output = ()>;
fn ack_in_band_interrupt(&mut self) -> impl Future<Output = ()>;
fn register_vmo(
&mut self,
request: Request<RegisterVmo, ___T>,
responder: Responder<RegisterVmo, ___T>,
) -> impl Future<Output = ()>;
fn unregister_vmo(
&mut self,
request: Request<UnregisterVmo, ___T>,
responder: Responder<UnregisterVmo, ___T>,
) -> impl Future<Output = ()>;
fn request(
&mut self,
request: Request<Request, ___T>,
responder: Responder<Request, ___T>,
) -> impl Future<Output = ()>;
}Expand description
A server handler for the Sdmmc protocol.
See Sdmmc for more details.
Required Methods§
Sourcefn initialize_command_queueing(
&mut self,
request: Request<InitializeCommandQueueing, ___T>,
responder: Responder<InitializeCommandQueueing, ___T>,
) -> impl Future<Output = ()>
fn initialize_command_queueing( &mut self, request: Request<InitializeCommandQueueing, ___T>, responder: Responder<InitializeCommandQueueing, ___T>, ) -> impl Future<Output = ()>
Initializes the CQHCI driver, providing it with all necessary resources.
This call is expected to be made once. The server should reject any additional calls
until the peer end of virtual_interrupt_lifeline closes.
§Interrupt Delegation
While the CQHCI driver is running, it takes over the physical IRQ object from its underlying
driver, and directly handles any CQHCI-specific interrupts. Interrupts which it cannot
service (e.g. SDHCI interrupts) are forwarded to the underlying driver via
virtual_interrupt. The server should service interrupts exactly as it normally would.
The CQHCI driver will wait for the virtual IRQ to be acked before acking the physical IRQ.
§Arguments
virtual_interrupt- A virtual interrupt to monitor instead of the physical IRQ. The CQHCI driver will use this to forward interrupts which it cannot directly service.virtual_interrupt_lifeline- A lifeline for the virtual interrupt. The CQHCI driver will destroy the peer end upon shutdown, which should be handled by the server as a signal to stop monitoring the virtual interrupt and return to monitoring the physical interrupt.
§Returns
cqhci_mmioandcqhci_mmio_offset- An MMIO for the CQHCI register block. MMIO size minus offset must be at least 512 bytes as per the CQHCI specification.sdhci_mmioandsdhci_mmio_offset- An MMIO for the SDHCI register block. MMIO size minus offset must be at least 512 bytes as per the SDHCI specification.bti- The BTI to use for pinning pages for DMA.interrupt- The physical interrupt to monitor.
Sourcefn enable_cqhci(
&mut self,
responder: Responder<EnableCqhci, ___T>,
) -> impl Future<Output = ()>
fn enable_cqhci( &mut self, responder: Responder<EnableCqhci, ___T>, ) -> impl Future<Output = ()>
Enables the Command Queueing Engine. The CQHCI driver is expected to already have called
[InitializeCommandQueueing] to handle interrupts.
While CQHCI is enabled, it is the caller’s responsibility to only submit regular requests
(via [Request]) via DCMD, or after disabling CQHCI.
Sourcefn disable_cqhci(
&mut self,
responder: Responder<DisableCqhci, ___T>,
) -> impl Future<Output = ()>
fn disable_cqhci( &mut self, responder: Responder<DisableCqhci, ___T>, ) -> impl Future<Output = ()>
Disables the Command Queueing Engine. EnableCqhci must have previously been called. From
this point onwards, regular requests can be submitted (until EnableCqhci is called again).
Sourcefn host_info(
&mut self,
responder: Responder<HostInfo, ___T>,
) -> impl Future<Output = ()>
fn host_info( &mut self, responder: Responder<HostInfo, ___T>, ) -> impl Future<Output = ()>
Get host info.
Sourcefn set_signal_voltage(
&mut self,
request: Request<SetSignalVoltage, ___T>,
responder: Responder<SetSignalVoltage, ___T>,
) -> impl Future<Output = ()>
fn set_signal_voltage( &mut self, request: Request<SetSignalVoltage, ___T>, responder: Responder<SetSignalVoltage, ___T>, ) -> impl Future<Output = ()>
Set signal voltage.
Sourcefn set_bus_width(
&mut self,
request: Request<SetBusWidth, ___T>,
responder: Responder<SetBusWidth, ___T>,
) -> impl Future<Output = ()>
fn set_bus_width( &mut self, request: Request<SetBusWidth, ___T>, responder: Responder<SetBusWidth, ___T>, ) -> impl Future<Output = ()>
Set bus width.
Sourcefn set_bus_freq(
&mut self,
request: Request<SetBusFreq, ___T>,
responder: Responder<SetBusFreq, ___T>,
) -> impl Future<Output = ()>
fn set_bus_freq( &mut self, request: Request<SetBusFreq, ___T>, responder: Responder<SetBusFreq, ___T>, ) -> impl Future<Output = ()>
Set bus frequency, zero means disable the clock to the card.
Sourcefn set_timing(
&mut self,
request: Request<SetTiming, ___T>,
responder: Responder<SetTiming, ___T>,
) -> impl Future<Output = ()>
fn set_timing( &mut self, request: Request<SetTiming, ___T>, responder: Responder<SetTiming, ___T>, ) -> impl Future<Output = ()>
Set mmc timing.
Sourcefn hw_reset(
&mut self,
responder: Responder<HwReset, ___T>,
) -> impl Future<Output = ()>
fn hw_reset( &mut self, responder: Responder<HwReset, ___T>, ) -> impl Future<Output = ()>
Issue a hw reset.
Sourcefn perform_tuning(
&mut self,
request: Request<PerformTuning, ___T>,
responder: Responder<PerformTuning, ___T>,
) -> impl Future<Output = ()>
fn perform_tuning( &mut self, request: Request<PerformTuning, ___T>, responder: Responder<PerformTuning, ___T>, ) -> impl Future<Output = ()>
Perform tuning.
Sourcefn register_in_band_interrupt(
&mut self,
request: Request<RegisterInBandInterrupt, ___T>,
responder: Responder<RegisterInBandInterrupt, ___T>,
) -> impl Future<Output = ()>
fn register_in_band_interrupt( &mut self, request: Request<RegisterInBandInterrupt, ___T>, responder: Responder<RegisterInBandInterrupt, ___T>, ) -> impl Future<Output = ()>
Register the given callback to be called when an in-band interrupt is received from the
card. Before calling the callback the protocol implementation will disable the in-band
interrupt in the controller. In-band interrupts can be re-enabled by calling
AckInBandInterrupt() once the previous interrupt has been handled by the client.
fn ack_in_band_interrupt(&mut self) -> impl Future<Output = ()>
Sourcefn register_vmo(
&mut self,
request: Request<RegisterVmo, ___T>,
responder: Responder<RegisterVmo, ___T>,
) -> impl Future<Output = ()>
fn register_vmo( &mut self, request: Request<RegisterVmo, ___T>, responder: Responder<RegisterVmo, ___T>, ) -> impl Future<Output = ()>
In the methods below, vmo_id is used to uniquely identify a VMO that will be passed to Request in an SdmmcBufferRegion. VMO IDs are chosen by the caller, and may be any uint32 value. Registers a VMO and transfers ownership to the protocol implementation. vmo_rights is a bit field containing SdmmcVmoRight values, and determines the read/write permissions used by the implementation when pinning or mapping the VMO. The implementation may pin vmo during this call or any time it is used in a request, and may keep it pinned until the VMO is unregistered. client_id may be in [0, SDMMC_MAX_CLIENT_ID] and identifies the ID space for this VMO to be registered in (that is, two different VMOs may use the same ID if they are registered for different clients).
Sourcefn unregister_vmo(
&mut self,
request: Request<UnregisterVmo, ___T>,
responder: Responder<UnregisterVmo, ___T>,
) -> impl Future<Output = ()>
fn unregister_vmo( &mut self, request: Request<UnregisterVmo, ___T>, responder: Responder<UnregisterVmo, ___T>, ) -> impl Future<Output = ()>
The callee unmaps/unpins the VMO and returns ownership to the caller.
Sourcefn request(
&mut self,
request: Request<Request, ___T>,
responder: Responder<Request, ___T>,
) -> impl Future<Output = ()>
fn request( &mut self, request: Request<Request, ___T>, responder: Responder<Request, ___T>, ) -> impl Future<Output = ()>
Perform the requests in order, atomically (i.e., no intervening requests). Furthermore, calls are replied to in the order they are received. If an error occurs, abort any remaining requests. Else, return the response of the last request.
The protocol implementation chooses whether or not to use DMA depending on the properties of the request and the capabilities of the controller.
Clients are responsible for performing the following cache operations:
After read requests:
- Call zx_cache_flush with ZX_CACHE_FLUSH_DATA | ZX_CACHE_FLUSH_INVALIDATE on buffers that have been mapped by the client.
- Call zx_vmo_op_range with ZX_VMO_OP_CACHE_CLEAN_INVALIDATE on all other buffers.
Note that writing to any portion of a buffer before Request has returned can corrupt the received data.
Before write requests:
- Call zx_cache_flush with ZX_CACHE_FLUSH_DATA on buffers that have been mapped by the client.
- Call zx_vmo_op_range with ZX_VMO_OP_CACHE_CLEAN on all other buffers.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.