ksz8851_driver.h File Reference

KSZ8851 Ethernet controller. More...

#include "core/nic.h"

Go to the source code of this file.

Data Structures

struct  Ksz8851Context
 KSZ8851 driver context. More...
 

Macros

#define KSZ8851_SPI_SUPPORT   ENABLED
 
#define KSZ8851_ETH_TX_BUFFER_SIZE   1536
 
#define KSZ8851_ETH_RX_BUFFER_SIZE   1536
 
#define KSZ8851_DATA_REG   *((volatile uint16_t *) 0x60000000)
 
#define KSZ8851_CMD_REG   *((volatile uint16_t *) 0x60000004)
 
#define KSZ8851_CMD_RD_REG   0x00
 
#define KSZ8851_CMD_WR_REG   0x40
 
#define KSZ8851_CMD_RD_FIFO   0x80
 
#define KSZ8851_CMD_WR_FIFO   0xC0
 
#define KSZ8851_CMD_B0   0x04
 
#define KSZ8851_CMD_B1   0x08
 
#define KSZ8851_CMD_B2   0x10
 
#define KSZ8851_CMD_B3   0x20
 
#define KSZ8851_CCR   0x08
 
#define KSZ8851_MARL   0x10
 
#define KSZ8851_MARM   0x12
 
#define KSZ8851_MARH   0x14
 
#define KSZ8851_OBCR   0x20
 
#define KSZ8851_EEPCR   0x22
 
#define KSZ8851_MBIR   0x24
 
#define KSZ8851_GRR   0x26
 
#define KSZ8851_WFCR   0x2A
 
#define KSZ8851_WF0CRC0   0x30
 
#define KSZ8851_WF0CRC1   0x32
 
#define KSZ8851_WF0BM0   0x34
 
#define KSZ8851_WF0BM1   0x36
 
#define KSZ8851_WF0BM2   0x38
 
#define KSZ8851_WF0BM3   0x3A
 
#define KSZ8851_WF1CRC0   0x40
 
#define KSZ8851_WF1CRC1   0x42
 
#define KSZ8851_WF1BM0   0x44
 
#define KSZ8851_WF1BM1   0x46
 
#define KSZ8851_WF1BM2   0x48
 
#define KSZ8851_WF1BM3   0x4A
 
#define KSZ8851_WF2CRC0   0x50
 
#define KSZ8851_WF2CRC1   0x52
 
#define KSZ8851_WF2BM0   0x54
 
#define KSZ8851_WF2BM1   0x56
 
#define KSZ8851_WF2BM2   0x58
 
#define KSZ8851_WF2BM3   0x5A
 
#define KSZ8851_WF3CRC0   0x60
 
#define KSZ8851_WF3CRC1   0x62
 
#define KSZ8851_WF3BM0   0x64
 
#define KSZ8851_WF3BM1   0x66
 
#define KSZ8851_WF3BM2   0x68
 
#define KSZ8851_WF3BM3   0x6A
 
#define KSZ8851_TXCR   0x70
 
#define KSZ8851_TXSR   0x72
 
#define KSZ8851_RXCR1   0x74
 
#define KSZ8851_RXCR2   0x76
 
#define KSZ8851_TXMIR   0x78
 
#define KSZ8851_RXFHSR   0x7C
 
#define KSZ8851_RXFHBCR   0x7E
 
#define KSZ8851_TXQCR   0x80
 
#define KSZ8851_RXQCR   0x82
 
#define KSZ8851_TXFDPR   0x84
 
#define KSZ8851_RXFDPR   0x86
 
#define KSZ8851_RXDTTR   0x8C
 
#define KSZ8851_RXDBCTR   0x8E
 
#define KSZ8851_IER   0x90
 
#define KSZ8851_ISR   0x92
 
#define KSZ8851_RXFCTR   0x9C
 
#define KSZ8851_TXNTFSR   0x9E
 
#define KSZ8851_MAHTR0   0xA0
 
#define KSZ8851_MAHTR1   0xA2
 
#define KSZ8851_MAHTR2   0xA4
 
#define KSZ8851_MAHTR3   0xA6
 
#define KSZ8851_FCLWR   0xB0
 
#define KSZ8851_FCHWR   0xB2
 
#define KSZ8851_FCOWR   0xB4
 
#define KSZ8851_CIDER   0xC0
 
#define KSZ8851_CGCR   0xC6
 
#define KSZ8851_IACR   0xC8
 
#define KSZ8851_IADLR   0xD0
 
#define KSZ8851_IADHR   0xD2
 
#define KSZ8851_PMECR   0xD4
 
#define KSZ8851_GSWUTR   0xD6
 
#define KSZ8851_PHYRR   0xD8
 
#define KSZ8851_P1MBCR   0xE4
 
#define KSZ8851_P1MBSR   0xE6
 
#define KSZ8851_PHY1ILR   0xE8
 
#define KSZ8851_PHY1IHR   0xEA
 
#define KSZ8851_P1ANAR   0xEC
 
#define KSZ8851_P1ANLPR   0xEE
 
#define KSZ8851_P1SCLMD   0xF4
 
#define KSZ8851_P1CR   0xF6
 
#define KSZ8851_P1SR   0xF8
 
#define KSZ8851_CCR_BUS_ENDIAN_MODE   0x0400
 
#define KSZ8851_CCR_EEPROM_PRESENCE   0x0200
 
#define KSZ8851_CCR_SPI_BUS_MODE   0x0100
 
#define KSZ8851_CCR_8_BIT_DATA_BUS   0x0080
 
#define KSZ8851_CCR_16_BIT_DATA_BUS   0x0040
 
#define KSZ8851_CCR_32_BIT_DATA_BUS   0x0020
 
#define KSZ8851_CCR_SHARED_BUS_MODE   0x0010
 
#define KSZ8851_CCR_128_PIN_PACKAGE   0x0008
 
#define KSZ8851_CCR_48_PIN_PACKAGE   0x0002
 
#define KSZ8851_CCR_32_PIN_PACKAGE   0x0001
 
#define KSZ8851_OBCR_OUT_PIN_DRIVE_STRENGTH   0x0040
 
#define KSZ8851_OBCR_BUS_CLK_SEL   0x0004
 
#define KSZ8851_OBCR_BUS_CLK_DIV   0x0003
 
#define KSZ8851_OBCR_BUS_CLK_DIV_1   0x0000
 
#define KSZ8851_OBCR_BUS_CLK_DIV_2   0x0001
 
#define KSZ8851_OBCR_BUS_CLK_DIV_3   0x0002
 
#define KSZ8851_EEPCR_EESRWA   0x0020
 
#define KSZ8851_EEPCR_EESA   0x0010
 
#define KSZ8851_EEPCR_EESB   0x0008
 
#define KSZ8851_EEPCR_EECB   0x0007
 
#define KSZ8851_EEPCR_EECB_EED_IO   0x0004
 
#define KSZ8851_EEPCR_EECB_EESK   0x0002
 
#define KSZ8851_EEPCR_EECB_EECS   0x0001
 
#define KSZ8851_MBIR_TXMBF   0x1000
 
#define KSZ8851_MBIR_TXMBFA   0x0800
 
#define KSZ8851_MBIR_TXMBFC   0x0700
 
#define KSZ8851_MBIR_RXMBF   0x0010
 
#define KSZ8851_MBIR_RXMBFA   0x0008
 
#define KSZ8851_MBIR_RXMBFC   0x0007
 
#define KSZ8851_GRR_QMU_MODULE_SOFT_RESET   0x0002
 
#define KSZ8851_GRR_GLOBAL_SOFT_RESET   0x0001
 
#define KSZ8851_WFCR_MPRXE   0x0080
 
#define KSZ8851_WFCR_WF3E   0x0008
 
#define KSZ8851_WFCR_WF2E   0x0004
 
#define KSZ8851_WFCR_WF1E   0x0002
 
#define KSZ8851_WFCR_WF0E   0x0001
 
#define KSZ8851_TXCR_TCGICMP   0x0100
 
#define KSZ8851_TXCR_TCGTCP   0x0040
 
#define KSZ8851_TXCR_TCGIP   0x0020
 
#define KSZ8851_TXCR_FTXQ   0x0010
 
#define KSZ8851_TXCR_TXFCE   0x0008
 
#define KSZ8851_TXCR_TXPE   0x0004
 
#define KSZ8851_TXCR_TXCE   0x0002
 
#define KSZ8851_TXCR_TXE   0x0001
 
#define KSZ8851_TXSR_TXLC   0x2000
 
#define KSZ8851_TXSR_TXMC   0x1000
 
#define KSZ8851_TXSR_TXFID   0x003F
 
#define KSZ8851_RXCR1_FRXQ   0x8000
 
#define KSZ8851_RXCR1_RXUDPFCC   0x4000
 
#define KSZ8851_RXCR1_RXTCPFCC   0x2000
 
#define KSZ8851_RXCR1_RXIPFCC   0x1000
 
#define KSZ8851_RXCR1_RXPAFMA   0x0800
 
#define KSZ8851_RXCR1_RXFCE   0x0400
 
#define KSZ8851_RXCR1_RXEFE   0x0200
 
#define KSZ8851_RXCR1_RXMAFMA   0x0100
 
#define KSZ8851_RXCR1_RXBE   0x0080
 
#define KSZ8851_RXCR1_RXME   0x0040
 
#define KSZ8851_RXCR1_RXUE   0x0020
 
#define KSZ8851_RXCR1_RXAE   0x0010
 
#define KSZ8851_RXCR1_RXINVF   0x0002
 
#define KSZ8851_RXCR1_RXE   0x0001
 
#define KSZ8851_RXCR2_SRDBL   0x00E0
 
#define KSZ8851_RXCR2_SRDBL_4_BYTES   0x0000
 
#define KSZ8851_RXCR2_SRDBL_8_BYTES   0x0020
 
#define KSZ8851_RXCR2_SRDBL_16_BYTES   0x0040
 
#define KSZ8851_RXCR2_SRDBL_32_BYTES   0x0060
 
