device

package
v0.0.0-...-9bd9f91 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package device provides an interface for interacting with DSA/IAA devices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletionRecordHeader

type CompletionRecordHeader struct {
	ComplexStatus  uint8  // Status.
	ErrorCode      uint8  // ErrorCode.
	Rsvd           uint16 // Reserved.
	BytesCompleted uint32 // Bytes completed.
}

CompletionRecordHeader represents the completion record header.

func (*CompletionRecordHeader) Status

func (c *CompletionRecordHeader) Status() uint8

Status return header's status

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context represents the context of the device.

func CreateContext

func CreateContext(typ config.DeviceType) *Context

CreateContext creates a new context instance given the device type.

func (*Context) MaxTransferSize

func (c *Context) MaxTransferSize() uint32

MaxTransferSize is the max transfer size supported by device.

func (*Context) Ready

func (c *Context) Ready() bool

Ready returns true if the context is ready.

func (*Context) SetMaxTransferSize

func (c *Context) SetMaxTransferSize(s uint32)

SetMaxTransferSize set the maxTransferSize, the method only used for test.

func (*Context) Submit

func (c *Context) Submit(desc uintptr, comp *CompletionRecordHeader) uint8

Submit submits a new request with the given descriptor and completion record header.

func (*Context) SubmitBusyPoll

func (c *Context) SubmitBusyPoll(desc uintptr, comp *CompletionRecordHeader) uint8

SubmitBusyPoll submits a new quick request with the given descriptor and completion record header. This method may cause higher CPU cost.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL