switchtec

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

README

imported from github.com/NearNodeFlash/nnf-ec/internal/switchtec

The license is Apache 2

Documentation

Index

Constants

View Source
const (
	Invalid_EventType   EventType = -1
	Global_EventType              = 0
	Partition_EventType           = 1
	Port_EventType                = 2
)
View Source
const (
	StackError_EventId       EventId = 0
	PpuError_EventId                 = 1
	IspError_EventId                 = 2
	SysReset_EventId                 = 3
	FwExc_EventId                    = 4
	FwNmi_EventId                    = 5
	FwNonFatal_EventId               = 6
	FwFatal_EventId                  = 7
	TwiMrpcComp_EventId              = 8
	TwiMrpcCompAsync_EventId         = 9
	CliMrpcComp_EventId              = 10
	CliMrpcCompAsync_EventId         = 11
	GpioInt_EventId                  = 12
	PartionReset_EventId             = 13
	MrpcComp_EventId                 = 14
	MrpcCompAsync_EventId            = 15
	DynPartBindComp_EventId          = 16
	AerInP2p_EventId                 = 17
	AerInVep_EventId                 = 18
	Dpc_EventId                      = 19
	Cts_EventId                      = 20
	Hotplug_EventId                  = 21
	Ier_EventId                      = 22
	Thresh_EventId                   = 23
	PowerMgmt_EventId                = 24
	TlpThrottling_EventId            = 25
	ForceSpeed_EventId               = 26
	CreditTimeout_EventId            = 27
	LinkState_EventId                = 28
	Gfms_EventId                     = 29
	Uec_EventId                      = 31

	MaxEventId     = 31
	InvalidEventId = -1
)
View Source
const (
	LocalPartitionIndex = -1
	IndexAll            = -2
)
View Source
const (
	Clear_EventFlag        EventFlags = (1 << 0)
	EnablePoll_EventFlag              = (1 << 1)
	EnableLog_EventFlag               = (1 << 2)
	EnableCli_EventFlag               = (1 << 3)
	EnableFatal_EventFlag             = (1 << 4)
	DisablePoll_EventFlag             = (1 << 5)
	DisableLog_EventFlag              = (1 << 6)
	DisableCli_EventFlag              = (1 << 7)
	DisableFatal_EventFlag            = (1 << 8)
)
View Source
const (
	HostLinkUp_GfmsEvent = iota
	HostLinkDown_GfmsEvent
	DeviceAdd_GfmsEvent
	DeviceDelete_GfmsEvent
	FabricLinkUp_GfmsEvent
	FabricLinkDown_GfmsEvent
	Bind_GfmsEvent
	Unbind_GfmsEvent
	DatabaseChanged_GfmsEvent
	HvdInstEnable_GfmsEvent
	HvdInstDisable_GfmsEvent
	EpPortRemove_GfmsEvent
	EpPortAdd_GfmsEvent
	Aer_GfmsEvent

	Max_GfmsEvent
)
View Source
const (
	PAXIDMask  = 0x1f
	PAXIdShift = 18
)
View Source
const (
	MaxBandwidthCounterPorts = uint8((maxDataLength - int(unsafe.Sizeof(BandwidthCounterCommand{}))) / int(unsafe.Sizeof(BandwidthCounter{})))
)
View Source
const (
	MaxSupportedTransferRates = 6
)
View Source
const (
	MrpcPayloadSize = 1024
)
View Source
const (
	NvmeAdminPassthruMaxDataLength = 4096 + 16*4
)
View Source
const (
	PffVep int = 100
)
View Source
const (
	UnboundPort uint8 = math.MaxUint8
)

Variables

View Source
var (
	MrpcInterruptedError = errors.New("MRPC Status Interrupted")
	MrpcIoError          = errors.New("MRPC I/O Error")
)
View Source
var (
	SwitchtecIoctlEventSummary uintptr
	SwitchtecIoctlEventCtl     uintptr
	SwitchtecIoctlPffToPort    uintptr
	SwitchtecIoctlPortToPff    uintptr
)
View Source
var (
	PciGenDataRateGTps = [MaxSupportedTransferRates]float64{0, 2.5, 5, 8, 16, 32}
	PciGenDataRateGBps = [MaxSupportedTransferRates]float64{0, 250, 500, 985, 1969, 3938}
)
View Source
var (
	EpPortNotDevice = errors.New("End-point is not a device")
)

