class Ufs

Defined at line 153 of file ../../src/devices/block/drivers/ufs/ufs.h

Base class for UFS drivers.

This class is the parent class for both UfsPci and UfsPdev drivers, which bind the UFS

controller via PCI and PDev respectively.

Protected Members

vmo mmio_buffer_vmo_
uint64_t mmio_buffer_size_
interrupt irq_
bti bti_
deque pending_commands_
Dispatcher irq_worker_dispatcher_
Dispatcher io_worker_dispatcher_
Dispatcher admin_worker_dispatcher_
Dispatcher exception_event_dispatcher_
IrqMethod irq_handler_
TaskMethod timeout_task_
unique_ptr device_manager_
unique_ptr transfer_request_processor_
unique_ptr task_management_request_processor_
unique_ptr rpmb_device_
uint32_t logical_unit_count_
unordered_set well_known_lun_set_
function_impl host_controller_callback_
bool shutdown_
uint32_t pending_dispatcher_shutdowns_
optional stop_completer_
uint32_t max_transfer_bytes_
bool qemu_quirk_
bool intel_quirk_
Config config_
InspectProperties properties_
shared_ptr incoming_
optional component_inspector_
optional node_name_
WireSyncClient parent_node_
WireSyncClient root_node_
WireSyncClient node_controller_
WireSyncClient hardware_power_element_control_client_
event hardware_power_assertive_token_
eventpair hardware_power_lease_control_token_
bool crypto_supported_
WireSyncClient inline_encryption_client_
ServerBindingGroup inline_encryption_bindings_

Public Methods

fidl::WireSyncClient<fuchsia_driver_framework::Node> & root_node ()

scsi::Controller

Defined at line 172 of file ../../src/devices/block/drivers/ufs/ufs.h

std::string_view driver_name ()

Defined at line 173 of file ../../src/devices/block/drivers/ufs/ufs.h

const std::shared_ptr<fdf::Namespace> & driver_incoming ()

Defined at line 174 of file ../../src/devices/block/drivers/ufs/ufs.h

std::shared_ptr<fdf::OutgoingDirectory> & driver_outgoing ()

Defined at line 175 of file ../../src/devices/block/drivers/ufs/ufs.h

async_dispatcher_t * driver_async_dispatcher ()

Defined at line 176 of file ../../src/devices/block/drivers/ufs/ufs.h

const std::optional<std::string> & driver_node_name ()

Defined at line 177 of file ../../src/devices/block/drivers/ufs/ufs.h

fdf::Logger & driver_logger ()

Defined at line 178 of file ../../src/devices/block/drivers/ufs/ufs.h

const ufs_config::Config & config ()

Defined at line 179 of file ../../src/devices/block/drivers/ufs/ufs.h

bool SupportsInlineEncryption ()

Defined at line 185 of file ../../src/devices/block/drivers/ufs/ufs.h

const fdf::MmioBuffer & GetMmio ()

Defined at line 194 of file ../../src/devices/block/drivers/ufs/ufs.h

DeviceManager & GetDeviceManager ()

Defined at line 199 of file ../../src/devices/block/drivers/ufs/ufs.h

TransferRequestProcessor & GetTransferRequestProcessor ()

Defined at line 203 of file ../../src/devices/block/drivers/ufs/ufs.h

fdf::UnownedDispatcher admin_worker_dispatcher ()

Defined at line 242 of file ../../src/devices/block/drivers/ufs/ufs.h

uint32_t GetLogicalUnitCount ()

for test

Defined at line 247 of file ../../src/devices/block/drivers/ufs/ufs.h

size_t GetPendingCommandsCount ()

Defined at line 248 of file ../../src/devices/block/drivers/ufs/ufs.h

bool HasWellKnownLun (WellKnownLuns lun)

Defined at line 255 of file ../../src/devices/block/drivers/ufs/ufs.h

bool intel_quirk ()

Defined at line 259 of file ../../src/devices/block/drivers/ufs/ufs.h

bool IsResumed ()

Defined at line 261 of file ../../src/devices/block/drivers/ufs/ufs.h

const inspect::Inspector & inspect ()

Defined at line 263 of file ../../src/devices/block/drivers/ufs/ufs.h

void Ufs ()

Defined at line 657 of file ../../src/devices/block/drivers/ufs/ufs.cc

void ~Ufs ()

Defined at line 1644 of file ../../src/devices/block/drivers/ufs/ufs.cc

zx::result<> Start (fdf::DriverContext context)

Defined at line 1391 of file ../../src/devices/block/drivers/ufs/ufs.cc

void Stop (fdf::StopCompleter completer)

