Versions in this module Expand all Collapse all v0 v0.1.0 May 1, 2024 v0.0.1 Feb 21, 2024 Changes in this version + const AerInP2p_EventId + const AerInVep_EventId + const Aer_GfmsEvent + const Bind_GfmsEvent + const Clear_EventFlag + const CliMrpcCompAsync_EventId + const CliMrpcComp_EventId + const CreditTimeout_EventId + const Cts_EventId + const DatabaseChanged_GfmsEvent + const DeviceAdd_GfmsEvent + const DeviceDelete_GfmsEvent + const DisableCli_EventFlag + const DisableFatal_EventFlag + const DisableLog_EventFlag + const DisablePoll_EventFlag + const Dpc_EventId + const DynPartBindComp_EventId + const EnableCli_EventFlag + const EnableFatal_EventFlag + const EnableLog_EventFlag + const EnablePoll_EventFlag + const EpPortAdd_GfmsEvent + const EpPortRemove_GfmsEvent + const FabricLinkDown_GfmsEvent + const FabricLinkUp_GfmsEvent + const ForceSpeed_EventId + const FwExc_EventId + const FwFatal_EventId + const FwNmi_EventId + const FwNonFatal_EventId + const Gfms_EventId + const Global_EventType + const GpioInt_EventId + const HostLinkDown_GfmsEvent + const HostLinkUp_GfmsEvent + const Hotplug_EventId + const HvdInstDisable_GfmsEvent + const HvdInstEnable_GfmsEvent + const Ier_EventId + const IndexAll + const InvalidEventId + const Invalid_EventType + const IspError_EventId + const LinkState_EventId + const LocalPartitionIndex + const MaxBandwidthCounterPorts + const MaxEventId + const MaxSupportedTransferRates + const Max_GfmsEvent + const MrpcCompAsync_EventId + const MrpcComp_EventId + const MrpcPayloadSize + const NvmeAdminPassthruMaxDataLength + const PAXIDMask + const PAXIdShift + const PartionReset_EventId + const Partition_EventType + const PffVep + const Port_EventType + const PowerMgmt_EventId + const PpuError_EventId + const StackError_EventId + const SysReset_EventId + const Thresh_EventId + const TlpThrottling_EventId + const TwiMrpcCompAsync_EventId + const TwiMrpcComp_EventId + const Uec_EventId + const Unbind_GfmsEvent + const UnboundPort + var EpPortNotDevice = errors.New("End-point is not a device") + var MrpcInterruptedError = errors.New("MRPC Status Interrupted") + var MrpcIoError = errors.New("MRPC I/O Error") + var PciGenDataRateGBps = [MaxSupportedTransferRates]float64 + var PciGenDataRateGTps = [MaxSupportedTransferRates]float64 + var SwitchtecIoctlEventCtl uintptr + var SwitchtecIoctlEventSummary uintptr + var SwitchtecIoctlPffToPort uintptr + var SwitchtecIoctlPortToPff uintptr + func GetDataRateGBps(pciGen uint8) float64 + func NewCommandController() *commandController + type AerGfmsEvent struct + AerErrLogTimeStampHigh uint32 + AerErrLogTimeStampLow uint32 + AerHeaderLog [4]uint32 + CeUeErrSts uint32 + Handle uint8 + PhysPortId uint16 + Reserved uint8 + func (event *AerGfmsEvent) CeUe() int + func (event *AerGfmsEvent) Dpc() int + func (event *AerGfmsEvent) Log() bool + func (event *AerGfmsEvent) Print() + type BandwidthCounter struct + Egress BandwidthCounterDirectional + Ingress BandwidthCounterDirectional + TimeInMicroseconds uint64 + func (from *BandwidthCounter) Subtract(c *BandwidthCounter) + type BandwidthCounterCommand struct + Count uint8 + Ports [maxPorts]BandwidthCounterPort + SubCmd uint8 + type BandwidthCounterDirectional struct + Completion uint64 + NonPosted uint64 + Posted uint64 + func (d *BandwidthCounterDirectional) Total() uint64 + type BandwidthCounterPort struct + Clear uint8 + Id uint8 + type BandwidthType int + const Payload_BandwidthType + const Raw_BandwidthType + type BindGfmsEvent struct + HostPhysPortId uint8 + HostSwIdx uint8 + LogPortId uint8 + PDFID uint16 + Reserved uint8 + func (event *BindGfmsEvent) Print() + type Command uint32 + const BindUnbindCommand + const DeviceManageCommand + const DumpCommand + const EchoCommand + const EpResourceAccessCommand + const EpTunnelConfigCommand + const GASReadCommand + const GASWriteCommand + const GetDeviceInfo + const GetPaxIDCommand + const GfmsEventCommand + const LinkStatCommand + const NvmeAdminPassthruCommand + const PartitionInfo + const PerformanceMonitorCommand + const PortConfigCommand + const PortControlCommand + const SerialNumberSecVersion + func (cmd Command) String() string + type CommandError struct + func (e *CommandError) Error() string + func (e *CommandError) Unwrap() error + type Device struct + Path string + func Open(path string) (*Device, error) + func (dev *Device) BandwidthCounterAll(clear bool) ([]PortId, []BandwidthCounter, error) + func (dev *Device) BandwidthCounterMany(physPortIds []uint8, clear bool) ([]BandwidthCounter, error) + func (dev *Device) BandwidthCounterSetAll(bwType BandwidthType) error + func (dev *Device) BandwidthCounterSetMany(physPortIds []int, bwType BandwidthType) error + func (dev *Device) Bind(hostSwIdx uint8, hostPhysPortID uint8, hostLogPortID uint8, pdfid uint16) error + func (dev *Device) ClearGfmsEvents() error + func (dev *Device) Close() error + func (dev *Device) CsrRead(pdfid uint16, addr uint16, length uint8) ([]byte, error) + func (dev *Device) CsrRead16(pdfid uint16, addr uint16) (uint16, error) + func (dev *Device) CsrRead32(pdfid uint16, addr uint16) (uint32, error) + func (dev *Device) CsrRead8(pdfid uint16, addr uint16) (uint8, error) + func (dev *Device) CsrWrite(pdfid uint16, addr uint16, payload []byte) error + func (dev *Device) CsrWrite16(pdfid uint16, addr uint16, data uint16) error + func (dev *Device) CsrWrite32(pdfid uint16, addr uint16, data uint32) error + func (dev *Device) CsrWrite8(pdfid uint16, addr uint16, data uint8) error + func (dev *Device) Echo(pattern uint32) error + func (dev *Device) EndPointTunnelDisable(pdfid uint16) error + func (dev *Device) EndPointTunnelEnable(pdfid uint16) error + func (dev *Device) EndPointTunnelStatus(pdfid uint16) (EpTunnelStatus, error) + func (dev *Device) EventCheck(chk *IoctlEventSummary) (*IoctlEventSummary, error) + func (dev *Device) EventCtl(id EventId, index int32, flags EventFlags, data *[5]uint32) (uint32, error) + func (dev *Device) EventSummary() (*IoctlEventSummary, error) + func (dev *Device) EventWait(timeoutMs int) (bool, error) + func (dev *Device) EventWaitFor(id EventId, index int32, timeout int64) (*IoctlEventSummary, error) + func (dev *Device) GASRead(offset uint64, length uint64) ([]byte, error) + func (dev *Device) GASWrite(data []byte, addr uint64) error + func (dev *Device) GetDeviceId() (uint32, error) + func (dev *Device) GetEvents(summary *IoctlEventSummary, id EventId, showAll bool, clearAll bool, ...) ([]Event, error) + func (dev *Device) GetFirmwareInfoMetadata(partitionId FirmwarePartitionId) (*FirmwareMetadata, error) + func (dev *Device) GetFirmwareVersion() (string, error) + func (dev *Device) GetFlashInfo() (*FlashInfo, error) + func (dev *Device) GetGfmsEvents() ([]GfmsEvent, error) + func (dev *Device) GetSerialNumber() (uint32, error) + func (dev *Device) GfmsEpPortDeviceEnumerate(pid uint8, f func(*DumpEpPortDevice) error) error + func (dev *Device) GfmsEpPortFinish() error + func (dev *Device) GfmsEpPortGet(pid uint8, len uint32) (*bytes.Buffer, error) + func (dev *Device) GfmsEpPortStart(pid uint8) (uint32, error) + func (dev *Device) ID() int32 + func (dev *Device) Identify() (int32, error) + func (dev *Device) IsLocal() bool + func (dev *Device) LinkStat() ([]PortLinkStat, error) + func (dev *Device) Lock() + func (dev *Device) MapResource(path string, offset uint64, length uint64, readonly bool) (*[]byte, error) + func (dev *Device) NvmeAdminPassthru(pdfid uint16, data []byte, expRspLen int) ([]byte, error) + func (dev *Device) OpenUart(name string) error + func (dev *Device) PffToPort(index uint32) (int32, int32, error) + func (dev *Device) PortToPff(partition, port int32) (int32, error) + func (dev *Device) ResourceSize(resource string) (int64, error) + func (dev *Device) RunCommand(cmd Command, payload interface{}, response interface{}) error + func (dev *Device) RunCommandRawBytes(cmd Command, payload []byte, response []byte) error + func (dev *Device) SetID(id int32) + func (dev *Device) Status() (PortIds, error) + func (dev *Device) SystemPath(resource string) (string, error) + func (dev *Device) Unbind(hostSwIdx uint8, hostPhysPortID uint8, hostLogPortID uint8) error + func (dev *Device) Unlock() + func (dev *Device) VfReset(pdfid uint16) error + type DeviceGfmsEvent struct + FunctionCount uint16 + PhysPortId uint16 + func (event *DeviceGfmsEvent) Print() + type DumpEpPortAttachedDeviceFunction struct + BAR [6]struct{ ... } + BARNumber uint32 + Bound uint8 + BoundHVDLogPID uint8 + BoundHVDPhyPID uint8 + BoundPAXID uint8 + DID uint16 + DeviceClass uint32 + FunctionID uint16 + PDFID uint16 + Rsvd uint16 + SRIOVCapPF uint8 + SubSysDID uint16 + SubSysVID uint16 + VFNum uint8 + VID uint16 + type DumpEpPortAttachmentHeader struct + AttachedDSPEnumID uint16 + FunctionCount uint16 + Rsvd uint32 + Size uint32 + type DumpEpPortDevice struct + Ep DumpEpPortEp + Hdr DumpEpPortHeader + Section DumpSectionHeader + type DumpEpPortEp struct + Functions []DumpEpPortAttachedDeviceFunction + Hdr DumpEpPortAttachmentHeader + type DumpEpPortHeader struct + Count uint16 + PhysicalPort uint8 + Rsvd uint32 + Size uint32 + Typ uint8 + type DumpEpPortNone struct + Hdr DumpEpPortHeader + Section DumpSectionHeader + type DumpEpPortSwitch struct + type DumpSectionHeader struct + PAXIndex uint8 + ResponseSize uint32 + Rsvd uint32 + SectionClass uint8 + SoftwareFID uint16 + type EpPortType uint8 + const DeviceEpPortType + const NoneEpPortType + const SwitchEpPortType + type EpTunnelStatus uint8 + const DisabledEpTunnelStatus + const EnabledEpTunnelStatus + const UnknownEpTunnelStatus + type EpTunnelSubCommand uint16 + const DisableEpTunnelSubCommand + const EnableEpTunnelSubCommand + const StatusEpTunnelSubCommand + type Event struct + Count int + Id EventId + Index int + Partition int + Port int + Type EventType + func (e *Event) Compare(e2 Event) bool + func (e *Event) String() string + type EventBit uint64 + type EventDef struct + Bit int + Description string + Id EventId + Options EventOptions + Type EventType + type EventFlags int32 + type EventId int + func (id *EventId) Bit() int + func (id *EventId) Description() string + func (id *EventId) Type() EventType + type EventOptions int32 + const Ignore_EventOption + type EventType int + func (e EventType) Name() string + type Events []Event + func (e Events) Len() int + func (e Events) Less(i, j int) bool + func (e Events) Swap(i, j int) + type FirmwareMetadata struct + BistEnable uint8 + BistGpioLevelCfg uint8 + BistGpioPinCfg uint8 + DateStr [8]uint8 + HeaderCrc uint32 + HeaderLength uint32 + HeaderVersion uint32 + ImageCrc uint32 + ImageLength uint32 + ImageStr [16]uint8 + LinkAddr uint32 + Magic [4]uint8 + MetadataLength int32 + PublicKeyExponent [4]uint8 + PublicKeyModules [512]uint8 + RealocatableImgLen uint32 + Reserved uint32 + Reserved1 uint32 + Reserved2 [4]uint8 + Reserved3 [3]uint8 + SecureVersion uint32 + Sequence uint32 + SubMagic [4]uint8 + TimeStr [8]uint8 + Type uint32 + UartPort uint8 + UartRate uint8 + Version uint32 + XmlVersion uint32 + type FirmwarePartitionId uint8 + const BL20FirmwarePartitionId + const BL21FirmwarePartitionId + const Cfg0FirmwarePartitionId + const Cfg1FirmwarePartitionId + const Img0FirmwarePartitionId + const Img1FirmwarePartitionId + const InvalidFirmwarePartitionId + const Key0FirmwarePartitionId + const Key1FirmwarePartitionId + const Map0FirmwarePartitionId + const Map1FirmwarePartitionId + const NvlogFirmwarePartitionId + const SEEPROMFirmwarePartitionId + type FlashInfo struct + BL20 FlashPartInfo + BL21 FlashPartInfo + Cfg0 FlashPartInfo + Cfg1 FlashPartInfo + DeviceId uint16 + EccEnable uint8 + FirmwareVersion uint32 + FlashSize uint32 + Img0 FlashPartInfo + Img1 FlashPartInfo + KeyMan0 FlashPartInfo + KeyMan1 FlashPartInfo + Map0 FlashPartInfo + Map1 FlashPartInfo + NVLog FlashPartInfo + RedundancyBL2Flag uint8 + RedundancyCfgFlag uint8 + RedundancyImgFlag uint8 + RedundancyKeyFlag uint8 + Reserved0 uint8 + Reserved1 [11]uint32 + RunningBL2Flag uint8 + RunningCfgFlag uint8 + RunningImgFlag uint8 + RunningKeyFlag uint8 + Vendor [8]FlashPartInfo + type FlashPartInfo struct + Active uint8 + ImageCrc uint32 + ImageLen uint32 + ImageVer uint16 + IsUsing uint8 + PartitionEnd uint32 + PartitionOffset uint32 + PartitionSizeDw uint32 + PartitionStart uint32 + ReadOnly uint8 + Reserved [2]uint8 + Valid uint8 + type GfmsEvent struct + Code int + Data [8 * 4]byte + Id int + type GfmsEventInterface interface + Print func() + func NewAerGfmsEvent(e GfmsEvent) GfmsEventInterface + func NewBindGfmsEvent(e GfmsEvent) GfmsEventInterface + func NewDeviceGfmsEvent(e GfmsEvent) GfmsEventInterface + func NewHostGfmsEvent(e GfmsEvent) GfmsEventInterface + func NewHvdGfmsEvent(e GfmsEvent) GfmsEventInterface + func NewPortGfmsEvent(e GfmsEvent) GfmsEventInterface + type HostGfmsEvent struct + PhysPortId uint16 + func (event *HostGfmsEvent) Print() + type HvdGfmsEvent struct + ClockChan uint8 + HvdInstId uint8 + PhysPortId uint8 + func (event *HvdGfmsEvent) Print() + type IoctlEventCtl struct + Count uint32 + Data [5]uint32 + EventId uint32 + Flags uint32 + Index int32 + Occurred uint32 + type IoctlEventSummary struct + type IoctlPffPort struct + Partition int32 + Pff uint32 + Port int32 + type PortGfmsEvent struct + PhysPortId uint8 + func (event *PortGfmsEvent) Print() + type PortId struct + LogPortId uint8 + Partition uint8 + PhysPortId uint8 + Stack uint8 + StackId uint8 + Upstream uint8 + func (p1 *PortId) Less(p2 *PortId) bool + type PortIds []PortId + func (p PortIds) Len() int + func (p PortIds) Less(i, j int) bool + func (p PortIds) Swap(i, j int) + type PortLinkStat struct + CfgLinkWidth uint8 + CurLinkRateGBps float64 + LinkGen uint8 + LinkState PortLinkState + LinkUp bool + LogPortId uint8 + NegLinkWidth uint8 + Partition uint8 + PhysPortId uint8 + Stack uint8 + StackId uint8 + Upstream uint8 + type PortLinkState uint16 + const PortLinkState_Config + const PortLinkState_Detect + const PortLinkState_Disable + const PortLinkState_HotReset + const PortLinkState_L0 + const PortLinkState_L1 + const PortLinkState_L2 + const PortLinkState_LoopBack + const PortLinkState_Polling + const PortLinkState_Recovery + const PortLinkState_TxL0s + const PortLinkState_Unknown + type SerialNumberSecurityVersionInfo struct + BL2SecureVersion uint32 + ChipSerial uint32 + KeyManifestSecureVersiion uint32 + MainSecureVersion uint32 + SecureUnlockVersion uint32 + type SubCommand uint8 + const ClearGfmsEventsSubCommand + const GetBandwidthCounterSubCommand + const GetEventCounterSetupSubCommand + const GetEventCounterSubCommand + const GetGfmsEventsSubCommand + const GetLatencyCounterSetupSubCommand + const GetLatencyCounterSubCommand + const GfmsDumpFinishSubCommand + const GfmsDumpGetSubCommand + const GfmsDumpStartSubCommand + const NvmeAdminPassthruData + const NvmeAdminPassthruEnd + const NvmeAdminPassthruStart + const PartitionInfoGetAllInfoSubCommand + const PartitionInfoGetMetadataSubCommand + const PortBindSubCommand + const PortUnbindSubCommand + const SetBandwidthCounterSubCommand + const SetupEventCounterSubCommand + const SetupLatencyCounterSubCommand + const TopologyInfoDumpDataGetSubCommand + const TopologyInfoDumpFinishSubCommand + const TopologyInfoDumpStartSubCommand + const TopologyInfoDumpStatusGetSubCommand