Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.goldfish.pipe

PROTOCOLS

GoldfishPipe

Defined in fuchsia.hardware.goldfish.pipe/goldfish-pipe.fidl

This interface can be used to establish a goldfish pipe connection. The client is responsible for managing the command structure associated with the pipe and should issue a 'close' command before destroying a previously opened pipe. Failure to do so may result in host side resources that are not cleaned up properly.

ConnectSysmem

Create a sysmem connection - used to implement fuchsia.hardware.sysmem.

Request

NameType
connection handle<channel>

Response

NameType
s zx/status

Create

Create a new pipe connection. The |id| identifies the pipe and must be used for all subsequent commands. The memory that will be used as command structure is returned in |vmo|.

Request

NameType

Response

NameType
s zx/status
id int32
vmo handle<vmo>

Destroy

Destroy a previously created pipe connection.

Request

NameType
id int32

Exec

Execute pipe command stored in associated command structure.

Request

NameType
id int32

GetBti

Get BTI that can be used create IO buffers for read/write commands.

Request

NameType

Response

NameType
s zx/status
bti handle<bti>

Open

Open pipe connection. This must be called before any other commands are issued and will cause the physical address of the command structure to be a associated with the pipe. The command structure must contain {.cmd = OPEN, .id = id} at the time this request is issued.

Request

NameType
id int32

RegisterSysmemHeap

Register a sysmem heap.

Request

NameType
heap uint64
connection handle<channel>

Response

NameType
s zx/status

SetEvent

Set event used to signal device state. Discards existing event after having transferred device state to the new event, if event exists.

Return error states from zx_object_wait_one and zx_object_signal if existing events on pipe_event cannot be transferred to the call. Otherwise returns ZX_OK.

Request

NameType
id int32
pipe_event handle<event>

Response

NameType
s zx/status

STRUCTS

PipeCmdBuffer

Defined in fuchsia.hardware.goldfish.pipe/goldfish-pipe.fidl

Pipe command structure used for all commands. Note: This structure is known to both the virtual device and driver.

NameTypeDescriptionDefault
cmd int32 No default
id int32 No default
status int32 No default
reserved int32 No default
rw_params PipeCmdReadWriteParams No default

PipeCmdReadWriteParams

Defined in fuchsia.hardware.goldfish.pipe/goldfish-pipe.fidl

Additional command parameters used for read/write commands. Note: This structure is known to both the virtual device and driver.

NameTypeDescriptionDefault
buffers_count uint32 No default
consumed_size int32 No default
ptrs uint64[336] No default
sizes uint32[336] No default
read_index uint32 No default

ENUMS

PipeCmdCode

Type: int32

Defined in fuchsia.hardware.goldfish.pipe/goldfish-pipe.fidl

Codes for supported pipe commands.

NameValueDescription
OPEN 1
CLOSE 2
POLL 3
WRITE 4
WAKE_ON_WRITE 5
READ 6
WAKE_ON_READ 7
CALL 11

PipeError

Type: int32

Defined in fuchsia.hardware.goldfish.pipe/goldfish-pipe.fidl

Pipe command errors. 0 is success.

NameValueDescription
INVAL -1
AGAIN -2
NOMEM -3
IO -4

PipeWakeFlag

Type: int32

Defined in fuchsia.hardware.goldfish.pipe/goldfish-pipe.fidl

Pipe device wake flags.

NameValueDescription
CLOSED 1
READ 2
WRITE 4

CONSTANTS

NameValueTypeDescription
MAX_BUFFERS_PER_COMMAND 336 uint32

Maximum number of buffers that can be used for read/write commands.