plat_win

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ATA_PASSTHROUGH     = 0xa1
	ATA_TRUSTED_RCV     = 0x5c
	ATA_TRUSTED_SND     = 0x5e
	ATA_IDENTIFY_DEVICE = 0xec

	SCSI_INQUIRY          = 0x12
	SCSI_MODE_SENSE_6     = 0x1a
	SCSI_READ_CAPACITY_10 = 0x25
	SCSI_ATA_PASSTHRU_16  = 0x85
	SCSI_SECURITY_IN      = 0xa2
	SCSI_SECURITY_OUT     = 0xb5
)
View Source
const (
	HARD_RESET                  = 0
	SRST                        = 1
	NON_DATA                    = 3
	PIO_DATA_IN                 = 4
	PIO_DATA_OUT                = 5
	DMA                         = 6
	DMA_QUEUED                  = 7
	DEVICE_DIAGNOSTIC           = 8
	DEVICE_RESET                = 9
	UDMA_DATA_IN                = 10
	UDMA_DATA_OUT               = 11
	FPDMA                       = 12
	RETURN_RESPONSE_INFORMATION = 15
)
View Source
const (
	NVME_STORPORT_DRIVER               = 0xE000
	NVME_PASS_THROUGH_SRB_IO_CODE      = 0xe0002000
	NVME_SIG_STR                       = "NvmeMini"
	NVME_SIG_STR_LEN                   = 8
	NVME_FROM_DEV_TO_HOST              = 2
	NVME_IOCTL_VENDOR_SPECIFIC_DW_SIZE = 6
	NVME_IOCTL_CMD_DW_SIZE             = 16
	NVME_IOCTL_COMPLETE_DW_SIZE        = 4
	NVME_PT_TIMEOUT                    = 40
)
View Source
const (
	SCSI_IOCTL_DATA_OUT         = byte(0)
	SCSI_IOCTL_DATA_IN          = byte(1)
	SCSI_IOCTL_DATA_UNSPECIFIED = byte(2)
)
View Source
const (
	CDB6GENERIC_LENGTH  = 6
	CDB10GENERIC_LENGTH = 10
	CDB12GENERIC_LENGTH = 12
)
View Source
const (
	MODE_PAGE_VENDOR_SPECIFIC               = 0x00
	MODE_PAGE_ERROR_RECOVERY                = 0x01
	MODE_PAGE_DISCONNECT                    = 0x02
	MODE_PAGE_FORMAT_DEVICE                 = 0x03 // disk
	MODE_PAGE_MRW                           = 0x03 // cdrom
	MODE_PAGE_RIGID_GEOMETRY                = 0x04
	MODE_PAGE_FLEXIBILE                     = 0x05 // disk
	MODE_PAGE_WRITE_PARAMETERS              = 0x05 // cdrom
	MODE_PAGE_VERIFY_ERROR                  = 0x07
	MODE_PAGE_CACHING                       = 0x08
	MODE_PAGE_PERIPHERAL                    = 0x09
	MODE_PAGE_CONTROL                       = 0x0A
	MODE_PAGE_MEDIUM_TYPES                  = 0x0B
	MODE_PAGE_NOTCH_PARTITION               = 0x0C
	MODE_PAGE_CD_AUDIO_CONTROL              = 0x0E
	MODE_PAGE_DATA_COMPRESS                 = 0x0F
	MODE_PAGE_DEVICE_CONFIG                 = 0x10
	MODE_PAGE_XOR_CONTROL                   = 0x10 // disk
	MODE_PAGE_MEDIUM_PARTITION              = 0x11
	MODE_PAGE_ENCLOSURE_SERVICES_MANAGEMENT = 0x14
	MODE_PAGE_EXTENDED                      = 0x15
	MODE_PAGE_EXTENDED_DEVICE_SPECIFIC      = 0x16
	MODE_PAGE_CDVD_FEATURE_SET              = 0x18
	MODE_PAGE_PROTOCOL_SPECIFIC_LUN         = 0x18
	MODE_PAGE_PROTOCOL_SPECIFIC_PORT        = 0x19
	MODE_PAGE_POWER_CONDITION               = 0x1A
	MODE_PAGE_LUN_MAPPING                   = 0x1B
	MODE_PAGE_FAULT_REPORTING               = 0x1C
	MODE_PAGE_CDVD_INACTIVITY               = 0x1D // cdrom
	MODE_PAGE_ELEMENT_ADDRESS               = 0x1D
	MODE_PAGE_TRANSPORT_GEOMETRY            = 0x1E
	MODE_PAGE_DEVICE_CAPABILITIES           = 0x1F
	MODE_PAGE_CAPABILITIES                  = 0x2A // cdrom

	MODE_SENSE_RETURN_ALL = 0x3f

	MODE_SENSE_CURRENT_VALUES    = 0x00
	MODE_SENSE_CHANGEABLE_VALUES = 0x40
	MODE_SENSE_DEFAULT_VAULES    = 0x80
	MODE_SENSE_SAVED_VALUES      = 0xc0
)
View Source
const (
	// 6-byte commands:
	SCSIOP_TEST_UNIT_READY     = 0x00
	SCSIOP_REZERO_UNIT         = 0x01
	SCSIOP_REWIND              = 0x01
	SCSIOP_REQUEST_BLOCK_ADDR  = 0x02
	SCSIOP_REQUEST_SENSE       = 0x03
	SCSIOP_FORMAT_UNIT         = 0x04
	SCSIOP_READ_BLOCK_LIMITS   = 0x05
	SCSIOP_REASSIGN_BLOCKS     = 0x07
	SCSIOP_INIT_ELEMENT_STATUS = 0x07
	SCSIOP_READ6               = 0x08
	SCSIOP_RECEIVE             = 0x08
	SCSIOP_WRITE6              = 0x0A
	SCSIOP_PRINT               = 0x0A
	SCSIOP_SEND                = 0x0A
	SCSIOP_SEEK6               = 0x0B
	SCSIOP_TRACK_SELECT        = 0x0B
	SCSIOP_SLEW_PRINT          = 0x0B
	SCSIOP_SET_CAPACITY        = 0x0B // tape
	SCSIOP_SEEK_BLOCK          = 0x0C
	SCSIOP_PARTITION           = 0x0D
	SCSIOP_READ_REVERSE        = 0x0F
	SCSIOP_WRITE_FILEMARKS     = 0x10
	SCSIOP_FLUSH_BUFFER        = 0x10
	SCSIOP_SPACE               = 0x11
	SCSIOP_INQUIRY             = 0x12
	SCSIOP_VERIFY6             = 0x13
	SCSIOP_RECOVER_BUF_DATA    = 0x14
	SCSIOP_MODE_SELECT         = 0x15
	SCSIOP_RESERVE_UNIT        = 0x16
	SCSIOP_RELEASE_UNIT        = 0x17
	SCSIOP_COPY                = 0x18
	SCSIOP_ERASE               = 0x19
	SCSIOP_MODE_SENSE          = 0x1A
	SCSIOP_START_STOP_UNIT     = 0x1B
	SCSIOP_STOP_PRINT          = 0x1B
	SCSIOP_LOAD_UNLOAD         = 0x1B
	SCSIOP_RECEIVE_DIAGNOSTIC  = 0x1C
	SCSIOP_SEND_DIAGNOSTIC     = 0x1D
	SCSIOP_MEDIUM_REMOVAL      = 0x1E

	// 10-byte commands
	SCSIOP_READ_FORMATTED_CAPACITY = 0x23
	SCSIOP_READ_CAPACITY           = 0x25
	SCSIOP_READ                    = 0x28
	SCSIOP_WRITE                   = 0x2A
	SCSIOP_SEEK                    = 0x2B
	SCSIOP_LOCATE                  = 0x2B
	SCSIOP_POSITION_TO_ELEMENT     = 0x2B
	SCSIOP_WRITE_VERIFY            = 0x2E
	SCSIOP_VERIFY                  = 0x2F
	SCSIOP_SEARCH_DATA_HIGH        = 0x30
	SCSIOP_SEARCH_DATA_EQUAL       = 0x31
	SCSIOP_SEARCH_DATA_LOW         = 0x32
	SCSIOP_SET_LIMITS              = 0x33
	SCSIOP_READ_POSITION           = 0x34
	SCSIOP_SYNCHRONIZE_CACHE       = 0x35
	SCSIOP_COMPARE                 = 0x39
	SCSIOP_COPY_COMPARE            = 0x3A
	SCSIOP_WRITE_DATA_BUFF         = 0x3B
	SCSIOP_READ_DATA_BUFF          = 0x3C
	SCSIOP_WRITE_LONG              = 0x3F
	SCSIOP_CHANGE_DEFINITION       = 0x40
	SCSIOP_WRITE_SAME              = 0x41
	SCSIOP_READ_SUB_CHANNEL        = 0x42
	SCSIOP_UNMAP                   = 0x42 // block device
	SCSIOP_READ_TOC                = 0x43
	SCSIOP_READ_HEADER             = 0x44
	SCSIOP_REPORT_DENSITY_SUPPORT  = 0x44 // tape
	SCSIOP_PLAY_AUDIO              = 0x45
	SCSIOP_GET_CONFIGURATION       = 0x46
	SCSIOP_PLAY_AUDIO_MSF          = 0x47
	SCSIOP_PLAY_TRACK_INDEX        = 0x48
	SCSIOP_SANITIZE                = 0x48 // block device
	SCSIOP_PLAY_TRACK_RELATIVE     = 0x49
	SCSIOP_GET_EVENT_STATUS        = 0x4A
	SCSIOP_PAUSE_RESUME            = 0x4B
	SCSIOP_LOG_SELECT              = 0x4C
	SCSIOP_LOG_SENSE               = 0x4D
	SCSIOP_STOP_PLAY_SCAN          = 0x4E
	SCSIOP_XDWRITE                 = 0x50
	SCSIOP_XPWRITE                 = 0x51
	SCSIOP_READ_DISK_INFORMATION   = 0x51
	SCSIOP_READ_DISC_INFORMATION   = 0x51 // proper use of disc over disk
	SCSIOP_READ_TRACK_INFORMATION  = 0x52
	SCSIOP_XDWRITE_READ            = 0x53
	SCSIOP_RESERVE_TRACK_RZONE     = 0x53
	SCSIOP_SEND_OPC_INFORMATION    = 0x54 // optimum power calibration
	SCSIOP_MODE_SELECT10           = 0x55
	SCSIOP_RESERVE_UNIT10          = 0x56
	SCSIOP_RESERVE_ELEMENT         = 0x56
	SCSIOP_RELEASE_UNIT10          = 0x57
	SCSIOP_RELEASE_ELEMENT         = 0x57
	SCSIOP_REPAIR_TRACK            = 0x58
	SCSIOP_MODE_SENSE10            = 0x5A
	SCSIOP_CLOSE_TRACK_SESSION     = 0x5B
	SCSIOP_READ_BUFFER_CAPACITY    = 0x5C
	SCSIOP_SEND_CUE_SHEET          = 0x5D
	SCSIOP_PERSISTENT_RESERVE_IN   = 0x5E
	SCSIOP_PERSISTENT_RESERVE_OUT  = 0x5F

	// 12-byte commands
	SCSIOP_REPORT_LUNS                  = 0xA0
	SCSIOP_BLANK                        = 0xA1
	SCSIOP_ATA_PASSTHROUGH12            = 0xA1
	SCSIOP_SEND_EVENT                   = 0xA2
	SCSIOP_SECURITY_PROTOCOL_IN         = 0xA2
	SCSIOP_SEND_KEY                     = 0xA3
	SCSIOP_MAINTENANCE_IN               = 0xA3
	SCSIOP_REPORT_KEY                   = 0xA4
	SCSIOP_MAINTENANCE_OUT              = 0xA4
	SCSIOP_MOVE_MEDIUM                  = 0xA5
	SCSIOP_LOAD_UNLOAD_SLOT             = 0xA6
	SCSIOP_EXCHANGE_MEDIUM              = 0xA6
	SCSIOP_SET_READ_AHEAD               = 0xA7
	SCSIOP_MOVE_MEDIUM_ATTACHED         = 0xA7
	SCSIOP_READ12                       = 0xA8
	SCSIOP_GET_MESSAGE                  = 0xA8
	SCSIOP_SERVICE_ACTION_OUT12         = 0xA9
	SCSIOP_WRITE12                      = 0xAA
	SCSIOP_SEND_MESSAGE                 = 0xAB
	SCSIOP_SERVICE_ACTION_IN12          = 0xAB
	SCSIOP_GET_PERFORMANCE              = 0xAC
	SCSIOP_READ_DVD_STRUCTURE           = 0xAD
	SCSIOP_WRITE_VERIFY12               = 0xAE
	SCSIOP_VERIFY12                     = 0xAF
	SCSIOP_SEARCH_DATA_HIGH12           = 0xB0
	SCSIOP_SEARCH_DATA_EQUAL12          = 0xB1
	SCSIOP_SEARCH_DATA_LOW12            = 0xB2
	SCSIOP_SET_LIMITS12                 = 0xB3
	SCSIOP_READ_ELEMENT_STATUS_ATTACHED = 0xB4
	SCSIOP_REQUEST_VOL_ELEMENT          = 0xB5
	SCSIOP_SECURITY_PROTOCOL_OUT        = 0xB5
	SCSIOP_SEND_VOLUME_TAG              = 0xB6
	SCSIOP_SET_STREAMING                = 0xB6 // C/DVD
	SCSIOP_READ_DEFECT_DATA             = 0xB7
	SCSIOP_READ_ELEMENT_STATUS          = 0xB8
	SCSIOP_READ_CD_MSF                  = 0xB9
	SCSIOP_SCAN_CD                      = 0xBA
	SCSIOP_REDUNDANCY_GROUP_IN          = 0xBA
	SCSIOP_SET_CD_SPEED                 = 0xBB
	SCSIOP_REDUNDANCY_GROUP_OUT         = 0xBB
	SCSIOP_PLAY_CD                      = 0xBC
	SCSIOP_SPARE_IN                     = 0xBC
	SCSIOP_MECHANISM_STATUS             = 0xBD
	SCSIOP_SPARE_OUT                    = 0xBD
	SCSIOP_READ_CD                      = 0xBE
	SCSIOP_VOLUME_SET_IN                = 0xBE
	SCSIOP_SEND_DVD_STRUCTURE           = 0xBF
	SCSIOP_VOLUME_SET_OUT               = 0xBF
	SCSIOP_INIT_ELEMENT_RANGE           = 0xE7

	// 16-byte commands
	SCSIOP_XDWRITE_EXTENDED16            = 0x80 // disk
	SCSIOP_WRITE_FILEMARKS16             = 0x80 // tape
	SCSIOP_REBUILD16                     = 0x81 // disk
	SCSIOP_READ_REVERSE16                = 0x81 // tape
	SCSIOP_REGENERATE16                  = 0x82 // disk
	SCSIOP_EXTENDED_COPY                 = 0x83
	SCSIOP_POPULATE_TOKEN                = 0x83 // disk
	SCSIOP_WRITE_USING_TOKEN             = 0x83 // disk
	SCSIOP_RECEIVE_COPY_RESULTS          = 0x84
	SCSIOP_RECEIVE_ROD_TOKEN_INFORMATION = 0x84 //disk
	SCSIOP_ATA_PASSTHROUGH16             = 0x85
	SCSIOP_ACCESS_CONTROL_IN             = 0x86
	SCSIOP_ACCESS_CONTROL_OUT            = 0x87
	SCSIOP_READ16                        = 0x88
	SCSIOP_COMPARE_AND_WRITE             = 0x89
	SCSIOP_WRITE16                       = 0x8A
	SCSIOP_READ_ATTRIBUTES               = 0x8C
	SCSIOP_WRITE_ATTRIBUTES              = 0x8D
	SCSIOP_WRITE_VERIFY16                = 0x8E
	SCSIOP_VERIFY16                      = 0x8F
	SCSIOP_PREFETCH16                    = 0x90
	SCSIOP_SYNCHRONIZE_CACHE16           = 0x91
	SCSIOP_SPACE16                       = 0x91 // tape
	SCSIOP_LOCK_UNLOCK_CACHE16           = 0x92
	SCSIOP_LOCATE16                      = 0x92 // tape
	SCSIOP_WRITE_SAME16                  = 0x93
	SCSIOP_ERASE16                       = 0x93 // tape
	SCSIOP_READ_CAPACITY16               = 0x9E
	SCSIOP_GET_LBA_STATUS                = 0x9E
	SCSIOP_SERVICE_ACTION_IN16           = 0x9E
	SCSIOP_SERVICE_ACTION_OUT16          = 0x9F

	// 32-byte commands
	SCSIOP_OPERATION32 = 0x7F
)
View Source
const (
	// Service Action for 32 bit write commands
	SERVICE_ACTION_XDWRITE      = 0x0004
	SERVICE_ACTION_XPWRITE      = 0x0006
	SERVICE_ACTION_XDWRITEREAD  = 0x0007
	SERVICE_ACTION_WRITE        = 0x000B
	SERVICE_ACTION_WRITE_VERIFY = 0x000C
	SERVICE_ACTION_WRITE_SAME   = 0x000D
	SERVICE_ACTION_ORWRITE      = 0x000E

	// Service actions for 0x48
	SERVICE_ACTION_OVERWRITE    = 0x01
	SERVICE_ACTION_BLOCK_ERASE  = 0x02
	SERVICE_ACTION_CRYPTO_ERASE = 0x03
	SERVICE_ACTION_EXIT_FAILURE = 0x1f

	// Service actions for 0x83
	SERVICE_ACTION_POPULATE_TOKEN    = 0x10
	SERVICE_ACTION_WRITE_USING_TOKEN = 0x11

	// Service actions for 0x84
	SERVICE_ACTION_RECEIVE_TOKEN_INFORMATION = 0x07

	// Service actions for 0x9E
	SERVICE_ACTION_READ_CAPACITY16 = 0x10
	SERVICE_ACTION_GET_LBA_STATUS  = 0x12
)
View Source
const (
	CDB_RETURN_ON_COMPLETION = 0
	CDB_RETURN_IMMEDIATE     = 1
)
View Source
const (
	SCSIOP_DENON_EJECT_DISC   = 0xE6
	SCSIOP_DENON_STOP_AUDIO   = 0xE7
	SCSIOP_DENON_PLAY_AUDIO   = 0xE8
	SCSIOP_DENON_READ_TOC     = 0xE9
	SCSIOP_DENON_READ_SUBCODE = 0xEB
)

