Data Structures | Macros | Typedefs | Enumerations
cpsw_mdio.h File Reference

This file contains the structure definitions and function prototypes of the MDIO submodule. More...

#include "cpsw_types.h"

Data Structures

struct  CpswMdio_PhyStatus_s
 MDIO PHY status. More...
 
struct  CpswMdio_Clause22ReadRegInArgs_s
 Input args for CPSW_MDIO_IOCTL_CLAUSE22_READ_REG command. More...
 
struct  CpswMdio_Clause45ReadRegInArgs_s
 Input args for CPSW_MDIO_IOCTL_CLAUSE45_READ_REG command. More...
 
struct  CpswMdio_Clause22WriteRegInArgs_s
 Input args for CPSW_MDIO_IOCTL_CLAUSE22_WRITE_REG command. More...
 
struct  CpswMdio_Clause45WriteRegInArgs_s
 Input args for CPSW_MDIO_IOCTL_CLAUSE45_WRITE_REG command. More...
 
struct  CpswMdio_Version_s
 MDIO hardware version. More...
 
struct  CpswMdio_Config_s
 MDIO module configuration. More...
 

Macros

#define CPSW_MDIO_PUBLIC_IOCTL(x)   (CPSW_IOCTL_MDIO_BASE | CPSW_IOCTL_MIN(x))
 Helper macro to create IOCTL commands for MDIO submodule.
 
#define CPSW_MDIO_PHY_ADDR_MASK(addr)   (1U << (addr))
 Create a MDIO PHY mask from a PHY address.
 
#define CPSW_MDIO_IS_PHY_ADDR_SET(mask, addr)   (((mask) & (1U << (addr))) != 0U)
 Check if the corresponding PHY address mask is set.
 
#define CPSW_MDIO_PHY_ADDR_MASK_NONE   (0x00000000U)
 MDIO PHY address mask for no PHYs present.
 
#define CPSW_MDIO_PHY_ADDR_MASK_ALL   (0xFFFFFFFFU)
 MDIO PHY address mask for all PHYs present.
 
#define CPSW_MDIO_MAX_PHY_CNT   (31U)
 Maximum number of PHYs supported on MDIO bus.
 

Typedefs

typedef enum
CpswMdio_OperatingMode_e 
CpswMdio_OperatingMode
 MDIO operating mode.
 
typedef enum CpswMdio_UserChannel_e CpswMdio_UserChannel
 MDIO user channels (also known as user groups)
 
typedef enum CpswMdio_FrameFormat_s CpswMdio_FrameFormat
 Frame format.
 
typedef enum CpswMdio_Clause45Mmd_e CpswMdio_Clause45Mmd
 Clause-45 MDIO Manageable Device (MMD) addresses.
 
typedef struct CpswMdio_PhyStatus_s CpswMdio_PhyStatus
 MDIO PHY status. More...
 
typedef struct
CpswMdio_Clause22ReadRegInArgs_s 
CpswMdio_Clause22ReadRegInArgs
 Input args for CPSW_MDIO_IOCTL_CLAUSE22_READ_REG command. More...
 
typedef struct
CpswMdio_Clause45ReadRegInArgs_s 
CpswMdio_Clause45ReadRegInArgs
 Input args for CPSW_MDIO_IOCTL_CLAUSE45_READ_REG command. More...
 
typedef struct
CpswMdio_Clause22WriteRegInArgs_s 
CpswMdio_Clause22WriteRegInArgs
 Input args for CPSW_MDIO_IOCTL_CLAUSE22_WRITE_REG command. More...
 
typedef struct
CpswMdio_Clause45WriteRegInArgs_s 
CpswMdio_Clause45WriteRegInArgs
 Input args for CPSW_MDIO_IOCTL_CLAUSE45_WRITE_REG command. More...
 
typedef struct CpswMdio_Version_s CpswMdio_Version
 MDIO hardware version. More...
 
typedef struct CpswMdio_Config_s CpswMdio_Config
 MDIO module configuration. More...
 
typedef struct CpswMdio_Obj_s * CpswMdio_Handle
 MDIO submodule handle. More...
 

Enumerations

enum  CpswMdio_Ioctl_e {
  CPSW_MDIO_IOCTL_GET_VERSION = CPSW_MDIO_PUBLIC_IOCTL(0U), CPSW_MDIO_IOCTL_GET_ALIVE_STATUS = CPSW_MDIO_PUBLIC_IOCTL(1U), CPSW_MDIO_IOCTL_GET_LINK_STATUS = CPSW_MDIO_PUBLIC_IOCTL(2U), CPSW_MDIO_IOCTL_CLAUSE22_READ_REG = CPSW_MDIO_PUBLIC_IOCTL(3U),
  CPSW_MDIO_IOCTL_CLAUSE22_WRITE_REG = CPSW_MDIO_PUBLIC_IOCTL(4U), CPSW_MDIO_IOCTL_CLAUSE45_READ_REG = CPSW_MDIO_PUBLIC_IOCTL(5U), CPSW_MDIO_IOCTL_CLAUSE45_WRITE_REG = CPSW_MDIO_PUBLIC_IOCTL(6U), CPSW_MDIO_IOCTL_CLAUSE22_READ_REG_ASYNC = CPSW_MDIO_PUBLIC_IOCTL(7U),
  CPSW_MDIO_IOCTL_CLAUSE22_WRITE_REG_ASYNC = CPSW_MDIO_PUBLIC_IOCTL(8U), CPSW_MDIO_IOCTL_CLAUSE45_READ_REG_ASYNC = CPSW_MDIO_PUBLIC_IOCTL(9U), CPSW_MDIO_IOCTL_CLAUSE45_WRITE_REG_ASYNC = CPSW_MDIO_PUBLIC_IOCTL(10U), CPSW_MDIO_IOCTL_GET_POLL_ENABLE_MASK = CPSW_MDIO_PUBLIC_IOCTL(11U),
  CPSW_MDIO_IOCTL_PRINT_REGS = CPSW_MDIO_PUBLIC_IOCTL(12U)
}
 MDIO IOCTL commands. More...
 
enum  CpswMdio_OperatingMode_e { CPSW_MDIO_MODE_NORMAL = 0U, CPSW_MDIO_MODE_STATE_CHANGE = 1U, CPSW_MDIO_MODE_MANUAL = 2U }
 MDIO operating mode. More...
 
enum  CpswMdio_UserChannel_e { CPSW_MDIO_USER_CHANNEL_0 = 0U, CPSW_MDIO_USER_CHANNEL_1 = 1U, CPSW_MDIO_USER_CHANNEL_LAST = CPSW_MDIO_USER_CHANNEL_1 }
 MDIO user channels (also known as user groups) More...
 
enum  CpswMdio_FrameFormat_s { CPSW_MDIO_FRAME_FORMAT_CLAUSE22 = 0U, CPSW_MDIO_FRAME_FORMAT_CLAUSE45 = 1U }
 Frame format. More...
 
enum  CpswMdio_Clause45Mmd_e {
  CPSW_MDIO_MMD_PMA_PMD = 1U, CPSW_MDIO_MMD_WIS = 2U, CPSW_MDIO_MMD_PCS = 3U, CPSW_MDIO_MMD_PHY_XS = 4U,
  CPSW_MDIO_MMD_DTE_XS = 5U, CPSW_MDIO_MMD_VENDOR_1 = 30U, CPSW_MDIO_MMD_VENDOR_2 = 31U
}
 Clause-45 MDIO Manageable Device (MMD) addresses. More...
 

Detailed Description

This file contains the structure definitions and function prototypes of the MDIO submodule.


Copyright 2020, Texas Instruments Incorporated