Defined at line 1593 of file ../../src/devices/block/drivers/ufs/ufs.cc

zx_status_t ExecuteCommandSync (uint8_t target, uint16_t lun, iovec cdb, bool is_write, iovec data)

Defined at line 524 of file ../../src/devices/block/drivers/ufs/ufs.cc

void ExecuteCommandsAsync (uint8_t target, uint16_t lun, std::span<scsi::ScsiRequest> batch)

Defined at line 477 of file ../../src/devices/block/drivers/ufs/ufs.cc

void ServeInlineEncryption (fidl::ServerEnd<fuchsia_hardware_inlineencryption::Device> server_end)

Defined at line 1459 of file ../../src/devices/block/drivers/ufs/ufs.cc

void ProgramKey (ProgramKeyRequestView request, ProgramKeyCompleter::Sync & completer)

fidl::WireServer

<fuchsia

_hardware_inlineencryption::Device>

Defined at line 1465 of file ../../src/devices/block/drivers/ufs/ufs.cc

void DeriveRawSecret (DeriveRawSecretRequestView request, DeriveRawSecretCompleter::Sync & completer)

Defined at line 1515 of file ../../src/devices/block/drivers/ufs/ufs.cc

void ProcessIoSubmissions ()

Convert block operations to UPIU commands and submit them asynchronously.

Defined at line 205 of file ../../src/devices/block/drivers/ufs/ufs.cc

TaskManagementRequestProcessor & GetTaskManagementRequestProcessor ()

Defined at line 207 of file ../../src/devices/block/drivers/ufs/ufs.h

void ProcessAdminCompletions ()

Find the completed Admin commands in the Request List and handle their completion.

Defined at line 299 of file ../../src/devices/block/drivers/ufs/ufs.cc

void ProcessIoCompletions ()

Find the completed IO commands in the Request List and handle their completion.

Defined at line 303 of file ../../src/devices/block/drivers/ufs/ufs.cc

void ProcessErrors ()

Recover errors in the request list.

Defined at line 305 of file ../../src/devices/block/drivers/ufs/ufs.cc

zx::result<> NotifyEventCallback (NotifyEvent event, uint64_t data)

Defines a callback function to perform when an |event| occurs.

Defined at line 118 of file ../../src/devices/block/drivers/ufs/ufs.cc

zx::result<> Notify (NotifyEvent event, uint64_t data)

The controller notifies the host controller when it takes the action defined in |event|.

Defined at line 137 of file ../../src/devices/block/drivers/ufs/ufs.cc

zx_status_t WaitWithTimeout (fit::function<bool ()> wait_for, zx::duration timeout, const fbl::String & timeout_message, zx::duration granularity)

Defined at line 144 of file ../../src/devices/block/drivers/ufs/ufs.cc

zx::result<uint16_t> TranslateUfsLunToScsiLun (uint8_t ufs_lun)

Defined at line 174 of file ../../src/devices/block/drivers/ufs/ufs.cc

zx::result<uint8_t> TranslateScsiLunToUfsLun (uint16_t scsi_lun)

Defined at line 188 of file ../../src/devices/block/drivers/ufs/ufs.cc

void SetHostControllerCallback (HostControllerCallback callback)

Used to register a platform-specific NotifyEventCallback, which handles variants and quirks for

each host interface platform.

Defined at line 223 of file ../../src/devices/block/drivers/ufs/ufs.h

fdf::Dispatcher & exception_event_dispatcher ()

Defined at line 239 of file ../../src/devices/block/drivers/ufs/ufs.h

fdf::UnownedDispatcher io_worker_dispatcher ()

Defined at line 241 of file ../../src/devices/block/drivers/ufs/ufs.h

void DumpRegisters ()

Defined at line 1143 of file ../../src/devices/block/drivers/ufs/ufs.cc

Protected Methods

zx::result<fdf::MmioBuffer> CreateMmioBuffer (zx_off_t offset, size_t size, zx::vmo vmo)

Defined at line 270 of file ../../src/devices/block/drivers/ufs/ufs.h

zx_status_t Init ()

Initialize the UFS controller and bind the logical units.

Declare this as virtual to delay driver initialization in tests.

Defined at line 659 of file ../../src/devices/block/drivers/ufs/ufs.cc

void OnDispatcherShutdown ()

Defined at line 1533 of file ../../src/devices/block/drivers/ufs/ufs.cc

void FinishStop (fdf::StopCompleter completer)

Defined at line 1548 of file ../../src/devices/block/drivers/ufs/ufs.cc

Friends

class RequestProcessor
class UfsTest