#define KSZ8851_RXCR2_SRDBL_SINGLE_FRAME   0x0080
 
#define KSZ8851_RXCR2_IUFFP   0x0010
 
#define KSZ8851_RXCR2_RXIUFCEZ   0x0008
 
#define KSZ8851_RXCR2_UDPLFE   0x0004
 
#define KSZ8851_RXCR2_RXICMPFCC   0x0002
 
#define KSZ8851_RXCR2_RXSAF   0x0001
 
#define KSZ8851_TXMIR_TXMA   0x1FFF
 
#define KSZ8851_RXFHSR_RXFV   0x8000
 
#define KSZ8851_RXFHSR_RXICMPFCS   0x2000
 
#define KSZ8851_RXFHSR_RXIPFCS   0x1000
 
#define KSZ8851_RXFHSR_RXTCPFCS   0x0800
 
#define KSZ8851_RXFHSR_RXUDPFCS   0x0400
 
#define KSZ8851_RXFHSR_RXBF   0x0080
 
#define KSZ8851_RXFHSR_RXMF   0x0040
 
#define KSZ8851_RXFHSR_RXUF   0x0020
 
#define KSZ8851_RXFHSR_RXMR   0x0010
 
#define KSZ8851_RXFHSR_RXFT   0x0008
 
#define KSZ8851_RXFHSR_RXFTL   0x0004
 
#define KSZ8851_RXFHSR_RXRF   0x0002
 
#define KSZ8851_RXFHSR_RXCE   0x0001
 
#define KSZ8851_RXFHBCR_RXBC   0x0FFF
 
#define KSZ8851_TXQCR_AETFE   0x0004
 
#define KSZ8851_TXQCR_TXQMAM   0x0002
 
#define KSZ8851_TXQCR_METFE   0x0001
 
#define KSZ8851_RXQCR_RXDTTS   0x1000
 
#define KSZ8851_RXQCR_RXDBCTS   0x0800
 
#define KSZ8851_RXQCR_RXFCTS   0x0400
 
#define KSZ8851_RXQCR_RXIPHTOE   0x0200
 
#define KSZ8851_RXQCR_RXDTTE   0x0080
 
#define KSZ8851_RXQCR_RXDBCTE   0x0040
 
#define KSZ8851_RXQCR_RXFCTE   0x0020
 
#define KSZ8851_RXQCR_ADRFE   0x0010
 
#define KSZ8851_RXQCR_SDA   0x0008
 
#define KSZ8851_RXQCR_RRXEF   0x0001
 
#define KSZ8851_TXFDPR_TXFPAI   0x4000
 
#define KSZ8851_TXFDPR_TXFP   0x07FF
 
#define KSZ8851_RXFDPR_RXFPAI   0x4000
 
#define KSZ8851_RXFDPR_WST   0x1000
 
#define KSZ8851_RXFDPR_EMS   0x0800
 
#define KSZ8851_RXFDPR_RXFP   0x07FF
 
#define KSZ8851_IER_LCIE   0x8000
 
#define KSZ8851_IER_TXIE   0x4000
 
#define KSZ8851_IER_RXIE   0x2000
 
#define KSZ8851_IER_RXOIE   0x0800
 
#define KSZ8851_IER_TXPSIE   0x0200
 
#define KSZ8851_IER_RXPSIE   0x0100
 
#define KSZ8851_IER_TXSAIE   0x0040
 
#define KSZ8851_IER_RXWFDIE   0x0020
 
#define KSZ8851_IER_RXMPDIE   0x0010
 
#define KSZ8851_IER_LDIE   0x0008
 
#define KSZ8851_IER_EDIE   0x0004
 
#define KSZ8851_IER_SPIBEIE   0x0002
 
#define KSZ8851_IER_DEDIE   0x0001
 
#define KSZ8851_ISR_LCIS   0x8000
 
#define KSZ8851_ISR_TXIS   0x4000
 
#define KSZ8851_ISR_RXIS   0x2000
 
#define KSZ8851_ISR_RXOIS   0x0800
 
#define KSZ8851_ISR_TXPSIS   0x0200
 
#define KSZ8851_ISR_RXPSIS   0x0100
 
#define KSZ8851_ISR_TXSAIS   0x0040
 
#define KSZ8851_ISR_RXWFDIS   0x0020
 
#define KSZ8851_ISR_RXMPDIS   0x0010
 
#define KSZ8851_ISR_LDIS   0x0008
 
#define KSZ8851_ISR_EDIS   0x0004
 
#define KSZ8851_ISR_SPIBEIS   0x0002
 
#define KSZ8851_RXFCTR_RXFC   0xFF00
 
#define KSZ8851_RXFCTR_RXFCT   0x00FF
 
#define KSZ8851_FCLWR_FCLWC   0x0FFF
 
#define KSZ8851_FCHWR_FCHWC   0x0FFF
 
#define KSZ8851_FCOWR_FCLWC   0x0FFF
 
#define KSZ8851_CIDER_FAMILY_ID   0xFF00
 
#define KSZ8851_CIDER_FAMILY_ID_DEFAULT   0x8800
 
#define KSZ8851_CIDER_CHIP_ID   0x00F0
 
#define KSZ8851_CIDER_CHIP_ID_DEFAULT   0x0070
 
#define KSZ8851_CIDER_REV_ID   0x000E
 
#define KSZ8851_CIDER_REV_ID_A2   0x0000
 
#define KSZ8851_CIDER_REV_ID_A3   0x0002
 
#define KSZ8851_CGCR_LEDSEL0   0x0200
 
#define KSZ8851_IACR_READ_EN   0x1000
 
#define KSZ8851_IACR_TABLE_SEL   0x0C00
 
#define KSZ8851_IACR_TABLE_SEL_MIB_COUNTER   0x0C00
 
#define KSZ8851_IACR_INDIRECT_ADDR   0x001F
 
#define KSZ8851_PMECR_PME_DELAY_EN   0x4000
 
#define KSZ8851_PMECR_PME_OUT_POLARITY   0x1000
 
#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN   0x0F00
 
#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN_WUP_FRAME   0x0800
 
#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN_MAGIC_PKT   0x0400
 
#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN_LINK_UP   0x0200
 
#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN_ENERGY_DETECT   0x0100
 
#define KSZ8851_PMECR_AUTO_WUP_EN   0x0080
 
#define KSZ8851_PMECR_WUP_TO_NORMAL_OP_MODE   0x0040
 
#define KSZ8851_PMECR_WUP_EVENT   0x003C
 
#define KSZ8851_PMECR_WUP_EVENT_NONE   0x0000
 
#define KSZ8851_PMECR_WUP_EVENT_ENERGY_DETECT   0x0004
 
#define KSZ8851_PMECR_WUP_EVENT_LINK_UP   0x0008
 
#define KSZ8851_PMECR_WUP_EVENT_MAGIC_PKT   0x0010
 
#define KSZ8851_PMECR_WUP_EVENT_WUP_FRAME   0x0020
 
#define KSZ8851_PMECR_PWR_MGMT_MODE   0x0003
 
#define KSZ8851_PMECR_PWR_MGMT_MODE_NORMAL   0x0000
 
#define KSZ8851_PMECR_PWR_MGMT_MODE_ENERGY_DETECT   0x0001
 
#define KSZ8851_PMECR_PWR_MGMT_MODE_PWR_SAVING   0x0003
 
#define KSZ8851_GSWUTR_WUP_TIME   0xFF00
 
#define KSZ8851_GSWUTR_GO_SLEEP_TIME   0x00FF
 
#define KSZ8851_PHYRR_PHY_RESET   0x0001
 
#define KSZ8851_P1MBCR_LOCAL_LOOPBACK   0x4000
 
#define KSZ8851_P1MBCR_FORCE_100   0x2000
 
#define KSZ8851_P1MBCR_AN_ENABLE   0x1000
 
#define KSZ8851_P1MBCR_RESTART_AN   0x0200
 
#define KSZ8851_P1MBCR_FORCE_FULL_DUPLEX   0x0100
 
#define KSZ8851_P1MBCR_HP_MDIX   0x0020
 
#define KSZ8851_P1MBCR_FORCE_MDIX   0x0010
 
#define KSZ8851_P1MBCR_DISABLE_MDIX   0x0008
 
#define KSZ8851_P1MBCR_DISABLE_TRANSMIT   0x0002
 
#define KSZ8851_P1MBCR_DISABLE_LED   0x0001
 
#define KSZ8851_P1MBSR_T4_CAPABLE   0x8000
 
#define KSZ8851_P1MBSR_100_FULL_CAPABLE   0x4000
 
#define KSZ8851_P1MBSR_100_HALF_CAPABLE   0x2000
 
#define KSZ8851_P1MBSR_10_FULL_CAPABLE   0x1000
 
#define KSZ8851_P1MBSR_10_HALF_CAPABLE   0x0800
 
#define KSZ8851_P1MBSR_PREAMBLE_SUPPR   0x0040
 
#define KSZ8851_P1MBSR_AN_COMPLETE   0x0020
 
#define KSZ8851_P1MBSR_AN_CAPABLE   0x0008
 
#define KSZ8851_P1MBSR_LINK_STATUS   0x0004
 
#define KSZ8851_P1MBSR_JABBER_TEST   0x0002
 
#define KSZ8851_P1MBSR_EXTENDED_CAPABLE   0x0001
 
#define KSZ8851_PHY1ILR_DEFAULT   0x1430
 
#define KSZ8851_PHY1IHR_DEFAULT   0x0022
 
#define KSZ8851_P1ANAR_NEXT_PAGE   0x8000
 
#define KSZ8851_P1ANAR_REMOTE_FAULT   0x2000
 
#define KSZ8851_P1ANAR_PAUSE   0x0400
 
#define KSZ8851_P1ANAR_ADV_100_FULL   0x0100
 
#define KSZ8851_P1ANAR_ADV_100_HALF   0x0080
 
#define KSZ8851_P1ANAR_ADV_10_FULL   0x0040
 