Denon CD ROM operation codes

View Source
const (
	SCSIMESS_ABORT                = 0x06
	SCSIMESS_ABORT_WITH_TAG       = 0x0D
	SCSIMESS_BUS_DEVICE_RESET     = 0x0C
	SCSIMESS_CLEAR_QUEUE          = 0x0E
	SCSIMESS_COMMAND_COMPLETE     = 0x00
	SCSIMESS_DISCONNECT           = 0x04
	SCSIMESS_EXTENDED_MESSAGE     = 0x01
	SCSIMESS_IDENTIFY             = 0x80
	SCSIMESS_IDENTIFY_WITH_DISCON = 0xC0
	SCSIMESS_IGNORE_WIDE_RESIDUE  = 0x23
	SCSIMESS_INITIATE_RECOVERY    = 0x0F
	SCSIMESS_INIT_DETECTED_ERROR  = 0x05
	SCSIMESS_LINK_CMD_COMP        = 0x0A
	SCSIMESS_LINK_CMD_COMP_W_FLAG = 0x0B
	SCSIMESS_MESS_PARITY_ERROR    = 0x09
	SCSIMESS_MESSAGE_REJECT       = 0x07
	SCSIMESS_NO_OPERATION         = 0x08
	SCSIMESS_HEAD_OF_QUEUE_TAG    = 0x21
	SCSIMESS_ORDERED_QUEUE_TAG    = 0x22
	SCSIMESS_SIMPLE_QUEUE_TAG     = 0x20
	SCSIMESS_RELEASE_RECOVERY     = 0x10
	SCSIMESS_RESTORE_POINTERS     = 0x03
	SCSIMESS_SAVE_DATA_POINTER    = 0x02
	SCSIMESS_TERMINATE_IO_PROCESS = 0x11
)

