Documentation ¶
Overview ¶
Package scsi provides a device command interface.
Index ¶
Constants ¶
const ( Page00 = 0x00 Page80 = 0x80 Page83 = 0x83 DataLen = 0xfc )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dev ¶
type Dev struct{ EmbeddedDev }
func (Dev) IDs ¶
IDs() returns the identification descriptors from the page 0x83 EVPD inquiry response.
<https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf>
Table 459 Device Identification VPD page ┏━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓ ┃ Bit┃ 7 ┃ 6 ┃ 5 ┃ 4 ┃ 3 ┃ 2 ┃ 1 ┃ 0 ┃ ┃Byte ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━┫ ┃ 0 │ PERIPHERAL QUALIFIER │ PERIPHERAL DEVICE TYPE ┃ ┠─────┼──────────────────────────┴────────────────────────────────────────────┨ ┃ 1 │ PAGE CODE (83h) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ 2 │ (MSB) ┃ ┠─────┤ PAGE LENGTH (n-3) ┃ ┃ 3 │ (LSB) ┃ ┠─────┴───────────────────────────────────────────────────────────────────────┨ ┃ Identification descriptor list ... ┃ ┠─────┬───────────────────────────────────────────────────────────────────────┨ ┃ 4 │ First Identification Descriptor (see table 460) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ n │ Last Identification Descriptor ┃ ┗━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
func (Dev) SerialNumber ¶
SerialNumber() returns the `Product Serial Number` field from the page 0x80 EVPD inquiry response.
<https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf>
Table 484 Unit Serial Number page (80h) ┏━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓ ┃ Bit┃ 7 ┃ 6 ┃ 5 ┃ 4 ┃ 3 ┃ 2 ┃ 1 ┃ 0 ┃ ┃Byte ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━┫ ┃ 0 │ PERIPHERAL QUALIFIER │ PERIPHERAL DEVICE TYPE ┃ ┠─────┼──────────────────────────┴────────────────────────────────────────────┨ ┃ 1 │ PAGE CODE (80h) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ 2 │ Reserved ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ 3 │ PAGE LENGTH ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ 4 │ ┃ ┠─────┤ ┃ ┃ ... │ Product Serial Number ┃ ┠─────┤ ┃ ┃ n │ ┃ ┗━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
func (Dev) StandardInquiry ¶
func (dev Dev) StandardInquiry() (std StdInqData, err error)
func (Dev) VPDs ¶
VPDs() returns the `SUPPORTED PAGE LIST` from the page 0x00 EVPD inquiry response.
<https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf>
Table 483 Supported Vital Product Data pages ┏━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓ ┃ Bit┃ 7 ┃ 6 ┃ 5 ┃ 4 ┃ 3 ┃ 2 ┃ 1 ┃ 0 ┃ ┃Byte ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━┫ ┃ 0 │ PERIPHERAL QUALIFIER │ PERIPHERAL DEVICE TYPE ┃ ┠─────┼──────────────────────────┴────────────────────────────────────────────┨ ┃ 1 │ PAGE CODE (00h) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ 2 │ Reserved ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ 3 │ PAGE LENGTH (n-3) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ 4 │ ┃ ┠─────┤ ┃ ┃ ... │ SUPPORTED PAGE LIST ┃ ┠─────┤ ┃ ┃ n │ ┃ ┗━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
type EmbeddedDev ¶
type IdDsc ¶
type IdDsc []byte
<https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf>
Table 460 Identification Descriptor ┏━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓ ┃ Bit┃ 7 ┃ 6 ┃ 5 ┃ 4 ┃ 3 ┃ 2 ┃ 1 ┃ 0 ┃ ┃Byte ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━┫ ┃ 0 │ PROTOCOL IDENTIFER │ CODE SET ┃ ┠─────┼────────┬────────┬─────────────────┼───────────────────────────────────┨ ┃ 1 │ PIV │Reserved│ ASSOCIATION │ IDENTIFIER TYPE ┃ ┠─────┼────────┴────────┴─────────────────┴───────────────────────────────────┨ ┃ 2 │ Reserved ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ 3 │ IDENTIFIER LENGTH (n-3) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┨ ┃ 4 │ ┃ ┠─────┤ ┃ ┃ ... │ IDENTIFIER ┃ ┠─────┤ ┃ ┃ n │ ┃ ┗━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
func (IdDsc) Association ¶
type StdInqData ¶
type StdInqData []byte
StdIngData provides methods that parse the respective fields of the page 0x00 inquiry response.
<https://www.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068j.pdf>
Table 59 Standard INQUIRY data format ┏━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓ ┃ Bit┃ 7 ┃ 6 ┃ 5 ┃ 4 ┃ 3 ┃ 2 ┃ 1 ┃ 0 ┃ ┃Byte ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━╇━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━┻━━━━━━━━┫ ┃ 0 │ PERIPHERAL QUALIFIER │ PERIPHERAL DEVICE TYPE ┃ ┠─────┼────────┬─────────────────┴────────────────────────────────────────────┨ ┃ 1 │ RMB │ Reserved ┃ ┠─────┼────────┴──────────────────────────────────────────────────────────────┨ ┃ 2 │ Version ┃ ┠─────┼────────┬────────┬─────────────────┬───────────────────────────────────┫ ┃ 3 │Obsolete│Obsolete│ Reserved │ Response Data Format ┃ ┠─────┼────────┴────────┴─────────────────┴───────────────────────────────────┫ ┃ 4 │ Additional Length (n-4) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┫ ┃ 5 │ Reserved ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┫ ┃ 6 │ Reserved ┃ ┠─────┼────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┫ ┃ 7 │Obsolete│Obsolete│Obsolete│Obsolete│Obsolete│Obsolete│ CMDQUE │ VS ┃ ┠─────┼────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┫ ┃ 8 │ (MSB) ┃ ┠─────┤ VENDOR IDENTIFICATION ┃ ┃ 15 │ (LSB) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┫ ┃ 16 │ (MSB) ┃ ┠─────┤ PRODUCT IDENTIFICATION ┃ ┃ 31 │ (LSB) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┫ ┃ 32 │ (MSB) ┃ ┠─────┤ PRODUCT REVISION LEVEL ┃ ┃ 35 │ (LSB) ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┫ ┃ 36 │ ┃ ┠─────┤ SERIAL NUMBER ┃ ┃ 43 │ ┃ ┠─────┼───────────────────────────────────────────────────────────────────────┫ ┃ 56 │ ┃ ┠─────┤ Reserved ┃ ┃ 95 │ ┃ ┠─────┴───────────────────────────────────────────────────────────────────────┫ ┃ Vendor-Specific Parameters ┃ ┠─────┬───────────────────────────────────────────────────────────────────────┫ ┃ 96 │ ┃ ┠─────┤ Vendor Specific ┃ ┃ n │ ┃ ┗━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
func (StdInqData) ProductID ¶
func (data StdInqData) ProductID() String
func (StdInqData) ProductRev ¶
func (data StdInqData) ProductRev() String
func (StdInqData) SerialNumber ¶
func (data StdInqData) SerialNumber() String
func (StdInqData) Type ¶
func (data StdInqData) Type() Type
func (StdInqData) VendorID ¶
func (data StdInqData) VendorID() String