ONLP
Open Network Linux Platform APIs
Functions

Functions

int onlp_sfpi_sw_init (void)
 Software initialization of the SFP module.
 
int onlp_sfpi_hw_init (uint32_t flags)
 Hardware initialization of the SFP module. More...
 
int onlp_sfpi_sw_denit (void)
 Deinitialize the chassis software module. More...
 
int onlp_sfpi_bitmap_get (onlp_sfp_bitmap_t *bmap)
 Get the bitmap of SFP-capable port numbers. More...
 
int onlp_sfpi_type_get (onlp_oid_id_t id, onlp_sfp_type_t *rtype)
 Determine the SFP connector type. More...
 
int onlp_sfpi_is_present (onlp_oid_id_t id)
 Determine if an SFP is present. More...
 
int onlp_sfpi_presence_bitmap_get (onlp_sfp_bitmap_t *dst)
 Return the presence bitmap for all SFP ports. More...
 
int onlp_sfpi_rx_los_bitmap_get (onlp_sfp_bitmap_t *dst)
 Return the RX_LOS bitmap for all SFP ports. More...
 
int onlp_sfpi_dev_read (onlp_oid_id_t id, int devaddr, int addr, uint8_t *dst, int len)
 Read bytes from the target device on the given SFP port. More...
 
int onlp_sfpi_dev_write (onlp_oid_id_t id, int devaddr, int addr, uint8_t *src, int len)
 Write bytes to the target device on the given SFP port. More...
 
int onlp_sfpi_dev_readb (onlp_oid_id_t id, int devaddr, int addr)
 Read a byte from the target device on the given SFP port. More...
 
int onlp_sfpi_dev_writeb (onlp_oid_id_t id, int devaddr, int addr, uint8_t value)
 Write a byte to the target device on the given SFP port. More...
 
int onlp_sfpi_dev_readw (onlp_oid_id_t id, int devaddr, int addr)
 Read a word from the target device on the given SFP port. More...
 
int onlp_sfpi_dev_writew (onlp_oid_id_t id, int devaddr, int addr, uint16_t value)
 Write a word to the target device on the given SFP port. More...
 
int onlp_sfpi_post_insert (onlp_oid_id_t id, sff_info_t *info)
 Perform any actions required after an SFP is inserted. More...
 
int onlp_sfpi_control_supported (onlp_oid_id_t id, onlp_sfp_control_t control, int *rv)
 Returns whether or not the given control is supported on the given port. More...
 
int onlp_sfpi_control_set (onlp_oid_id_t id, onlp_sfp_control_t control, int value)
 Set an SFP control. More...
 
int onlp_sfpi_control_get (onlp_oid_id_t id, onlp_sfp_control_t control, int *value)
 Get an SFP control. More...
 
int onlp_sfpi_port_map (onlp_oid_id_t id, int *rport)
 Remap SFP user SFP port numbers before calling the SFPI interface. More...
 
int onlp_sfpi_hdr_get (onlp_oid_id_t id, onlp_oid_hdr_t *hdr)
 Get the SFP's OID header. More...
 

Detailed Description

Function Documentation

◆ onlp_sfpi_bitmap_get()

int onlp_sfpi_bitmap_get ( onlp_sfp_bitmap_t bmap)

Get the bitmap of SFP-capable port numbers.

Parameters
[out]bmapReceives the bitmap.

◆ onlp_sfpi_control_get()

int onlp_sfpi_control_get ( onlp_oid_id_t  id,
onlp_sfp_control_t  control,
int *  value 
)

Get an SFP control.

Parameters
idThe SFP Port ID.
controlThe control
[out]valueReceives the current value.

◆ onlp_sfpi_control_set()

int onlp_sfpi_control_set ( onlp_oid_id_t  id,
onlp_sfp_control_t  control,
int  value 
)

Set an SFP control.

Parameters
idThe SFP Port ID.
controlThe control.
valueThe value.

◆ onlp_sfpi_control_supported()

int onlp_sfpi_control_supported ( onlp_oid_id_t  id,
onlp_sfp_control_t  control,
int *  rv 
)

Returns whether or not the given control is supported on the given port.

Parameters
idThe SFP Port ID.
controlThe control.
[out]rvReceives 1 if supported, 0 if not supported.
Note
This provided for convenience and is optional. If you implement this function your control_set and control_get APIs will not be called on unsupported ports.

◆ onlp_sfpi_dev_read()

int onlp_sfpi_dev_read ( onlp_oid_id_t  id,
int  devaddr,
int  addr,
uint8_t *  dst,
int  len 
)

Read bytes from the target device on the given SFP port.