SCSI Bus Messages

View Source
const (
	SCSIMESS_MODIFY_DATA_POINTER  = 0x00
	SCSIMESS_SYNCHRONOUS_DATA_REQ = 0x01
	SCSIMESS_WIDE_DATA_REQUEST    = 0x03
)
View Source
const (
	SCSIMESS_MODIFY_DATA_LENGTH = 5
	SCSIMESS_SYNCH_DATA_LENGTH  = 3
	SCSIMESS_WIDE_DATA_LENGTH   = 2
)
View Source
const (
	IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS = 0x560000
	IOCTL_DISK_GET_PARTITION_INFO_EX     = 0x00070048
)
View Source
const (
	NVMeDataTypeUnknown = 0 + iota
	NVMeDataTypeIdentify
	NVMeDataTypeLogPage
	NVMeDataTypeFeature
)
View Source
const (
	NVME_IDENTIFY_CNS_SPECIFIC_NAMESPACE = 0 + iota
	NVME_IDENTIFY_CNS_CONTROLLER
	NVME_IDENTIFY_CNS_ACTIVE_NAMESPACES
	NVME_IDENTIFY_CNS_DESCRIPTOR_NAMESPACE
	NVME_IDENTIFY_CNS_NVM_SET
	NVME_IDENTIFY_CNS_SPECIFIC_NAMESPACE_IO_COMMAND_SET
	NVME_IDENTIFY_CNS_SPECIFIC_CONTROLLER_IO_COMMAND_SET
	NVME_IDENTIFY_CNS_ACTIVE_NAMESPACE_LIST_IO_COMMAND_SET
	NVME_IDENTIFY_CNS_ALLOCATED_NAMESPACE_LIST
	NVME_IDENTIFY_CNS_ALLOCATED_NAMESPACE
	NVME_IDENTIFY_CNS_CONTROLLER_LIST_OF_NSID
	NVME_IDENTIFY_CNS_CONTROLLER_LIST_OF_NVM_SUBSYSTEM
	NVME_IDENTIFY_CNS_PRIMARY_CONTROLLER_CAPABILITIES
	NVME_IDENTIFY_CNS_SECONDARY_CONTROLLER_LIST
	NVME_IDENTIFY_CNS_NAMESPACE_GRANULARITY_LIST
	NVME_IDENTIFY_CNS_UUID_LIST
	NVME_IDENTIFY_CNS_DOMAIN_LIST
	NVME_IDENTIFY_CNS_ENDURANCE_GROUP_LIST
	NVME_IDENTIFY_CNS_ALLOCATED_NAMSPACE_LIST_IO_COMMAND_SET
	NVME_IDENTIFY_CNS_ALLOCATED_NAMESPACE_IO_COMMAND_SET
	NVME_IDENTIFY_CNS_IO_COMMAND_SET
)
View Source
const (
	CDB_FORCE_MEDIA_ACCESS = 0x08
)
View Source
const (
	MAX_PARTITIONS = 64
)

