class Ufs

Defined at line 155 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_
mutex commands_lock_
list_node pending_commands_
sync_completion admin_signal_
sync_completion io_signal_
Dispatcher irq_worker_dispatcher_
Dispatcher io_worker_dispatcher_
Dispatcher admin_worker_dispatcher_
Dispatcher exception_event_dispatcher_
Completion irq_worker_shutdown_completion_
Completion io_worker_shutdown_completion_
Completion admin_worker_shutdown_completion_
Completion exception_event_completion_
Completion wait_for_power_resumed_
unique_ptr device_manager_
unique_ptr transfer_request_processor_
unique_ptr task_management_request_processor_
uint32_t logical_unit_count_
unordered_set well_known_lun_set_
function_impl host_controller_callback_
bool driver_shutdown_
uint32_t max_transfer_bytes_
bool qemu_quirk_
mutex lock_
Config config_
InspectProperties properties_
WireSyncClient parent_node_
WireSyncClient root_node_
WireSyncClient node_controller_
WireSyncClient hardware_power_element_control_client_
WireSyncClient hardware_power_lessor_client_
event hardware_power_assertive_token_
ClientEnd hardware_power_lease_control_client_end_

Public Methods

void QueueIoCommand (IoCommand * io_cmd)

Queue an IO command to be performed asynchronously.

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

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

Defined at line 109 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 128 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 135 of file ../../src/devices/block/drivers/ufs/ufs.cc

void Ufs (fdf::DriverStartArgs start_args, fdf::UnownedSynchronizedDispatcher dispatcher)

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

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

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

void ~Ufs ()

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

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

scsi::Controller

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

std::string_view driver_name ()

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

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

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

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

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

async_dispatcher_t * driver_async_dispatcher ()

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

void ProcessIoSubmissions ()

Convert block operations to UPIU commands and submit them asynchronously.

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

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

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

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

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

fdf::Logger & driver_logger ()

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

const ufs_config::Config & config ()

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

size_t BlockOpSize ()

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

const fdf::MmioBuffer & GetMmio ()

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

DeviceManager & GetDeviceManager ()

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

TransferRequestProcessor & GetTransferRequestProcessor ()

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

TaskManagementRequestProcessor & GetTaskManagementRequestProcessor ()

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

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

libsync::Completion & exception_event_completion ()

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

uint32_t GetLogicalUnitCount ()

for test

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

bool HasWellKnownLun (WellKnownLuns lun)

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

bool IsResumed ()

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

const inspect::Inspector & inspect ()

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

zx::result<> Start ()

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

void PrepareStop (fdf::PrepareStopCompleter completer)

Defined at line 1322 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 489 of file ../../src/devices/block/drivers/ufs/ufs.cc

void ExecuteCommandAsync (uint8_t target, uint16_t lun, iovec cdb, bool is_write, uint32_t block_size_bytes, scsi::DeviceOp * device_op, iovec data)

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

void ProcessAdminCompletions ()

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

Defined at line 265 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 269 of file ../../src/devices/block/drivers/ufs/ufs.cc

void ProcessErrors ()

Recover errors in the request list.

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

void DumpRegisters ()

Defined at line 1028 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 260 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 593 of file ../../src/devices/block/drivers/ufs/ufs.cc

Friends

class UfsTest