ksz8873_driver.h File Reference

KSZ8873 3-port Ethernet switch. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define KSZ8873_PORT1   1
 
#define KSZ8873_PORT2   2
 
#define KSZ8873_SPI_CMD_WRITE   0x02
 
#define KSZ8873_SPI_CMD_READ   0x03
 
#define KSZ8873_BMCR   0x00
 
#define KSZ8873_BMSR   0x01
 
#define KSZ8873_PHYID1   0x02
 
#define KSZ8873_PHYID2   0x03
 
#define KSZ8873_ANAR   0x04
 
#define KSZ8873_ANLPAR   0x05
 
#define KSZ8873_LINKMD   0x1D
 
#define KSZ8873_PHYSCS   0x1F
 
#define KSZ8873_CHIP_ID0   0x00
 
#define KSZ8873_CHIP_ID1   0x01
 
#define KSZ8873_GLOBAL_CTRL0   0x02
 
#define KSZ8873_GLOBAL_CTRL1   0x03
 
#define KSZ8873_GLOBAL_CTRL2   0x04
 
#define KSZ8873_GLOBAL_CTRL3   0x05
 
#define KSZ8873_GLOBAL_CTRL4   0x06
 
#define KSZ8873_GLOBAL_CTRL5   0x07
 
#define KSZ8873_GLOBAL_CTRL6   0x08
 
#define KSZ8873_GLOBAL_CTRL7   0x09
 
#define KSZ8873_GLOBAL_CTRL8   0x0A
 
#define KSZ8873_GLOBAL_CTRL9   0x0B
 
#define KSZ8873_GLOBAL_CTRL10   0x0C
 
#define KSZ8873_GLOBAL_CTRL11   0x0D
 
#define KSZ8873_GLOBAL_CTRL12   0x0E
 
#define KSZ8873_GLOBAL_CTRL13   0x0F
 
#define KSZ8873_PORT1_CTRL0   0x10
 
#define KSZ8873_PORT1_CTRL1   0x11
 
#define KSZ8873_PORT1_CTRL2   0x12
 
#define KSZ8873_PORT1_CTRL3   0x13
 
#define KSZ8873_PORT1_CTRL4   0x14
 
#define KSZ8873_PORT1_CTRL5   0x15
 
#define KSZ8873_PORT1_Q0_IG_LIMIT   0x16
 
#define KSZ8873_PORT1_Q1_IG_LIMIT   0x17
 
#define KSZ8873_PORT1_Q2_IG_LIMIT   0x18
 
#define KSZ8873_PORT1_Q3_IG_LIMIT   0x19
 
#define KSZ8873_PORT1_PSCS   0x1A
 
#define KSZ8873_PORT1_LINKMD   0x1B
 
#define KSZ8873_PORT1_CTRL12   0x1C
 
#define KSZ8873_PORT1_CTRL13   0x1D
 
#define KSZ8873_PORT1_STAT0   0x1E
 
#define KSZ8873_PORT1_STAT1   0x1F
 
#define KSZ8873_PORT2_CTRL0   0x20
 
#define KSZ8873_PORT2_CTRL1   0x21
 
#define KSZ8873_PORT2_CTRL2   0x22
 
#define KSZ8873_PORT2_CTRL3   0x23
 
#define KSZ8873_PORT2_CTRL4   0x24
 
#define KSZ8873_PORT2_CTRL5   0x25
 
#define KSZ8873_PORT2_Q0_IG_LIMIT   0x26
 
#define KSZ8873_PORT2_Q1_IG_LIMIT   0x27
 
#define KSZ8873_PORT2_Q2_IG_LIMIT   0x28
 
#define KSZ8873_PORT2_Q3_IG_LIMIT   0x29
 
#define KSZ8873_PORT2_PSCS   0x2A
 
#define KSZ8873_PORT2_LINKMD   0x2B
 
#define KSZ8873_PORT2_CTRL12   0x2C
 
#define KSZ8873_PORT2_CTRL13   0x2D
 
#define KSZ8873_PORT2_STAT0   0x2E
 
#define KSZ8873_PORT2_STAT1   0x2F
 
#define KSZ8873_PORT3_CTRL0   0x30
 
#define KSZ8873_PORT3_CTRL1   0x31
 
#define KSZ8873_PORT3_CTRL2   0x32
 
#define KSZ8873_PORT3_CTRL3   0x33
 
#define KSZ8873_PORT3_CTRL4   0x34
 
#define KSZ8873_PORT3_CTRL5   0x35
 
#define KSZ8873_PORT3_Q0_IG_LIMIT   0x36
 
#define KSZ8873_PORT3_Q1_IG_LIMIT   0x37
 
#define KSZ8873_PORT3_Q2_IG_LIMIT   0x38
 
#define KSZ8873_PORT3_Q3_IG_LIMIT   0x39
 
#define KSZ8873_PORT3_STAT0   0x3E
 
#define KSZ8873_PORT3_STAT1   0x3F
 
#define KSZ8873_RESET   0x43
 
#define KSZ8873_TOS_PRIO_CTRL0   0x60
 
#define KSZ8873_TOS_PRIO_CTRL1   0x61
 
#define KSZ8873_TOS_PRIO_CTRL2   0x62
 
#define KSZ8873_TOS_PRIO_CTRL3   0x63
 
#define KSZ8873_TOS_PRIO_CTRL4   0x64
 
#define KSZ8873_TOS_PRIO_CTRL5   0x65
 
#define KSZ8873_TOS_PRIO_CTRL6   0x66
 
#define KSZ8873_TOS_PRIO_CTRL7   0x67
 
#define KSZ8873_TOS_PRIO_CTRL8   0x68
 
#define KSZ8873_TOS_PRIO_CTRL9   0x69
 
#define KSZ8873_TOS_PRIO_CTRL10   0x6A
 
#define KSZ8873_TOS_PRIO_CTRL11   0x6B
 
#define KSZ8873_TOS_PRIO_CTRL12   0x6C
 
#define KSZ8873_TOS_PRIO_CTRL13   0x6D
 
#define KSZ8873_TOS_PRIO_CTRL14   0x6E
 
#define KSZ8873_TOS_PRIO_CTRL15   0x6F
 
#define KSZ8873_MAC_ADDR0   0x70
 
#define KSZ8873_MAC_ADDR1   0x71
 
#define KSZ8873_MAC_ADDR2   0x72
 
#define KSZ8873_MAC_ADDR3   0x73
 
#define KSZ8873_MAC_ADDR4   0x74
 
#define KSZ8873_MAC_ADDR5   0x75
 
#define KSZ8873_UDR1   0x76
 
#define KSZ8873_UDR2   0x77
 
#define KSZ8873_UDR3   0x78
 
#define KSZ8873_IND_ACCESS_CTRL0   0x79
 
#define KSZ8873_IND_ACCESS_CTRL1   0x7A
 
#define KSZ8873_IND_DATA8   0x7B
 
#define KSZ8873_IND_DATA7   0x7C
 
#define KSZ8873_IND_DATA6   0x7D
 
#define KSZ8873_IND_DATA5   0x7E
 
#define KSZ8873_IND_DATA4   0x7F
 
#define KSZ8873_IND_DATA3   0x80
 
#define KSZ8873_IND_DATA2   0x81
 
#define KSZ8873_IND_DATA1   0x82
 
#define KSZ8873_IND_DATA0   0x83
 
#define KSZ8873_MACA1   0x8E
 
#define KSZ8873_MACA2   0x94
 
#define KSZ8873_PORT1_Q0_EG_LIMIT   0x9A
 
#define KSZ8873_PORT1_Q1_EG_LIMIT   0x9B
 
#define KSZ8873_PORT1_Q2_EG_LIMIT   0x9C
 
#define KSZ8873_PORT1_Q3_EG_LIMIT   0x9D
 
#define KSZ8873_PORT2_Q0_EG_LIMIT   0x9E
 
#define KSZ8873_PORT2_Q1_EG_LIMIT   0x9F
 
#define KSZ8873_PORT2_Q2_EG_LIMIT   0xA0
 
#define KSZ8873_PORT2_Q3_EG_LIMIT   0xA1
 
#define KSZ8873_PORT3_Q0_EG_LIMIT   0xA2
 
#define KSZ8873_PORT3_Q1_EG_LIMIT   0xA3
 
#define KSZ8873_PORT3_Q2_EG_LIMIT   0xA4
 
#define KSZ8873_PORT3_Q3_EG_LIMIT   0xA5
 
#define KSZ8873_MODE_INDICATOR   0xA6
 
#define KSZ8873_HIGH_PRIO_PKT_BUF_Q3   0xA7
 
#define KSZ8873_HIGH_PRIO_PKT_BUF_Q2   0xA8
 
#define KSZ8873_HIGH_PRIO_PKT_BUF_Q1   0xA9
 
#define KSZ8873_HIGH_PRIO_PKT_BUF_Q0   0xAA
 
#define KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE1   0xAB
 
#define KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE2   0xAC
 
#define KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE3   0xAD
 
#define KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE4   0xAE
 
#define KSZ8873_PORT1_Q3_TXQ_SPLIT   0xAF
 
#define KSZ8873_PORT1_Q2_TXQ_SPLIT   0xB0
 
#define KSZ8873_PORT1_Q1_TXQ_SPLIT   0xB1
 