Variables

This section is empty.

Functions

func StorageBusTypeToString

func StorageBusTypeToString(busType STORAGE_BUS_TYPE) string

Types

type ATA_PASSTHROUGH12

type ATA_PASSTHROUGH12 struct {
	OperationCode uint8
	B01           uint8
	B02           uint8
	Features      uint8
	SectorCount   uint8
	LbaLow        uint8
	LbaMid        uint8
	LbaHigh       uint8
	Device        uint8
	Command       uint8
	Reserved3     uint8
	Control       uint8
}

func (*ATA_PASSTHROUGH12) GetMultipleCount

func (c *ATA_PASSTHROUGH12) GetMultipleCount() uint8

func (*ATA_PASSTHROUGH12) GetOffline

func (c *ATA_PASSTHROUGH12) GetOffline() uint8

func (*ATA_PASSTHROUGH12) GetProtocol

func (c *ATA_PASSTHROUGH12) GetProtocol() uint8

func (*ATA_PASSTHROUGH12) GetTLength

func (c *ATA_PASSTHROUGH12) GetTLength() uint8

func (*ATA_PASSTHROUGH12) IsByteBlock

func (c *ATA_PASSTHROUGH12) IsByteBlock() bool

func (*ATA_PASSTHROUGH12) IsCkCond