Functions

func GetDataRateGBps

func GetDataRateGBps(pciGen uint8) float64

func NewCommandController

func NewCommandController() *commandController

Types

type AerGfmsEvent

type AerGfmsEvent struct {
	PhysPortId             uint16
	Handle                 uint8
	Reserved               uint8
	CeUeErrSts             uint32
	AerErrLogTimeStampHigh uint32
	AerErrLogTimeStampLow  uint32
	AerHeaderLog           [4]uint32
}

Event Data for Switchtec GFMS AER Event

func (*AerGfmsEvent) CeUe

func (event *AerGfmsEvent) CeUe() int

func (*AerGfmsEvent) Dpc

func (event *AerGfmsEvent) Dpc() int

func (*AerGfmsEvent) Log

func (event *AerGfmsEvent) Log() bool

func (*AerGfmsEvent) Print

func (event *AerGfmsEvent) Print()

type BandwidthCounter

type BandwidthCounter struct {
	TimeInMicroseconds uint64
	Egress             BandwidthCounterDirectional
	Ingress            BandwidthCounterDirectional
}

func (*BandwidthCounter) Subtract

func (from *BandwidthCounter) Subtract(c *BandwidthCounter)

type BandwidthCounterCommand

type BandwidthCounterCommand struct {
	SubCmd uint8
	Count  uint8                          `structex:"countOf='Ports'"`
	Ports  [maxPorts]BandwidthCounterPort `structex:"truncate"`
}

type BandwidthCounterDirectional

type BandwidthCounterDirectional struct {
	Posted     uint64
	Completion uint64
	NonPosted  uint64
}

func (*BandwidthCounterDirectional) Total

type BandwidthCounterPort

type BandwidthCounterPort struct {
	Id    uint8
	Clear uint8
}

type BandwidthType

type BandwidthType int
const (
	Raw_BandwidthType     BandwidthType = 0
	Payload_BandwidthType               = 1
)

type BindGfmsEvent

type BindGfmsEvent struct {
	HostSwIdx      uint8
	HostPhysPortId uint8
	LogPortId      uint8
	Reserved       uint8
	PDFID          uint16
}

Event Data for Switchtec GFMS Bind / Unbind Event

func (*BindGfmsEvent) Print

func (event *BindGfmsEvent) Print()

type Command

type Command uint32

A Command describes the executable command sent to the device.

const (
	PerformanceMonitorCommand Command = 7

	// Global Address Space commands
	LinkStatCommand Command = 28
	GASReadCommand  Command = 0x29 // 41
	PartitionInfo   Command = 0x2B // 43
	GASWriteCommand Command = 0x34 // 52

	EchoCommand     Command = 0x41 // 65
	GetPaxIDCommand Command = 0x81 // 129

	// Global Fabric Management Service commands
	DumpCommand              Command = 0x83
	BindUnbindCommand        Command = 0x84
	DeviceManageCommand      Command = 0x85 // Obsolete - See NvmeAdminPassthru
	PortConfigCommand        Command = 0x88
	GfmsEventCommand         Command = 0x89
	PortControlCommand       Command = 0x8D
	EpResourceAccessCommand  Command = 0x8E
	EpTunnelConfigCommand    Command = 0x8F
	NvmeAdminPassthruCommand Command = 0x91

	GetDeviceInfo          Command = 0x100
	SerialNumberSecVersion Command = 0x109
)

The supported command set for a device.

func (Command) String

func (cmd Command) String() string

type CommandError

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

func (*CommandError) Error

func (e *CommandError) Error() string

func (*CommandError) Unwrap

func (e *CommandError) Unwrap() error

type Device

type Device struct {
	Path string
	// contains filtered or unexported fields
}

Device describing the switchtec device

func Open

func Open(path string) (*Device, error)

Open returns the device such that it is accessible to other API functions.

func (*Device) BandwidthCounterAll

func (dev *Device) BandwidthCounterAll(clear bool) ([]PortId, []BandwidthCounter, error)

func (*Device) BandwidthCounterMany

func (dev *Device) BandwidthCounterMany(physPortIds []uint8, clear bool) ([]BandwidthCounter, error)

func (*Device) BandwidthCounterSetAll