#define KSZ8851_P1ANAR_ADV_10_HALF   0x0020
 
#define KSZ8851_P1ANAR_SELECTOR   0x001F
 
#define KSZ8851_P1ANLPR_NEXT_PAGE   0x8000
 
#define KSZ8851_P1ANLPR_LP_ACK   0x4000
 
#define KSZ8851_P1ANLPR_REMOTE_FAULT   0x2000
 
#define KSZ8851_P1ANLPR_PAUSE   0x0400
 
#define KSZ8851_P1ANLPR_ADV_100_FULL   0x0100
 
#define KSZ8851_P1ANLPR_ADV_100_HALF   0x0080
 
#define KSZ8851_P1ANLPR_ADV_10_FULL   0x0040
 
#define KSZ8851_P1ANLPR_ADV_10_HALF   0x0020
 
#define KSZ8851_P1SCLMD_VCT_RESULT   0x6000
 
#define KSZ8851_P1SCLMD_VCT_EN   0x1000
 
#define KSZ8851_P1SCLMD_FORCE_LNK   0x0800
 
#define KSZ8851_P1SCLMD_REMOTE_LOOPBACK   0x0200
 
#define KSZ8851_P1SCLMD_VCT_FAULT_COUNT   0x01FF
 
#define KSZ8851_P1CR_LED_OFF   0x8000
 
#define KSZ8851_P1CR_TX_DISABLE   0x4000
 
#define KSZ8851_P1CR_RESTART_AN   0x2000
 
#define KSZ8851_P1CR_DISABLE_AUTO_MDIX   0x0400
 
#define KSZ8851_P1CR_FORCE_MDIX   0x0200
 
#define KSZ8851_P1CR_AN_ENABLE   0x0080
 
#define KSZ8851_P1CR_FORCE_SPEED   0x0040
 
#define KSZ8851_P1CR_FORCE_DUPLEX   0x0020
 
#define KSZ8851_P1CR_ADV_PAUSE   0x0010
 
#define KSZ8851_P1CR_ADV_100_FULL   0x0008
 
#define KSZ8851_P1CR_ADV_100_HALF   0x0004
 
#define KSZ8851_P1CR_ADV_10_FULL   0x0002
 
#define KSZ8851_P1CR_ADV_10_HALF   0x0001
 
#define KSZ8851_P1SR_HP_MDIX   0x8000
 
#define KSZ8851_P1SR_POLARITY_REVERSE   0x2000
 
#define KSZ8851_P1SR_OPERATION_SPEED   0x0400
 
#define KSZ8851_P1SR_OPERATION_DUPLEX   0x0200
 
#define KSZ8851_P1SR_MDIX_STATUS   0x0080
 
#define KSZ8851_P1SR_AN_DONE   0x0040
 
#define KSZ8851_P1SR_LINK_GOOD   0x0020
 
#define KSZ8851_P1SR_LP_PAUSE   0x0010
 
#define KSZ8851_P1SR_LP_100_FULL   0x0008
 
#define KSZ8851_P1SR_LP_100_HALF   0x0004
 
#define KSZ8851_P1SR_LP_10_FULL   0x0002
 
#define KSZ8851_P1SR_LP_10_HALF   0x0001
 
#define KSZ8851_TX_CTRL_TXIC   0x8000
 
#define KSZ8851_TX_CTRL_TXFID   0x003F
 

Functions

error_t ksz8851Init (NetInterface *interface)
 KSZ8851 controller initialization. More...
 
void ksz8851InitHook (NetInterface *interface)
 KSZ8851 custom configuration. More...
 
void ksz8851Tick (NetInterface *interface)
 KSZ8851 timer handler. More...
 
void ksz8851EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ksz8851DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
bool_t ksz8851IrqHandler (NetInterface *interface)
 KSZ8851 interrupt service routine. More...
 
void ksz8851EventHandler (NetInterface *interface)
 KSZ8851 event handler. More...
 
error_t ksz8851SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send a packet. More...
 
error_t ksz8851ReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t ksz8851UpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void ksz8851WriteReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write KSZ8851 register. More...
 
uint16_t ksz8851ReadReg (NetInterface *interface, uint8_t address)
 Read KSZ8851 register. More...
 
void ksz8851WriteFifo (NetInterface *interface, const uint8_t *data, size_t length)
 Write TX FIFO. More...
 
void ksz8851ReadFifo (NetInterface *interface, uint8_t *data, size_t length)
 Read RX FIFO. More...
 
void ksz8851SetBit (NetInterface *interface, uint8_t address, uint16_t mask)
 Set bit field. More...
 
void ksz8851ClearBit (NetInterface *interface, uint8_t address, uint16_t mask)
 Clear bit field. More...
 
uint32_t ksz8851CalcCrc (const void *data, size_t length)
 CRC calculation. More...
 
void ksz8851DumpReg (NetInterface *interface)
 Dump registers for debugging purpose. More...
 

Variables

typedef __packed_struct
 TX packet header. More...
 
uint16_t byteCount
 
 Ksz8851TxHeader
 
 Ksz8851RxHeader
 
const NicDriver ksz8851Driver
 KSZ8851 driver. More...
 

Detailed Description

KSZ8851 Ethernet controller.

License

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

Copyright (C) 2010-2024 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
2.4.4

Definition in file ksz8851_driver.h.

Macro Definition Documentation

◆ KSZ8851_CCR

#define KSZ8851_CCR   0x08

Definition at line 88 of file ksz8851_driver.h.

◆ KSZ8851_CCR_128_PIN_PACKAGE

#define KSZ8851_CCR_128_PIN_PACKAGE   0x0008

Definition at line 171 of file ksz8851_driver.h.

◆ KSZ8851_CCR_16_BIT_DATA_BUS

#define KSZ8851_CCR_16_BIT_DATA_BUS   0x0040

Definition at line 168 of file ksz8851_driver.h.

◆ KSZ8851_CCR_32_BIT_DATA_BUS

#define KSZ8851_CCR_32_BIT_DATA_BUS   0x0020

Definition at line 169 of file ksz8851_driver.h.

◆ KSZ8851_CCR_32_PIN_PACKAGE

#define KSZ8851_CCR_32_PIN_PACKAGE   0x0001

Definition at line 173 of file ksz8851_driver.h.

◆ KSZ8851_CCR_48_PIN_PACKAGE

#define KSZ8851_CCR_48_PIN_PACKAGE   0x0002

Definition at line 172 of file ksz8851_driver.h.

◆ KSZ8851_CCR_8_BIT_DATA_BUS

#define KSZ8851_CCR_8_BIT_DATA_BUS   0x0080

Definition at line 167 of file ksz8851_driver.h.

◆ KSZ8851_CCR_BUS_ENDIAN_MODE

#define KSZ8851_CCR_BUS_ENDIAN_MODE   0x0400

Definition at line 164 of file ksz8851_driver.h.

◆ KSZ8851_CCR_EEPROM_PRESENCE

#define KSZ8851_CCR_EEPROM_PRESENCE   0x0200

Definition at line 165 of file ksz8851_driver.h.

◆ KSZ8851_CCR_SHARED_BUS_MODE

#define KSZ8851_CCR_SHARED_BUS_MODE   0x0010

Definition at line 170 of file ksz8851_driver.h.

◆ KSZ8851_CCR_SPI_BUS_MODE

#define KSZ8851_CCR_SPI_BUS_MODE   0x0100

Definition at line 166 of file ksz8851_driver.h.

◆ KSZ8851_CGCR

#define KSZ8851_CGCR   0xC6

Definition at line 146 of file ksz8851_driver.h.

◆ KSZ8851_CGCR_LEDSEL0

#define KSZ8851_CGCR_LEDSEL0   0x0200

Definition at line 355 of file ksz8851_driver.h.

◆ KSZ8851_CIDER

#define KSZ8851_CIDER   0xC0

Definition at line 145 of file ksz8851_driver.h.

◆ KSZ8851_CIDER_CHIP_ID

#define KSZ8851_CIDER_CHIP_ID   0x00F0

Definition at line 348 of file ksz8851_driver.h.

◆ KSZ8851_CIDER_CHIP_ID_DEFAULT

#define KSZ8851_CIDER_CHIP_ID_DEFAULT   0x0070

Definition at line 349 of file ksz8851_driver.h.

◆ KSZ8851_CIDER_FAMILY_ID

#define KSZ8851_CIDER_FAMILY_ID   0xFF00

Definition at line 346 of file ksz8851_driver.h.

◆ KSZ8851_CIDER_FAMILY_ID_DEFAULT

#define KSZ8851_CIDER_FAMILY_ID_DEFAULT   0x8800

Definition at line 347 of file ksz8851_driver.h.

◆ KSZ8851_CIDER_REV_ID

#define KSZ8851_CIDER_REV_ID   0x000E

Definition at line 350 of file ksz8851_driver.h.

◆ KSZ8851_CIDER_REV_ID_A2

#define KSZ8851_CIDER_REV_ID_A2   0x0000

Definition at line 351 of file ksz8851_driver.h.

◆ KSZ8851_CIDER_REV_ID_A3

#define KSZ8851_CIDER_REV_ID_A3   0x0002

Definition at line 352 of file ksz8851_driver.h.

◆ KSZ8851_CMD_B0

#define KSZ8851_CMD_B0   0x04

Definition at line 76 of file ksz8851_driver.h.

◆ KSZ8851_CMD_B1

#define KSZ8851_CMD_B1   0x08

Definition at line 77 of file ksz8851_driver.h.

◆ KSZ8851_CMD_B2

#define KSZ8851_CMD_B2   0x10

Definition at line 78 of file ksz8851_driver.h.

◆ KSZ8851_CMD_B3

#define KSZ8851_CMD_B3   0x20

Definition at line 79 of file ksz8851_driver.h.

◆ KSZ8851_CMD_RD_FIFO

#define KSZ8851_CMD_RD_FIFO   0x80

Definition at line 71 of file ksz8851_driver.h.

◆ KSZ8851_CMD_RD_REG

#define KSZ8851_CMD_RD_REG   0x00