#define KSZ8873_PORT1_Q0_TXQ_SPLIT   0xB2
 
#define KSZ8873_PORT2_Q3_TXQ_SPLIT   0xB3
 
#define KSZ8873_PORT2_Q2_TXQ_SPLIT   0xB4
 
#define KSZ8873_PORT2_Q1_TXQ_SPLIT   0xB5
 
#define KSZ8873_PORT2_Q0_TXQ_SPLIT   0xB6
 
#define KSZ8873_PORT3_Q3_TXQ_SPLIT   0xB7
 
#define KSZ8873_PORT3_Q2_TXQ_SPLIT   0xB8
 
#define KSZ8873_PORT3_Q1_TXQ_SPLIT   0xB9
 
#define KSZ8873_PORT3_Q0_TXQ_SPLIT   0xBA
 
#define KSZ8873_INT_EN   0xBB
 
#define KSZ8873_LINK_CHANGE_INT   0xBC
 
#define KSZ8873_FORCE_PAUSE_OFF_LIMIT_EN   0xBD
 
#define KSZ8873_FIBER_SIGNAL_THRESHOLD   0xC0
 
#define KSZ8873_INTERNAL_LDO_CTRL   0xC1
 
#define KSZ8873_INSERT_SRC_PVID   0xC2
 
#define KSZ8873_PWR_MGMT_LED_MODE   0xC3
 
#define KSZ8873_SLEEP_MODE   0xC4
 
#define KSZ8873_FWD_INVALID_VID_FRAME_HOST_MODE   0xC6
 
#define KSZ8873_PORTn_CTRL0(port)   (0x00 + ((port) * 0x10))
 
#define KSZ8873_PORTn_CTRL1(port)   (0x01 + ((port) * 0x10))
 
#define KSZ8873_PORTn_CTRL2(port)   (0x02 + ((port) * 0x10))
 
#define KSZ8873_PORTn_CTRL3(port)   (0x03 + ((port) * 0x10))
 
#define KSZ8873_PORTn_CTRL4(port)   (0x04 + ((port) * 0x10))
 
#define KSZ8873_PORTn_CTRL5(port)   (0x05 + ((port) * 0x10))
 
#define KSZ8873_PORTn_Q0_IG_LIMIT(port)   (0x06 + ((port) * 0x10))
 
#define KSZ8873_PORTn_Q1_IG_LIMIT(port)   (0x07 + ((port) * 0x10))
 
#define KSZ8873_PORTn_Q2_IG_LIMIT(port)   (0x08 + ((port) * 0x10))
 
#define KSZ8873_PORTn_Q3_IG_LIMIT(port)   (0x09 + ((port) * 0x10))
 
#define KSZ8873_PORTn_PSCS(port)   (0x0A + ((port) * 0x10))
 
#define KSZ8873_PORTn_LINKMD(port)   (0x0B + ((port) * 0x10))
 
#define KSZ8873_PORTn_CTRL12(port)   (0x0C + ((port) * 0x10))
 
#define KSZ8873_PORTn_CTRL13(port)   (0x0D + ((port) * 0x10))
 
#define KSZ8873_PORTn_STAT0(port)   (0x0E + ((port) * 0x10))
 
#define KSZ8873_PORTn_STAT1(port)   (0x0F + ((port) * 0x10))
 
#define KSZ8873_PORTn_Q0_EG_LIMIT(port)   (0x96 + ((port) * 0x04))
 
#define KSZ8873_PORTn_Q1_EG_LIMIT(port)   (0x97 + ((port) * 0x04))
 
#define KSZ8873_PORTn_Q2_EG_LIMIT(port)   (0x98 + ((port) * 0x04))
 
#define KSZ8873_PORTn_Q3_EG_LIMIT(port)   (0x99 + ((port) * 0x04))
 
#define KSZ8873_PORTn_Q3_TXQ_SPLIT(port)   (0xAB + ((port) * 0x04))
 
#define KSZ8873_PORTn_Q2_TXQ_SPLIT(port)   (0xAC + ((port) * 0x04))
 
#define KSZ8873_PORTn_Q1_TXQ_SPLIT(port)   (0xAD + ((port) * 0x04))
 
#define KSZ8873_PORTn_Q0_TXQ_SPLIT(port)   (0xAE + ((port) * 0x04))
 
#define KSZ8873_BMCR_RESET   0x8000
 
#define KSZ8873_BMCR_LOOPBACK   0x4000
 
#define KSZ8873_BMCR_FORCE_100   0x2000
 
#define KSZ8873_BMCR_AN_EN   0x1000
 
#define KSZ8873_BMCR_POWER_DOWN   0x0800
 
#define KSZ8873_BMCR_ISOLATE   0x0400
 
#define KSZ8873_BMCR_RESTART_AN   0x0200
 
#define KSZ8873_BMCR_FORCE_FULL_DUPLEX   0x0100
 
#define KSZ8873_BMCR_COL_TEST   0x0080
 
#define KSZ8873_BMCR_HP_MDIX   0x0020
 
#define KSZ8873_BMCR_FORCE_MDI   0x0010
 
#define KSZ8873_BMCR_AUTO_MDIX_DIS   0x0008
 
#define KSZ8873_BMCR_FAR_END_FAULT_DIS   0x0004
 
#define KSZ8873_BMCR_TRANSMIT_DIS   0x0002
 
#define KSZ8873_BMCR_LED_DIS   0x0001
 
#define KSZ8873_BMSR_100BT4   0x8000
 
#define KSZ8873_BMSR_100BTX_FD   0x4000
 
#define KSZ8873_BMSR_100BTX_HD   0x2000
 
#define KSZ8873_BMSR_10BT_FD   0x1000
 
#define KSZ8873_BMSR_10BT_HD   0x0800
 
#define KSZ8873_BMSR_PREAMBLE_SUPPR   0x0040
 
#define KSZ8873_BMSR_AN_COMPLETE   0x0020
 
#define KSZ8873_BMSR_FAR_END_FAULT   0x0010
 
#define KSZ8873_BMSR_AN_CAPABLE   0x0008
 
#define KSZ8873_BMSR_LINK_STATUS   0x0004
 
#define KSZ8873_BMSR_JABBER_TEST   0x0002
 
#define KSZ8873_BMSR_EXTENDED_CAPABLE   0x0001
 
#define KSZ8873_PHYID1_DEFAULT   0x0022
 
#define KSZ8873_PHYID2_DEFAULT   0x1430
 
#define KSZ8873_ANAR_NEXT_PAGE   0x8000
 
#define KSZ8873_ANAR_REMOTE_FAULT   0x2000
 
#define KSZ8873_ANAR_PAUSE   0x0400
 
#define KSZ8873_ANAR_100BTX_FD   0x0100
 
#define KSZ8873_ANAR_100BTX_HD   0x0080
 
#define KSZ8873_ANAR_10BT_FD   0x0040
 
#define KSZ8873_ANAR_10BT_HD   0x0020
 
#define KSZ8873_ANAR_SELECTOR   0x001F
 
#define KSZ8873_ANAR_SELECTOR_DEFAULT   0x0001
 
#define KSZ8873_ANLPAR_NEXT_PAGE   0x8000
 
#define KSZ8873_ANLPAR_LP_ACK   0x4000
 
#define KSZ8873_ANLPAR_REMOTE_FAULT   0x2000
 
#define KSZ8873_ANLPAR_PAUSE   0x0400
 
#define KSZ8873_ANLPAR_100BTX_FD   0x0100
 
#define KSZ8873_ANLPAR_100BTX_HD   0x0080
 
#define KSZ8873_ANLPAR_10BT_FD   0x0040
 
#define KSZ8873_ANLPAR_10BT_HD   0x0020
 
#define KSZ8873_LINKMD_TEST_EN   0x8000
 
#define KSZ8873_LINKMD_RESULT   0x6000
 
#define KSZ8873_LINKMD_SHORT   0x1000
 
#define KSZ8873_LINKMD_FAULT_COUNT   0x01FF
 
#define KSZ8873_PHYSCS_OP_MODE   0x0700
 
#define KSZ8873_PHYSCS_OP_MODE_AN   0x0100
 
#define KSZ8873_PHYSCS_OP_MODE_10BT_HD   0x0200
 
#define KSZ8873_PHYSCS_OP_MODE_100BTX_HD   0x0300
 
#define KSZ8873_PHYSCS_OP_MODE_10BT_FD   0x0500
 
#define KSZ8873_PHYSCS_OP_MODE_100BTX_FD   0x0600
 
#define KSZ8873_PHYSCS_OP_MODE_ISOLATE   0x0700
 
#define KSZ8873_PHYSCS_POLRVS   0x0020
 
#define KSZ8873_PHYSCS_MDIX_STATUS   0x0010
 
#define KSZ8873_PHYSCS_FORCE_LINK   0x0008
 
#define KSZ8873_PHYSCS_PWRSAVE   0x0004
 
#define KSZ8873_PHYSCS_REMOTE_LOOPBACK   0x0002
 
#define KSZ8873_CHIP_ID0_FAMILY_ID   0xFF
 
#define KSZ8873_CHIP_ID0_FAMILY_ID_DEFAULT   0x88
 
#define KSZ8873_CHIP_ID1_CHIP_ID   0xF0
 
#define KSZ8873_CHIP_ID1_CHIP_ID_DEFAULT   0x30
 