func (dev *Device) BandwidthCounterSetAll(bwType BandwidthType) error

Set Bandwidth Type performance monitor for all ports in the system

func (*Device) BandwidthCounterSetMany

func (dev *Device) BandwidthCounterSetMany(physPortIds []int, bwType BandwidthType) error

Set Bandwidth Type for particular physical ports in the system

func (*Device) Bind

func (dev *Device) Bind(hostSwIdx uint8, hostPhysPortID uint8, hostLogPortID uint8, pdfid uint16) error

Bind does some stuff

func (*Device) ClearGfmsEvents

func (dev *Device) ClearGfmsEvents() error

func (*Device) Close

func (dev *Device) Close() error

Close -

func (*Device) CsrRead

func (dev *Device) CsrRead(pdfid uint16, addr uint16, length uint8) ([]byte, error)

func (*Device) CsrRead16

func (dev *Device) CsrRead16(pdfid uint16, addr uint16) (uint16, error)

func (*Device) CsrRead32

func (dev *Device) CsrRead32(pdfid uint16, addr uint16) (uint32, error)

func (*Device) CsrRead8

func (dev *Device) CsrRead8(pdfid uint16, addr uint16) (uint8, error)

func (*Device) CsrWrite

func (dev *Device) CsrWrite(pdfid uint16, addr uint16, payload []byte) error

func (*Device) CsrWrite16

func (dev *Device) CsrWrite16(pdfid uint16, addr uint16, data uint16) error

func (*Device) CsrWrite32

func (dev *Device) CsrWrite32(pdfid uint16, addr uint16, data uint32) error

func (*Device) CsrWrite8

func (dev *Device) CsrWrite8(pdfid uint16, addr uint16, data uint8) error

func (*Device) Echo

func (dev *Device) Echo(pattern uint32) error

Echo will send a pattern to the device and expect to receive its inverse, confirming that the device is functioning properly.

func (*Device) EndPointTunnelDisable

func (dev *Device) EndPointTunnelDisable(pdfid uint16) error

func (*Device) EndPointTunnelEnable

func (dev *Device) EndPointTunnelEnable(pdfid uint16) error

func (*Device) EndPointTunnelStatus

func (dev *Device) EndPointTunnelStatus(pdfid uint16) (EpTunnelStatus, error)

func (*Device) EventCheck

func (dev *Device) EventCheck(chk *IoctlEventSummary) (*IoctlEventSummary, error)

func (*Device) EventCtl

func (dev *Device) EventCtl(id EventId, index int32, flags EventFlags, data *[5]uint32) (uint32, error)

func (*Device) EventSummary

func (dev *Device) EventSummary() (*IoctlEventSummary, error)

func (*Device) EventWait

func (dev *Device) EventWait(timeoutMs int) (bool, error)

func (*Device) EventWaitFor

func (dev *Device) EventWaitFor(id EventId, index int32, timeout int64) (*IoctlEventSummary, error)

EventWaitFor will wait for the the occurrence of the EventId at the location specified by Index or a timeout to occur. The Event summary is returned, empty on timeout or with the value of the event otherwise. timeout = -1 is infinite wait.

func (*Device) GASRead

func (dev *Device) GASRead(offset uint64, length uint64) ([]byte, error)

func (*Device) GASWrite

func (dev *Device) GASWrite(data []byte, addr uint64) error

GASWrite will write at a given address bytes to the Global Address Space

func (*Device) GetDeviceId

func (dev *Device) GetDeviceId() (uint32, error)

GetDeviceId -

func (*Device) GetEvents

func (dev *Device) GetEvents(summary *IoctlEventSummary, id EventId, showAll bool, clearAll bool, index int32) ([]Event, error)

func (*Device) GetFirmwareInfoMetadata

func (dev *Device) GetFirmwareInfoMetadata(partitionId FirmwarePartitionId) (*FirmwareMetadata, error)

func (*Device) GetFirmwareVersion

func (dev *Device) GetFirmwareVersion() (string, error)

GetFirmwareVersion -

func (*Device) GetFlashInfo

func (dev *Device) GetFlashInfo() (*FlashInfo, error)

GetFlashInfo -

func (*Device) GetGfmsEvents

func (dev *Device) GetGfmsEvents() ([]GfmsEvent, error)

func (*Device) GetSerialNumber

