go_dparm

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

github.com/jc-lab/go-dparm

Control ATA/NVMe and TCG protocol

C++ Version: jcu-dparm

WIP

This project is working in progress.

Supported platforms

Windows

  • ATA passthrough command

  • TCG protocol support

    • Support on ATA, SCSI, Windows NVMe driver
    • nvmewin driver is not tested
  • If the device ― likely USB Flash Memory ― does not support identify, used STORAGE_DEVICE_DESCRIPTOR Instead.

  • NVMe passthrough command is not supported yet

Linux

  • All feature support (sg, nvme driver)
  • If the device ― likely USB Flash Memory ― does not support identify, used INQUIRY command Instead.

example

TODO

...

Notes

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupportThisDriver = errors.New("not supported in this driver")
)

Functions

func NewSystemDriveFactory

func NewSystemDriveFactory() common.DriveFactory

Types

type DriveHandleImpl

type DriveHandleImpl struct {
	common.DriveHandle

	Info common.DriveInfo
	// contains filtered or unexported fields
}

func (*DriveHandleImpl) AtaDoTaskFileCmd

func (p *DriveHandleImpl) AtaDoTaskFileCmd(rw bool, dma bool, tf *ata.Tf, data []byte, timeoutSecs int) error

func (*DriveHandleImpl) Close

func (p *DriveHandleImpl) Close()

func (*DriveHandleImpl) GetDevicePath

func (p *DriveHandleImpl) GetDevicePath() string

func (*DriveHandleImpl) GetDriveInfo

func (p *DriveHandleImpl) GetDriveInfo() *common.DriveInfo

func (*DriveHandleImpl) GetDriverHandle

func (p *DriveHandleImpl) GetDriverHandle() common.DriverHandle

func (*DriveHandleImpl) GetDriverName

func (p *DriveHandleImpl) GetDriverName() string

func (*DriveHandleImpl) GetDrivingType

func (p *DriveHandleImpl) GetDrivingType() common.DrivingType

func (*DriveHandleImpl) NvmeGetLogPage

func (p *DriveHandleImpl) NvmeGetLogPage(nsid uint32, logId uint32, rae bool, size int) ([]byte, error)

func (*DriveHandleImpl) SecurityCommand

func (p *DriveHandleImpl) SecurityCommand(rw bool, dma bool, protocol uint8, comId uint16, buffer []byte, timeoutSecs int) error

func (*DriveHandleImpl) TcgDiscovery0

func (p *DriveHandleImpl) TcgDiscovery0() error

type LinuxDriveFactory

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

func NewLinuxDriveFactory

func NewLinuxDriveFactory() *LinuxDriveFactory

func (*LinuxDriveFactory) EnumDrives

func (f *LinuxDriveFactory) EnumDrives() ([]common.DriveInfo, error)

func (*LinuxDriveFactory) EnumVolumes

func (f *LinuxDriveFactory) EnumVolumes() (common.EnumVolumeContext, error)

func (*LinuxDriveFactory) OpenByFd

func (f *LinuxDriveFactory) OpenByFd(fd int, path string) (common.DriveHandle, error)

func (*LinuxDriveFactory) OpenByPath

func (f *LinuxDriveFactory) OpenByPath(path string) (common.DriveHandle, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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