Documentation ¶
Index ¶
- Constants
- func FabricIdConnectionsConnectionIdGet(fabricId string, connectionId string, model *sf.ConnectionV100Connection) error
- func FabricIdConnectionsConnectionIdPatch(fabricId string, connectionId string, model *sf.ConnectionV100Connection) error
- func FabricIdConnectionsGet(fabricId string, model *sf.ConnectionCollectionConnectionCollection) error
- func FabricIdEndpointGroupsEndpointIdGet(fabricId string, groupId string, model *sf.EndpointGroupV130EndpointGroup) error
- func FabricIdEndpointGroupsGet(fabricId string, model *sf.EndpointGroupCollectionEndpointGroupCollection) error
- func FabricIdEndpointsEndpointIdGet(fabricId string, endpointId string, model *sf.EndpointV150Endpoint) error
- func FabricIdEndpointsGet(fabricId string, model *sf.EndpointCollectionEndpointCollection) error
- func FabricIdGet(fabricId string, model *sf.FabricV120Fabric) error
- func FabricIdSwitchesGet(fabricId string, model *sf.SwitchCollectionSwitchCollection) error
- func FabricIdSwitchesSwitchIdGet(fabricId string, switchId string, model *sf.SwitchV140Switch) error
- func FabricIdSwitchesSwitchIdPortsGet(fabricId string, switchId string, model *sf.PortCollectionPortCollection) error
- func FabricIdSwitchesSwitchIdPortsPortIdGet(fabricId string, switchId string, portId string, model *sf.PortV130Port) error
- func Get(model *sf.FabricCollectionFabricCollection) error
- func GetPortPDFID(fabricId, switchId, portId string, controllerId uint16) (uint16, error)
- func GetSwitchDevice(fabricId, switchId string) *switchtec.Device
- func GetSwitchPath(fabricId, switchId string) *string
- func Initialize(log ec.Logger, ctrl SwitchtecControllerInterface) error
- func NewDefaultApiRouter(s Api, c SwitchtecControllerInterface) ec.Router
- func NewFabricMonitor(f *Fabric) *monitor
- func Start() error
- type Api
- type ConfigFile
- type Connection
- type DefaultApiRouter
- type DefaultApiService
- func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdPatch(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsEndpointGroupIdGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsEndpointIdGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdGet(w http.ResponseWriter, r *http.Request)
- func (*DefaultApiService) RedfishV1FabricsGet(w http.ResponseWriter, r *http.Request)
- type Endpoint
- type EndpointGroup
- type Fabric
- func (m *Fabric) EventHandler(e event.Event) error
- func (f *Fabric) FindDownstreamEndpoint(portId, functionId string) (string, error)
- func (f *Fabric) GetDownstreamPortRelativePortIndex(switchId, portId string) (int, error)
- func (f *Fabric) GetSwitchPort(switchId, portId string) (*Port, error)
- func (f *Fabric) ResetEndpoint(switchId, portId string, vfIndex int) error
- type ManagementConfig
- type MockSwitchtecController
- type MockSwitchtecDevice
- func (d *MockSwitchtecDevice) Bind(hostPhysPortId, hostLogPortId uint8, pdfid uint16) error
- func (d *MockSwitchtecDevice) Close()
- func (*MockSwitchtecDevice) Device() *switchtec.Device
- func (d *MockSwitchtecDevice) EnumerateEndpoint(physPortId uint8, handlerFunc func(epPort *switchtec.DumpEpPortDevice) error) error
- func (d *MockSwitchtecDevice) GetEvents() ([]switchtec.GfmsEvent, error)
- func (d *MockSwitchtecDevice) GetFirmwareVersion() (string, error)
- func (d *MockSwitchtecDevice) GetManufacturer() (string, error)
- func (d *MockSwitchtecDevice) GetModel() (string, error)
- func (d *MockSwitchtecDevice) GetPortMetrics() (PortMetrics, error)
- func (d *MockSwitchtecDevice) GetPortStatus() ([]switchtec.PortLinkStat, error)
- func (d *MockSwitchtecDevice) GetSerialNumber() (string, error)
- func (d *MockSwitchtecDevice) Identify() (int32, error)
- func (*MockSwitchtecDevice) Path() *string
- func (d *MockSwitchtecDevice) ResetEndpoint(pdfid uint16) error
- type MockSwitchtecPort
- type Port
- type PortConfig
- type PortMetric
- type PortMetrics
- type Switch
- type SwitchConfig
- type SwitchtecCliController
- type SwitchtecCliDevice
- func (d *SwitchtecCliDevice) Bind(hostPhysPortId, hostLogPortId uint8, pdfid uint16) error
- func (d *SwitchtecCliDevice) Close()
- func (d *SwitchtecCliDevice) Device() *switchtec.Device
- func (d *SwitchtecCliDevice) EnumerateEndpoint(physPortId uint8, handlerFunc func(epPort *switchtec.DumpEpPortDevice) error) error
- func (d *SwitchtecCliDevice) GetEvents() ([]switchtec.GfmsEvent, error)
- func (d *SwitchtecCliDevice) GetFirmwareVersion() (string, error)
- func (d *SwitchtecCliDevice) GetManufacturer() (string, error)
- func (d *SwitchtecCliDevice) GetModel() (string, error)
- func (d *SwitchtecCliDevice) GetPortMetrics() (PortMetrics, error)
- func (d *SwitchtecCliDevice) GetPortStatus() ([]switchtec.PortLinkStat, error)
- func (d *SwitchtecCliDevice) GetSerialNumber() (string, error)
- func (d *SwitchtecCliDevice) Identify() (int32, error)
- func (d *SwitchtecCliDevice) Path() *string
- func (d *SwitchtecCliDevice) ResetEndpoint(pdfid uint16) error
- type SwitchtecController
- type SwitchtecControllerInterface
- type SwitchtecDevice
- func (d *SwitchtecDevice) Bind(hostPhysPortId, hostLogPortId uint8, pdfid uint16) error
- func (d *SwitchtecDevice) Close()
- func (d *SwitchtecDevice) Device() *switchtec.Device
- func (d *SwitchtecDevice) EnumerateEndpoint(id uint8, f func(epPort *switchtec.DumpEpPortDevice) error) error
- func (d *SwitchtecDevice) GetEvents() ([]switchtec.GfmsEvent, error)
- func (d *SwitchtecDevice) GetFirmwareVersion() (string, error)
- func (d *SwitchtecDevice) GetManufacturer() (string, error)
- func (d *SwitchtecDevice) GetModel() (string, error)
- func (d *SwitchtecDevice) GetPortMetrics() (PortMetrics, error)
- func (d *SwitchtecDevice) GetPortStatus() ([]switchtec.PortLinkStat, error)
- func (d *SwitchtecDevice) GetSerialNumber() (string, error)
- func (d *SwitchtecDevice) Identify() (int32, error)
- func (d *SwitchtecDevice) Path() *string
- func (d *SwitchtecDevice) ResetEndpoint(pdfid uint16) error
- type SwitchtecDeviceInterface
Constants ¶
const (
FabricId = "Rabbit"
)
Variables ¶
This section is empty.
Functions ¶
func FabricIdConnectionsConnectionIdGet ¶
func FabricIdConnectionsConnectionIdGet(fabricId string, connectionId string, model *sf.ConnectionV100Connection) error
FabricIdConnectionsConnectionIdGet
func FabricIdConnectionsConnectionIdPatch ¶
func FabricIdConnectionsConnectionIdPatch(fabricId string, connectionId string, model *sf.ConnectionV100Connection) error
FabricIdConnectionsConnectionIdPatch -
func FabricIdConnectionsGet ¶
func FabricIdConnectionsGet(fabricId string, model *sf.ConnectionCollectionConnectionCollection) error
FabricIdConnectionsGet -
func FabricIdEndpointGroupsEndpointIdGet ¶
func FabricIdEndpointGroupsEndpointIdGet(fabricId string, groupId string, model *sf.EndpointGroupV130EndpointGroup) error
func FabricIdEndpointGroupsGet ¶
func FabricIdEndpointGroupsGet(fabricId string, model *sf.EndpointGroupCollectionEndpointGroupCollection) error
FabricIdEndpointGroupsGet -
func FabricIdEndpointsEndpointIdGet ¶
func FabricIdEndpointsEndpointIdGet(fabricId string, endpointId string, model *sf.EndpointV150Endpoint) error
FabricIdEndpointsEndpointIdGet -
func FabricIdEndpointsGet ¶
func FabricIdEndpointsGet(fabricId string, model *sf.EndpointCollectionEndpointCollection) error
FabricIdEndpointsGet -
func FabricIdGet ¶
func FabricIdGet(fabricId string, model *sf.FabricV120Fabric) error
FabricIdGet -
func FabricIdSwitchesGet ¶
func FabricIdSwitchesGet(fabricId string, model *sf.SwitchCollectionSwitchCollection) error
FabricIdSwitchesGet -
func FabricIdSwitchesSwitchIdGet ¶
func FabricIdSwitchesSwitchIdGet(fabricId string, switchId string, model *sf.SwitchV140Switch) error
FabricIdSwitchesSwitchIdGet -
func FabricIdSwitchesSwitchIdPortsGet ¶
func FabricIdSwitchesSwitchIdPortsGet(fabricId string, switchId string, model *sf.PortCollectionPortCollection) error
FabricIdSwitchesSwitchIdPortsGet -
func FabricIdSwitchesSwitchIdPortsPortIdGet ¶
func FabricIdSwitchesSwitchIdPortsPortIdGet(fabricId string, switchId string, portId string, model *sf.PortV130Port) error
FabricIdSwitchesSwitchIdPortsPortIdGet -
func GetPortPDFID ¶
GetPortPDFID
func GetSwitchDevice ¶
func GetSwitchPath ¶
func Initialize ¶
func Initialize(log ec.Logger, ctrl SwitchtecControllerInterface) error
Initialize
func NewDefaultApiRouter ¶
func NewDefaultApiRouter(s Api, c SwitchtecControllerInterface) ec.Router
NewDefaultApiRouter -
func NewFabricMonitor ¶
func NewFabricMonitor(f *Fabric) *monitor
The Fabric Monitor is responsible for ensuring that the fabriic and related sub-resource are updated with the latest information from the switch. This runs as a background thread, and periodically queries the fabric.
Types ¶
type Api ¶
type Api interface { RedfishV1FabricsGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdSwitchesGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdSwitchesSwitchIdGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdEndpointsGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdEndpointsEndpointIdGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdEndpointGroupsGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdEndpointGroupsEndpointGroupIdGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdConnectionsGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdConnectionsConnectionIdGet(w http.ResponseWriter, r *http.Request) RedfishV1FabricsFabricIdConnectionsConnectionIdPatch(w http.ResponseWriter, r *http.Request) }
Api - defines an interface for Near-Node Flash related methods
type ConfigFile ¶
type ConfigFile struct { Version string Metadata struct { Name string } ManagementConfig ManagementConfig `yaml:"managementConfig"` Switches []SwitchConfig ManagementPortCount int UpstreamPortCount int DownstreamPortCount int }
func (*ConfigFile) IsManagementRoutingEnabled ¶
func (c *ConfigFile) IsManagementRoutingEnabled() bool
Method returns True if the management configuration has routing enabled, False otherwise. Management Routing is when one PAX is controlled through another device - this is needed on bringup configurations where there is not a Rabbit-P that is connected to both systems.
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
type DefaultApiRouter ¶
type DefaultApiRouter struct {
// contains filtered or unexported fields
}
DefaultApiRouter -
type DefaultApiService ¶
type DefaultApiService struct { }
DefaultApiService -
func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdConnectionsConnectionIdGet -
func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdPatch ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsConnectionIdPatch(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdConnectionsConnectionIdPatch -
func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdConnectionsGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdConnectionsGet -
func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsEndpointGroupIdGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsEndpointGroupIdGet(w http.ResponseWriter, r *http.Request)
func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointGroupsGet(w http.ResponseWriter, r *http.Request)
func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsEndpointIdGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsEndpointIdGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdEndpointsEndpointIdGet -
func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdEndpointsGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdEndpointsGet -
func (*DefaultApiService) RedfishV1FabricsFabricIdGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdGet -
func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdSwitchesGet -
func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdSwitchesSwitchIdGet -
func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdSwitchesSwitchIdPortsGet -
func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdGet ¶
func (*DefaultApiService) RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsFabricIdSwitchesSwitchIdPortsPortIdGet -
func (*DefaultApiService) RedfishV1FabricsGet ¶
func (*DefaultApiService) RedfishV1FabricsGet(w http.ResponseWriter, r *http.Request)
RedfishV1FabricsGet -
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
func GetEndpoint ¶
GetEndpoint - Returns the first endpoint for the given switch port. For USP, there will only ever be one ID. For DSP there will be an endpoint for each Physical and Virtual Functions on the DSP, but the first ID (corresponding to the PF) is what is returned.
func (*Endpoint) ControllerId ¶
func (*Endpoint) Type ¶
func (e *Endpoint) Type() sf.EndpointV150EntityType
type EndpointGroup ¶
type EndpointGroup struct {
// contains filtered or unexported fields
}
Endpoint Group is represents a collection of endpoints and the related Connection. Only one Endpoint Intitator may belong to a group, with the remaining endpoints expected to be Drive types. An Endpoint Group is equivalent to a Host-Virtualization Domain defiend on the Switchtec device, with the exception of the Endpoint Group containing the Processor (i.e Rabbit) - for this EPG contains two, smaller HVDs that point to the switch-local DSPs.
type Fabric ¶
type Fabric struct {
// contains filtered or unexported fields
}
var FabricController *Fabric
Used to provide access to exported functions while protecting the singleton (i.e. manager)
func (*Fabric) FindDownstreamEndpoint ¶
FindDownstreamEndpoint -
func (*Fabric) GetDownstreamPortRelativePortIndex ¶
func (*Fabric) GetSwitchPort ¶
type ManagementConfig ¶
type MockSwitchtecController ¶
type MockSwitchtecController struct {
// contains filtered or unexported fields
}
func (*MockSwitchtecController) Open ¶
func (c *MockSwitchtecController) Open(path string) (SwitchtecDeviceInterface, error)
func (*MockSwitchtecController) SetSwitchNotExists ¶
func (c *MockSwitchtecController) SetSwitchNotExists(switchIdx int)
type MockSwitchtecDevice ¶
type MockSwitchtecDevice struct {
// contains filtered or unexported fields
}
func (*MockSwitchtecDevice) Bind ¶
func (d *MockSwitchtecDevice) Bind(hostPhysPortId, hostLogPortId uint8, pdfid uint16) error
func (*MockSwitchtecDevice) Close ¶
func (d *MockSwitchtecDevice) Close()
func (*MockSwitchtecDevice) Device ¶
func (*MockSwitchtecDevice) Device() *switchtec.Device
func (*MockSwitchtecDevice) EnumerateEndpoint ¶
func (d *MockSwitchtecDevice) EnumerateEndpoint(physPortId uint8, handlerFunc func(epPort *switchtec.DumpEpPortDevice) error) error
func (*MockSwitchtecDevice) GetEvents ¶
func (d *MockSwitchtecDevice) GetEvents() ([]switchtec.GfmsEvent, error)
func (*MockSwitchtecDevice) GetFirmwareVersion ¶
func (d *MockSwitchtecDevice) GetFirmwareVersion() (string, error)
func (*MockSwitchtecDevice) GetManufacturer ¶
func (d *MockSwitchtecDevice) GetManufacturer() (string, error)
func (*MockSwitchtecDevice) GetModel ¶
func (d *MockSwitchtecDevice) GetModel() (string, error)
func (*MockSwitchtecDevice) GetPortMetrics ¶
func (d *MockSwitchtecDevice) GetPortMetrics() (PortMetrics, error)
func (*MockSwitchtecDevice) GetPortStatus ¶
func (d *MockSwitchtecDevice) GetPortStatus() ([]switchtec.PortLinkStat, error)
func (*MockSwitchtecDevice) GetSerialNumber ¶
func (d *MockSwitchtecDevice) GetSerialNumber() (string, error)
func (*MockSwitchtecDevice) Identify ¶
func (d *MockSwitchtecDevice) Identify() (int32, error)
func (*MockSwitchtecDevice) Path ¶
func (*MockSwitchtecDevice) Path() *string
func (*MockSwitchtecDevice) ResetEndpoint ¶
func (d *MockSwitchtecDevice) ResetEndpoint(pdfid uint16) error
type MockSwitchtecPort ¶
type MockSwitchtecPort struct {
// contains filtered or unexported fields
}
type Port ¶
type Port struct {
// contains filtered or unexported fields
}
func (*Port) GetBaseEndpointIndex ¶
func (*Port) Initialize ¶
type PortConfig ¶
type PortMetric ¶
type PortMetric struct { PhysPortId uint8 // NOTE: This is a terrible definition in the switchtec package - these are raw Tx/Rx counter values // that can be _used_ for calculating the bandwidth. Think about renaming this in the switchtec package // to something like "PortMetrics" switchtec.BandwidthCounter }
type PortMetrics ¶
type PortMetrics []PortMetric
type Switch ¶
type Switch struct { DEBUG_NEXT_SWITCH_LOG_PORT_ID int // contains filtered or unexported fields }
type SwitchConfig ¶
type SwitchtecCliController ¶
type SwitchtecCliController struct{}
func (SwitchtecCliController) Exists ¶
func (c SwitchtecCliController) Exists(path string) bool
func (SwitchtecCliController) Open ¶
func (c SwitchtecCliController) Open(path string) (SwitchtecDeviceInterface, error)
type SwitchtecCliDevice ¶
type SwitchtecCliDevice struct {
// contains filtered or unexported fields
}
func (*SwitchtecCliDevice) Bind ¶
func (d *SwitchtecCliDevice) Bind(hostPhysPortId, hostLogPortId uint8, pdfid uint16) error
func (*SwitchtecCliDevice) Close ¶
func (d *SwitchtecCliDevice) Close()
func (*SwitchtecCliDevice) Device ¶
func (d *SwitchtecCliDevice) Device() *switchtec.Device
func (*SwitchtecCliDevice) EnumerateEndpoint ¶
func (d *SwitchtecCliDevice) EnumerateEndpoint(physPortId uint8, handlerFunc func(epPort *switchtec.DumpEpPortDevice) error) error
func (*SwitchtecCliDevice) GetEvents ¶
func (d *SwitchtecCliDevice) GetEvents() ([]switchtec.GfmsEvent, error)
func (*SwitchtecCliDevice) GetFirmwareVersion ¶
func (d *SwitchtecCliDevice) GetFirmwareVersion() (string, error)
func (*SwitchtecCliDevice) GetManufacturer ¶
func (d *SwitchtecCliDevice) GetManufacturer() (string, error)
func (*SwitchtecCliDevice) GetModel ¶
func (d *SwitchtecCliDevice) GetModel() (string, error)
func (*SwitchtecCliDevice) GetPortMetrics ¶
func (d *SwitchtecCliDevice) GetPortMetrics() (PortMetrics, error)
func (*SwitchtecCliDevice) GetPortStatus ¶
func (d *SwitchtecCliDevice) GetPortStatus() ([]switchtec.PortLinkStat, error)
func (*SwitchtecCliDevice) GetSerialNumber ¶
func (d *SwitchtecCliDevice) GetSerialNumber() (string, error)
func (*SwitchtecCliDevice) Identify ¶
func (d *SwitchtecCliDevice) Identify() (int32, error)
func (*SwitchtecCliDevice) Path ¶
func (d *SwitchtecCliDevice) Path() *string
func (*SwitchtecCliDevice) ResetEndpoint ¶
func (d *SwitchtecCliDevice) ResetEndpoint(pdfid uint16) error
type SwitchtecController ¶
type SwitchtecController struct{}
func (SwitchtecController) Exists ¶
func (SwitchtecController) Exists(path string) bool
func (SwitchtecController) Open ¶
func (SwitchtecController) Open(path string) (SwitchtecDeviceInterface, error)
type SwitchtecControllerInterface ¶
type SwitchtecControllerInterface interface {
Open(path string) (SwitchtecDeviceInterface, error)
}
func NewMockSwitchtecController ¶
func NewMockSwitchtecController() SwitchtecControllerInterface
func NewSwitchtecCliController ¶
func NewSwitchtecCliController() SwitchtecControllerInterface
func NewSwitchtecController ¶
func NewSwitchtecController() SwitchtecControllerInterface
type SwitchtecDevice ¶
type SwitchtecDevice struct {
// contains filtered or unexported fields
}
func (*SwitchtecDevice) Bind ¶
func (d *SwitchtecDevice) Bind(hostPhysPortId, hostLogPortId uint8, pdfid uint16) error
func (*SwitchtecDevice) Close ¶
func (d *SwitchtecDevice) Close()
func (*SwitchtecDevice) Device ¶
func (d *SwitchtecDevice) Device() *switchtec.Device
func (*SwitchtecDevice) EnumerateEndpoint ¶
func (d *SwitchtecDevice) EnumerateEndpoint(id uint8, f func(epPort *switchtec.DumpEpPortDevice) error) error
func (*SwitchtecDevice) GetEvents ¶
func (d *SwitchtecDevice) GetEvents() ([]switchtec.GfmsEvent, error)
func (*SwitchtecDevice) GetFirmwareVersion ¶
func (d *SwitchtecDevice) GetFirmwareVersion() (string, error)
func (*SwitchtecDevice) GetManufacturer ¶
func (d *SwitchtecDevice) GetManufacturer() (string, error)
func (*SwitchtecDevice) GetModel ¶
func (d *SwitchtecDevice) GetModel() (string, error)
func (*SwitchtecDevice) GetPortMetrics ¶
func (d *SwitchtecDevice) GetPortMetrics() (PortMetrics, error)
func (*SwitchtecDevice) GetPortStatus ¶
func (d *SwitchtecDevice) GetPortStatus() ([]switchtec.PortLinkStat, error)
func (*SwitchtecDevice) GetSerialNumber ¶
func (d *SwitchtecDevice) GetSerialNumber() (string, error)
func (*SwitchtecDevice) Identify ¶
func (d *SwitchtecDevice) Identify() (int32, error)
func (*SwitchtecDevice) Path ¶
func (d *SwitchtecDevice) Path() *string
func (*SwitchtecDevice) ResetEndpoint ¶
func (d *SwitchtecDevice) ResetEndpoint(pdfid uint16) error
type SwitchtecDeviceInterface ¶
type SwitchtecDeviceInterface interface { // these are ugly getters for the nvme devices to get attributes // about the device interface. Not sure how to make this less crap // without adding an unnecessarily large abstraction. I'll keep it // for now until something better is found. Device() *switchtec.Device Path() *string Close() Identify() (int32, error) GetFirmwareVersion() (string, error) GetModel() (string, error) GetManufacturer() (string, error) GetSerialNumber() (string, error) GetPortStatus() ([]switchtec.PortLinkStat, error) GetPortMetrics() (PortMetrics, error) GetEvents() ([]switchtec.GfmsEvent, error) EnumerateEndpoint(uint8, func(epPort *switchtec.DumpEpPortDevice) error) error ResetEndpoint(uint16) error Bind(uint8, uint8, uint16) error }