Documentation
¶
Index ¶
- Constants
- Variables
- func ATAString(b []byte) string
- func ATATrustedReceive(fd uintptr, proto uint8, comID uint16, resp *[]byte) error
- func ATATrustedSend(fd uintptr, proto uint8, comID uint16, in []byte) error
- func SCSIModeSense(fd uintptr, pageNum, subPageNum, pageControl uint8) ([]byte, error)
- func SCSIReadCapacity(fd uintptr) (uint64, error)
- func SCSISecurityIn(fd uintptr, proto uint8, sps uint16, resp *[]byte) error
- func SCSISecurityOut(fd uintptr, proto uint8, sps uint16, in []byte) error
- func SendCDB(fd uintptr, cdb []byte, dir CDBDirection, buf *[]byte) error
- type CDB10
- type CDB12
- type CDB16
- type CDB6
- type CDBDirection
- type IdentifyDeviceResponse
- type InquiryResponse
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 ( CDBToDevice CDBDirection = -2 CDBFromDevice CDBDirection = -3 CDBToFromDevice CDBDirection = -4 SG_INFO_OK_MASK = 0x1 SG_INFO_OK = 0x0 SG_IO = 0x2285 // Timeout in milliseconds DEFAULT_TIMEOUT = 20000 PIO_DATA_IN = 4 PIO_DATA_OUT = 5 SENSE_ILLEGAL_REQUEST = 0x5 DRIVER_SENSE = 0x8 )
Variables ¶
View Source
var (
ErrIllegalRequest = errors.New("illegal SCSI request")
)
Functions ¶
func ATATrustedReceive ¶
ATA TRUSTED RECEIVE
func ATATrustedSend ¶
ATA TRUSTED SEND
func SCSIModeSense ¶
SCSI MODE SENSE(6) - Returns the raw response
func SCSIReadCapacity ¶
SCSI READ CAPACITY(10) - Returns the capacity in bytes
func SCSISecurityIn ¶
SCSI SECURITY IN
func SCSISecurityOut ¶
SCSI SECURITY OUT
Types ¶
type CDBDirection ¶
type CDBDirection int32
type IdentifyDeviceResponse ¶
type IdentifyDeviceResponse struct { Serial [20]byte Firmware [8]byte Model [40]byte // contains filtered or unexported fields }
ATA IDENTFY DEVICE response
func ATAIdentify ¶
func ATAIdentify(fd uintptr) (IdentifyDeviceResponse, error)
ATA Passthrough via SCSI (which is what Linux uses for all ATA these days)
func (IdentifyDeviceResponse) String ¶
func (id IdentifyDeviceResponse) String() string
type InquiryResponse ¶
type InquiryResponse struct { Peripheral byte // peripheral qualifier, device type Version byte VendorIdent [8]byte ProductIdent [16]byte ProductRev [4]byte // contains filtered or unexported fields }
SCSI INQUIRY response
func SCSIInquiry ¶
func SCSIInquiry(fd uintptr) (InquiryResponse, error)
INQUIRY - Returns parsed inquiry data.
func (InquiryResponse) String ¶
func (inq InquiryResponse) String() string
Click to show internal directories.
Click to hide internal directories.