func (dev *Device) GetSerialNumber() (uint32, error)

GetSerialNumber -

func (*Device) GfmsEpPortDeviceEnumerate

func (dev *Device) GfmsEpPortDeviceEnumerate(pid uint8, f func(*DumpEpPortDevice) error) error

func (*Device) GfmsEpPortFinish

func (dev *Device) GfmsEpPortFinish() error

func (*Device) GfmsEpPortGet

func (dev *Device) GfmsEpPortGet(pid uint8, len uint32) (*bytes.Buffer, error)

func (*Device) GfmsEpPortStart

func (dev *Device) GfmsEpPortStart(pid uint8) (uint32, error)

func (*Device) ID

func (dev *Device) ID() int32

func (*Device) Identify

func (dev *Device) Identify() (int32, error)

Identify will return the PAX Identifer

func (*Device) IsLocal

func (dev *Device) IsLocal() bool

func (*Device) LinkStat

func (dev *Device) LinkStat() ([]PortLinkStat, error)

Link Stat will get the status of all the ports on a switchtec device

func (*Device) Lock

func (dev *Device) Lock()

func (*Device) MapResource

func (dev *Device) MapResource(path string, offset uint64, length uint64, readonly bool) (*[]byte, error)

func (*Device) NvmeAdminPassthru

func (dev *Device) NvmeAdminPassthru(pdfid uint16, data []byte, expRspLen int) ([]byte, error)

NvmeAdminPassthru will send an ADMIN PASSTHRU command to device and get reply `pdfid` is the Physical Device Function Identifier `data` is payload transmitted to the device `expRspLen` is the expected response length from the command

func (*Device) OpenUart

func (dev *Device) OpenUart(name string) error

OpenUart will open a UART device and configure the device for UART operations.

func (*Device) PffToPort

func (dev *Device) PffToPort(index uint32) (int32, int32, error)

func (*Device) PortToPff

func (dev *Device) PortToPff(partition, port int32) (int32, error)

func (*Device) ResourceSize

func (dev *Device) ResourceSize(resource string) (int64, error)

func (*Device) RunCommand

func (dev *Device) RunCommand(cmd Command, payload interface{}, response interface{}) error

RunCommand takes a command parameter and payload to send to the device. Optionally can take a response to return data back to the caller. Payload and response can be any structex annotated structure.

func (*Device) RunCommandRawBytes

func (dev *Device) RunCommandRawBytes(cmd Command, payload []byte, response []byte) error

RunCommandRawBytes function will run the command on the device

func (*Device) SetID

func (dev *Device) SetID(id int32)

func (*Device) Status

func (dev *Device) Status() (PortIds, error)

Get the status of all the ports on the switchtec device

func (*Device) SystemPath

func (dev *Device) SystemPath(resource string) (string, error)

func (*Device) Unbind

func (dev *Device) Unbind(hostSwIdx uint8, hostPhysPortID uint8, hostLogPortID uint8) error

Unbind does some unbind stuff

func (*Device) Unlock

func (dev *Device) Unlock()

func (*Device) VfReset

func (dev *Device) VfReset(pdfid uint16) error

type DeviceGfmsEvent

type DeviceGfmsEvent struct {
	PhysPortId    uint16
	FunctionCount uint16
}

Event Data for Switchtec GFMS Device Add / Delete Event

func (*DeviceGfmsEvent) Print

func (event *DeviceGfmsEvent) Print()

type DumpEpPortAttachedDeviceFunction

type DumpEpPortAttachedDeviceFunction struct {
	FunctionID     uint16
	PDFID          uint16
	SRIOVCapPF     uint8
	VFNum          uint8
	Rsvd           uint16
	Bound          uint8
	BoundPAXID     uint8
	BoundHVDPhyPID uint8
	BoundHVDLogPID uint8
	VID            uint16
	DID            uint16
	SubSysVID      uint16
	SubSysDID      uint16
	DeviceClass    uint32 `bitfield:"24"`
	BARNumber      uint32 `bitfield:"8"`
	BAR            [6]struct {
		Typ  uint8
		Size uint8
	}
}

type DumpEpPortAttachmentHeader

type DumpEpPortAttachmentHeader struct {
	FunctionCount     uint16 `countOf:"Functions"`
	AttachedDSPEnumID uint16
	Size              uint32 `bitfield:"24"`
	Rsvd              uint32 `bitfield:"8,reserved"`
}

