nvme

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// cf. NVM Express Base Specification 2.0c , section 5: Admin Command Set
	NVME_ADMIN_GET_LOG_PAGE uint8 = 0x02
	NVME_ADMIN_IDENTIFY     uint8 = 0x06
)

Variables

View Source
var (
	// Defined in <linux/nvme_ioctl.h>
	NVME_IOCTL_ADMIN_CMD = ioctl.Iowr('N', 0x41, unsafe.Sizeof(nvmePassthruCommand{}))
)
View Source
var (
	NativeEndian binary.ByteOrder
)

Functions

func FormatBigBytes

func FormatBigBytes(v *big.Int) string

func Le128ToBigInt

func Le128ToBigInt(buf [16]byte) *big.Int

Le128ToBigInt takes a little-endian 16-byte slice and returns a *big.Int representing it.

Types

type NVMeController

type NVMeController struct {
	VendorID        uint16
	ModelNumber     string
	SerialNumber    string
	FirmwareVersion string
	OUI             uint32 // IEEE OUI identifier
	MaxDataXferSize uint
}

NVMeController encapsulates the attributes of an NVMe controller.

func (*NVMeController) Print

func (c *NVMeController) Print(w io.Writer)

Print outputs the attributes of an NVMe controller in a pretty-print style.

type NVMeDevice

type NVMeDevice struct {
	Name string
	// contains filtered or unexported fields
}

func NewNVMeDevice

func NewNVMeDevice(name string) *NVMeDevice

func (*NVMeDevice) Close

func (d *NVMeDevice) Close() error

func (*NVMeDevice) IdentifyController

func (d *NVMeDevice) IdentifyController(w io.Writer) (NVMeController, error)

func (*NVMeDevice) IdentifyNamespace

func (d *NVMeDevice) IdentifyNamespace(w io.Writer, namespace uint32) error

func (*NVMeDevice) Open

func (d *NVMeDevice) Open() (err error)

func (*NVMeDevice) PrintSMART

func (d *NVMeDevice) PrintSMART(w io.Writer) error

func (*NVMeDevice) ReadSMART

func (d *NVMeDevice) ReadSMART() (*SmartLog, error)

type SmartLog

type SmartLog struct {
	CritWarning      uint8
	Temperature      [2]uint8
	AvailSpare       uint8
	SpareThresh      uint8
	PercentUsed      uint8
	Rsvd6            [26]byte
	DataUnitsRead    [16]byte
	DataUnitsWritten [16]byte
	HostReads        [16]byte
	HostWrites       [16]byte
	CtrlBusyTime     [16]byte
	PowerCycles      [16]byte
	PowerOnHours     [16]byte
	UnsafeShutdowns  [16]byte
	MediaErrors      [16]byte
	NumErrLogEntries [16]byte
	WarningTempTime  uint32
	CritCompTime     uint32
	TempSensor       [8]uint16
	Rsvd216          [296]byte

} // 512 bytes

Jump to

Keyboard shortcuts

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