PDK API Guide for J721E
mdio_priv.h File Reference

Introduction

This file contains private type definitions and helper macros for the MDIO port module which are meant for internal use in Enet Per drivers.

Go to the source code of this file.

Data Structures

struct  Mdio_PhyStatus
 MDIO PHY status. More...
 
struct  Mdio_Callbacks
 MDIO callback functions. More...
 
struct  Mdio_Obj
 MDIO port object. More...
 

Macros

#define MDIO_PRIVATE_IOCTL(x)
 Helper macro to create private IOCTL commands for MDIO module. More...
 
#define MDIO_FEATURE_CLAUSE45   (ENET_BIT(0U))
 MDIO Clause-45 feature mask. More...
 

Typedefs

typedef void(* Mdio_LinkStateCallback) (EnetMdio_Group group, Mdio_PhyStatus *phyStatus, void *cbArgs)
 MDIO link state change callback function. More...
 
typedef void(* Mdio_UserAccessCallback) (EnetMdio_Group group, uint8_t phyAddr, void *cbArgs)
 MDIO user access completion callback function. More...
 
typedef Mdio_ObjMdio_Handle
 MDIO module handle. More...
 

Enumerations

enum  Mdio_PrivIoctls { MDIO_IOCTL_HANDLE_INTR = MDIO_PRIVATE_IOCTL(0U) }
 MDIO private IOCTL commands. More...
 

Functions

int32_t Mdio_open (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
 Open and initialize MDIO. More...
 
int32_t Mdio_rejoin (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId)
 Rejoin a running MDIO. More...
 
int32_t Mdio_ioctl (EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
 Run an IOCTL operation on MDIO. More...
 
int32_t Mdio_ioctlManualMode (EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
 Run an IOCTL operation on MDIO when MDIO manual mode is enabled. More...
 
void Mdio_close (EnetMod_Handle hMod)
 Close MDIO. More...
 

Macro Definition Documentation

◆ MDIO_PRIVATE_IOCTL

#define MDIO_PRIVATE_IOCTL (   x)
Value:
ENET_IOCTL_MDIO_BASE | \
ENET_IOCTL_PER_CPSW | \
ENET_IOCTL_MIN(x))
Definition: enet_ioctl.h:170

Helper macro to create private IOCTL commands for MDIO module.

◆ MDIO_FEATURE_CLAUSE45

#define MDIO_FEATURE_CLAUSE45   (ENET_BIT(0U))

MDIO Clause-45 feature mask.

Typedef Documentation

◆ Mdio_LinkStateCallback

typedef void(* Mdio_LinkStateCallback) (EnetMdio_Group group, Mdio_PhyStatus *phyStatus, void *cbArgs)

MDIO link state change callback function.

Callback for the MDIO link state change interrupt (MDIO_LINKINT). This callback is invoked from interrupt context.

Parameters
groupUser channel or group
phyStatusPHY status: alive and linked masks
cbArgsCallback function arguments

◆ Mdio_UserAccessCallback

typedef void(* Mdio_UserAccessCallback) (EnetMdio_Group group, uint8_t phyAddr, void *cbArgs)

MDIO user access completion callback function.

Parameters
groupUser channel or group
phyAddrAddress of the PHY that completed access
cbArgsCallback function arguments

◆ Mdio_Handle

MDIO module handle.

Enumeration Type Documentation

◆ Mdio_PrivIoctls

MDIO private IOCTL commands.

Enumerator
MDIO_IOCTL_HANDLE_INTR 

Handle MDIO_INTR which combines MDIO_LINKINT and MDIO_USERINT events.

IOCTL parameters: inArgs: Mdio_Callbacks outArgs: None

Function Documentation

◆ Mdio_open()

int32_t Mdio_open ( EnetMod_Handle  hMod,
Enet_Type  enetType,
uint32_t  instId,
const void *  cfg,
uint32_t  cfgSize 
)

Open and initialize MDIO.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
cfgConfiguration parameters
cfgSizeSize of the configuration parameters
Returns
Enet_ErrorCodes

◆ Mdio_rejoin()

int32_t Mdio_rejoin ( EnetMod_Handle  hMod,
Enet_Type  enetType,
uint32_t  instId 
)

Rejoin a running MDIO.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
Returns
Enet_ErrorCodes

◆ Mdio_ioctl()

int32_t Mdio_ioctl ( EnetMod_Handle  hMod,
uint32_t  cmd,
Enet_IoctlPrms prms 
)

Run an IOCTL operation on MDIO.

Parameters
hModEnet Module handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes

◆ Mdio_ioctlManualMode()

int32_t Mdio_ioctlManualMode ( EnetMod_Handle  hMod,
uint32_t  cmd,
Enet_IoctlPrms prms 
)

Run an IOCTL operation on MDIO when MDIO manual mode is enabled.

Parameters
hModEnet Module handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes

◆ Mdio_close()

void Mdio_close ( EnetMod_Handle  hMod)

Close MDIO.

Parameters
hModEnet Module handle