type DumpEpPortDevice

type DumpEpPortDevice struct {
	Section DumpSectionHeader
	Hdr     DumpEpPortHeader
	Ep      DumpEpPortEp
}

DumpEpPortDevice is returned when DumpEpPortHeader.Type is DeviceEpPortType

type DumpEpPortEp

type DumpEpPortEp struct {
	Hdr       DumpEpPortAttachmentHeader
	Functions []DumpEpPortAttachedDeviceFunction
}

DumpEpPortDevice is returned after a DumpSectionHeader of type Device(0)

type DumpEpPortHeader

type DumpEpPortHeader struct {
	Typ          uint8
	PhysicalPort uint8
	Count        uint16
	Size         uint32 `bitfield:"24"`
	Rsvd         uint32 `bitfield:"8,reserved"`
}

DumpEpPortHeader is returned as part of a Ep Port Dump

type DumpEpPortNone

type DumpEpPortNone struct {
	Section DumpSectionHeader
	Hdr     DumpEpPortHeader
}

DumpEpPortNone is returned when DumpEpPortHeader.Type is NoneEpPortType

type DumpEpPortSwitch

type DumpEpPortSwitch struct {
}

DumpEpPortSwitch is returned when DumpEpPortHeader.Type is SwitchEpPortType

type DumpSectionHeader

type DumpSectionHeader struct {
	SectionClass uint8
	PAXIndex     uint8
	SoftwareFID  uint16
	ResponseSize uint32
	Rsvd         uint32

} // 12 bytes

DumpSectionHeader is returned as part of every dump section

type EpPortType

type EpPortType uint8

EpPortType describes the type of return data for an GFMS EP Dump

const (
	DeviceEpPortType EpPortType = 0
	SwitchEpPortType EpPortType = 1
	NoneEpPortType   EpPortType = 2
)

type EpTunnelStatus

type EpTunnelStatus uint8
const (
	DisabledEpTunnelStatus EpTunnelStatus = 0
	EnabledEpTunnelStatus  EpTunnelStatus = 1
	UnknownEpTunnelStatus  EpTunnelStatus = 2
)

type EpTunnelSubCommand

type EpTunnelSubCommand uint16
const (
	EnableEpTunnelSubCommand  EpTunnelSubCommand = 0
	DisableEpTunnelSubCommand EpTunnelSubCommand = 1
	StatusEpTunnelSubCommand  EpTunnelSubCommand = 2
)

type Event

type Event struct {
	Id        EventId
	Type      EventType
	Count     int
	Index     int
	Partition int
	Port      int
}

func (*Event) Compare

func (e *Event) Compare(e2 Event) bool

func (*Event) String

func (e *Event) String() string

type EventBit

type EventBit uint64

type EventDef

type EventDef struct {
	Type        EventType
	Id          EventId
	Options     EventOptions
	Bit         int
	Description string
}

type EventFlags

type EventFlags int32

type EventId

type EventId int

func (*EventId) Bit

func (id *EventId) Bit() int

func (*EventId) Description

func (id *EventId) Description() string

func (*EventId) Type

func (id *EventId) Type() EventType

type EventOptions

type EventOptions int32
const (
	Ignore_EventOption EventOptions = (1 << 0)
)

type EventType

type EventType int

func (EventType) Name

func (e EventType) Name() string

type Events

type Events []Event

func (Events) Len

func (e Events) Len() int

func (Events) Less

func (e Events) Less(i, j int) bool

func (Events) Swap

func (e Events) Swap(i, j int)

type FirmwareMetadata

type FirmwareMetadata struct {
	Magic              [4]uint8
	SubMagic           [4]uint8
	HeaderVersion      uint32
	SecureVersion      uint32
	HeaderLength       uint32
	MetadataLength     int32
	ImageLength        uint32
	Type               uint32
	Reserved           uint32
	Version            uint32
	Sequence           uint32
	Reserved1          uint32
	DateStr            [8]uint8
	TimeStr            [8]uint8
	ImageStr           [16]uint8
	Reserved2          [4]uint8
	ImageCrc           uint32
	PublicKeyModules   [512]uint8
	PublicKeyExponent  [4]uint8
	UartPort           uint8
	UartRate           uint8
	BistEnable         uint8
	BistGpioPinCfg     uint8
	BistGpioLevelCfg   uint8
	Reserved3          [3]uint8
	XmlVersion         uint32
	RealocatableImgLen uint32
	LinkAddr           uint32
	HeaderCrc          uint32
}