func (c *ATA_PASSTHROUGH12) IsCkCond() bool

func (*ATA_PASSTHROUGH12) IsTDir

func (c *ATA_PASSTHROUGH12) IsTDir() bool

func (*ATA_PASSTHROUGH12) SetByteBlock

func (c *ATA_PASSTHROUGH12) SetByteBlock(v bool)

func (*ATA_PASSTHROUGH12) SetCkCond

func (c *ATA_PASSTHROUGH12) SetCkCond(v bool)

func (*ATA_PASSTHROUGH12) SetMultipleCount

func (c *ATA_PASSTHROUGH12) SetMultipleCount(v uint8)

func (*ATA_PASSTHROUGH12) SetOffline

func (c *ATA_PASSTHROUGH12) SetOffline(v uint8)

func (*ATA_PASSTHROUGH12) SetProtocol

func (c *ATA_PASSTHROUGH12) SetProtocol(v uint8)

func (*ATA_PASSTHROUGH12) SetTDir

func (c *ATA_PASSTHROUGH12) SetTDir(v bool)

func (*ATA_PASSTHROUGH12) SetTLength

func (c *ATA_PASSTHROUGH12) SetTLength(v uint8)

type ATA_PASSTHROUGH16

type ATA_PASSTHROUGH16 struct {
	OperationCode   uint8 // 0x85 - SCSIOP_ATA_PASSTHROUGH16
	B01             uint8
	B02             uint8
	Features15_8    uint8
	Features7_0     uint8
	SectorCount15_8 uint8
	SectorCount7_0  uint8
	LbaLow15_8      uint8
	LbaLow7_0       uint8
	LbaMid15_8      uint8
	LbaMid7_0       uint8
	LbaHigh15_8     uint8
	LbaHigh7_0      uint8
	Device          uint8
	Command         uint8
	Control         uint8
}

func (*ATA_PASSTHROUGH16) GetMultipleCount

func (c *ATA_PASSTHROUGH16) GetMultipleCount() uint8

func (*ATA_PASSTHROUGH16) GetOffline

func (c *ATA_PASSTHROUGH16) GetOffline() uint8

func (*ATA_PASSTHROUGH16) GetProtocol

func (c *ATA_PASSTHROUGH16) GetProtocol() uint8

func (*ATA_PASSTHROUGH16) GetTLength

func (c *ATA_PASSTHROUGH16) GetTLength() uint8

func (*ATA_PASSTHROUGH16) IsByteBlock

func (c *ATA_PASSTHROUGH16) IsByteBlock() bool

func (*ATA_PASSTHROUGH16) IsCkCond

func (c *ATA_PASSTHROUGH16) IsCkCond() bool

func (*ATA_PASSTHROUGH16) IsExtend

func (c *ATA_PASSTHROUGH16) IsExtend() bool

func (*ATA_PASSTHROUGH16) IsTDir

func (c *ATA_PASSTHROUGH16) IsTDir() bool

func (*ATA_PASSTHROUGH16) SetByteBlock

func (c *ATA_PASSTHROUGH16) SetByteBlock(v bool)

func (*ATA_PASSTHROUGH16) SetCkCond

func (c *ATA_PASSTHROUGH16) SetCkCond(v bool)

func (*ATA_PASSTHROUGH16) SetExtend

func (c *ATA_PASSTHROUGH16) SetExtend(v bool)

func (*ATA_PASSTHROUGH16) SetMultipleCount

func (c *ATA_PASSTHROUGH16) SetMultipleCount(v uint8)

func (*ATA_PASSTHROUGH16) SetOffline

func (c *ATA_PASSTHROUGH16) SetOffline(v uint8)

func (*ATA_PASSTHROUGH16) SetProtocol

func (c *ATA_PASSTHROUGH16) SetProtocol(v uint8)

func (*ATA_PASSTHROUGH16) SetTDir

func (c *ATA_PASSTHROUGH16) SetTDir(v bool)

func (*ATA_PASSTHROUGH16) SetTLength

func (c *ATA_PASSTHROUGH16) SetTLength(v uint8)

type ATA_PASS_THROUGH_DIRECT

type ATA_PASS_THROUGH_DIRECT struct {
	Length             uint16   `struc:"uint16"`
	AtaFlags           uint16   `struc:"uint16"`
	PathId             uint8    `struc:"uint8"`
	TargetId           uint8    `struc:"uint8"`
	Lun                uint8    `struc:"uint8"`
	ReservedAsUchar    uint8    `struc:"uint8"`
	DataTransferLength uint32   `struc:"uint32"`
	TimeOutValue       uint32   `struc:"uint32"`
	ReservedAsUlong    uint32   `struc:"uint32"`
	DataBuffer         uintptr  `struc:"off_t"`
	PreviousTaskFile   [8]uint8 `struc:"[8]uint8"`
	CurrentTaskFile    [8]uint8 `struc:"[8]uint8"`
}

type CDB10

type CDB10 struct {
	OperationCode     uint8
	B01               uint8
	LogicalBlockByte  [4]uint8
	Reserved2         uint8
	TransferBlocksMsb uint8
	TransferBlocksLsb uint8
	Control           uint8
}