#define KSZ8873_CHIP_ID1_REVISION_ID   0x0E
 
#define KSZ8873_CHIP_ID1_START_SWITCH   0x01
 
#define KSZ8873_GLOBAL_CTRL1_PASS_ALL_FRAMES   0x80
 
#define KSZ8873_GLOBAL_CTRL1_TAIL_TAG_EN   0x40
 
#define KSZ8873_GLOBAL_CTRL1_TX_FLOW_CTRL_EN   0x20
 
#define KSZ8873_GLOBAL_CTRL1_RX_FLOW_CTRL_EN   0x10
 
#define KSZ8873_GLOBAL_CTRL1_FRAME_LEN_CHECK_EN   0x08
 
#define KSZ8873_GLOBAL_CTRL1_AGING_EN   0x04
 
#define KSZ8873_GLOBAL_CTRL1_FAST_AGE_EN   0x02
 
#define KSZ8873_GLOBAL_CTRL1_AGGRESSIVE_BACK_OFF_EN   0x01
 
#define KSZ8873_PORTn_CTRL0_BCAST_STORM_PROTECT_EN   0x80
 
#define KSZ8873_PORTn_CTRL0_DIFFSERV_PRIO_CLASS_EN   0x40
 
#define KSZ8873_PORTn_CTRL0_802_1P_PRIO_CLASS_EN   0x20
 
#define KSZ8873_PORTn_CTRL0_PORT_PRIO_CLASS_EN   0x18
 
#define KSZ8873_PORTn_CTRL0_TAG_INSERTION   0x04
 
#define KSZ8873_PORTn_CTRL0_TAG_REMOVAL   0x02
 
#define KSZ8873_PORTn_CTRL0_TXQ_SPLIT_EN   0x01
 
#define KSZ8873_PORTn_CTRL1_SNIFFER_PORT   0x80
 
#define KSZ8873_PORTn_CTRL1_RECEIVE_SNIFF   0x40
 
#define KSZ8873_PORTn_CTRL1_TRANSMIT_SNIFF   0x20
 
#define KSZ8873_PORTn_CTRL1_DOUBLE_TAG   0x10
 
#define KSZ8873_PORTn_CTRL1_USER_PRIO_CEILING   0x08
 
#define KSZ8873_PORTn_CTRL1_PORT_VLAN_MEMBERSHIP   0x07
 
#define KSZ8873_PORTn_CTRL2_TWO_QUEUE_SPLIT_EN   0x80
 
#define KSZ8873_PORTn_CTRL2_INGRESS_VLAN_FILT   0x40
 
#define KSZ8873_PORTn_CTRL2_DISCARD_NON_PVID_PKT   0x20
 
#define KSZ8873_PORTn_CTRL2_FORCE_FLOW_CTRL   0x10
 
#define KSZ8873_PORTn_CTRL2_BACK_PRESSURE_EN   0x08
 
#define KSZ8873_PORTn_CTRL2_TRANSMIT_EN   0x04
 
#define KSZ8873_PORTn_CTRL2_RECEIVE_EN   0x02
 
#define KSZ8873_PORTn_CTRL2_LEARNING_DIS   0x01
 
#define KSZ8873_PORTn_CTRL3_DEFAULT_USER_PRIO   0xE0
 
#define KSZ8873_PORTn_CTRL3_DEFAULT_CFI   0x10
 
#define KSZ8873_PORTn_CTRL3_DEFAULT_VID_MSB   0x0F
 
#define KSZ8873_PORTn_CTRL4_DEFAULT_VID_LSB   0xFF
 
#define KSZ8873_PORTn_PSCS_VCT_10M_SHORT   0x80
 
#define KSZ8873_PORTn_PSCS_VCT_RESULT   0x60
 
#define KSZ8873_PORTn_PSCS_VCT_EN   0x10
 
#define KSZ8873_PORTn_PSCS_FORCE_LNK   0x08
 
#define KSZ8873_PORTn_PSCS_REMOTE_LOOPBACK   0x02
 
#define KSZ8873_PORTn_PSCS_VCT_FAULT_COUNT_MSB   0x01
 
#define KSZ8873_PORTn_LINKMD_VCT_FAULT_COUNT_LSB   0xFF
 
#define KSZ8873_PORTn_STAT0_MDIX_STATUS   0x80
 
#define KSZ8873_PORTn_STAT0_AN_DONE   0x40
 
#define KSZ8873_PORTn_STAT0_LINK_GOOD   0x20
 
#define KSZ8873_PORTn_STAT0_LP_FLOW_CTRL_CAPABLE   0x10
 
#define KSZ8873_PORTn_STAT0_LP_100BTX_FD_CAPABLE   0x08
 
#define KSZ8873_PORTn_STAT0_LP_100BTX_HF_CAPABLE   0x04
 
#define KSZ8873_PORTn_STAT0_LP_10BT_FD_CAPABLE   0x02
 
#define KSZ8873_PORTn_STAT0_LP_10BT_HD_CAPABLE   0x01
 
#define KSZ8873_PORTn_STAT1_HP_MDIX   0x80
 
#define KSZ8873_PORTn_STAT1_POLRVS   0x20
 
#define KSZ8873_PORTn_STAT1_TX_FLOW_CTRL_EN   0x10
 
#define KSZ8873_PORTn_STAT1_RX_FLOW_CTRL_EN   0x08
 
#define KSZ8873_PORTn_STAT1_OP_SPEED   0x04
 
#define KSZ8873_PORTn_STAT1_OP_DUPLEX   0x02
 
#define KSZ8873_PORTn_STAT1_FAR_END_FAULT   0x01
 
#define KSZ8873_RESET_SOFT_RESET   0x10
 
#define KSZ8873_RESET_PCS_RESET   0x01
 
#define KSZ8873_MODE_INDICATOR_FLL   0x41
 
#define KSZ8873_MODE_INDICATOR_MLL   0x43
 
#define KSZ8873_MODE_INDICATOR_RLL   0x53
 
#define KSZ8873_TAIL_TAG_ENCODE(port)   ((port) & 0x03)
 
#define KSZ8873_TAIL_TAG_DECODE(tag)   (((tag) & 0x01) + 1)
 

Functions

error_t ksz8873Init (NetInterface *interface)
 KSZ8873 Ethernet switch initialization. More...
 
bool_t ksz8873GetLinkState (NetInterface *interface, uint8_t port)
 Get link state. More...
 
void ksz8873Tick (NetInterface *interface)
 KSZ8873 timer handler. More...
 
void ksz8873EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ksz8873DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void ksz8873EventHandler (NetInterface *interface)
 KSZ8873 event handler. More...
 
error_t ksz8873TagFrame (NetInterface *interface, NetBuffer *buffer, size_t *offset, uint8_t port, uint16_t *type)
 Add tail tag to Ethernet frame. More...
 
error_t ksz8873UntagFrame (NetInterface *interface, uint8_t **frame, size_t *length, uint8_t *port)
 Decode tail tag from incoming Ethernet frame. More...
 