type FirmwarePartitionId

type FirmwarePartitionId uint8
const (
	Map0FirmwarePartitionId    FirmwarePartitionId = 0x0
	Map1FirmwarePartitionId    FirmwarePartitionId = 0x1
	Key0FirmwarePartitionId    FirmwarePartitionId = 0x2
	Key1FirmwarePartitionId    FirmwarePartitionId = 0x3
	BL20FirmwarePartitionId    FirmwarePartitionId = 0x4
	BL21FirmwarePartitionId    FirmwarePartitionId = 0x5
	Cfg0FirmwarePartitionId    FirmwarePartitionId = 0x6
	Cfg1FirmwarePartitionId    FirmwarePartitionId = 0x7
	Img0FirmwarePartitionId    FirmwarePartitionId = 0x8
	Img1FirmwarePartitionId    FirmwarePartitionId = 0x9
	NvlogFirmwarePartitionId   FirmwarePartitionId = 0xA
	SEEPROMFirmwarePartitionId FirmwarePartitionId = 0xFE
	InvalidFirmwarePartitionId FirmwarePartitionId = 0xFF
)

type FlashInfo

type FlashInfo struct {
	FirmwareVersion   uint32
	FlashSize         uint32
	DeviceId          uint16
	EccEnable         uint8
	Reserved0         uint8
	RunningBL2Flag    uint8
	RunningCfgFlag    uint8
	RunningImgFlag    uint8
	RunningKeyFlag    uint8
	RedundancyKeyFlag uint8
	RedundancyBL2Flag uint8
	RedundancyCfgFlag uint8
	RedundancyImgFlag uint8
	Reserved1         [11]uint32
	Map0              FlashPartInfo
	Map1              FlashPartInfo
	KeyMan0           FlashPartInfo
	KeyMan1           FlashPartInfo
	BL20              FlashPartInfo
	BL21              FlashPartInfo
	Cfg0              FlashPartInfo
	Cfg1              FlashPartInfo
	Img0              FlashPartInfo
	Img1              FlashPartInfo
	NVLog             FlashPartInfo
	Vendor            [8]FlashPartInfo
}

type FlashPartInfo

type FlashPartInfo struct {
	ImageCrc        uint32
	ImageLen        uint32
	ImageVer        uint16
	Valid           uint8
	Active          uint8
	PartitionStart  uint32
	PartitionEnd    uint32
	PartitionOffset uint32
	PartitionSizeDw uint32
	ReadOnly        uint8
	IsUsing         uint8
	Reserved        [2]uint8
}

type GfmsEvent

type GfmsEvent struct {
	Code int
	Id   int
	Data [8 * 4]byte
}

type GfmsEventInterface

type GfmsEventInterface interface {
	Print()
}

func NewAerGfmsEvent

func NewAerGfmsEvent(e GfmsEvent) GfmsEventInterface

func NewBindGfmsEvent

func NewBindGfmsEvent(e GfmsEvent) GfmsEventInterface

func NewDeviceGfmsEvent

func NewDeviceGfmsEvent(e GfmsEvent) GfmsEventInterface

func NewHostGfmsEvent

func NewHostGfmsEvent(e GfmsEvent) GfmsEventInterface

func NewHvdGfmsEvent

func NewHvdGfmsEvent(e GfmsEvent) GfmsEventInterface

func NewPortGfmsEvent

func NewPortGfmsEvent(e GfmsEvent) GfmsEventInterface

type HostGfmsEvent

type HostGfmsEvent struct {
	PhysPortId uint16
}

Event Data for Switchtec GFMS Host Link Up / Down Event

func (*HostGfmsEvent) Print

func (event *HostGfmsEvent) Print()

type HvdGfmsEvent

type HvdGfmsEvent struct {
	HvdInstId  uint8
	PhysPortId uint8
	ClockChan  uint8
}

Event Data for Switchtec GFMS HVD Instance Enable / Disable Event

func (*HvdGfmsEvent) Print

func (event *HvdGfmsEvent) Print()

type IoctlEventCtl