func (*CDB10) GetLogicalUnitNumber

func (c *CDB10) GetLogicalUnitNumber() uint8

func (*CDB10) IsDisablePageOut

func (c *CDB10) IsDisablePageOut() bool

func (*CDB10) IsForceUnitAccess

func (c *CDB10) IsForceUnitAccess() bool

func (*CDB10) IsRelativeAddress

func (c *CDB10) IsRelativeAddress() bool

func (*CDB10) SetDisablePageOut

func (c *CDB10) SetDisablePageOut(v bool)

func (*CDB10) SetForceUnitAccess

func (c *CDB10) SetForceUnitAccess(v bool)

func (*CDB10) SetLogicalUnitNumber

func (c *CDB10) SetLogicalUnitNumber(v uint8)

func (*CDB10) SetRelativeAddress

func (c *CDB10) SetRelativeAddress(v bool)

type CDB16

type CDB16 struct {
	OperationCode  uint8
	B01            uint8
	LogicalBlock   [8]uint8
	TransferLength [4]uint8
	Reserved2      uint8
	Control        uint8
}

func (*CDB16) GetProtection

func (c *CDB16) GetProtection() uint8

func (*CDB16) IsDisablePageOut

func (c *CDB16) IsDisablePageOut() bool

func (*CDB16) IsForceUnitAccess

func (c *CDB16) IsForceUnitAccess() bool

func (*CDB16) SetDisablePageOut

func (c *CDB16) SetDisablePageOut(v bool)

func (*CDB16) SetForceUnitAccess

func (c *CDB16) SetForceUnitAccess(v bool)

func (*CDB16) SetProtection

func (c *CDB16) SetProtection(v uint8)

type DEVICE_TYPE

type DEVICE_TYPE = uint32

type DISK_EXTENT

type DISK_EXTENT struct {
	DiskNumber     uint32
	StartingOffset uint64
	ExtentLength   uint64
}

type DISK_GEOMETRY

type DISK_GEOMETRY struct {
	Cylinders         uint64
	MediaType         MEDIA_TYPE
	TracksPerCylinder uint32
	SectorsPerTrack   uint32
	BytesPerSector    uint32
}

type DISK_GEOMETRY_EX

type DISK_GEOMETRY_EX struct {
	Geometry DISK_GEOMETRY
	DiskSize uint64
}

type DRIVE_LAYOUT_INFORMATION_EX_HEADER

type DRIVE_LAYOUT_INFORMATION_EX_HEADER struct {
	PartitionStyle PartitionStyle
	PartitionCount uint32
}

type DRIVE_LAYOUT_INFORMATION_MBR

type DRIVE_LAYOUT_INFORMATION_MBR struct {
	Signature uint32
	CheckSum  uint32
}

type MEDIA_TYPE

type MEDIA_TYPE = uint32

type NVME_PASS_THROUGH_IOCTL

type NVME_PASS_THROUGH_IOCTL struct {
	SrbIoCtrl       SRB_IO_CONTROL
	VendorSpecific  [NVME_IOCTL_VENDOR_SPECIFIC_DW_SIZE]uint32
	NVMeCmd         [NVME_IOCTL_CMD_DW_SIZE]uint32
	CplEntry        [NVME_IOCTL_COMPLETE_DW_SIZE]uint32
	Direction       uint32
	QueueId         uint32
	DataBufferLen   uint32
	MetaDataLen     uint32
	ReturnBufferLen uint32
	DataBuffer      [4096]byte
}

type NVMe_COMMAND

type NVMe_COMMAND struct {
	/*
	 * [Command Dword 0] This field is common to all commands and is defined
	 * in Figure 6.
	 */
	CDW0 NVMe_COMMAND_DWORD_0

	/*
	 * [Namespace Identifier] This field indicates the namespace that this
	 * command applies to. If the namespace is not used for the command then
	 * this field shall be cleared to 0h. If a command shall be applied to all
	 * namespaces on the device then this value shall be set to FFFFFFFFh.
	 */
	NSID uint32

	/* DWORD 2 3 */
	DW02 uint32
	DW03 uint32

	/*
	 * [Metadata Pointer] This field contains the address of a contiguous
	 * physical buffer of metadata. This field is only used if metadata is not
	 * interleaved with the LBA data as specified in the Format NVM command.
	 * This field shall be Dword aligned.
	 */
	MPTR uint64

	/* [PRP Entry 1] This field contains the first PRP entry for the command. */
	PRP1 uint64

	/*
	 * [PRP Entry 2] This field contains the second PRP entry for the command.
	 * If the data transfer spans more than two memory pages then this field is
	 * a PRP List pointer.
	 */
	PRP2 uint64

	/* [Command Dword 10] This field is command specific Dword 10. */
	/*
	 * Defined in Admin and NVM Vendor Specific Command format.
	 * Number of DWORDs in PRP data transfer (in Figure 8).
	 */
	CDW10_OR_NDP uint32

	/* [Command Dword 11] This field is command specific Dword 11. */
	/*
	 * Defined in Admin and NVM Vendor Specific Command format.
	 * Number of DWORDs in MPTR Metadata transfer (in Figure 8).
	 */
	CDW11_OR_NDM uint32

	/* [Command Dword 12] This field is command specific Dword 12. */
	CDW12 uint32

	/* [Command Dword 13] This field is command specific Dword 13. */
	CDW13 uint32

	/* [Command Dword 14] This field is command specific Dword 14. */
	CDW14 uint32

	/* [Command Dword 15] This field is command specific Dword 15. */
	CDW15 uint32
}

type NVMe_COMMAND_DWORD_0

type NVMe_COMMAND_DWORD_0 struct {
	OPC byte
	B01 byte
	CID uint16
}

func (*NVMe_COMMAND_DWORD_0) GetFuse

func (p *NVMe_COMMAND_DWORD_0) GetFuse() byte

func (*NVMe_COMMAND_DWORD_0) SetFuse

func (p *NVMe_COMMAND_DWORD_0) SetFuse(value byte)

type NvmeAdminOpCode

