msc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Signature = 0x43425355 // "USBC" in little endian
)

Variables

View Source
var MSC *msc

Functions

func Port

func Port(dev machine.BlockDevice) *msc

Port returns the USB Mass Storage port

func SetProductID

func SetProductID(productID string)

func SetProductRev

func SetProductRev(productRev string)

func SetVendorID

func SetVendorID(vendorID string)

Types

type CBW

type CBW struct {
	HasCmd bool
	Data   []byte
}

func (*CBW) CSW

func (c *CBW) CSW(status csw.Status, residue uint32, b []byte)

func (*CBW) SCSICmd

func (c *CBW) SCSICmd() scsi.Cmd

func (*CBW) Tag

func (c *CBW) Tag() uint32

type Error

type Error int

func (Error) Error

func (e Error) Error() string

type RecorderDisk

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

RecorderDisk is a block device that records actions taken on it

func NewRecorderDisk

func NewRecorderDisk(dev machine.BlockDevice, count int) *RecorderDisk

NewRecorderDisk creates a new RecorderDisk instance

func (*RecorderDisk) ClearLog

func (d *RecorderDisk) ClearLog()

func (*RecorderDisk) EraseBlockSize

func (d *RecorderDisk) EraseBlockSize() int64

func (*RecorderDisk) EraseBlocks

func (d *RecorderDisk) EraseBlocks(startBlock, numBlocks int64) error

func (*RecorderDisk) GetLog

func (d *RecorderDisk) GetLog() []RecorderRecord

func (*RecorderDisk) ReadAt

func (d *RecorderDisk) ReadAt(buffer []byte, offset int64) (int, error)

func (*RecorderDisk) Record

func (d *RecorderDisk) Record(opCode RecorderOpCode, offset int64, length int, data []byte)

func (*RecorderDisk) Size

func (d *RecorderDisk) Size() int64

func (*RecorderDisk) WriteAt

func (d *RecorderDisk) WriteAt(buffer []byte, offset int64) (int, error)

func (*RecorderDisk) WriteBlockSize

func (d *RecorderDisk) WriteBlockSize() int64

type RecorderOpCode

type RecorderOpCode uint8
const (
	RecorderOpCodeRead RecorderOpCode = iota
	RecorderOpCodeWrite
	RecorderOpCodeEraseBlocks
)

type RecorderRecord

type RecorderRecord struct {
	OpCode RecorderOpCode
	Offset int64
	Length int
	Data   []byte
	Time   int64
	// contains filtered or unexported fields
}

func (*RecorderRecord) String

func (r *RecorderRecord) String() (string, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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