type IoctlEventCtl struct {
	EventId  uint32
	Index    int32
	Flags    uint32
	Occurred uint32
	Count    uint32
	Data     [5]uint32
}

type IoctlEventSummary

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

TODO: Source from switchtec-user

type IoctlPffPort

type IoctlPffPort struct {
	Pff       uint32
	Partition int32
	Port      int32
}

type PortGfmsEvent

type PortGfmsEvent struct {
	PhysPortId uint8
}

Event Data for Switchtec GFMS EP Port Add / Remove Event

func (*PortGfmsEvent) Print

func (event *PortGfmsEvent) Print()

type PortId

type PortId struct {
	Partition  uint8
	Stack      uint8
	Upstream   uint8
	StackId    uint8
	PhysPortId uint8
	LogPortId  uint8
}

Port Identification

func (*PortId) Less

func (p1 *PortId) Less(p2 *PortId) bool

type PortIds

type PortIds []PortId

func (PortIds) Len

func (p PortIds) Len() int

func (PortIds) Less

func (p PortIds) Less(i, j int) bool

func (PortIds) Swap

func (p PortIds) Swap(i, j int)

type PortLinkStat

type PortLinkStat struct {
	Partition uint8
	Stack     uint8
	StackId   uint8
	Upstream  uint8

	PhysPortId uint8
	LogPortId  uint8

	CfgLinkWidth uint8
	NegLinkWidth uint8

	LinkUp    bool
	LinkGen   uint8
	LinkState PortLinkState

	CurLinkRateGBps float64
}

PortLinkStat -

type PortLinkState

type PortLinkState uint16
const (
	PortLinkState_Detect   PortLinkState = 0x0000
	PortLinkState_Polling  PortLinkState = 0x0001
	PortLinkState_Config   PortLinkState = 0x0002
	PortLinkState_L0       PortLinkState = 0x0003
	PortLinkState_Recovery PortLinkState = 0x0004
	PortLinkState_Disable  PortLinkState = 0x0005
	PortLinkState_LoopBack PortLinkState = 0x0006
	PortLinkState_HotReset PortLinkState = 0x0007
	PortLinkState_TxL0s    PortLinkState = 0x0008
	PortLinkState_L1       PortLinkState = 0x0009
	PortLinkState_L2       PortLinkState = 0x000A
	PortLinkState_Unknown  PortLinkState = 0x00FF
)

type SerialNumberSecurityVersionInfo

type SerialNumberSecurityVersionInfo struct {
	ChipSerial                uint32
	KeyManifestSecureVersiion uint32
	BL2SecureVersion          uint32
	MainSecureVersion         uint32
	SecureUnlockVersion       uint32
}

type SubCommand

type SubCommand uint8

SubCommand -

const (
	SetupEventCounterSubCommand      SubCommand = 0
	GetBandwidthCounterSubCommand    SubCommand = 1
	GetEventCounterSubCommand        SubCommand = 2
	GetEventCounterSetupSubCommand   SubCommand = 3
	SetupLatencyCounterSubCommand    SubCommand = 4
	GetLatencyCounterSetupSubCommand SubCommand = 5
	GetLatencyCounterSubCommand      SubCommand = 6
	SetBandwidthCounterSubCommand    SubCommand = 12

	PortBindSubCommand   SubCommand = 1
	PortUnbindSubCommand SubCommand = 2

	PartitionInfoGetAllInfoSubCommand  SubCommand = 0
	PartitionInfoGetMetadataSubCommand SubCommand = 1

	TopologyInfoDumpStartSubCommand     SubCommand = 1
	TopologyInfoDumpStatusGetSubCommand SubCommand = 2
	TopologyInfoDumpDataGetSubCommand   SubCommand = 3
	TopologyInfoDumpFinishSubCommand    SubCommand = 4

	GfmsDumpStartSubCommand  = 1
	GfmsDumpGetSubCommand    = 2
	GfmsDumpFinishSubCommand = 3

	NvmeAdminPassthruStart SubCommand = 1
	NvmeAdminPassthruData  SubCommand = 2
	NvmeAdminPassthruEnd   SubCommand = 3

	ClearGfmsEventsSubCommand SubCommand = 0
	GetGfmsEventsSubCommand   SubCommand = 1
)

Jump to

Keyboard shortcuts

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