type NvmeAdminOpCode = byte
const (
	NVME_ADMIN_OP_DELETE_SQ      NvmeAdminOpCode = 0x00
	NVME_ADMIN_OP_CREATE_SQ      NvmeAdminOpCode = 0x01
	NVME_ADMIN_OP_GET_LOG_PAGE   NvmeAdminOpCode = 0x02
	NVME_ADMIN_OP_DELETE_CQ      NvmeAdminOpCode = 0x04
	NVME_ADMIN_OP_CREATE_CQ      NvmeAdminOpCode = 0x05
	NVME_ADMIN_OP_IDENTIFY       NvmeAdminOpCode = 0x06
	NVME_ADMIN_OP_ABORT_CMD      NvmeAdminOpCode = 0x08
	NVME_ADMIN_OP_SET_FEATURES   NvmeAdminOpCode = 0x09
	NVME_ADMIN_OP_GET_FEATURES   NvmeAdminOpCode = 0x0A
	NVME_ADMIN_OP_ASYNC_EVENT    NvmeAdminOpCode = 0x0C
	NVME_ADMIN_OP_NS_MGMT        NvmeAdminOpCode = 0x0D
	NVME_ADMIN_OP_ACTIVATE_FW    NvmeAdminOpCode = 0x10
	NVME_ADMIN_OP_DOWNLOAD_FW    NvmeAdminOpCode = 0x11
	NVME_ADMIN_OP_DEV_SELF_TEST  NvmeAdminOpCode = 0x14
	NVME_ADMIN_OP_NS_ATTACH      NvmeAdminOpCode = 0x15
	NVME_ADMIN_OP_KEEP_ALIVE     NvmeAdminOpCode = 0x18
	NVME_ADMIN_OP_DIRECTIVE_SEND NvmeAdminOpCode = 0x19
	NVME_ADMIN_OP_DIRECTIVE_RECV NvmeAdminOpCode = 0x1A
	NVME_ADMIN_OP_VIRTUAL_MGMT   NvmeAdminOpCode = 0x1C
	NVME_ADMIN_OP_NVME_MI_SEND   NvmeAdminOpCode = 0x1D
	NVME_ADMIN_OP_NVME_MI_RECV   NvmeAdminOpCode = 0x1E
	NVME_ADMIN_OP_DBBUF          NvmeAdminOpCode = 0x7C
	NVME_ADMIN_OP_FORMAT_NVM     NvmeAdminOpCode = 0x80
	NVME_ADMIN_OP_SECURITY_SEND  NvmeAdminOpCode = 0x81
	NVME_ADMIN_OP_SECURITY_RECV  NvmeAdminOpCode = 0x82
	NVME_ADMIN_OP_SANITIZE_NVM   NvmeAdminOpCode = 0x84
	NVME_ADMIN_OP_GET_LBA_STATUS NvmeAdminOpCode = 0x86
)

type PartitionStyle

type PartitionStyle uint32
const (
	PartitionStyleMbr PartitionStyle = 0
	PartitionStyleGpt PartitionStyle = 1
	PartitionStyleRaw PartitionStyle = 2
)

type SCSI_ADDRESS

type SCSI_ADDRESS struct {
	Length     uint32
	PortNumber uint8
	PathId     uint8
	TargetId   uint8
	Lun        uint8
}

type SCSI_PASS_THROUGH_DIRECT

type SCSI_PASS_THROUGH_DIRECT struct {
	Length             uint16   `struc:"uint16"`
	ScsiStatus         byte     `struc:"uint8"`
	PathId             byte     `struc:"uint8"`
	TargetId           byte     `struc:"uint8"`
	Lun                byte     `struc:"uint8"`
	CdbLength          byte     `struc:"uint8"`
	SenseInfoLength    byte     `struc:"uint8"`
	DataIn             byte     `struc:"uint8"`
	DataTransferLength uint32   `struc:"uint32"`
	TimeOutValue       uint32   `struc:"uint32"`
	DataBuffer         uintptr  `struc:"off_t"`
	SenseInfoOffset    uint32   `struc:"uint32,offsetof=SenseInfo"`
	Cdb                [16]byte `struc:"[16]uint8"`
}

type SCSI_PASS_THROUGH_DIRECT_WITH_SENSE_BUF

type SCSI_PASS_THROUGH_DIRECT_WITH_SENSE_BUF struct {
	SCSI_PASS_THROUGH_DIRECT
	Filter    uint32 // realign buffers to double word boundary
	SenseData [32]byte
}

type SCSI_SECURITY_PROTOCOL

type SCSI_SECURITY_PROTOCOL struct {
	OperationCode uint8  `struc:"uint8"`
	Protocol      uint8  `struc:"uint8"`
	ProtocolSp    uint16 `struc:"uint16,big"`
	B04           uint8  `struc:"uint8"`
	B05           uint8  `struc:"uint8"`
	Length        uint32 `struc:"uint32,big"`
	B10           uint8  `struc:"uint8"`
	Control       uint8  `struc:"uint8"`
}

func (*SCSI_SECURITY_PROTOCOL) IsInc512

func (p *SCSI_SECURITY_PROTOCOL) IsInc512() bool

func (*SCSI_SECURITY_PROTOCOL) SetInc512

func (p *SCSI_SECURITY_PROTOCOL) SetInc512(v bool)

type SRB_IO_CONTROL

type SRB_IO_CONTROL struct {
	HeaderLength uint32
	Signature    [8]byte
	Timeout      uint32
	ControlCode  uint32
	ReturnCode   uint32
	Length       uint32
}

type STORAGE_BUS_TYPE

type STORAGE_BUS_TYPE byte
const (
	BusTypeUnknown STORAGE_BUS_TYPE = iota + 0
	BusTypeScsi
	BusTypeAtapi
	BusTypeAta
	BusType1394
	BusTypeSsa
	BusTypeFibre
	BusTypeUsb
	BusTypeRAID
	BusTypeiScsi
	BusTypeSas
	BusTypeSata
	BusTypeSd
	BusTypeMmc
	BusTypeVirtual
	BusTypeFileBackedVirtual
	BusTypeSpaces
	BusTypeNvme
	BusTypeSCM
	BusTypeUfs
	BusTypeMax
	BusTypeMaxReserved STORAGE_BUS_TYPE = 0x7F
)