Parameters
idThe SFP Port ID.
devaddrThe device address.
addrRead offset.
[out]dstReceives the data.
lenRead length.
Returns
The number of bytes read or ONLP_STATUS_E_* no error.

◆ onlp_sfpi_dev_readb()

int onlp_sfpi_dev_readb ( onlp_oid_id_t  id,
int  devaddr,
int  addr 
)

Read a byte from the target device on the given SFP port.

Parameters
idThe SFP Port ID.
devaddrThe device address.
addrThe read address.
Returns
The byte on success or ONLP_STATUS_E* on error.

◆ onlp_sfpi_dev_readw()

int onlp_sfpi_dev_readw ( onlp_oid_id_t  id,
int  devaddr,
int  addr 
)

Read a word from the target device on the given SFP port.

Parameters
idThe SFP Port ID.
devaddrThe device address.
addrThe read address.
Returns
The word if successful, ONLP_STATUS_E* on error.

◆ onlp_sfpi_dev_write()

int onlp_sfpi_dev_write ( onlp_oid_id_t  id,
int  devaddr,
int  addr,
uint8_t *  src,
int  len 
)

Write bytes to the target device on the given SFP port.

Parameters
idThe SFP Port ID.
devaddrThe device address.
addrWrite offset.
srcThe bytes to write.
lenWrite length.

◆ onlp_sfpi_dev_writeb()

int onlp_sfpi_dev_writeb ( onlp_oid_id_t  id,
int  devaddr,
int  addr,
uint8_t  value 
)

Write a byte to the target device on the given SFP port.

Parameters
idThe SFP Port ID.
devaddrThe device address.
addrThe write address.
valueThe write value.

◆ onlp_sfpi_dev_writew()

int onlp_sfpi_dev_writew ( onlp_oid_id_t  id,
int  devaddr,
int  addr,
uint16_t  value 
)

Write a word to the target device on the given SFP port.

Parameters
idThe SFP Port ID.
devaddrThe device address.
addrThe write address.
valueThe write value.

◆ onlp_sfpi_hdr_get()

int onlp_sfpi_hdr_get ( onlp_oid_id_t  id,
onlp_oid_hdr_t hdr 
)

Get the SFP's OID header.

Parameters
idThe SFP oid.
[out]hdrReceives the header.

◆ onlp_sfpi_hw_init()

int onlp_sfpi_hw_init ( uint32_t  flags)

Hardware initialization of the SFP module.

Parameters
flagsThe hardware initialization flags.

◆ onlp_sfpi_is_present()

int onlp_sfpi_is_present ( onlp_oid_id_t  id)

Determine if an SFP is present.

Parameters
idThe SFP Port ID.
Returns
1 if present
0 if absent
An error condition.

◆ onlp_sfpi_port_map()

int onlp_sfpi_port_map ( onlp_oid_id_t  id,
int *  rport 
)

Remap SFP user SFP port numbers before calling the SFPI interface.

Parameters
idThe SFP Port ID.
[out]rportReceives the new port.
Note
This function will be called to remap the user SFP port number to the number returned in rport before the SFPI functions are called. This is an optional convenience for platforms with dynamic or variant physical SFP numbering.

◆ onlp_sfpi_post_insert()

int onlp_sfpi_post_insert ( onlp_oid_id_t  id,
sff_info_t *  info 
)

Perform any actions required after an SFP is inserted.

Parameters
idThe SFP Port ID.
infoThe SFF Module information structure.
Note
This function is optional. If your platform must adjust equalizer or preemphasis settings internally then this function should be implemented as the trigger.

◆ onlp_sfpi_presence_bitmap_get()

int onlp_sfpi_presence_bitmap_get ( onlp_sfp_bitmap_t dst)

Return the presence bitmap for all SFP ports.

Parameters
[out]dstReceives the presence bitmap.

◆ onlp_sfpi_rx_los_bitmap_get()

int onlp_sfpi_rx_los_bitmap_get ( onlp_sfp_bitmap_t dst)

Return the RX_LOS bitmap for all SFP ports.

Parameters
[out]dstReceives the RX_LOS bitmap.

◆ onlp_sfpi_sw_denit()

int onlp_sfpi_sw_denit ( void  )

Deinitialize the chassis software module.

Note
The primary purpose of this API is to properly deallocate any resources used by the module in order faciliate detection of real resouce leaks.

◆ onlp_sfpi_type_get()

int onlp_sfpi_type_get ( onlp_oid_id_t  id,
onlp_sfp_type_t rtype 
)

Determine the SFP connector type.

Parameters
idThe SFP Port ID.
[out]rtypeReceives the connector type.