Definition at line 69 of file ksz8851_driver.h.

◆ KSZ8851_CMD_REG

#define KSZ8851_CMD_REG   *((volatile uint16_t *) 0x60000004)

Definition at line 65 of file ksz8851_driver.h.

◆ KSZ8851_CMD_WR_FIFO

#define KSZ8851_CMD_WR_FIFO   0xC0

Definition at line 72 of file ksz8851_driver.h.

◆ KSZ8851_CMD_WR_REG

#define KSZ8851_CMD_WR_REG   0x40

Definition at line 70 of file ksz8851_driver.h.

◆ KSZ8851_DATA_REG

#define KSZ8851_DATA_REG   *((volatile uint16_t *) 0x60000000)

Definition at line 60 of file ksz8851_driver.h.

◆ KSZ8851_EEPCR

#define KSZ8851_EEPCR   0x22

Definition at line 93 of file ksz8851_driver.h.

◆ KSZ8851_EEPCR_EECB

#define KSZ8851_EEPCR_EECB   0x0007

Definition at line 187 of file ksz8851_driver.h.

◆ KSZ8851_EEPCR_EECB_EECS

#define KSZ8851_EEPCR_EECB_EECS   0x0001

Definition at line 190 of file ksz8851_driver.h.

◆ KSZ8851_EEPCR_EECB_EED_IO

#define KSZ8851_EEPCR_EECB_EED_IO   0x0004

Definition at line 188 of file ksz8851_driver.h.

◆ KSZ8851_EEPCR_EECB_EESK

#define KSZ8851_EEPCR_EECB_EESK   0x0002

Definition at line 189 of file ksz8851_driver.h.

◆ KSZ8851_EEPCR_EESA

#define KSZ8851_EEPCR_EESA   0x0010

Definition at line 185 of file ksz8851_driver.h.

◆ KSZ8851_EEPCR_EESB

#define KSZ8851_EEPCR_EESB   0x0008

Definition at line 186 of file ksz8851_driver.h.

◆ KSZ8851_EEPCR_EESRWA

#define KSZ8851_EEPCR_EESRWA   0x0020

Definition at line 184 of file ksz8851_driver.h.

◆ KSZ8851_ETH_RX_BUFFER_SIZE

#define KSZ8851_ETH_RX_BUFFER_SIZE   1536

Definition at line 53 of file ksz8851_driver.h.

◆ KSZ8851_ETH_TX_BUFFER_SIZE

#define KSZ8851_ETH_TX_BUFFER_SIZE   1536

Definition at line 46 of file ksz8851_driver.h.

◆ KSZ8851_FCHWR

#define KSZ8851_FCHWR   0xB2

Definition at line 143 of file ksz8851_driver.h.

◆ KSZ8851_FCHWR_FCHWC

#define KSZ8851_FCHWR_FCHWC   0x0FFF

Definition at line 340 of file ksz8851_driver.h.

◆ KSZ8851_FCLWR

#define KSZ8851_FCLWR   0xB0

Definition at line 142 of file ksz8851_driver.h.

◆ KSZ8851_FCLWR_FCLWC

#define KSZ8851_FCLWR_FCLWC   0x0FFF

Definition at line 337 of file ksz8851_driver.h.

◆ KSZ8851_FCOWR

#define KSZ8851_FCOWR   0xB4

Definition at line 144 of file ksz8851_driver.h.

◆ KSZ8851_FCOWR_FCLWC

#define KSZ8851_FCOWR_FCLWC   0x0FFF

Definition at line 343 of file ksz8851_driver.h.

◆ KSZ8851_GRR

#define KSZ8851_GRR   0x26

Definition at line 95 of file ksz8851_driver.h.

◆ KSZ8851_GRR_GLOBAL_SOFT_RESET

#define KSZ8851_GRR_GLOBAL_SOFT_RESET   0x0001

Definition at line 202 of file ksz8851_driver.h.

◆ KSZ8851_GRR_QMU_MODULE_SOFT_RESET

#define KSZ8851_GRR_QMU_MODULE_SOFT_RESET   0x0002

Definition at line 201 of file ksz8851_driver.h.

◆ KSZ8851_GSWUTR

#define KSZ8851_GSWUTR   0xD6

Definition at line 151 of file ksz8851_driver.h.

◆ KSZ8851_GSWUTR_GO_SLEEP_TIME

#define KSZ8851_GSWUTR_GO_SLEEP_TIME   0x00FF

Definition at line 386 of file ksz8851_driver.h.

◆ KSZ8851_GSWUTR_WUP_TIME

#define KSZ8851_GSWUTR_WUP_TIME   0xFF00

Definition at line 385 of file ksz8851_driver.h.

◆ KSZ8851_IACR

#define KSZ8851_IACR   0xC8

Definition at line 147 of file ksz8851_driver.h.

◆ KSZ8851_IACR_INDIRECT_ADDR

#define KSZ8851_IACR_INDIRECT_ADDR   0x001F

Definition at line 361 of file ksz8851_driver.h.

◆ KSZ8851_IACR_READ_EN

#define KSZ8851_IACR_READ_EN   0x1000

Definition at line 358 of file ksz8851_driver.h.

◆ KSZ8851_IACR_TABLE_SEL

#define KSZ8851_IACR_TABLE_SEL   0x0C00

Definition at line 359 of file ksz8851_driver.h.

◆ KSZ8851_IACR_TABLE_SEL_MIB_COUNTER

#define KSZ8851_IACR_TABLE_SEL_MIB_COUNTER   0x0C00

Definition at line 360 of file ksz8851_driver.h.

◆ KSZ8851_IADHR

#define KSZ8851_IADHR   0xD2

Definition at line 149 of file ksz8851_driver.h.

◆ KSZ8851_IADLR

#define KSZ8851_IADLR   0xD0

Definition at line 148 of file ksz8851_driver.h.

◆ KSZ8851_IER

#define KSZ8851_IER   0x90

Definition at line 134 of file ksz8851_driver.h.

◆ KSZ8851_IER_DEDIE

#define KSZ8851_IER_DEDIE   0x0001

Definition at line 316 of file ksz8851_driver.h.

◆ KSZ8851_IER_EDIE

#define KSZ8851_IER_EDIE   0x0004

Definition at line 314 of file ksz8851_driver.h.

◆ KSZ8851_IER_LCIE

#define KSZ8851_IER_LCIE   0x8000

Definition at line 304 of file ksz8851_driver.h.

◆ KSZ8851_IER_LDIE

#define KSZ8851_IER_LDIE   0x0008

Definition at line 313 of file ksz8851_driver.h.

◆ KSZ8851_IER_RXIE

#define KSZ8851_IER_RXIE   0x2000

Definition at line 306 of file ksz8851_driver.h.

◆ KSZ8851_IER_RXMPDIE

#define KSZ8851_IER_RXMPDIE   0x0010

Definition at line 312 of file ksz8851_driver.h.

◆ KSZ8851_IER_RXOIE

#define KSZ8851_IER_RXOIE   0x0800

Definition at line 307 of file ksz8851_driver.h.

◆ KSZ8851_IER_RXPSIE

#define KSZ8851_IER_RXPSIE   0x0100

Definition at line 309 of file ksz8851_driver.h.

◆ KSZ8851_IER_RXWFDIE

#define KSZ8851_IER_RXWFDIE   0x0020

Definition at line 311 of file ksz8851_driver.h.

◆ KSZ8851_IER_SPIBEIE

#define KSZ8851_IER_SPIBEIE   0x0002

Definition at line 315 of file ksz8851_driver.h.

◆ KSZ8851_IER_TXIE

#define KSZ8851_IER_TXIE   0x4000

Definition at line 305 of file ksz8851_driver.h.

◆ KSZ8851_IER_TXPSIE

#define KSZ8851_IER_TXPSIE   0x0200

Definition at line 308 of file ksz8851_driver.h.

◆ KSZ8851_IER_TXSAIE

#define KSZ8851_IER_TXSAIE   0x0040

Definition at line 310 of file ksz8851_driver.h.

◆ KSZ8851_ISR

#define KSZ8851_ISR   0x92

Definition at line 135 of file ksz8851_driver.h.

◆ KSZ8851_ISR_EDIS

#define KSZ8851_ISR_EDIS   0x0004

Definition at line 329 of file ksz8851_driver.h.

◆ KSZ8851_ISR_LCIS

#define KSZ8851_ISR_LCIS   0x8000

Definition at line 319 of file ksz8851_driver.h.

◆ KSZ8851_ISR_LDIS

#define KSZ8851_ISR_LDIS   0x0008

Definition at line 328 of file ksz8851_driver.h.

◆ KSZ8851_ISR_RXIS

#define KSZ8851_ISR_RXIS   0x2000

Definition at line 321 of file ksz8851_driver.h.

◆ KSZ8851_ISR_RXMPDIS

#define KSZ8851_ISR_RXMPDIS   0x0010

Definition at line 327 of file ksz8851_driver.h.

◆ KSZ8851_ISR_RXOIS

#define KSZ8851_ISR_RXOIS   0x0800

Definition at line 322 of file ksz8851_driver.h.

◆ KSZ8851_ISR_RXPSIS

#define KSZ8851_ISR_RXPSIS   0x0100

Definition at line 324 of file ksz8851_driver.h.

◆ KSZ8851_ISR_RXWFDIS

#define KSZ8851_ISR_RXWFDIS   0x0020

Definition at line 326 of file ksz8851_driver.h.

◆ KSZ8851_ISR_SPIBEIS

#define KSZ8851_ISR_SPIBEIS   0x0002

Definition at line 330 of file ksz8851_driver.h.

◆ KSZ8851_ISR_TXIS

#define KSZ8851_ISR_TXIS   0x4000

Definition at line 320 of file ksz8851_driver.h.

◆ KSZ8851_ISR_TXPSIS

#define KSZ8851_ISR_TXPSIS   0x0200

Definition at line 323 of file ksz8851_driver.h.

◆ KSZ8851_ISR_TXSAIS

