ksz8563_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
KSZ8563 3-port Ethernet switch driver.
void ksz8563EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz8563_driver.c:895
bool_t ksz8563GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz8563_driver.c:567
#define KSZ8563_GLOBAL_PORT_MIRROR_SNOOP_CTRL_IGMP_SNOOP_EN
Definition: ksz8563_driver.h:970
#define KSZ8563_PORTn_XMII_CTRL1_RGMII_ID_EG
Definition: ksz8563_driver.h:1348
#define KSZ8563_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz8563_driver.h:58
#define KSZ8563_SWITCH_LUE_CTRL2_FLUSH_OPTION
Definition: ksz8563_driver.h:878
void ksz8563WriteSwitchReg32(NetInterface *interface, uint16_t address, uint32_t data)
Write switch register (32 bits)
Definition: ksz8563_driver.c:1851
#define KSZ8563_PORTn_XMII_CTRL0_DUPLEX
Definition: ksz8563_driver.h:1340
#define KSZ8563_STATIC_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz8563_driver.h:1081
error_t ksz8563AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz8563_driver.c:984
void ksz8563WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz8563_driver.c:1519
#define KSZ8563_GLOBAL_PORT_MIRROR_SNOOP_CTRL_MLD_SNOOP_EN
Definition: ksz8563_driver.h:972
void ksz8563WriteSwitchReg16(NetInterface *interface, uint16_t address, uint16_t data)
Write switch register (16 bits)
Definition: ksz8563_driver.c:1759
#define KSZ8563_GLOBAL_PORT_MIRROR_SNOOP_CTRL
Definition: ksz8563_driver.h:179
#define KSZ8563_UNKONWN_MULTICAST_CTRL_FWD_MAP_ALL
Definition: ksz8563_driver.h:923
#define KSZ8563_PORTn_XMII_CTRL0_SPEED_10_100
Definition: ksz8563_driver.h:1342
#define KSZ8563_ALU_TABLE_CTRL_START_FINISH
Definition: ksz8563_driver.h:1031
#define KSZ8563_STATIC_MCAST_TABLE_CTRL_ACTION
Definition: ksz8563_driver.h:1045
#define KSZ8563_SWITCH_LUE_CTRL0_HASH_OPTION_CRC
Definition: ksz8563_driver.h:861
#define KSZ8563_ALU_TABLE_ENTRY2_PORT3_FORWARD
Definition: ksz8563_driver.h:1060
#define KSZ8563_UNKONWN_MULTICAST_CTRL_FWD
Definition: ksz8563_driver.h:918
#define KSZ8563_STATIC_MCAST_TABLE_CTRL_TABLE_INDEX
Definition: ksz8563_driver.h:1042
#define KSZ8563_STATIC_MCAST_TABLE_CTRL_START_FINISH
Definition: ksz8563_driver.h:1043
#define KSZ8563_UNKONWN_MULTICAST_CTRL
Definition: ksz8563_driver.h:133
#define KSZ8563_SWITCH_MAC_CTRL0_FRAME_LEN_CHECK_EN
Definition: ksz8563_driver.h:935
#define KSZ8563_STATIC_TABLE_ENTRY1_VALID
Definition: ksz8563_driver.h:1072
void ksz8563WriteSwitchReg8(NetInterface *interface, uint16_t address, uint8_t data)
Write switch register (8 bits)
Definition: ksz8563_driver.c:1669
#define KSZ8563_TAIL_TAG_PORT_BLOCKING_OVERRIDE
Definition: ksz8563_driver.h:59
error_t ksz8563TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz8563_driver.c:456
#define KSZ8563_ALU_TABLE_ENTRY2_PORT2_FORWARD
Definition: ksz8563_driver.h:1061
void ksz8563WriteMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr, uint16_t data)
Write MMD register.
Definition: ksz8563_driver.c:1615
#define KSZ8563_PORTn_XMII_CTRL1_IF_TYPE_RGMII
Definition: ksz8563_driver.h:1353
uint16_t ksz8563ReadMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr)
Read MMD register.
Definition: ksz8563_driver.c:1643
error_t ksz8563DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz8563_driver.c:1106
#define KSZ8563_ALU_TABLE_CTRL_VALID_ENTRY_OR_SEARCH_END
Definition: ksz8563_driver.h:1033
error_t ksz8563GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz8563_driver.c:1186
#define KSZ8563_SWITCH_LUE_CTRL3_AGE_PERIOD_DEFAULT
Definition: ksz8563_driver.h:887
error_t ksz8563Init(NetInterface *interface)
KSZ8563 Ethernet switch initialization.
Definition: ksz8563_driver.c:91
uint32_t ksz8563ReadSwitchReg32(NetInterface *interface, uint16_t address)
Read switch register (32 bits)
Definition: ksz8563_driver.c:1897
#define KSZ8563_ALU_TABLE_ENTRY2_PORT1_FORWARD
Definition: ksz8563_driver.h:1062
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
void ksz8563FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz8563_driver.c:1427
void ksz8563SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz8563_driver.c:874
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
uint8_t ksz8563ReadSwitchReg8(NetInterface *interface, uint16_t address)
Read switch register (8 bits)
Definition: ksz8563_driver.c:1712
#define KSZ8563_PORTn_XMII_CTRL1_RGMII_ID_IG
Definition: ksz8563_driver.h:1347
#define KSZ8563_UNKONWN_MULTICAST_CTRL_FWD_MAP
Definition: ksz8563_driver.h:919
#define KSZ8563_SWITCH_LUE_CTRL1_FLUSH_ALU_TABLE
Definition: ksz8563_driver.h:867
#define KSZ8563_PORTn_OP_CTRL0_TAIL_TAG_EN
Definition: ksz8563_driver.h:1328
#define KSZ8563_SWITCH_OP_START_SWITCH
Definition: ksz8563_driver.h:840
void ksz8563DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz8563_driver.c:1589
#define KSZ8563_PORTn_MSTP_STATE_TRANSMIT_EN
Definition: ksz8563_driver.h:1417
void ksz8563EventHandler(NetInterface *interface)
KSZ8563 event handler.
Definition: ksz8563_driver.c:331
#define KSZ8563_STATIC_MCAST_TABLE_CTRL_TABLE_SELECT
Definition: ksz8563_driver.h:1044
__weak_func void ksz8563InitHook(NetInterface *interface)
KSZ8563 custom configuration.
Definition: ksz8563_driver.c:231
#define KSZ8563_PORTn_XMII_CTRL1_SPEED_1000
Definition: ksz8563_driver.h:1346
#define KSZ8563_MMD_LED_MODE_RESERVED_DEFAULT
Definition: ksz8563_driver.h:726
#define KSZ8563_STATIC_TABLE_ENTRY2_OVERRIDE
Definition: ksz8563_driver.h:1079
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
#define KSZ8563_MMD_LED_MODE_LED_MODE_SINGLE
Definition: ksz8563_driver.h:724
#define KSZ8563_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT3
Definition: ksz8563_driver.h:922
uint16_t ksz8563ReadSwitchReg16(NetInterface *interface, uint16_t address)
Read switch register (16 bits)
Definition: ksz8563_driver.c:1803
void ksz8563EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz8563_driver.c:925
const uint8_t ksz8563IngressTailTag[3]
Tail tag rules (host to KSZ8563)
Definition: ksz8563_driver.c:77
#define KSZ8563_MMDACR_FUNC_DATA_NO_POST_INC
Definition: ksz8563_driver.h:671
const SwitchDriver ksz8563SwitchDriver
KSZ8563 Ethernet switch driver.
Definition: ksz8563_driver.c:45
#define KSZ8563_PORTn_XMII_CTRL1_IF_TYPE
Definition: ksz8563_driver.h:1350
#define KSZ8563_PORTn_MSTP_STATE_LEARNING_DIS
Definition: ksz8563_driver.h:1419
#define KSZ8563_SWITCH_LUE_CTRL2_FLUSH_OPTION_DYNAMIC
Definition: ksz8563_driver.h:880
#define KSZ8563_ALU_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz8563_driver.h:1059
void ksz8563SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz8563_driver.c:755
NicDuplexMode ksz8563GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz8563_driver.c:691
error_t ksz8563GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz8563_driver.c:1332
uint16_t ksz8563ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz8563_driver.c:1553
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
SwitchPortState ksz8563GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz8563_driver.c:811
void ksz8563EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz8563_driver.c:955
error_t ksz8563UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz8563_driver.c:515
#define KSZ8563_SWITCH_OP_SOFT_HARD_RESET
Definition: ksz8563_driver.h:839
#define KSZ8563_STATIC_MCAST_TABLE_CTRL
Definition: ksz8563_driver.h:192
uint32_t ksz8563GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz8563_driver.c:601
#define KSZ8563_PORTn_MSTP_STATE_RECEIVE_EN
Definition: ksz8563_driver.h:1418
#define KSZ8563_PORTn_ETH_PHY_REG(port, addr)
Definition: ksz8563_driver.h:587
TCP/IP stack core.
void ksz8563SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz8563_driver.c:1474
#define KSZ8563_SWITCH_LUE_CTRL0_AGE_COUNT_DEFAULT
Definition: ksz8563_driver.h:857
#define KSZ8563_SWITCH_LUE_CTRL0_RESERVED_MCAST_LOOKUP_EN
Definition: ksz8563_driver.h:858
Helper functions for Ethernet.
Debugging facilities.
#define KSZ8563_ALU_TABLE_CTRL_ACTION_SEARCH
Definition: ksz8563_driver.h:1039
void ksz8563FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz8563_driver.c:1283
#define KSZ8563_SWITCH_LUE_CTRL1_FLUSH_MSTP_ENTRIES
Definition: ksz8563_driver.h:868