dpll_netlink

package
v0.0.0-...-cba9a52 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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DPLL_A_TYPES = iota
	DPLL_A_ID
	DPLL_A_MODULE_NAME
	DPLL_A_PAD
	DPLL_A_CLOCK_ID
	DPLL_A_MODE
	DPLL_A_MODE_SUPPORTED
	DPLL_A_LOCK_STATUS
	DPLL_A_TEMP
	DPLL_A_TYPE

	DPLL_A_MAX = __DPLL_A_MAX - 1
)
View Source
const (
	DPLL_A_PIN_TYPES = iota

	DPLL_A_PIN_ID
	DPLL_A_PIN_PARENT_ID
	DPLL_A_PIN_MODULE_NAME
	DPLL_A_PIN_PAD
	DPLL_A_PIN_CLOCK_ID
	DPLL_A_PIN_BOARD_LABEL
	DPLL_A_PIN_PANEL_LABEL
	DPLL_A_PIN_PACKAGE_LABEL
	DPLL_A_PIN_TYPE
	DPLL_A_PIN_DIRECTION
	DPLL_A_PIN_FREQUENCY
	DPLL_A_PIN_FREQUENCY_SUPPORTED
	DPLL_A_PIN_FREQUENCY_MIN
	DPLL_A_PIN_FREQUENCY_MAX
	DPLL_A_PIN_PRIO
	DPLL_A_PIN_STATE
	DPLL_A_PIN_CAPABILITIES
	DPLL_A_PIN_PARENT_DEVICE
	DPLL_A_PIN_PARENT_PIN
	DPLL_A_PIN_PHASE_ADJUST_MIN
	DPLL_A_PIN_PHASE_ADJUST_MAX
	DPLL_A_PIN_PHASE_ADJUST
	DPLL_A_PIN_PHASE_OFFSET
	DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET

	DPLL_A_PIN_MAX = __DPLL_A_PIN_MAX - 1
)
View Source
const (
	DPLL_CMDS = iota
	DPLL_CMD_DEVICE_ID_GET
	DPLL_CMD_DEVICE_GET
	DPLL_CMD_DEVICE_SET
	DPLL_CMD_DEVICE_CREATE_NTF
	DPLL_CMD_DEVICE_DELETE_NTF
	DPLL_CMD_DEVICE_CHANGE_NTF
	DPLL_CMD_PIN_ID_GET
	DPLL_CMD_PIN_GET
	DPLL_CMD_PIN_SET
	DPLL_CMD_PIN_CREATE_NTF
	DPLL_CMD_PIN_DELETE_NTF
	DPLL_CMD_PIN_CHANGE_NTF

	DPLL_CMD_MAX = (__DPLL_CMD_MAX - 1)
)
View Source
const DPLL_MCGRP_MONITOR = "monitor"
View Source
const DPLL_PHASE_OFFSET_DIVIDER = 1000
View Source
const DPLL_TEMP_DIVIDER = 1000

Variables

This section is empty.

Functions

func GetDpllType

func GetDpllType(tp uint32) string

GetDpllType returns DPLL type as a string

func GetLockStatus

func GetLockStatus(ls uint32) string

GetLockStatus returns DPLL lock status as a string

func GetMode

func GetMode(md uint32) string

GetMode returns DPLL mode as a string

func GetPinCapabilities

func GetPinCapabilities(c uint32) string

GetPinCapabilities returns DPLL pin capabilities as a csv

func GetPinDirection

func GetPinDirection(d uint32) string

GetPinDirection returns DPLL pin direction as a string

func GetPinInfoHR

func GetPinInfoHR(reply *DoPinGetReply) ([]byte, error)

GetPinInfoHR returns human-readable pin status

func GetPinState

func GetPinState(s uint32) string

GetPinState returns DPLL pin state as a string

func GetPinType

func GetPinType(tp uint32) string

GetPinType returns DPLL pin type as a string

Types

type Conn

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

A Conn is a connection to netlink family "dpll".

func Dial

func Dial(cfg *netlink.Config) (*Conn, error)

Dial opens a Conn for netlink family "dpll". Any options are passed directly to the underlying netlink package.

func (*Conn) Close

func (c *Conn) Close() error

Close closes the Conn's underlying netlink connection.

func (*Conn) DoDeviceGet

func (c *Conn) DoDeviceGet(req DoDeviceGetRequest) (*DoDeviceGetReply, error)

DoDeviceGet wraps the "device-get" operation: Get list of DPLL devices (dump) or attributes of a single dpll device

func (*Conn) DoDeviceIdGet

func (c *Conn) DoDeviceIdGet(req DoDeviceIdGetRequest) (*DoDeviceIdGetReply, error)

DoDeviceIdGet wraps the "device-id-get" operation: Get id of dpll device that matches given attributes

func (*Conn) DoPinGet

func (c *Conn) DoPinGet(req DoPinGetRequest) (*DoPinGetReply, error)

DoPinGet wraps the "pin-get" operation:

func (*Conn) DumpDeviceGet

func (c *Conn) DumpDeviceGet() ([]*DoDeviceGetReply, error)

func (*Conn) DumpPinGet

func (c *Conn) DumpPinGet() ([]*DoPinGetReply, error)

