PDK API Guide for J721E
icssg_priv.h File Reference

Introduction

This file contains the private type definitions and helper macros for the ICSSG peripheral.

Go to the source code of this file.

Data Structures

struct  Icssg_evtCbInfo
 Icssg event callback info structure. More...
 
struct  Icssg_Pruss
 ICSS_PRU object. More...
 
struct  Icssg_Fw
 ICSSG firmware. More...
 
struct  Icssg_FwPoolMem
 ICSSG buffer pool memories. More...
 
struct  Icssg_IoctlCmd_s
 IOCTL command structure used to communicate with ICSSG. More...
 
struct  Icssg_IoctlCmdResp
 IOCTL command response structure used to communicate with ICSSG. More...
 
struct  Icssg_Obj
 Icssg per object. More...
 

Macros

#define ICSSG_PRUSS_ID_0   (0U)
 PRU ICSS subsystem instance 0. More...
 
#define ICSSG_PRUSS_ID_1   (1U)
 PRU ICSS subsystem instance 1. More...
 
#define ICSSG_PRUSS_ID_2   (2U)
 PRU ICSS subsystem instance 2. More...
 
#define ICSSG_CACHELINE_ALIGNMENT   (64U)
 Cache alignment used for IOCTL command structure. More...
 

Typedefs

typedef Icssg_ObjIcssg_Handle
 MAC port module handle. More...
 

Functions

struct Icssg_IoctlCmd_s __attribute__ ((packed)) Icssg_IoctlCmd
 IOCTL command structure used to communicate with ICSSG. More...
 
void Icssg_initCfg (EnetPer_Handle hPer, Enet_Type enetType, void *cfg, uint32_t cfgSize)
 Initialize ICSSG peripheral's configuration parameters. More...
 