#define KSZ8851_ISR_TXSAIS   0x0040

Definition at line 325 of file ksz8851_driver.h.

◆ KSZ8851_MAHTR0

#define KSZ8851_MAHTR0   0xA0

Definition at line 138 of file ksz8851_driver.h.

◆ KSZ8851_MAHTR1

#define KSZ8851_MAHTR1   0xA2

Definition at line 139 of file ksz8851_driver.h.

◆ KSZ8851_MAHTR2

#define KSZ8851_MAHTR2   0xA4

Definition at line 140 of file ksz8851_driver.h.

◆ KSZ8851_MAHTR3

#define KSZ8851_MAHTR3   0xA6

Definition at line 141 of file ksz8851_driver.h.

◆ KSZ8851_MARH

#define KSZ8851_MARH   0x14

Definition at line 91 of file ksz8851_driver.h.

◆ KSZ8851_MARL

#define KSZ8851_MARL   0x10

Definition at line 89 of file ksz8851_driver.h.

◆ KSZ8851_MARM

#define KSZ8851_MARM   0x12

Definition at line 90 of file ksz8851_driver.h.

◆ KSZ8851_MBIR

#define KSZ8851_MBIR   0x24

Definition at line 94 of file ksz8851_driver.h.

◆ KSZ8851_MBIR_RXMBF

#define KSZ8851_MBIR_RXMBF   0x0010

Definition at line 196 of file ksz8851_driver.h.

◆ KSZ8851_MBIR_RXMBFA

#define KSZ8851_MBIR_RXMBFA   0x0008

Definition at line 197 of file ksz8851_driver.h.

◆ KSZ8851_MBIR_RXMBFC

#define KSZ8851_MBIR_RXMBFC   0x0007

Definition at line 198 of file ksz8851_driver.h.

◆ KSZ8851_MBIR_TXMBF

#define KSZ8851_MBIR_TXMBF   0x1000

Definition at line 193 of file ksz8851_driver.h.

◆ KSZ8851_MBIR_TXMBFA

#define KSZ8851_MBIR_TXMBFA   0x0800

Definition at line 194 of file ksz8851_driver.h.

◆ KSZ8851_MBIR_TXMBFC

#define KSZ8851_MBIR_TXMBFC   0x0700

Definition at line 195 of file ksz8851_driver.h.

◆ KSZ8851_OBCR

#define KSZ8851_OBCR   0x20

Definition at line 92 of file ksz8851_driver.h.

◆ KSZ8851_OBCR_BUS_CLK_DIV

#define KSZ8851_OBCR_BUS_CLK_DIV   0x0003

Definition at line 178 of file ksz8851_driver.h.

◆ KSZ8851_OBCR_BUS_CLK_DIV_1

#define KSZ8851_OBCR_BUS_CLK_DIV_1   0x0000

Definition at line 179 of file ksz8851_driver.h.

◆ KSZ8851_OBCR_BUS_CLK_DIV_2

#define KSZ8851_OBCR_BUS_CLK_DIV_2   0x0001

Definition at line 180 of file ksz8851_driver.h.

◆ KSZ8851_OBCR_BUS_CLK_DIV_3

#define KSZ8851_OBCR_BUS_CLK_DIV_3   0x0002

Definition at line 181 of file ksz8851_driver.h.

◆ KSZ8851_OBCR_BUS_CLK_SEL

#define KSZ8851_OBCR_BUS_CLK_SEL   0x0004

Definition at line 177 of file ksz8851_driver.h.

◆ KSZ8851_OBCR_OUT_PIN_DRIVE_STRENGTH

#define KSZ8851_OBCR_OUT_PIN_DRIVE_STRENGTH   0x0040

Definition at line 176 of file ksz8851_driver.h.

◆ KSZ8851_P1ANAR

#define KSZ8851_P1ANAR   0xEC

Definition at line 157 of file ksz8851_driver.h.

◆ KSZ8851_P1ANAR_ADV_100_FULL

#define KSZ8851_P1ANAR_ADV_100_FULL   0x0100

Definition at line 426 of file ksz8851_driver.h.

◆ KSZ8851_P1ANAR_ADV_100_HALF

#define KSZ8851_P1ANAR_ADV_100_HALF   0x0080

Definition at line 427 of file ksz8851_driver.h.

◆ KSZ8851_P1ANAR_ADV_10_FULL

#define KSZ8851_P1ANAR_ADV_10_FULL   0x0040

Definition at line 428 of file ksz8851_driver.h.

◆ KSZ8851_P1ANAR_ADV_10_HALF

#define KSZ8851_P1ANAR_ADV_10_HALF   0x0020

Definition at line 429 of file ksz8851_driver.h.

◆ KSZ8851_P1ANAR_NEXT_PAGE

#define KSZ8851_P1ANAR_NEXT_PAGE   0x8000

Definition at line 423 of file ksz8851_driver.h.

◆ KSZ8851_P1ANAR_PAUSE

#define KSZ8851_P1ANAR_PAUSE   0x0400

Definition at line 425 of file ksz8851_driver.h.

◆ KSZ8851_P1ANAR_REMOTE_FAULT

#define KSZ8851_P1ANAR_REMOTE_FAULT   0x2000

Definition at line 424 of file ksz8851_driver.h.

◆ KSZ8851_P1ANAR_SELECTOR

#define KSZ8851_P1ANAR_SELECTOR   0x001F

Definition at line 430 of file ksz8851_driver.h.

◆ KSZ8851_P1ANLPR

#define KSZ8851_P1ANLPR   0xEE

Definition at line 158 of file ksz8851_driver.h.

◆ KSZ8851_P1ANLPR_ADV_100_FULL

#define KSZ8851_P1ANLPR_ADV_100_FULL   0x0100

Definition at line 437 of file ksz8851_driver.h.

◆ KSZ8851_P1ANLPR_ADV_100_HALF

#define KSZ8851_P1ANLPR_ADV_100_HALF   0x0080

Definition at line 438 of file ksz8851_driver.h.

◆ KSZ8851_P1ANLPR_ADV_10_FULL

#define KSZ8851_P1ANLPR_ADV_10_FULL   0x0040

Definition at line 439 of file ksz8851_driver.h.

◆ KSZ8851_P1ANLPR_ADV_10_HALF

#define KSZ8851_P1ANLPR_ADV_10_HALF   0x0020

Definition at line 440 of file ksz8851_driver.h.

◆ KSZ8851_P1ANLPR_LP_ACK

#define KSZ8851_P1ANLPR_LP_ACK   0x4000

Definition at line 434 of file ksz8851_driver.h.

◆ KSZ8851_P1ANLPR_NEXT_PAGE

#define KSZ8851_P1ANLPR_NEXT_PAGE   0x8000

Definition at line 433 of file ksz8851_driver.h.

◆ KSZ8851_P1ANLPR_PAUSE

#define KSZ8851_P1ANLPR_PAUSE   0x0400

Definition at line 436 of file ksz8851_driver.h.

◆ KSZ8851_P1ANLPR_REMOTE_FAULT

#define KSZ8851_P1ANLPR_REMOTE_FAULT   0x2000

Definition at line 435 of file ksz8851_driver.h.

◆ KSZ8851_P1CR

#define KSZ8851_P1CR   0xF6

Definition at line 160 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_ADV_100_FULL

#define KSZ8851_P1CR_ADV_100_FULL   0x0008

Definition at line 459 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_ADV_100_HALF

#define KSZ8851_P1CR_ADV_100_HALF   0x0004

Definition at line 460 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_ADV_10_FULL

#define KSZ8851_P1CR_ADV_10_FULL   0x0002

Definition at line 461 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_ADV_10_HALF

#define KSZ8851_P1CR_ADV_10_HALF   0x0001

Definition at line 462 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_ADV_PAUSE

#define KSZ8851_P1CR_ADV_PAUSE   0x0010

Definition at line 458 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_AN_ENABLE

#define KSZ8851_P1CR_AN_ENABLE   0x0080

Definition at line 455 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_DISABLE_AUTO_MDIX

#define KSZ8851_P1CR_DISABLE_AUTO_MDIX   0x0400

Definition at line 453 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_FORCE_DUPLEX

#define KSZ8851_P1CR_FORCE_DUPLEX   0x0020

Definition at line 457 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_FORCE_MDIX

#define KSZ8851_P1CR_FORCE_MDIX   0x0200

Definition at line 454 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_FORCE_SPEED

#define KSZ8851_P1CR_FORCE_SPEED   0x0040

Definition at line 456 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_LED_OFF

#define KSZ8851_P1CR_LED_OFF   0x8000

Definition at line 450 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_RESTART_AN

#define KSZ8851_P1CR_RESTART_AN   0x2000

Definition at line 452 of file ksz8851_driver.h.

◆ KSZ8851_P1CR_TX_DISABLE

#define KSZ8851_P1CR_TX_DISABLE   0x4000

Definition at line 451 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR

#define KSZ8851_P1MBCR   0xE4

Definition at line 153 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_AN_ENABLE

#define KSZ8851_P1MBCR_AN_ENABLE   0x1000

Definition at line 394 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_DISABLE_LED

#define KSZ8851_P1MBCR_DISABLE_LED   0x0001

Definition at line 401 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_DISABLE_MDIX

#define KSZ8851_P1MBCR_DISABLE_MDIX   0x0008

Definition at line 399 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_DISABLE_TRANSMIT

#define KSZ8851_P1MBCR_DISABLE_TRANSMIT   0x0002

Definition at line 400 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_FORCE_100

#define KSZ8851_P1MBCR_FORCE_100   0x2000

Definition at line 393 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_FORCE_FULL_DUPLEX

#define KSZ8851_P1MBCR_FORCE_FULL_DUPLEX   0x0100

Definition at line 396 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_FORCE_MDIX

#define KSZ8851_P1MBCR_FORCE_MDIX   0x0010

Definition at line 398 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_HP_MDIX

#define KSZ8851_P1MBCR_HP_MDIX   0x0020

Definition at line 397 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_LOCAL_LOOPBACK