type STORAGE_DEVICE_DESCRIPTOR

type STORAGE_DEVICE_DESCRIPTOR struct {
	Version               uint32
	Size                  uint32
	DeviceType            byte
	DeviceTypeModifier    byte
	RemovableMedia        bool
	CommandQueueing       bool
	VendorIdOffset        uint32
	ProductIdOffset       uint32
	ProductRevisionOffset uint32
	SerialNumberOffset    uint32
	BusType               STORAGE_BUS_TYPE
	RawPropertiesLength   uint32
}

type STORAGE_DEVICE_NUMBER

type STORAGE_DEVICE_NUMBER struct {
	DeviceType      DEVICE_TYPE
	DeviceNumber    uint32
	PartitionNumber uint32
}

type STORAGE_PROPERTY_ID

type STORAGE_PROPERTY_ID = uint32
const (
	StorageDeviceProperty STORAGE_PROPERTY_ID = 0 + iota
	StorageAdapterProperty
	StorageDeviceIdProperty
	StorageDeviceUniqueIdProperty
	StorageDeviceWriteCacheProperty
	StorageMiniportProperty
	StorageAccessAlignmentProperty
	StorageDeviceSeekPenaltyProperty
	StorageDeviceTrimProperty
	StorageDeviceWriteAggregationProperty
	StorageDeviceDeviceTelemetryProperty
	StorageDeviceLBProvisioningProperty
	StorageDevicePowerProperty
	StorageDeviceCopyOffloadProperty
	StorageDeviceResiliencyProperty
	StorageDeviceMediumProductType
	StorageAdapterRpmbProperty
	StorageAdapterCryptoProperty
)
const (
	StorageDeviceIoCapabilityProperty STORAGE_PROPERTY_ID = 48 + iota
	StorageAdapterProtocolSpecificProperty
	StorageDeviceProtocolSpecificProperty
	StorageAdapterTemperatureProperty
	StorageDeviceTemperatureProperty
	StorageAdapterPhysicalTopologyProperty
	StorageDevicePhysicalTopologyProperty
	StorageDeviceAttributesProperty
	StorageDeviceManagementStatus
	StorageAdapterSerialNumberProperty
	StorageDeviceLocationProperty
	StorageDeviceNumaProperty
	StorageDeviceZonedDeviceProperty
	StorageDeviceUnsafeShutdownCount
	StorageDeviceEnduranceProperty
	StorageDeviceLedStateProperty
)
const (
	StorageDeviceSelfEncryptionProperty STORAGE_PROPERTY_ID = 64 + iota
	StorageFruIdProperty
)

type STORAGE_PROPERTY_QUERY

type STORAGE_PROPERTY_QUERY struct {
	PropertyId STORAGE_PROPERTY_ID
	QueryType  STORAGE_QUERY_TYPE
}

type STORAGE_PROPERTY_QUERY_WITH_DUMMY

type STORAGE_PROPERTY_QUERY_WITH_DUMMY struct {
	PropertyId           STORAGE_PROPERTY_ID
	QueryType            STORAGE_QUERY_TYPE
	AdditionalParameters [1]byte
}

type STORAGE_PROTOCOL_DATA_DESCRIPTOR added in v0.0.5

type STORAGE_PROTOCOL_DATA_DESCRIPTOR struct {
	Version          uint32
	Size             uint32
	ProtocolSpecific STORAGE_PROTOCOL_SPECIFIC_DATA
}

type STORAGE_PROTOCOL_SPECIFIC_DATA

type STORAGE_PROTOCOL_SPECIFIC_DATA struct {
	ProtocolType                 STORAGE_PROTOCOL_TYPE
	DataType                     uint32
	ProtocolDataRequestValue     uint32
	ProtocolDataRequestSubValue  uint32
	ProtocolDataOffset           uint32
	ProtocolDataLength           uint32
	FixedProtocolReturnData      uint32
	ProtocolDataRequestSubValue2 uint32
	ProtocolDataRequestSubValue3 uint32
	ProtocolDataRequestSubValue4 uint32
}

type STORAGE_PROTOCOL_TYPE

type STORAGE_PROTOCOL_TYPE = uint32
const (
	ProtocolTypeUnknown STORAGE_PROTOCOL_TYPE = 0x00 + iota
	ProtocolTypeScsi
	ProtocolTypeAta
	ProtocolTypeNvme
	ProtocolTypeSd
	ProtocolTypeUfs
	ProtocolTypeProprietary STORAGE_PROTOCOL_TYPE = 0x7E
	ProtocolTypeMaxReserved STORAGE_PROTOCOL_TYPE = 0x7F
)

type STORAGE_QUERY_TYPE

type STORAGE_QUERY_TYPE = uint32
const (
	PropertyStandardQuery   STORAGE_QUERY_TYPE = 0
	PropertyExistsQuery     STORAGE_QUERY_TYPE = 1
	PropertyMaskQuery       STORAGE_QUERY_TYPE = 2
	PropertyQueryMaxDefined STORAGE_QUERY_TYPE = 3
)

type StorageQueryWithBuffer

type StorageQueryWithBuffer struct {
	Query            STORAGE_PROPERTY_QUERY
	ProtocolSpecific STORAGE_PROTOCOL_SPECIFIC_DATA
	Buffer           [4096]byte
}

type StorageQueryWithoutBuffer

type StorageQueryWithoutBuffer struct {
	Query            STORAGE_PROPERTY_QUERY
	ProtocolSpecific STORAGE_PROTOCOL_SPECIFIC_DATA
}

type VOLUME_DISK_EXTENTS

type VOLUME_DISK_EXTENTS struct {
	NumberOfDiskExtents uint32
	Extents             [1]DISK_EXTENT
}

Jump to

Keyboard shortcuts

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