int32_t Icssg_open (EnetPer_Handle hPer, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
 Open and initialize the ICSSG Peripheral. More...
 
int32_t Icssg_rejoin (EnetPer_Handle hPer, Enet_Type enetType, uint32_t instId)
 Rejoin a running ICSSG peripheral. More...
 
int32_t Icssg_ioctl (EnetPer_Handle hPer, uint32_t cmd, Enet_IoctlPrms *prms)
 Issue an operation on the ICSSG peripheral. More...
 
void Icssg_poll (EnetPer_Handle hPer, Enet_Event evt, const void *arg, uint32_t argSize)
 Poll for Ethernet events. More...
 
uint64_t Icssg_convertTs (EnetPer_Handle hPer, uint64_t ts)
 Converts ICSSG timestamp to nanoseconds. More...
 
void Icssg_periodicTick (EnetPer_Handle hPer)
 Run periodic tick on the ICSSG peripheral. More...
 
void Icssg_registerEventCb (EnetPer_Handle hPer, Enet_Event evt, uint32_t evtNum, Enet_EventCallback evtCb, void *evtCbArgs)
 
void Icssg_unregisterEventCb (EnetPer_Handle hPer, Enet_Event evt, uint32_t evtNum)
 
void Icssg_close (EnetPer_Handle hPer)
 Close the ICSSG peripheral. More...
 

Variables

uint8_t param
 
uint8_t seqNum
 
uint8_t type
 
uint8_t header
 
uint32_t spare [3]
 

Macro Definition Documentation

◆ ICSSG_PRUSS_ID_0

#define ICSSG_PRUSS_ID_0   (0U)

PRU ICSS subsystem instance 0.

◆ ICSSG_PRUSS_ID_1

#define ICSSG_PRUSS_ID_1   (1U)

PRU ICSS subsystem instance 1.

◆ ICSSG_PRUSS_ID_2

#define ICSSG_PRUSS_ID_2   (2U)

PRU ICSS subsystem instance 2.

◆ ICSSG_CACHELINE_ALIGNMENT

#define ICSSG_CACHELINE_ALIGNMENT   (64U)

Cache alignment used for IOCTL command structure.

Typedef Documentation

◆ Icssg_Handle

MAC port module handle.

Function Documentation

◆ __attribute__()

struct Icssg_IoctlCmd_s __attribute__ ( (packed)  )

IOCTL command structure used to communicate with ICSSG.

◆ Icssg_initCfg()

void Icssg_initCfg ( EnetPer_Handle  hPer,
Enet_Type  enetType,
void *  cfg,
uint32_t  cfgSize 
)

Initialize ICSSG peripheral's configuration parameters.

Initializes the configuration parameter of the ICSSG peripheral.

Parameters
hPerEnet Peripheral handle
enetTypeEnet Peripheral type
cfgConfiguration parameters to be initialized. The config is of type Icssg_Cfg.
cfgSizeSize of the configuration parameters. It must be the size of Icssg_Cfg config structure.

◆ Icssg_open()

int32_t Icssg_open ( EnetPer_Handle  hPer,
Enet_Type  enetType,
uint32_t  instId,
const void *  cfg,
uint32_t  cfgSize 
)

Open and initialize the ICSSG Peripheral.

Opens and initializes the ICSSG peripheral with the configuration parameters provided by the caller.

Parameters
hPerEnet Peripheral handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
cfgConfiguration parameters to be initialized. The config is of type Icssg_Cfg.
cfgSizeSize of the configuration parameters. It must be the size of Icssg_Cfg config structure.
Returns
Enet_ErrorCodes

◆ Icssg_rejoin()

int32_t Icssg_rejoin ( EnetPer_Handle  hPer,
Enet_Type  enetType,
uint32_t  instId 
)

Rejoin a running ICSSG peripheral.

This operation is not supported by the ICSSG peripheral. Calling this function will return ENET_ENOTSUPPORTED.

Parameters
hPerEnet Peripheral handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
Return values
ENET_ENOTSUPPORTED

◆ Icssg_ioctl()

int32_t Icssg_ioctl ( EnetPer_Handle  hPer,
uint32_t  cmd,
Enet_IoctlPrms prms 
)

Issue an operation on the ICSSG peripheral.

Issues a control operation on the ICSSG peripheral.

Parameters
hPerEnet Peripheral handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes

◆ Icssg_poll()

void Icssg_poll ( EnetPer_Handle  hPer,
Enet_Event  evt,
const void *  arg,
uint32_t  argSize 
)

Poll for Ethernet events.

Unblocking poll for the events specified in evt. ICSSG uses this function to poll for completion of asynchronous IOCTLs.

Parameters
hPerEnet Peripheral handle
evtEvent type
argPointer to the poll argument. This is specific to the poll event type
argSizeSize of arg

◆ Icssg_convertTs()

uint64_t Icssg_convertTs ( EnetPer_Handle  hPer,
uint64_t  ts 
)

Converts ICSSG timestamp to nanoseconds.

ICSSG timestamp encodes IEP count low/high and rollover count as bit fields in the 64-bit value returned by ICSSG. This value needs to be converted to nanoseconds before application can consume it.

Parameters
hPerEnet Peripheral handle
tsTimestamp value, definition is peripheral specific
Returns
Nanoseconds value.

◆ Icssg_periodicTick()

void Icssg_periodicTick ( EnetPer_Handle  hPer)

Run periodic tick on the ICSSG peripheral.

Run PHY periodic tick on the ICSSG peripheral. The peripheral driver in turn runs the periodic tick operation on all opened PHYs.

Parameters
hPerEnet Peripheral handle

◆ Icssg_registerEventCb()

void Icssg_registerEventCb ( EnetPer_Handle  hPer,
Enet_Event  evt,
uint32_t  evtNum,
Enet_EventCallback  evtCb,
void *  evtCbArgs 
)

◆ Icssg_unregisterEventCb()

void Icssg_unregisterEventCb ( EnetPer_Handle  hPer,
Enet_Event  evt,
uint32_t  evtNum 
)

◆ Icssg_close()

void Icssg_close ( EnetPer_Handle  hPer)

Close the ICSSG peripheral.

Closes the ICSSG peripheral.

Parameters
hPerEnet Peripheral handle

Variable Documentation

◆ param

uint8_t param

Command parameter

◆ seqNum

uint8_t seqNum

Sequence number

◆ type

uint8_t type

Command type

◆ header

uint8_t header

Command header

◆ spare

uint32_t spare[3]

Spare data. Used for commands that take additional arguments