class Ufs

Defined at line 171 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_
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 driver_shutdown_
uint32_t max_transfer_bytes_
bool qemu_quirk_
bool intel_quirk_
mutex lock_
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_

Public Methods

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

scsi::Controller

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

std::string_view driver_name ()

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

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

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

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

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

async_dispatcher_t * driver_async_dispatcher ()

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

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

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

fdf::Logger & driver_logger ()

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

const ufs_config::Config & config ()

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

size_t BlockOpSize ()

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

void ProcessIoSubmissions ()

Convert block operations to UPIU commands and submit them asynchronously.

Defined at line 200 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 113 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 132 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 139 of file ../../src/devices/block/drivers/ufs/ufs.cc

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

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

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

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

const fdf::MmioBuffer & GetMmio ()

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

DeviceManager & GetDeviceManager ()

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

TransferRequestProcessor & GetTransferRequestProcessor ()

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

TaskManagementRequestProcessor & GetTaskManagementRequestProcessor ()

Defined at line 217 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 236 of file ../../src/devices/block/drivers/ufs/ufs.h

fdf::Dispatcher & exception_event_dispatcher ()

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

fdf::UnownedDispatcher io_worker_dispatcher ()

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

fdf::UnownedDispatcher admin_worker_dispatcher ()

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

uint32_t GetLogicalUnitCount ()

for test

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

void Ufs ()

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

void ~Ufs ()

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

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

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

void Stop (fdf::StopCompleter completer)

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

void QueueIoCommand (IoCommand * io_cmd)

Queue an IO command to be performed asynchronously.

void ProcessAdminCompletions ()

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

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

bool HasWellKnownLun (WellKnownLuns lun)

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

void ProcessIoCompletions ()

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

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

bool intel_quirk ()

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

bool IsResumed ()

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

void ProcessErrors ()

Recover errors in the request list.

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

const inspect::Inspector & inspect ()

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

void DumpRegisters ()

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

Friends

class RequestProcessor
class UfsTest