#define KSZ8851_P1MBCR_LOCAL_LOOPBACK   0x4000

Definition at line 392 of file ksz8851_driver.h.

◆ KSZ8851_P1MBCR_RESTART_AN

#define KSZ8851_P1MBCR_RESTART_AN   0x0200

Definition at line 395 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR

#define KSZ8851_P1MBSR   0xE6

Definition at line 154 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_100_FULL_CAPABLE

#define KSZ8851_P1MBSR_100_FULL_CAPABLE   0x4000

Definition at line 405 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_100_HALF_CAPABLE

#define KSZ8851_P1MBSR_100_HALF_CAPABLE   0x2000

Definition at line 406 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_10_FULL_CAPABLE

#define KSZ8851_P1MBSR_10_FULL_CAPABLE   0x1000

Definition at line 407 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_10_HALF_CAPABLE

#define KSZ8851_P1MBSR_10_HALF_CAPABLE   0x0800

Definition at line 408 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_AN_CAPABLE

#define KSZ8851_P1MBSR_AN_CAPABLE   0x0008

Definition at line 411 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_AN_COMPLETE

#define KSZ8851_P1MBSR_AN_COMPLETE   0x0020

Definition at line 410 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_EXTENDED_CAPABLE

#define KSZ8851_P1MBSR_EXTENDED_CAPABLE   0x0001

Definition at line 414 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_JABBER_TEST

#define KSZ8851_P1MBSR_JABBER_TEST   0x0002

Definition at line 413 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_LINK_STATUS

#define KSZ8851_P1MBSR_LINK_STATUS   0x0004

Definition at line 412 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_PREAMBLE_SUPPR

#define KSZ8851_P1MBSR_PREAMBLE_SUPPR   0x0040

Definition at line 409 of file ksz8851_driver.h.

◆ KSZ8851_P1MBSR_T4_CAPABLE

#define KSZ8851_P1MBSR_T4_CAPABLE   0x8000

Definition at line 404 of file ksz8851_driver.h.

◆ KSZ8851_P1SCLMD

#define KSZ8851_P1SCLMD   0xF4

Definition at line 159 of file ksz8851_driver.h.

◆ KSZ8851_P1SCLMD_FORCE_LNK

#define KSZ8851_P1SCLMD_FORCE_LNK   0x0800

Definition at line 445 of file ksz8851_driver.h.

◆ KSZ8851_P1SCLMD_REMOTE_LOOPBACK

#define KSZ8851_P1SCLMD_REMOTE_LOOPBACK   0x0200

Definition at line 446 of file ksz8851_driver.h.

◆ KSZ8851_P1SCLMD_VCT_EN

#define KSZ8851_P1SCLMD_VCT_EN   0x1000

Definition at line 444 of file ksz8851_driver.h.

◆ KSZ8851_P1SCLMD_VCT_FAULT_COUNT

#define KSZ8851_P1SCLMD_VCT_FAULT_COUNT   0x01FF

Definition at line 447 of file ksz8851_driver.h.

◆ KSZ8851_P1SCLMD_VCT_RESULT

#define KSZ8851_P1SCLMD_VCT_RESULT   0x6000

Definition at line 443 of file ksz8851_driver.h.

◆ KSZ8851_P1SR

#define KSZ8851_P1SR   0xF8

Definition at line 161 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_AN_DONE

#define KSZ8851_P1SR_AN_DONE   0x0040

Definition at line 470 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_HP_MDIX

#define KSZ8851_P1SR_HP_MDIX   0x8000

Definition at line 465 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_LINK_GOOD

#define KSZ8851_P1SR_LINK_GOOD   0x0020

Definition at line 471 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_LP_100_FULL

#define KSZ8851_P1SR_LP_100_FULL   0x0008

Definition at line 473 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_LP_100_HALF

#define KSZ8851_P1SR_LP_100_HALF   0x0004

Definition at line 474 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_LP_10_FULL

#define KSZ8851_P1SR_LP_10_FULL   0x0002

Definition at line 475 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_LP_10_HALF

#define KSZ8851_P1SR_LP_10_HALF   0x0001

Definition at line 476 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_LP_PAUSE

#define KSZ8851_P1SR_LP_PAUSE   0x0010

Definition at line 472 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_MDIX_STATUS

#define KSZ8851_P1SR_MDIX_STATUS   0x0080

Definition at line 469 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_OPERATION_DUPLEX

#define KSZ8851_P1SR_OPERATION_DUPLEX   0x0200

Definition at line 468 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_OPERATION_SPEED

#define KSZ8851_P1SR_OPERATION_SPEED   0x0400

Definition at line 467 of file ksz8851_driver.h.

◆ KSZ8851_P1SR_POLARITY_REVERSE

#define KSZ8851_P1SR_POLARITY_REVERSE   0x2000

Definition at line 466 of file ksz8851_driver.h.

◆ KSZ8851_PHY1IHR

#define KSZ8851_PHY1IHR   0xEA

Definition at line 156 of file ksz8851_driver.h.

◆ KSZ8851_PHY1IHR_DEFAULT

#define KSZ8851_PHY1IHR_DEFAULT   0x0022

Definition at line 420 of file ksz8851_driver.h.

◆ KSZ8851_PHY1ILR

#define KSZ8851_PHY1ILR   0xE8

Definition at line 155 of file ksz8851_driver.h.

◆ KSZ8851_PHY1ILR_DEFAULT

#define KSZ8851_PHY1ILR_DEFAULT   0x1430

Definition at line 417 of file ksz8851_driver.h.

◆ KSZ8851_PHYRR

#define KSZ8851_PHYRR   0xD8

Definition at line 152 of file ksz8851_driver.h.

◆ KSZ8851_PHYRR_PHY_RESET

#define KSZ8851_PHYRR_PHY_RESET   0x0001

Definition at line 389 of file ksz8851_driver.h.

◆ KSZ8851_PMECR

#define KSZ8851_PMECR   0xD4

Definition at line 150 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_AUTO_WUP_EN

#define KSZ8851_PMECR_AUTO_WUP_EN   0x0080

Definition at line 371 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_PME_DELAY_EN

#define KSZ8851_PMECR_PME_DELAY_EN   0x4000

Definition at line 364 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_PME_OUT_POLARITY

#define KSZ8851_PMECR_PME_OUT_POLARITY   0x1000

Definition at line 365 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_PWR_MGMT_MODE

#define KSZ8851_PMECR_PWR_MGMT_MODE   0x0003

Definition at line 379 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_PWR_MGMT_MODE_ENERGY_DETECT

#define KSZ8851_PMECR_PWR_MGMT_MODE_ENERGY_DETECT   0x0001

Definition at line 381 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_PWR_MGMT_MODE_NORMAL

#define KSZ8851_PMECR_PWR_MGMT_MODE_NORMAL   0x0000

Definition at line 380 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_PWR_MGMT_MODE_PWR_SAVING

#define KSZ8851_PMECR_PWR_MGMT_MODE_PWR_SAVING   0x0003

Definition at line 382 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WOL_TO_PME_OUT_EN

#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN   0x0F00

Definition at line 366 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WOL_TO_PME_OUT_EN_ENERGY_DETECT

#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN_ENERGY_DETECT   0x0100

Definition at line 370 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WOL_TO_PME_OUT_EN_LINK_UP

#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN_LINK_UP   0x0200

Definition at line 369 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WOL_TO_PME_OUT_EN_MAGIC_PKT

#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN_MAGIC_PKT   0x0400

Definition at line 368 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WOL_TO_PME_OUT_EN_WUP_FRAME

#define KSZ8851_PMECR_WOL_TO_PME_OUT_EN_WUP_FRAME   0x0800

Definition at line 367 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WUP_EVENT

#define KSZ8851_PMECR_WUP_EVENT   0x003C

Definition at line 373 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WUP_EVENT_ENERGY_DETECT

#define KSZ8851_PMECR_WUP_EVENT_ENERGY_DETECT   0x0004

Definition at line 375 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WUP_EVENT_LINK_UP

#define KSZ8851_PMECR_WUP_EVENT_LINK_UP   0x0008

Definition at line 376 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WUP_EVENT_MAGIC_PKT

#define KSZ8851_PMECR_WUP_EVENT_MAGIC_PKT   0x0010

Definition at line 377 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WUP_EVENT_NONE

#define KSZ8851_PMECR_WUP_EVENT_NONE   0x0000

Definition at line 374 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WUP_EVENT_WUP_FRAME

#define KSZ8851_PMECR_WUP_EVENT_WUP_FRAME   0x0020

Definition at line 378 of file ksz8851_driver.h.

◆ KSZ8851_PMECR_WUP_TO_NORMAL_OP_MODE

#define KSZ8851_PMECR_WUP_TO_NORMAL_OP_MODE   0x0040

Definition at line 372 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1

#define KSZ8851_RXCR1   0x74

Definition at line 123 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_FRXQ

#define KSZ8851_RXCR1_FRXQ   0x8000

Definition at line 227 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXAE

#define KSZ8851_RXCR1_RXAE   0x0010

Definition at line 238 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXBE

#define KSZ8851_RXCR1_RXBE   0x0080

Definition at line 235 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXE

#define KSZ8851_RXCR1_RXE   0x0001

Definition at line 240 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXEFE

#define KSZ8851_RXCR1_RXEFE   0x0200

Definition at line 233 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXFCE

#define KSZ8851_RXCR1_RXFCE   0x0400

Definition at line 232 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXINVF

#define KSZ8851_RXCR1_RXINVF   0x0002

Definition at line 239 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXIPFCC

#define KSZ8851_RXCR1_RXIPFCC   0x1000

Definition at line 230 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXMAFMA

#define KSZ8851_RXCR1_RXMAFMA   0x0100

Definition at line 234 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXME

#define KSZ8851_RXCR1_RXME   0x0040

Definition at line 236 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXPAFMA

#define KSZ8851_RXCR1_RXPAFMA   0x0800

Definition at line 231 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXTCPFCC

#define KSZ8851_RXCR1_RXTCPFCC   0x2000