void ksz8873WritePhyReg (NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t ksz8873ReadPhyReg (NetInterface *interface, uint8_t port, uint8_t address)
 Read PHY register. More...
 
void ksz8873DumpPhyReg (NetInterface *interface, uint8_t port)
 Dump PHY registers for debugging purpose. More...
 
void ksz8873WriteSwitchReg (NetInterface *interface, uint8_t address, uint8_t data)
 Write switch register. More...
 
uint8_t ksz8873ReadSwitchReg (NetInterface *interface, uint8_t address)
 Read switch register. More...
 
void ksz8873DumpSwitchReg (NetInterface *interface)
 Dump switch registers for debugging purpose. More...
 

Variables

const PhyDriver ksz8873PhyDriver
 KSZ8873 Ethernet switch driver. More...
 

Detailed Description

KSZ8873 3-port Ethernet switch.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2019 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.6

Definition in file ksz8873_driver.h.

Macro Definition Documentation

◆ KSZ8873_ANAR

#define KSZ8873_ANAR   0x04

Definition at line 50 of file ksz8873_driver.h.

◆ KSZ8873_ANAR_100BTX_FD

#define KSZ8873_ANAR_100BTX_FD   0x0100

Definition at line 265 of file ksz8873_driver.h.

◆ KSZ8873_ANAR_100BTX_HD

#define KSZ8873_ANAR_100BTX_HD   0x0080

Definition at line 266 of file ksz8873_driver.h.

◆ KSZ8873_ANAR_10BT_FD

#define KSZ8873_ANAR_10BT_FD   0x0040

Definition at line 267 of file ksz8873_driver.h.

◆ KSZ8873_ANAR_10BT_HD

#define KSZ8873_ANAR_10BT_HD   0x0020

Definition at line 268 of file ksz8873_driver.h.

◆ KSZ8873_ANAR_NEXT_PAGE

#define KSZ8873_ANAR_NEXT_PAGE   0x8000

Definition at line 262 of file ksz8873_driver.h.

◆ KSZ8873_ANAR_PAUSE

#define KSZ8873_ANAR_PAUSE   0x0400

Definition at line 264 of file ksz8873_driver.h.

◆ KSZ8873_ANAR_REMOTE_FAULT

#define KSZ8873_ANAR_REMOTE_FAULT   0x2000

Definition at line 263 of file ksz8873_driver.h.

◆ KSZ8873_ANAR_SELECTOR

#define KSZ8873_ANAR_SELECTOR   0x001F

Definition at line 269 of file ksz8873_driver.h.

◆ KSZ8873_ANAR_SELECTOR_DEFAULT

#define KSZ8873_ANAR_SELECTOR_DEFAULT   0x0001

Definition at line 270 of file ksz8873_driver.h.

◆ KSZ8873_ANLPAR

#define KSZ8873_ANLPAR   0x05

Definition at line 51 of file ksz8873_driver.h.

◆ KSZ8873_ANLPAR_100BTX_FD

#define KSZ8873_ANLPAR_100BTX_FD   0x0100

Definition at line 277 of file ksz8873_driver.h.

◆ KSZ8873_ANLPAR_100BTX_HD

#define KSZ8873_ANLPAR_100BTX_HD   0x0080

Definition at line 278 of file ksz8873_driver.h.

◆ KSZ8873_ANLPAR_10BT_FD

#define KSZ8873_ANLPAR_10BT_FD   0x0040

Definition at line 279 of file ksz8873_driver.h.

◆ KSZ8873_ANLPAR_10BT_HD

#define KSZ8873_ANLPAR_10BT_HD   0x0020

Definition at line 280 of file ksz8873_driver.h.

◆ KSZ8873_ANLPAR_LP_ACK

#define KSZ8873_ANLPAR_LP_ACK   0x4000

Definition at line 274 of file ksz8873_driver.h.

◆ KSZ8873_ANLPAR_NEXT_PAGE

#define KSZ8873_ANLPAR_NEXT_PAGE   0x8000

Definition at line 273 of file ksz8873_driver.h.

◆ KSZ8873_ANLPAR_PAUSE

#define KSZ8873_ANLPAR_PAUSE   0x0400

Definition at line 276 of file ksz8873_driver.h.

◆ KSZ8873_ANLPAR_REMOTE_FAULT

#define KSZ8873_ANLPAR_REMOTE_FAULT   0x2000

Definition at line 275 of file ksz8873_driver.h.

◆ KSZ8873_BMCR

#define KSZ8873_BMCR   0x00

Definition at line 46 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_AN_EN

#define KSZ8873_BMCR_AN_EN   0x1000

Definition at line 228 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_AUTO_MDIX_DIS

#define KSZ8873_BMCR_AUTO_MDIX_DIS   0x0008

Definition at line 236 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_COL_TEST

#define KSZ8873_BMCR_COL_TEST   0x0080

Definition at line 233 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_FAR_END_FAULT_DIS

#define KSZ8873_BMCR_FAR_END_FAULT_DIS   0x0004

Definition at line 237 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_FORCE_100

#define KSZ8873_BMCR_FORCE_100   0x2000

Definition at line 227 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_FORCE_FULL_DUPLEX

#define KSZ8873_BMCR_FORCE_FULL_DUPLEX   0x0100

Definition at line 232 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_FORCE_MDI

#define KSZ8873_BMCR_FORCE_MDI   0x0010

Definition at line 235 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_HP_MDIX

#define KSZ8873_BMCR_HP_MDIX   0x0020

Definition at line 234 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_ISOLATE

#define KSZ8873_BMCR_ISOLATE   0x0400

Definition at line 230 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_LED_DIS

#define KSZ8873_BMCR_LED_DIS   0x0001

Definition at line 239 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_LOOPBACK

#define KSZ8873_BMCR_LOOPBACK   0x4000

Definition at line 226 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_POWER_DOWN

#define KSZ8873_BMCR_POWER_DOWN   0x0800

Definition at line 229 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_RESET

#define KSZ8873_BMCR_RESET   0x8000

Definition at line 225 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_RESTART_AN

#define KSZ8873_BMCR_RESTART_AN   0x0200

Definition at line 231 of file ksz8873_driver.h.

◆ KSZ8873_BMCR_TRANSMIT_DIS

#define KSZ8873_BMCR_TRANSMIT_DIS   0x0002

Definition at line 238 of file ksz8873_driver.h.

◆ KSZ8873_BMSR

#define KSZ8873_BMSR   0x01

Definition at line 47 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_100BT4

#define KSZ8873_BMSR_100BT4   0x8000

Definition at line 242 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_100BTX_FD

#define KSZ8873_BMSR_100BTX_FD   0x4000

Definition at line 243 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_100BTX_HD

#define KSZ8873_BMSR_100BTX_HD   0x2000

Definition at line 244 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_10BT_FD

#define KSZ8873_BMSR_10BT_FD   0x1000

Definition at line 245 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_10BT_HD

#define KSZ8873_BMSR_10BT_HD   0x0800

Definition at line 246 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_AN_CAPABLE

#define KSZ8873_BMSR_AN_CAPABLE   0x0008

Definition at line 250 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_AN_COMPLETE

#define KSZ8873_BMSR_AN_COMPLETE   0x0020

Definition at line 248 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_EXTENDED_CAPABLE

#define KSZ8873_BMSR_EXTENDED_CAPABLE   0x0001

Definition at line 253 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_FAR_END_FAULT

#define KSZ8873_BMSR_FAR_END_FAULT   0x0010

Definition at line 249 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_JABBER_TEST

#define KSZ8873_BMSR_JABBER_TEST   0x0002

Definition at line 252 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_LINK_STATUS

#define KSZ8873_BMSR_LINK_STATUS   0x0004

Definition at line 251 of file ksz8873_driver.h.

◆ KSZ8873_BMSR_PREAMBLE_SUPPR

#define KSZ8873_BMSR_PREAMBLE_SUPPR   0x0040

Definition at line 247 of file ksz8873_driver.h.

◆ KSZ8873_CHIP_ID0

#define KSZ8873_CHIP_ID0   0x00

Definition at line 56 of file ksz8873_driver.h.

◆ KSZ8873_CHIP_ID0_FAMILY_ID

#define KSZ8873_CHIP_ID0_FAMILY_ID   0xFF

Definition at line 303 of file ksz8873_driver.h.

◆ KSZ8873_CHIP_ID0_FAMILY_ID_DEFAULT

#define KSZ8873_CHIP_ID0_FAMILY_ID_DEFAULT   0x88

Definition at line 304 of file ksz8873_driver.h.

◆ KSZ8873_CHIP_ID1

#define KSZ8873_CHIP_ID1   0x01

Definition at line 57 of file ksz8873_driver.h.

◆ KSZ8873_CHIP_ID1_CHIP_ID

#define KSZ8873_CHIP_ID1_CHIP_ID   0xF0

Definition at line 307 of file ksz8873_driver.h.

◆ KSZ8873_CHIP_ID1_CHIP_ID_DEFAULT

#define KSZ8873_CHIP_ID1_CHIP_ID_DEFAULT   0x30

Definition at line 308 of file ksz8873_driver.h.

◆ KSZ8873_CHIP_ID1_REVISION_ID

#define KSZ8873_CHIP_ID1_REVISION_ID   0x0E

Definition at line 309 of file ksz8873_driver.h.

◆ KSZ8873_CHIP_ID1_START_SWITCH

#define KSZ8873_CHIP_ID1_START_SWITCH   0x01

Definition at line 310 of file ksz8873_driver.h.

◆ KSZ8873_FIBER_SIGNAL_THRESHOLD

#define KSZ8873_FIBER_SIGNAL_THRESHOLD   0xC0

Definition at line 191 of file ksz8873_driver.h.

◆ KSZ8873_FORCE_PAUSE_OFF_LIMIT_EN

#define KSZ8873_FORCE_PAUSE_OFF_LIMIT_EN   0xBD

Definition at line 190 of file ksz8873_driver.h.

◆ KSZ8873_FWD_INVALID_VID_FRAME_HOST_MODE

#define KSZ8873_FWD_INVALID_VID_FRAME_HOST_MODE   0xC6

Definition at line 196 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL0

#define KSZ8873_GLOBAL_CTRL0   0x02

Definition at line 58 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL1

#define KSZ8873_GLOBAL_CTRL1   0x03

Definition at line 59 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL10

#define KSZ8873_GLOBAL_CTRL10   0x0C

Definition at line 68 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL11

#define KSZ8873_GLOBAL_CTRL11   0x0D

Definition at line 69 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL12

#define KSZ8873_GLOBAL_CTRL12   0x0E

Definition at line 70 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL13

#define KSZ8873_GLOBAL_CTRL13   0x0F

Definition at line 71 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL1_AGGRESSIVE_BACK_OFF_EN

#define KSZ8873_GLOBAL_CTRL1_AGGRESSIVE_BACK_OFF_EN   0x01

Definition at line 320 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL1_AGING_EN

#define KSZ8873_GLOBAL_CTRL1_AGING_EN   0x04

Definition at line 318 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL1_FAST_AGE_EN

#define KSZ8873_GLOBAL_CTRL1_FAST_AGE_EN   0x02

Definition at line 319 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL1_FRAME_LEN_CHECK_EN

#define KSZ8873_GLOBAL_CTRL1_FRAME_LEN_CHECK_EN   0x08

Definition at line 317 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL1_PASS_ALL_FRAMES

#define KSZ8873_GLOBAL_CTRL1_PASS_ALL_FRAMES   0x80

Definition at line 313 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL1_RX_FLOW_CTRL_EN

#define KSZ8873_GLOBAL_CTRL1_RX_FLOW_CTRL_EN   0x10

Definition at line 316 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL1_TAIL_TAG_EN

#define KSZ8873_GLOBAL_CTRL1_TAIL_TAG_EN   0x40

Definition at line 314 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL1_TX_FLOW_CTRL_EN

#define KSZ8873_GLOBAL_CTRL1_TX_FLOW_CTRL_EN   0x20

Definition at line 315 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL2

#define KSZ8873_GLOBAL_CTRL2   0x04

Definition at line 60 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL3

#define KSZ8873_GLOBAL_CTRL3   0x05

Definition at line 61 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL4

#define KSZ8873_GLOBAL_CTRL4   0x06

Definition at line 62 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL5

#define KSZ8873_GLOBAL_CTRL5   0x07

Definition at line 63 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL6

#define KSZ8873_GLOBAL_CTRL6   0x08

Definition at line 64 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL7

#define KSZ8873_GLOBAL_CTRL7   0x09

Definition at line 65 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL8

#define KSZ8873_GLOBAL_CTRL8   0x0A

Definition at line 66 of file ksz8873_driver.h.

◆ KSZ8873_GLOBAL_CTRL9

#define KSZ8873_GLOBAL_CTRL9   0x0B

Definition at line 67 of file ksz8873_driver.h.

◆ KSZ8873_HIGH_PRIO_PKT_BUF_Q0

#define KSZ8873_HIGH_PRIO_PKT_BUF_Q0   0xAA

Definition at line 171 of file ksz8873_driver.h.

◆ KSZ8873_HIGH_PRIO_PKT_BUF_Q1

#define KSZ8873_HIGH_PRIO_PKT_BUF_Q1   0xA9

Definition at line 170 of file ksz8873_driver.h.

◆ KSZ8873_HIGH_PRIO_PKT_BUF_Q2

#define KSZ8873_HIGH_PRIO_PKT_BUF_Q2   0xA8

Definition at line 169 of file ksz8873_driver.h.

◆ KSZ8873_HIGH_PRIO_PKT_BUF_Q3

#define KSZ8873_HIGH_PRIO_PKT_BUF_Q3   0xA7

Definition at line 168 of file ksz8873_driver.h.

◆ KSZ8873_IND_ACCESS_CTRL0

#define KSZ8873_IND_ACCESS_CTRL0   0x79

Definition at line 142 of file ksz8873_driver.h.

◆ KSZ8873_IND_ACCESS_CTRL1

#define KSZ8873_IND_ACCESS_CTRL1   0x7A

Definition at line 143 of file ksz8873_driver.h.

◆ KSZ8873_IND_DATA0

#define KSZ8873_IND_DATA0   0x83

Definition at line 152 of file ksz8873_driver.h.

◆ KSZ8873_IND_DATA1

#define KSZ8873_IND_DATA1   0x82

Definition at line 151 of file ksz8873_driver.h.

◆ KSZ8873_IND_DATA2

#define KSZ8873_IND_DATA2   0x81

Definition at line 150 of file ksz8873_driver.h.

◆ KSZ8873_IND_DATA3

#define KSZ8873_IND_DATA3   0x80

Definition at line 149 of file ksz8873_driver.h.

◆ KSZ8873_IND_DATA4

#define KSZ8873_IND_DATA4   0x7F

Definition at line 148 of file ksz8873_driver.h.

◆ KSZ8873_IND_DATA5

#define KSZ8873_IND_DATA5   0x7E

Definition at line 147 of file ksz8873_driver.h.

◆ KSZ8873_IND_DATA6

#define KSZ8873_IND_DATA6   0x7D

Definition at line 146 of file ksz8873_driver.h.

◆ KSZ8873_IND_DATA7

#define KSZ8873_IND_DATA7   0x7C

Definition at line 145 of file ksz8873_driver.h.

◆ KSZ8873_IND_DATA8

#define KSZ8873_IND_DATA8   0x7B

Definition at line 144 of file ksz8873_driver.h.

◆ KSZ8873_INSERT_SRC_PVID

#define KSZ8873_INSERT_SRC_PVID   0xC2

Definition at line 193 of file ksz8873_driver.h.

◆ KSZ8873_INT_EN

#define KSZ8873_INT_EN   0xBB

Definition at line 188 of file ksz8873_driver.h.

◆ KSZ8873_INTERNAL_LDO_CTRL

#define KSZ8873_INTERNAL_LDO_CTRL   0xC1

Definition at line 192 of file ksz8873_driver.h.

◆ KSZ8873_LINK_CHANGE_INT

#define KSZ8873_LINK_CHANGE_INT   0xBC

Definition at line 189 of file ksz8873_driver.h.

◆ KSZ8873_LINKMD

#define KSZ8873_LINKMD   0x1D

Definition at line 52 of file ksz8873_driver.h.

◆ KSZ8873_LINKMD_FAULT_COUNT

#define KSZ8873_LINKMD_FAULT_COUNT   0x01FF

Definition at line 286 of file ksz8873_driver.h.

◆ KSZ8873_LINKMD_RESULT

#define KSZ8873_LINKMD_RESULT   0x6000

Definition at line 284 of file ksz8873_driver.h.

◆ KSZ8873_LINKMD_SHORT

#define KSZ8873_LINKMD_SHORT   0x1000

Definition at line 285 of file ksz8873_driver.h.

◆ KSZ8873_LINKMD_TEST_EN

#define KSZ8873_LINKMD_TEST_EN   0x8000

Definition at line 283 of file ksz8873_driver.h.

◆ KSZ8873_MAC_ADDR0

#define KSZ8873_MAC_ADDR0   0x70

Definition at line 133 of file ksz8873_driver.h.

◆ KSZ8873_MAC_ADDR1

#define KSZ8873_MAC_ADDR1   0x71

Definition at line 134 of file ksz8873_driver.h.

◆ KSZ8873_MAC_ADDR2

#define KSZ8873_MAC_ADDR2   0x72

Definition at line 135 of file ksz8873_driver.h.

◆ KSZ8873_MAC_ADDR3

#define KSZ8873_MAC_ADDR3   0x73

Definition at line 136 of file ksz8873_driver.h.

◆ KSZ8873_MAC_ADDR4

#define KSZ8873_MAC_ADDR4   0x74

Definition at line 137 of file ksz8873_driver.h.

◆ KSZ8873_MAC_ADDR5

#define KSZ8873_MAC_ADDR5   0x75

Definition at line 138 of file ksz8873_driver.h.

◆ KSZ8873_MACA1

#define KSZ8873_MACA1   0x8E

Definition at line 153 of file ksz8873_driver.h.

◆ KSZ8873_MACA2

#define KSZ8873_MACA2   0x94

Definition at line 154 of file ksz8873_driver.h.

◆ KSZ8873_MODE_INDICATOR

#define KSZ8873_MODE_INDICATOR   0xA6

Definition at line 167 of file ksz8873_driver.h.

◆ KSZ8873_MODE_INDICATOR_FLL

#define KSZ8873_MODE_INDICATOR_FLL   0x41

Definition at line 392 of file ksz8873_driver.h.

◆ KSZ8873_MODE_INDICATOR_MLL

#define KSZ8873_MODE_INDICATOR_MLL   0x43

Definition at line 393 of file ksz8873_driver.h.

◆ KSZ8873_MODE_INDICATOR_RLL

#define KSZ8873_MODE_INDICATOR_RLL   0x53

Definition at line 394 of file ksz8873_driver.h.

◆ KSZ8873_PHYID1

#define KSZ8873_PHYID1   0x02

Definition at line 48 of file ksz8873_driver.h.

◆ KSZ8873_PHYID1_DEFAULT

#define KSZ8873_PHYID1_DEFAULT   0x0022

Definition at line 256 of file ksz8873_driver.h.

◆ KSZ8873_PHYID2

#define KSZ8873_PHYID2   0x03

Definition at line 49 of file ksz8873_driver.h.

◆ KSZ8873_PHYID2_DEFAULT

#define KSZ8873_PHYID2_DEFAULT   0x1430

Definition at line 259 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS

#define KSZ8873_PHYSCS   0x1F

Definition at line 53 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_FORCE_LINK

#define KSZ8873_PHYSCS_FORCE_LINK   0x0008

Definition at line 298 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_MDIX_STATUS

#define KSZ8873_PHYSCS_MDIX_STATUS   0x0010

Definition at line 297 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_OP_MODE

#define KSZ8873_PHYSCS_OP_MODE   0x0700

Definition at line 289 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_OP_MODE_100BTX_FD

#define KSZ8873_PHYSCS_OP_MODE_100BTX_FD   0x0600

Definition at line 294 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_OP_MODE_100BTX_HD

#define KSZ8873_PHYSCS_OP_MODE_100BTX_HD   0x0300

Definition at line 292 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_OP_MODE_10BT_FD

#define KSZ8873_PHYSCS_OP_MODE_10BT_FD   0x0500

Definition at line 293 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_OP_MODE_10BT_HD

#define KSZ8873_PHYSCS_OP_MODE_10BT_HD   0x0200

Definition at line 291 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_OP_MODE_AN

#define KSZ8873_PHYSCS_OP_MODE_AN   0x0100

Definition at line 290 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_OP_MODE_ISOLATE

#define KSZ8873_PHYSCS_OP_MODE_ISOLATE   0x0700

Definition at line 295 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_POLRVS

#define KSZ8873_PHYSCS_POLRVS   0x0020

Definition at line 296 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_PWRSAVE

#define KSZ8873_PHYSCS_PWRSAVE   0x0004

Definition at line 299 of file ksz8873_driver.h.

◆ KSZ8873_PHYSCS_REMOTE_LOOPBACK

#define KSZ8873_PHYSCS_REMOTE_LOOPBACK   0x0002

Definition at line 300 of file ksz8873_driver.h.

◆ KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE1

#define KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE1   0xAB

Definition at line 172 of file ksz8873_driver.h.

◆ KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE2

#define KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE2   0xAC

Definition at line 173 of file ksz8873_driver.h.

◆ KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE3

#define KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE3   0xAD

Definition at line 174 of file ksz8873_driver.h.

◆ KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE4

#define KSZ8873_PM_USAGE_FLOW_CTRL_SEL_MODE4   0xAE

Definition at line 175 of file ksz8873_driver.h.

◆ KSZ8873_PORT1

#define KSZ8873_PORT1   1

Definition at line 38 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_CTRL0

#define KSZ8873_PORT1_CTRL0   0x10

Definition at line 72 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_CTRL1

#define KSZ8873_PORT1_CTRL1   0x11

Definition at line 73 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_CTRL12

#define KSZ8873_PORT1_CTRL12   0x1C

Definition at line 84 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_CTRL13

#define KSZ8873_PORT1_CTRL13   0x1D

Definition at line 85 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_CTRL2

#define KSZ8873_PORT1_CTRL2   0x12

Definition at line 74 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_CTRL3

#define KSZ8873_PORT1_CTRL3   0x13

Definition at line 75 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_CTRL4

#define KSZ8873_PORT1_CTRL4   0x14

Definition at line 76 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_CTRL5

#define KSZ8873_PORT1_CTRL5   0x15

Definition at line 77 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_LINKMD

#define KSZ8873_PORT1_LINKMD   0x1B

Definition at line 83 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_PSCS

#define KSZ8873_PORT1_PSCS   0x1A

Definition at line 82 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q0_EG_LIMIT

#define KSZ8873_PORT1_Q0_EG_LIMIT   0x9A

Definition at line 155 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q0_IG_LIMIT

#define KSZ8873_PORT1_Q0_IG_LIMIT   0x16

Definition at line 78 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q0_TXQ_SPLIT

#define KSZ8873_PORT1_Q0_TXQ_SPLIT   0xB2

Definition at line 179 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q1_EG_LIMIT

#define KSZ8873_PORT1_Q1_EG_LIMIT   0x9B

Definition at line 156 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q1_IG_LIMIT

#define KSZ8873_PORT1_Q1_IG_LIMIT   0x17

Definition at line 79 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q1_TXQ_SPLIT

#define KSZ8873_PORT1_Q1_TXQ_SPLIT   0xB1

Definition at line 178 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q2_EG_LIMIT

#define KSZ8873_PORT1_Q2_EG_LIMIT   0x9C

Definition at line 157 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q2_IG_LIMIT

#define KSZ8873_PORT1_Q2_IG_LIMIT   0x18

Definition at line 80 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q2_TXQ_SPLIT

#define KSZ8873_PORT1_Q2_TXQ_SPLIT   0xB0

Definition at line 177 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q3_EG_LIMIT

#define KSZ8873_PORT1_Q3_EG_LIMIT   0x9D

Definition at line 158 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q3_IG_LIMIT

#define KSZ8873_PORT1_Q3_IG_LIMIT   0x19

Definition at line 81 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_Q3_TXQ_SPLIT

#define KSZ8873_PORT1_Q3_TXQ_SPLIT   0xAF

Definition at line 176 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_STAT0

#define KSZ8873_PORT1_STAT0   0x1E

Definition at line 86 of file ksz8873_driver.h.

◆ KSZ8873_PORT1_STAT1

#define KSZ8873_PORT1_STAT1   0x1F

Definition at line 87 of file ksz8873_driver.h.

◆ KSZ8873_PORT2

#define KSZ8873_PORT2   2

Definition at line 39 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_CTRL0

#define KSZ8873_PORT2_CTRL0   0x20

Definition at line 88 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_CTRL1

#define KSZ8873_PORT2_CTRL1   0x21

Definition at line 89 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_CTRL12

#define KSZ8873_PORT2_CTRL12   0x2C

Definition at line 100 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_CTRL13

#define KSZ8873_PORT2_CTRL13   0x2D

Definition at line 101 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_CTRL2

#define KSZ8873_PORT2_CTRL2   0x22

Definition at line 90 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_CTRL3

#define KSZ8873_PORT2_CTRL3   0x23

Definition at line 91 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_CTRL4

#define KSZ8873_PORT2_CTRL4   0x24

Definition at line 92 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_CTRL5

#define KSZ8873_PORT2_CTRL5   0x25

Definition at line 93 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_LINKMD

#define KSZ8873_PORT2_LINKMD   0x2B

Definition at line 99 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_PSCS

#define KSZ8873_PORT2_PSCS   0x2A

Definition at line 98 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q0_EG_LIMIT

#define KSZ8873_PORT2_Q0_EG_LIMIT   0x9E

Definition at line 159 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q0_IG_LIMIT

#define KSZ8873_PORT2_Q0_IG_LIMIT   0x26

Definition at line 94 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q0_TXQ_SPLIT

#define KSZ8873_PORT2_Q0_TXQ_SPLIT   0xB6

Definition at line 183 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q1_EG_LIMIT

#define KSZ8873_PORT2_Q1_EG_LIMIT   0x9F

Definition at line 160 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q1_IG_LIMIT

#define KSZ8873_PORT2_Q1_IG_LIMIT   0x27

Definition at line 95 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q1_TXQ_SPLIT

#define KSZ8873_PORT2_Q1_TXQ_SPLIT   0xB5

Definition at line 182 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q2_EG_LIMIT

#define KSZ8873_PORT2_Q2_EG_LIMIT   0xA0

Definition at line 161 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q2_IG_LIMIT

#define KSZ8873_PORT2_Q2_IG_LIMIT   0x28

Definition at line 96 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q2_TXQ_SPLIT

#define KSZ8873_PORT2_Q2_TXQ_SPLIT   0xB4

Definition at line 181 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q3_EG_LIMIT

#define KSZ8873_PORT2_Q3_EG_LIMIT   0xA1

Definition at line 162 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q3_IG_LIMIT

#define KSZ8873_PORT2_Q3_IG_LIMIT   0x29

Definition at line 97 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_Q3_TXQ_SPLIT

#define KSZ8873_PORT2_Q3_TXQ_SPLIT   0xB3

Definition at line 180 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_STAT0

#define KSZ8873_PORT2_STAT0   0x2E

Definition at line 102 of file ksz8873_driver.h.

◆ KSZ8873_PORT2_STAT1

#define KSZ8873_PORT2_STAT1   0x2F

Definition at line 103 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_CTRL0

#define KSZ8873_PORT3_CTRL0   0x30

Definition at line 104 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_CTRL1

#define KSZ8873_PORT3_CTRL1   0x31

Definition at line 105 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_CTRL2

#define KSZ8873_PORT3_CTRL2   0x32

Definition at line 106 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_CTRL3

#define KSZ8873_PORT3_CTRL3   0x33

Definition at line 107 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_CTRL4

#define KSZ8873_PORT3_CTRL4   0x34

Definition at line 108 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_CTRL5

#define KSZ8873_PORT3_CTRL5   0x35

Definition at line 109 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q0_EG_LIMIT

#define KSZ8873_PORT3_Q0_EG_LIMIT   0xA2

Definition at line 163 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q0_IG_LIMIT

#define KSZ8873_PORT3_Q0_IG_LIMIT   0x36

Definition at line 110 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q0_TXQ_SPLIT

#define KSZ8873_PORT3_Q0_TXQ_SPLIT   0xBA

Definition at line 187 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q1_EG_LIMIT

#define KSZ8873_PORT3_Q1_EG_LIMIT   0xA3

Definition at line 164 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q1_IG_LIMIT

#define KSZ8873_PORT3_Q1_IG_LIMIT   0x37

Definition at line 111 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q1_TXQ_SPLIT

#define KSZ8873_PORT3_Q1_TXQ_SPLIT   0xB9

Definition at line 186 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q2_EG_LIMIT

#define KSZ8873_PORT3_Q2_EG_LIMIT   0xA4

Definition at line 165 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q2_IG_LIMIT

#define KSZ8873_PORT3_Q2_IG_LIMIT   0x38

Definition at line 112 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q2_TXQ_SPLIT

#define KSZ8873_PORT3_Q2_TXQ_SPLIT   0xB8

Definition at line 185 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q3_EG_LIMIT

#define KSZ8873_PORT3_Q3_EG_LIMIT   0xA5

Definition at line 166 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q3_IG_LIMIT

#define KSZ8873_PORT3_Q3_IG_LIMIT   0x39

Definition at line 113 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_Q3_TXQ_SPLIT

#define KSZ8873_PORT3_Q3_TXQ_SPLIT   0xB7

Definition at line 184 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_STAT0

#define KSZ8873_PORT3_STAT0   0x3E

Definition at line 114 of file ksz8873_driver.h.

◆ KSZ8873_PORT3_STAT1

#define KSZ8873_PORT3_STAT1   0x3F

Definition at line 115 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL0

#define KSZ8873_PORTn_CTRL0 (   port)    (0x00 + ((port) * 0x10))

Definition at line 199 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL0_802_1P_PRIO_CLASS_EN

#define KSZ8873_PORTn_CTRL0_802_1P_PRIO_CLASS_EN   0x20

Definition at line 325 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL0_BCAST_STORM_PROTECT_EN

#define KSZ8873_PORTn_CTRL0_BCAST_STORM_PROTECT_EN   0x80

Definition at line 323 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL0_DIFFSERV_PRIO_CLASS_EN

#define KSZ8873_PORTn_CTRL0_DIFFSERV_PRIO_CLASS_EN   0x40

Definition at line 324 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL0_PORT_PRIO_CLASS_EN

#define KSZ8873_PORTn_CTRL0_PORT_PRIO_CLASS_EN   0x18

Definition at line 326 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL0_TAG_INSERTION

#define KSZ8873_PORTn_CTRL0_TAG_INSERTION   0x04

Definition at line 327 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL0_TAG_REMOVAL

#define KSZ8873_PORTn_CTRL0_TAG_REMOVAL   0x02

Definition at line 328 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL0_TXQ_SPLIT_EN

#define KSZ8873_PORTn_CTRL0_TXQ_SPLIT_EN   0x01

Definition at line 329 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL1

#define KSZ8873_PORTn_CTRL1 (   port)    (0x01 + ((port) * 0x10))

Definition at line 200 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL12

#define KSZ8873_PORTn_CTRL12 (   port)    (0x0C + ((port) * 0x10))

Definition at line 211 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL13

#define KSZ8873_PORTn_CTRL13 (   port)    (0x0D + ((port) * 0x10))

Definition at line 212 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL1_DOUBLE_TAG

#define KSZ8873_PORTn_CTRL1_DOUBLE_TAG   0x10

Definition at line 335 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL1_PORT_VLAN_MEMBERSHIP

#define KSZ8873_PORTn_CTRL1_PORT_VLAN_MEMBERSHIP   0x07

Definition at line 337 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL1_RECEIVE_SNIFF

#define KSZ8873_PORTn_CTRL1_RECEIVE_SNIFF   0x40

Definition at line 333 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL1_SNIFFER_PORT

#define KSZ8873_PORTn_CTRL1_SNIFFER_PORT   0x80

Definition at line 332 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL1_TRANSMIT_SNIFF

#define KSZ8873_PORTn_CTRL1_TRANSMIT_SNIFF   0x20

Definition at line 334 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL1_USER_PRIO_CEILING

#define KSZ8873_PORTn_CTRL1_USER_PRIO_CEILING   0x08

Definition at line 336 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL2

#define KSZ8873_PORTn_CTRL2 (   port)    (0x02 + ((port) * 0x10))

Definition at line 201 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL2_BACK_PRESSURE_EN

#define KSZ8873_PORTn_CTRL2_BACK_PRESSURE_EN   0x08

Definition at line 344 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL2_DISCARD_NON_PVID_PKT

#define KSZ8873_PORTn_CTRL2_DISCARD_NON_PVID_PKT   0x20

Definition at line 342 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL2_FORCE_FLOW_CTRL

#define KSZ8873_PORTn_CTRL2_FORCE_FLOW_CTRL   0x10

Definition at line 343 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL2_INGRESS_VLAN_FILT

#define KSZ8873_PORTn_CTRL2_INGRESS_VLAN_FILT   0x40

Definition at line 341 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL2_LEARNING_DIS

#define KSZ8873_PORTn_CTRL2_LEARNING_DIS   0x01

Definition at line 347 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL2_RECEIVE_EN

#define KSZ8873_PORTn_CTRL2_RECEIVE_EN   0x02

Definition at line 346 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL2_TRANSMIT_EN

#define KSZ8873_PORTn_CTRL2_TRANSMIT_EN   0x04

Definition at line 345 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL2_TWO_QUEUE_SPLIT_EN

#define KSZ8873_PORTn_CTRL2_TWO_QUEUE_SPLIT_EN   0x80

Definition at line 340 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL3

#define KSZ8873_PORTn_CTRL3 (   port)    (0x03 + ((port) * 0x10))

Definition at line 202 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL3_DEFAULT_CFI

#define KSZ8873_PORTn_CTRL3_DEFAULT_CFI   0x10

Definition at line 351 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL3_DEFAULT_USER_PRIO

#define KSZ8873_PORTn_CTRL3_DEFAULT_USER_PRIO   0xE0

Definition at line 350 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL3_DEFAULT_VID_MSB

#define KSZ8873_PORTn_CTRL3_DEFAULT_VID_MSB   0x0F

Definition at line 352 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL4

#define KSZ8873_PORTn_CTRL4 (   port)    (0x04 + ((port) * 0x10))

Definition at line 203 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL4_DEFAULT_VID_LSB

#define KSZ8873_PORTn_CTRL4_DEFAULT_VID_LSB   0xFF

Definition at line 355 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_CTRL5

#define KSZ8873_PORTn_CTRL5 (   port)    (0x05 + ((port) * 0x10))

Definition at line 204 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_LINKMD

#define KSZ8873_PORTn_LINKMD (   port)    (0x0B + ((port) * 0x10))

Definition at line 210 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_LINKMD_VCT_FAULT_COUNT_LSB

#define KSZ8873_PORTn_LINKMD_VCT_FAULT_COUNT_LSB   0xFF

Definition at line 366 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_PSCS

#define KSZ8873_PORTn_PSCS (   port)    (0x0A + ((port) * 0x10))

Definition at line 209 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_PSCS_FORCE_LNK

#define KSZ8873_PORTn_PSCS_FORCE_LNK   0x08

Definition at line 361 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_PSCS_REMOTE_LOOPBACK

#define KSZ8873_PORTn_PSCS_REMOTE_LOOPBACK   0x02

Definition at line 362 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_PSCS_VCT_10M_SHORT

#define KSZ8873_PORTn_PSCS_VCT_10M_SHORT   0x80

Definition at line 358 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_PSCS_VCT_EN

#define KSZ8873_PORTn_PSCS_VCT_EN   0x10

Definition at line 360 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_PSCS_VCT_FAULT_COUNT_MSB

#define KSZ8873_PORTn_PSCS_VCT_FAULT_COUNT_MSB   0x01

Definition at line 363 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_PSCS_VCT_RESULT

#define KSZ8873_PORTn_PSCS_VCT_RESULT   0x60

Definition at line 359 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q0_EG_LIMIT

#define KSZ8873_PORTn_Q0_EG_LIMIT (   port)    (0x96 + ((port) * 0x04))

Definition at line 215 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q0_IG_LIMIT

#define KSZ8873_PORTn_Q0_IG_LIMIT (   port)    (0x06 + ((port) * 0x10))

Definition at line 205 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q0_TXQ_SPLIT

#define KSZ8873_PORTn_Q0_TXQ_SPLIT (   port)    (0xAE + ((port) * 0x04))

Definition at line 222 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q1_EG_LIMIT

#define KSZ8873_PORTn_Q1_EG_LIMIT (   port)    (0x97 + ((port) * 0x04))

Definition at line 216 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q1_IG_LIMIT

#define KSZ8873_PORTn_Q1_IG_LIMIT (   port)    (0x07 + ((port) * 0x10))

Definition at line 206 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q1_TXQ_SPLIT

#define KSZ8873_PORTn_Q1_TXQ_SPLIT (   port)    (0xAD + ((port) * 0x04))

Definition at line 221 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q2_EG_LIMIT

#define KSZ8873_PORTn_Q2_EG_LIMIT (   port)    (0x98 + ((port) * 0x04))

Definition at line 217 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q2_IG_LIMIT

#define KSZ8873_PORTn_Q2_IG_LIMIT (   port)    (0x08 + ((port) * 0x10))

Definition at line 207 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q2_TXQ_SPLIT

#define KSZ8873_PORTn_Q2_TXQ_SPLIT (   port)    (0xAC + ((port) * 0x04))

Definition at line 220 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q3_EG_LIMIT

#define KSZ8873_PORTn_Q3_EG_LIMIT (   port)    (0x99 + ((port) * 0x04))

Definition at line 218 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q3_IG_LIMIT

#define KSZ8873_PORTn_Q3_IG_LIMIT (   port)    (0x09 + ((port) * 0x10))

Definition at line 208 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_Q3_TXQ_SPLIT

#define KSZ8873_PORTn_Q3_TXQ_SPLIT (   port)    (0xAB + ((port) * 0x04))

Definition at line 219 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT0

#define KSZ8873_PORTn_STAT0 (   port)    (0x0E + ((port) * 0x10))

Definition at line 213 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT0_AN_DONE

#define KSZ8873_PORTn_STAT0_AN_DONE   0x40

Definition at line 370 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT0_LINK_GOOD

#define KSZ8873_PORTn_STAT0_LINK_GOOD   0x20

Definition at line 371 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT0_LP_100BTX_FD_CAPABLE

#define KSZ8873_PORTn_STAT0_LP_100BTX_FD_CAPABLE   0x08

Definition at line 373 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT0_LP_100BTX_HF_CAPABLE

#define KSZ8873_PORTn_STAT0_LP_100BTX_HF_CAPABLE   0x04

Definition at line 374 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT0_LP_10BT_FD_CAPABLE

#define KSZ8873_PORTn_STAT0_LP_10BT_FD_CAPABLE   0x02

Definition at line 375 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT0_LP_10BT_HD_CAPABLE

#define KSZ8873_PORTn_STAT0_LP_10BT_HD_CAPABLE   0x01

Definition at line 376 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT0_LP_FLOW_CTRL_CAPABLE

#define KSZ8873_PORTn_STAT0_LP_FLOW_CTRL_CAPABLE   0x10

Definition at line 372 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT0_MDIX_STATUS

#define KSZ8873_PORTn_STAT0_MDIX_STATUS   0x80

Definition at line 369 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT1

#define KSZ8873_PORTn_STAT1 (   port)    (0x0F + ((port) * 0x10))

Definition at line 214 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT1_FAR_END_FAULT

#define KSZ8873_PORTn_STAT1_FAR_END_FAULT   0x01

Definition at line 385 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT1_HP_MDIX

#define KSZ8873_PORTn_STAT1_HP_MDIX   0x80

Definition at line 379 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT1_OP_DUPLEX

#define KSZ8873_PORTn_STAT1_OP_DUPLEX   0x02

Definition at line 384 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT1_OP_SPEED

#define KSZ8873_PORTn_STAT1_OP_SPEED   0x04

Definition at line 383 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT1_POLRVS

#define KSZ8873_PORTn_STAT1_POLRVS   0x20

Definition at line 380 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT1_RX_FLOW_CTRL_EN

#define KSZ8873_PORTn_STAT1_RX_FLOW_CTRL_EN   0x08

Definition at line 382 of file ksz8873_driver.h.

◆ KSZ8873_PORTn_STAT1_TX_FLOW_CTRL_EN

#define KSZ8873_PORTn_STAT1_TX_FLOW_CTRL_EN   0x10

Definition at line 381 of file ksz8873_driver.h.

◆ KSZ8873_PWR_MGMT_LED_MODE

#define KSZ8873_PWR_MGMT_LED_MODE   0xC3

Definition at line 194 of file ksz8873_driver.h.

◆ KSZ8873_RESET

#define KSZ8873_RESET   0x43

Definition at line 116 of file ksz8873_driver.h.

◆ KSZ8873_RESET_PCS_RESET

#define KSZ8873_RESET_PCS_RESET   0x01

Definition at line 389 of file ksz8873_driver.h.

◆ KSZ8873_RESET_SOFT_RESET

#define KSZ8873_RESET_SOFT_RESET   0x10

Definition at line 388 of file ksz8873_driver.h.

◆ KSZ8873_SLEEP_MODE

#define KSZ8873_SLEEP_MODE   0xC4

Definition at line 195 of file ksz8873_driver.h.

◆ KSZ8873_SPI_CMD_READ

#define KSZ8873_SPI_CMD_READ   0x03

Definition at line 43 of file ksz8873_driver.h.

◆ KSZ8873_SPI_CMD_WRITE

#define KSZ8873_SPI_CMD_WRITE   0x02

Definition at line 42 of file ksz8873_driver.h.

◆ KSZ8873_TAIL_TAG_DECODE

#define KSZ8873_TAIL_TAG_DECODE (   tag)    (((tag) & 0x01) + 1)

Definition at line 399 of file ksz8873_driver.h.

◆ KSZ8873_TAIL_TAG_ENCODE

#define KSZ8873_TAIL_TAG_ENCODE (   port)    ((port) & 0x03)

Definition at line 397 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL0

#define KSZ8873_TOS_PRIO_CTRL0   0x60

Definition at line 117 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL1

#define KSZ8873_TOS_PRIO_CTRL1   0x61

Definition at line 118 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL10

#define KSZ8873_TOS_PRIO_CTRL10   0x6A

Definition at line 127 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL11

#define KSZ8873_TOS_PRIO_CTRL11   0x6B

Definition at line 128 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL12

#define KSZ8873_TOS_PRIO_CTRL12   0x6C

Definition at line 129 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL13

#define KSZ8873_TOS_PRIO_CTRL13   0x6D

Definition at line 130 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL14

#define KSZ8873_TOS_PRIO_CTRL14   0x6E

Definition at line 131 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL15

#define KSZ8873_TOS_PRIO_CTRL15   0x6F

Definition at line 132 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL2

#define KSZ8873_TOS_PRIO_CTRL2   0x62

Definition at line 119 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL3

#define KSZ8873_TOS_PRIO_CTRL3   0x63

Definition at line 120 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL4

#define KSZ8873_TOS_PRIO_CTRL4   0x64

Definition at line 121 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL5

#define KSZ8873_TOS_PRIO_CTRL5   0x65

Definition at line 122 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL6

#define KSZ8873_TOS_PRIO_CTRL6   0x66

Definition at line 123 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL7

#define KSZ8873_TOS_PRIO_CTRL7   0x67

Definition at line 124 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL8

#define KSZ8873_TOS_PRIO_CTRL8   0x68

Definition at line 125 of file ksz8873_driver.h.

◆ KSZ8873_TOS_PRIO_CTRL9

#define KSZ8873_TOS_PRIO_CTRL9   0x69

Definition at line 126 of file ksz8873_driver.h.

◆ KSZ8873_UDR1

#define KSZ8873_UDR1   0x76

Definition at line 139 of file ksz8873_driver.h.

◆ KSZ8873_UDR2

#define KSZ8873_UDR2   0x77

Definition at line 140 of file ksz8873_driver.h.

◆ KSZ8873_UDR3

#define KSZ8873_UDR3   0x78

Definition at line 141 of file ksz8873_driver.h.

Function Documentation

◆ ksz8873DisableIrq()

void ksz8873DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 327 of file ksz8873_driver.c.

◆ ksz8873DumpPhyReg()

void ksz8873DumpPhyReg ( NetInterface interface,
uint8_t  port 
)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface
[in]portPort number

Definition at line 607 of file ksz8873_driver.c.

◆ ksz8873DumpSwitchReg()

void ksz8873DumpSwitchReg ( NetInterface interface)

Dump switch registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 726 of file ksz8873_driver.c.

◆ ksz8873EnableIrq()

void ksz8873EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 317 of file ksz8873_driver.c.

◆ ksz8873EventHandler()

void ksz8873EventHandler ( NetInterface interface)

KSZ8873 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 337 of file ksz8873_driver.c.

◆ ksz8873GetLinkState()

bool_t ksz8873GetLinkState ( NetInterface interface,
uint8_t  port 
)

Get link state.

Parameters
[in]interfaceUnderlying network interface
[in]portPort number
Returns
Link state

Definition at line 174 of file ksz8873_driver.c.

◆ ksz8873Init()

error_t ksz8873Init ( NetInterface interface)

KSZ8873 Ethernet switch initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 75 of file ksz8873_driver.c.

◆ ksz8873ReadPhyReg()

uint16_t ksz8873ReadPhyReg ( NetInterface interface,
uint8_t  port,
uint8_t  address 
)

Read PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]portPort number
[in]addressPHY register address
Returns
Register value

