scsi

package
v0.0.0-...-19051da Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SG_DXFER_NONE        = -1
	SG_DXFER_TO_DEV      = -2
	SG_DXFER_FROM_DEV    = -3
	SG_DXFER_TO_FROM_DEV = -4

	SG_INFO_OK_MASK = 0x1
	SG_INFO_OK      = 0x0

	SG_IO = 0x2285
)

Variables

This section is empty.

Functions

func FindUSBDevices

func FindUSBDevices(vid uint16, pid uint16) ([]string, error)

Types

type SCSI

type SCSI struct {
	Timeout uint32
	// contains filtered or unexported fields
}

func New

func New(path string) (*SCSI, error)

func (*SCSI) Close

func (s *SCSI) Close() error

func (*SCSI) Read

func (s *SCSI) Read(cmd []byte, data *[]byte) error

func (*SCSI) Reopen

func (s *SCSI) Reopen() error

func (*SCSI) SGIO

func (s *SCSI) SGIO(hdr *SGIOHdr) error

func (*SCSI) Write

func (s *SCSI) Write(cmd []byte, data []byte) error

type SGIOHdr

type SGIOHdr struct {
	InterfaceID    int32   // 'S' for SCSI generic (required)
	DxferDirection int32   // data transfer direction
	CmdLen         uint8   // SCSI command length (<= 16 bytes)
	MxSbLen        uint8   // max length to write to sbp
	IovecCount     uint16  // 0 implies no scatter gather
	DxferLen       uint32  // byte count of data transfer
	DxferP         uintptr // points to data transfer memory or scatter gather list
	CmdP           uintptr // points to command to perform
	SbP            uintptr // points to sense_buffer memory
	Timeout        uint32  // MAX_UINT -> no timeout (unit: millisec)
	Flags          uint32  // 0 -> default, see SG_FLAG...
	PackID         int32   // unused internally (normally)
	UsrPtr         uintptr // unused internally
	Status         uint8   // SCSI status
	MaskedStatus   uint8   // shifted, masked scsi status
	MsgStatus      uint8   // messaging level data (optional)
	SbLenWr        uint8   // byte count actually written to sbp
	HostStatus     uint16  // errors from host adapter
	DriverStatus   uint16  // errors from software driver
	ResID          int32   // dxfer_len - actual_transferred
	Duration       uint32  // time taken by cmd (unit: millisec)
	Info           uint32  // auxiliary information
}

Jump to

Keyboard shortcuts

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