Definition at line 229 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXUDPFCC

#define KSZ8851_RXCR1_RXUDPFCC   0x4000

Definition at line 228 of file ksz8851_driver.h.

◆ KSZ8851_RXCR1_RXUE

#define KSZ8851_RXCR1_RXUE   0x0020

Definition at line 237 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2

#define KSZ8851_RXCR2   0x76

Definition at line 124 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_IUFFP

#define KSZ8851_RXCR2_IUFFP   0x0010

Definition at line 249 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_RXICMPFCC

#define KSZ8851_RXCR2_RXICMPFCC   0x0002

Definition at line 252 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_RXIUFCEZ

#define KSZ8851_RXCR2_RXIUFCEZ   0x0008

Definition at line 250 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_RXSAF

#define KSZ8851_RXCR2_RXSAF   0x0001

Definition at line 253 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_SRDBL

#define KSZ8851_RXCR2_SRDBL   0x00E0

Definition at line 243 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_SRDBL_16_BYTES

#define KSZ8851_RXCR2_SRDBL_16_BYTES   0x0040

Definition at line 246 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_SRDBL_32_BYTES

#define KSZ8851_RXCR2_SRDBL_32_BYTES   0x0060

Definition at line 247 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_SRDBL_4_BYTES

#define KSZ8851_RXCR2_SRDBL_4_BYTES   0x0000

Definition at line 244 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_SRDBL_8_BYTES

#define KSZ8851_RXCR2_SRDBL_8_BYTES   0x0020

Definition at line 245 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_SRDBL_SINGLE_FRAME

#define KSZ8851_RXCR2_SRDBL_SINGLE_FRAME   0x0080

Definition at line 248 of file ksz8851_driver.h.

◆ KSZ8851_RXCR2_UDPLFE

#define KSZ8851_RXCR2_UDPLFE   0x0004

Definition at line 251 of file ksz8851_driver.h.

◆ KSZ8851_RXDBCTR

#define KSZ8851_RXDBCTR   0x8E

Definition at line 133 of file ksz8851_driver.h.

◆ KSZ8851_RXDTTR

#define KSZ8851_RXDTTR   0x8C

Definition at line 132 of file ksz8851_driver.h.

◆ KSZ8851_RXFCTR

#define KSZ8851_RXFCTR   0x9C

Definition at line 136 of file ksz8851_driver.h.

◆ KSZ8851_RXFCTR_RXFC

#define KSZ8851_RXFCTR_RXFC   0xFF00

Definition at line 333 of file ksz8851_driver.h.

◆ KSZ8851_RXFCTR_RXFCT

#define KSZ8851_RXFCTR_RXFCT   0x00FF

Definition at line 334 of file ksz8851_driver.h.

◆ KSZ8851_RXFDPR

#define KSZ8851_RXFDPR   0x86

Definition at line 131 of file ksz8851_driver.h.

◆ KSZ8851_RXFDPR_EMS

#define KSZ8851_RXFDPR_EMS   0x0800

Definition at line 300 of file ksz8851_driver.h.

◆ KSZ8851_RXFDPR_RXFP

#define KSZ8851_RXFDPR_RXFP   0x07FF

Definition at line 301 of file ksz8851_driver.h.

◆ KSZ8851_RXFDPR_RXFPAI

#define KSZ8851_RXFDPR_RXFPAI   0x4000

Definition at line 298 of file ksz8851_driver.h.

◆ KSZ8851_RXFDPR_WST

#define KSZ8851_RXFDPR_WST   0x1000

Definition at line 299 of file ksz8851_driver.h.

◆ KSZ8851_RXFHBCR

#define KSZ8851_RXFHBCR   0x7E

Definition at line 127 of file ksz8851_driver.h.

◆ KSZ8851_RXFHBCR_RXBC

#define KSZ8851_RXFHBCR_RXBC   0x0FFF

Definition at line 274 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR

#define KSZ8851_RXFHSR   0x7C

Definition at line 126 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXBF

#define KSZ8851_RXFHSR_RXBF   0x0080

Definition at line 264 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXCE

#define KSZ8851_RXFHSR_RXCE   0x0001

Definition at line 271 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXFT

#define KSZ8851_RXFHSR_RXFT   0x0008

Definition at line 268 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXFTL

#define KSZ8851_RXFHSR_RXFTL   0x0004

Definition at line 269 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXFV

#define KSZ8851_RXFHSR_RXFV   0x8000

Definition at line 259 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXICMPFCS

#define KSZ8851_RXFHSR_RXICMPFCS   0x2000

Definition at line 260 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXIPFCS

#define KSZ8851_RXFHSR_RXIPFCS   0x1000

Definition at line 261 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXMF

#define KSZ8851_RXFHSR_RXMF   0x0040

Definition at line 265 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXMR

#define KSZ8851_RXFHSR_RXMR   0x0010

Definition at line 267 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXRF

#define KSZ8851_RXFHSR_RXRF   0x0002

Definition at line 270 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXTCPFCS

#define KSZ8851_RXFHSR_RXTCPFCS   0x0800

Definition at line 262 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXUDPFCS

#define KSZ8851_RXFHSR_RXUDPFCS   0x0400

Definition at line 263 of file ksz8851_driver.h.

◆ KSZ8851_RXFHSR_RXUF

#define KSZ8851_RXFHSR_RXUF   0x0020

Definition at line 266 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR

#define KSZ8851_RXQCR   0x82

Definition at line 129 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_ADRFE

#define KSZ8851_RXQCR_ADRFE   0x0010

Definition at line 289 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_RRXEF

#define KSZ8851_RXQCR_RRXEF   0x0001

Definition at line 291 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_RXDBCTE

#define KSZ8851_RXQCR_RXDBCTE   0x0040

Definition at line 287 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_RXDBCTS

#define KSZ8851_RXQCR_RXDBCTS   0x0800

Definition at line 283 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_RXDTTE

#define KSZ8851_RXQCR_RXDTTE   0x0080

Definition at line 286 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_RXDTTS

#define KSZ8851_RXQCR_RXDTTS   0x1000

Definition at line 282 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_RXFCTE

#define KSZ8851_RXQCR_RXFCTE   0x0020

Definition at line 288 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_RXFCTS

#define KSZ8851_RXQCR_RXFCTS   0x0400

Definition at line 284 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_RXIPHTOE

#define KSZ8851_RXQCR_RXIPHTOE   0x0200

Definition at line 285 of file ksz8851_driver.h.

◆ KSZ8851_RXQCR_SDA

#define KSZ8851_RXQCR_SDA   0x0008

Definition at line 290 of file ksz8851_driver.h.

◆ KSZ8851_SPI_SUPPORT

#define KSZ8851_SPI_SUPPORT   ENABLED

Definition at line 39 of file ksz8851_driver.h.

◆ KSZ8851_TX_CTRL_TXFID

#define KSZ8851_TX_CTRL_TXFID   0x003F

Definition at line 480 of file ksz8851_driver.h.

◆ KSZ8851_TX_CTRL_TXIC

#define KSZ8851_TX_CTRL_TXIC   0x8000

Definition at line 479 of file ksz8851_driver.h.

◆ KSZ8851_TXCR

#define KSZ8851_TXCR   0x70

Definition at line 121 of file ksz8851_driver.h.

◆ KSZ8851_TXCR_FTXQ

#define KSZ8851_TXCR_FTXQ   0x0010

Definition at line 215 of file ksz8851_driver.h.

◆ KSZ8851_TXCR_TCGICMP

#define KSZ8851_TXCR_TCGICMP   0x0100

Definition at line 212 of file ksz8851_driver.h.

◆ KSZ8851_TXCR_TCGIP

#define KSZ8851_TXCR_TCGIP   0x0020

Definition at line 214 of file ksz8851_driver.h.

◆ KSZ8851_TXCR_TCGTCP

#define KSZ8851_TXCR_TCGTCP   0x0040

Definition at line 213 of file ksz8851_driver.h.

◆ KSZ8851_TXCR_TXCE

#define KSZ8851_TXCR_TXCE   0x0002

Definition at line 218 of file ksz8851_driver.h.

◆ KSZ8851_TXCR_TXE

#define KSZ8851_TXCR_TXE   0x0001

Definition at line 219 of file ksz8851_driver.h.

◆ KSZ8851_TXCR_TXFCE

#define KSZ8851_TXCR_TXFCE   0x0008

Definition at line 216 of file ksz8851_driver.h.

◆ KSZ8851_TXCR_TXPE

#define KSZ8851_TXCR_TXPE   0x0004

Definition at line 217 of file ksz8851_driver.h.

◆ KSZ8851_TXFDPR

#define KSZ8851_TXFDPR   0x84

Definition at line 130 of file ksz8851_driver.h.

◆ KSZ8851_TXFDPR_TXFP

#define KSZ8851_TXFDPR_TXFP   0x07FF

Definition at line 295 of file ksz8851_driver.h.

◆ KSZ8851_TXFDPR_TXFPAI

#define KSZ8851_TXFDPR_TXFPAI   0x4000

Definition at line 294 of file ksz8851_driver.h.

◆ KSZ8851_TXMIR

#define KSZ8851_TXMIR   0x78

Definition at line 125 of file ksz8851_driver.h.

◆ KSZ8851_TXMIR_TXMA

#define KSZ8851_TXMIR_TXMA   0x1FFF

Definition at line 256 of file ksz8851_driver.h.

◆ KSZ8851_TXNTFSR

#define KSZ8851_TXNTFSR   0x9E

Definition at line 137 of file ksz8851_driver.h.

◆ KSZ8851_TXQCR

#define KSZ8851_TXQCR   0x80

Definition at line 128 of file ksz8851_driver.h.

◆ KSZ8851_TXQCR_AETFE

#define KSZ8851_TXQCR_AETFE   0x0004

Definition at line 277 of file ksz8851_driver.h.

◆ KSZ8851_TXQCR_METFE

#define KSZ8851_TXQCR_METFE   0x0001

Definition at line 279 of file ksz8851_driver.h.