Definition at line 593 of file ksz8873_driver.c.

◆ ksz8873ReadSwitchReg()

uint8_t ksz8873ReadSwitchReg ( NetInterface interface,
uint8_t  address 
)

Read switch register.

Parameters
[in]interfaceUnderlying network interface
[in]addressSwitch register address
Returns
Register value

Definition at line 678 of file ksz8873_driver.c.

◆ ksz8873TagFrame()

error_t ksz8873TagFrame ( NetInterface interface,
NetBuffer buffer,
size_t *  offset,
uint8_t  port,
uint16_t *  type 
)

Add tail tag to Ethernet frame.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the payload
[in,out]offsetOffset to the first payload byte
[in]portSwitch port identifier
[in,out]typeEthernet type
Returns
Error code

Definition at line 480 of file ksz8873_driver.c.

◆ ksz8873Tick()

void ksz8873Tick ( NetInterface interface)

KSZ8873 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 222 of file ksz8873_driver.c.

◆ ksz8873UntagFrame()

error_t ksz8873UntagFrame ( NetInterface interface,
uint8_t **  frame,
size_t *  length,
uint8_t *  port 
)

Decode tail tag from incoming Ethernet frame.

Parameters
[in]interfaceUnderlying network interface
[in,out]framePointer to the received Ethernet frame
[in,out]lengthLength of the frame, in bytes
[out]portSwitch port identifier
Returns
Error code

Definition at line 532 of file ksz8873_driver.c.

◆ ksz8873WritePhyReg()

void ksz8873WritePhyReg ( NetInterface interface,
uint8_t  port,
uint8_t  address,
uint16_t  data 
)

Write PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]portPort number
[in]addressPHY register address
[in]dataRegister value

Definition at line 577 of file ksz8873_driver.c.

◆ ksz8873WriteSwitchReg()

void ksz8873WriteSwitchReg ( NetInterface interface,
uint8_t  address,
uint8_t  data 
)

Write switch register.

Parameters
[in]interfaceUnderlying network interface
[in]addressSwitch register address
[in]dataRegister value

Definition at line 631 of file ksz8873_driver.c.

Variable Documentation

◆ ksz8873PhyDriver

const PhyDriver ksz8873PhyDriver

KSZ8873 Ethernet switch driver.

Definition at line 45 of file ksz8873_driver.c.