func (*Conn) GetGenetlinkConn

func (c *Conn) GetGenetlinkConn() *genetlink.Conn

GetGenetlinkConn exposes genetlink connection

func (*Conn) GetGenetlinkFamily

func (c *Conn) GetGenetlinkFamily() genetlink.Family

GetGenetlinkFamily exposes genetlink family

func (*Conn) GetMcastGroupId

func (c *Conn) GetMcastGroupId(mcGroup string) (id uint32, found bool)

GetMcastGroupId finds the requested multicast group in the family and returns its ID

type DoDeviceGetReply

type DoDeviceGetReply struct {
	Id            uint32
	ModuleName    string
	Mode          uint32
	ModeSupported uint32
	LockStatus    uint32
	Temp          int32
	ClockId       uint64
	Type          uint32
}

DoDeviceGetReply is used with the DoDeviceGet method.

func ParseDeviceReplies

func ParseDeviceReplies(msgs []genetlink.Message) ([]*DoDeviceGetReply, error)

type DoDeviceGetRequest

type DoDeviceGetRequest struct {
	Id         uint32
	ModuleName string
}

DoDeviceGetRequest is used with the DoDeviceGet method.

type DoDeviceIdGetReply

type DoDeviceIdGetReply struct {
	Id uint32
}

DoDeviceIdGetReply is used with the DoDeviceIdGet method.

type DoDeviceIdGetRequest

type DoDeviceIdGetRequest struct {
	// TODO: field "ModuleName", type "string"
	ClockId uint64
	Type    uint8
}

DoDeviceIdGetRequest is used with the DoDeviceIdGet method.

type DoPinGetReply

type DoPinGetReply struct {
	Id                        uint32
	ClockId                   uint64
	BoardLabel                string
	PanelLabel                string
	PackageLabel              string
	Type                      uint32
	Frequency                 uint64
	FrequencySupported        FrequencyRange
	Capabilities              uint32
	ParentDevice              PinParentDevice
	ParentPin                 PinParentPin
	PhaseAdjustMin            int32
	PhaseAdjustMax            int32
	PhaseAdjust               int32
	FractionalFrequencyOffset int
	ModuleName                string
}

DoPinGetReply is used with the DoPinGet method.

func ParsePinReplies

func ParsePinReplies(msgs []genetlink.Message) ([]*DoPinGetReply, error)

type DoPinGetReplyHR

type DoPinGetReplyHR struct {
	Id                        uint32            `json:"id"`
	ClockId                   uint64            `json:"clockId"`
	BoardLabel                string            `json:"boardLabel"`
	PanelLabel                string            `json:"panelLabel"`
	PackageLabel              string            `json:"packageLabel"`
	Type                      string            `json:"type"`
	Frequency                 uint64            `json:"frequency"`
	FrequencySupported        FrequencyRange    `json:"frequencySupported"`
	Capabilities              string            `json:"capabilities"`
	ParentDevice              PinParentDeviceHR `json:"pinParentDevice"`
	ParentPin                 PinParentPinHR    `json:"pinParentPin"`
	PhaseAdjustMin            int32             `json:"phaseAdjustMin"`
	PhaseAdjustMax            int32             `json:"phaseAdjustMax"`
	PhaseAdjust               int32             `json:"phaseAdjust"`
	FractionalFrequencyOffset int               `json:"fractionalFrequencyOffset"`
	ModuleName                string            `json:"moduleName"`
}

DoPinGetReply is used with the DoPinGet method.

type DoPinGetRequest

type DoPinGetRequest struct {
	Id uint32
}

DoPinGetRequest is used with the DoPinGet method.

type DpllStatusHR

type DpllStatusHR struct {
	Id            uint32
	ModuleName    string
	Mode          string
	ModeSupported string
	LockStatus    string
	ClockId       string
	Type          string
}

DpllStatusHR represents human-readable DPLL status

func GetDpllStatusHR

func GetDpllStatusHR(reply *DoDeviceGetReply) DpllStatusHR

GetDpllStatusHR returns human-readable DPLL status

type FrequencyRange

type FrequencyRange struct {
	FrequencyMin uint64 `json:"frequencyMin"`
	FrequencyMax uint64 `json:"frequencyMax"`
}

FrequencyRange contains nested netlink attributes.

type PinParentDevice

type PinParentDevice struct {
	ParentId    uint32
	Direction   uint32
	Prio        uint32
	State       uint32
	PhaseOffset int64
}

PinParentDevice contains nested netlink attributes.

type PinParentDeviceHR

type PinParentDeviceHR struct {
	ParentId    uint32 `json:"parentId"`
	Direction   string `json:"direction"`
	Prio        uint32 `json:"prio"`
	State       string `json:"state"`
	PhaseOffset int64  `json:"phaseOffset"`
}

PinParentDevice contains nested netlink attributes.

type PinParentPin

type PinParentPin struct {
	ParentId uint32
	State    uint32
}

PinParentPin contains nested netlink attributes.

type PinParentPinHR

type PinParentPinHR struct {
	ParentId uint32 `json:"parentId"`
	State    string `json:"parentState"`
}

PinParentPin contains nested netlink attributes.

Jump to

Keyboard shortcuts

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