◆ KSZ8851_TXQCR_TXQMAM

#define KSZ8851_TXQCR_TXQMAM   0x0002

Definition at line 278 of file ksz8851_driver.h.

◆ KSZ8851_TXSR

#define KSZ8851_TXSR   0x72

Definition at line 122 of file ksz8851_driver.h.

◆ KSZ8851_TXSR_TXFID

#define KSZ8851_TXSR_TXFID   0x003F

Definition at line 224 of file ksz8851_driver.h.

◆ KSZ8851_TXSR_TXLC

#define KSZ8851_TXSR_TXLC   0x2000

Definition at line 222 of file ksz8851_driver.h.

◆ KSZ8851_TXSR_TXMC

#define KSZ8851_TXSR_TXMC   0x1000

Definition at line 223 of file ksz8851_driver.h.

◆ KSZ8851_WF0BM0

#define KSZ8851_WF0BM0   0x34

Definition at line 99 of file ksz8851_driver.h.

◆ KSZ8851_WF0BM1

#define KSZ8851_WF0BM1   0x36

Definition at line 100 of file ksz8851_driver.h.

◆ KSZ8851_WF0BM2

#define KSZ8851_WF0BM2   0x38

Definition at line 101 of file ksz8851_driver.h.

◆ KSZ8851_WF0BM3

#define KSZ8851_WF0BM3   0x3A

Definition at line 102 of file ksz8851_driver.h.

◆ KSZ8851_WF0CRC0

#define KSZ8851_WF0CRC0   0x30

Definition at line 97 of file ksz8851_driver.h.

◆ KSZ8851_WF0CRC1

#define KSZ8851_WF0CRC1   0x32

Definition at line 98 of file ksz8851_driver.h.

◆ KSZ8851_WF1BM0

#define KSZ8851_WF1BM0   0x44

Definition at line 105 of file ksz8851_driver.h.

◆ KSZ8851_WF1BM1

#define KSZ8851_WF1BM1   0x46

Definition at line 106 of file ksz8851_driver.h.

◆ KSZ8851_WF1BM2

#define KSZ8851_WF1BM2   0x48

Definition at line 107 of file ksz8851_driver.h.

◆ KSZ8851_WF1BM3

#define KSZ8851_WF1BM3   0x4A

Definition at line 108 of file ksz8851_driver.h.

◆ KSZ8851_WF1CRC0

#define KSZ8851_WF1CRC0   0x40

Definition at line 103 of file ksz8851_driver.h.

◆ KSZ8851_WF1CRC1

#define KSZ8851_WF1CRC1   0x42

Definition at line 104 of file ksz8851_driver.h.

◆ KSZ8851_WF2BM0

#define KSZ8851_WF2BM0   0x54

Definition at line 111 of file ksz8851_driver.h.

◆ KSZ8851_WF2BM1

#define KSZ8851_WF2BM1   0x56

Definition at line 112 of file ksz8851_driver.h.

◆ KSZ8851_WF2BM2

#define KSZ8851_WF2BM2   0x58

Definition at line 113 of file ksz8851_driver.h.

◆ KSZ8851_WF2BM3

#define KSZ8851_WF2BM3   0x5A

Definition at line 114 of file ksz8851_driver.h.

◆ KSZ8851_WF2CRC0

#define KSZ8851_WF2CRC0   0x50

Definition at line 109 of file ksz8851_driver.h.

◆ KSZ8851_WF2CRC1

#define KSZ8851_WF2CRC1   0x52

Definition at line 110 of file ksz8851_driver.h.

◆ KSZ8851_WF3BM0

#define KSZ8851_WF3BM0   0x64

Definition at line 117 of file ksz8851_driver.h.

◆ KSZ8851_WF3BM1

#define KSZ8851_WF3BM1   0x66

Definition at line 118 of file ksz8851_driver.h.

◆ KSZ8851_WF3BM2

#define KSZ8851_WF3BM2   0x68

Definition at line 119 of file ksz8851_driver.h.

◆ KSZ8851_WF3BM3

#define KSZ8851_WF3BM3   0x6A

Definition at line 120 of file ksz8851_driver.h.

◆ KSZ8851_WF3CRC0

#define KSZ8851_WF3CRC0   0x60

Definition at line 115 of file ksz8851_driver.h.

◆ KSZ8851_WF3CRC1

#define KSZ8851_WF3CRC1   0x62

Definition at line 116 of file ksz8851_driver.h.

◆ KSZ8851_WFCR

#define KSZ8851_WFCR   0x2A

Definition at line 96 of file ksz8851_driver.h.

◆ KSZ8851_WFCR_MPRXE

#define KSZ8851_WFCR_MPRXE   0x0080

Definition at line 205 of file ksz8851_driver.h.

◆ KSZ8851_WFCR_WF0E

#define KSZ8851_WFCR_WF0E   0x0001

Definition at line 209 of file ksz8851_driver.h.

◆ KSZ8851_WFCR_WF1E

#define KSZ8851_WFCR_WF1E   0x0002

Definition at line 208 of file ksz8851_driver.h.

◆ KSZ8851_WFCR_WF2E

#define KSZ8851_WFCR_WF2E   0x0004

Definition at line 207 of file ksz8851_driver.h.

◆ KSZ8851_WFCR_WF3E

#define KSZ8851_WFCR_WF3E   0x0008

Definition at line 206 of file ksz8851_driver.h.

Function Documentation

◆ ksz8851CalcCrc()

uint32_t ksz8851CalcCrc ( const void *  data,
size_t  length 
)

CRC calculation.

Parameters
[in]dataPointer to the data over which to calculate the CRC
[in]lengthNumber of bytes to process
Returns
Resulting CRC value

Definition at line 874 of file ksz8851_driver.c.

◆ ksz8851ClearBit()

void ksz8851ClearBit ( NetInterface interface,
uint8_t  address,
uint16_t  mask 
)

Clear bit field.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]maskBits to clear in the target register

Definition at line 856 of file ksz8851_driver.c.

◆ ksz8851DisableIrq()

void ksz8851DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 218 of file ksz8851_driver.c.

◆ ksz8851DumpReg()

void ksz8851DumpReg ( NetInterface interface)

Dump registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 914 of file ksz8851_driver.c.

◆ ksz8851EnableIrq()

void ksz8851EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 203 of file ksz8851_driver.c.

◆ ksz8851EventHandler()

void ksz8851EventHandler ( NetInterface interface)

KSZ8851 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 306 of file ksz8851_driver.c.

◆ ksz8851Init()

error_t ksz8851Init ( NetInterface interface)

KSZ8851 controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 71 of file ksz8851_driver.c.

◆ ksz8851InitHook()

void ksz8851InitHook ( NetInterface interface)

KSZ8851 custom configuration.

Parameters
[in]interfaceUnderlying network interface

Definition at line 183 of file ksz8851_driver.c.

◆ ksz8851IrqHandler()

bool_t ksz8851IrqHandler ( NetInterface interface)

KSZ8851 interrupt service routine.

Parameters
[in]interfaceUnderlying network interface
Returns
TRUE if a higher priority task must be woken. Else FALSE is returned

Definition at line 234 of file ksz8851_driver.c.

◆ ksz8851ReadFifo()

void ksz8851ReadFifo ( NetInterface interface,
uint8_t *  data,
size_t  length 
)

Read RX FIFO.

Parameters
[in]interfaceUnderlying network interface
[out]dataBuffer where to store the incoming data
[in]lengthNumber of data to read

Definition at line 766 of file ksz8851_driver.c.

◆ ksz8851ReadReg()

uint16_t ksz8851ReadReg ( NetInterface interface,
uint8_t  address 
)

Read KSZ8851 register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
Returns
Register value

Definition at line 658 of file ksz8851_driver.c.

◆ ksz8851ReceivePacket()

error_t ksz8851ReceivePacket ( NetInterface interface)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 468 of file ksz8851_driver.c.

◆ ksz8851SendPacket()

error_t ksz8851SendPacket ( NetInterface interface,
const NetBuffer buffer,
size_t  offset,
NetTxAncillary ancillary 
)

Send a packet.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
[in]ancillaryAdditional options passed to the stack along with the packet
Returns
Error code

Definition at line 392 of file ksz8851_driver.c.

◆ ksz8851SetBit()

void ksz8851SetBit ( NetInterface interface,
uint8_t  address,
uint16_t  mask 
)

Set bit field.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]maskBits to set in the target register

Definition at line 838 of file ksz8851_driver.c.

◆ ksz8851Tick()

void ksz8851Tick ( NetInterface interface)

KSZ8851 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 193 of file ksz8851_driver.c.

◆ ksz8851UpdateMacAddrFilter()

error_t ksz8851UpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 549 of file ksz8851_driver.c.

◆ ksz8851WriteFifo()

void ksz8851WriteFifo ( NetInterface interface,
const uint8_t *  data,
size_t  length 
)

Write TX FIFO.

Parameters
[in]interfaceUnderlying network interface
[in]dataPointer to the data being written
[in]lengthNumber of data to write

Definition at line 715 of file ksz8851_driver.c.

◆ ksz8851WriteReg()

void ksz8851WriteReg ( NetInterface interface,
uint8_t  address,
uint16_t  data 
)

Write KSZ8851 register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]dataRegister value

Definition at line 606 of file ksz8851_driver.c.

Variable Documentation

◆ __packed_struct

typedef __packed_struct
Initial value:
{
uint16_t controlWord

TX packet header.

RX packet header.

Definition at line 492 of file ksz8851_driver.h.

◆ byteCount

uint8_t byteCount

Definition at line 495 of file ksz8851_driver.h.

◆ ksz8851Driver

const NicDriver ksz8851Driver
extern

KSZ8851 driver.

Definition at line 44 of file ksz8851_driver.c.

◆ Ksz8851RxHeader

Ksz8851RxHeader

Definition at line 507 of file ksz8851_driver.h.

◆ Ksz8851TxHeader

Ksz8851TxHeader

Definition at line 496 of file ksz8851_driver.h.