ksz9563_driver.c
#define KSZ9563_SWITCH_LUE_CTRL0_AGE_COUNT_DEFAULT
Definition: ksz9563_driver.h:889
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
#define KSZ9563_SWITCH_OP_START_SWITCH
Definition: ksz9563_driver.h:872
const uint8_t ksz9563IngressTailTag[3]
Tail tag rules (host to KSZ9563)
Definition: ksz9563_driver.c:77
KSZ9563 3-port Gigabit Ethernet switch driver.
#define KSZ9563_SWITCH_LUE_CTRL1_FLUSH_ALU_TABLE
Definition: ksz9563_driver.h:899
void ksz9563DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz9563_driver.c:1595
#define KSZ9563_PORTn_XMII_CTRL1_RGMII_ID_IG
Definition: ksz9563_driver.h:1380
#define KSZ9563_STATIC_MCAST_TABLE_CTRL_TABLE_SELECT
Definition: ksz9563_driver.h:1076
void ksz9563WriteSwitchReg32(NetInterface *interface, uint16_t address, uint32_t data)
Write switch register (32 bits)
Definition: ksz9563_driver.c:1857
void ksz9563FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz9563_driver.c:1289
uint16_t ksz9563ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz9563_driver.c:1559
#define KSZ9563_GLOBAL_PORT_MIRROR_SNOOP_CTRL_MLD_SNOOP_EN
Definition: ksz9563_driver.h:1004
#define KSZ9563_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz9563_driver.h:58
#define KSZ9563_STATIC_MCAST_TABLE_CTRL
Definition: ksz9563_driver.h:196
#define KSZ9563_ALU_TABLE_ENTRY2_PORT3_FORWARD
Definition: ksz9563_driver.h:1092
#define KSZ9563_PORTn_XMII_CTRL1_SPEED_1000
Definition: ksz9563_driver.h:1379
uint16_t ksz9563ReadMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr)
Read MMD register.
Definition: ksz9563_driver.c:1649
error_t ksz9563Init(NetInterface *interface)
KSZ9563 Ethernet switch initialization.
Definition: ksz9563_driver.c:91
#define KSZ9563_PORTn_XMII_CTRL1_RGMII_ID_EG
Definition: ksz9563_driver.h:1381
__weak_func void ksz9563InitHook(NetInterface *interface)
KSZ9563 custom configuration.
Definition: ksz9563_driver.c:232
void ksz9563WriteSwitchReg8(NetInterface *interface, uint16_t address, uint8_t data)
Write switch register (8 bits)
Definition: ksz9563_driver.c:1675
void ksz9563SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz9563_driver.c:880
uint16_t ksz9563ReadSwitchReg16(NetInterface *interface, uint16_t address)
Read switch register (16 bits)
Definition: ksz9563_driver.c:1809
#define KSZ9563_PORTn_XMII_CTRL0_SPEED_10_100
Definition: ksz9563_driver.h:1375
#define KSZ9563_ALU_TABLE_CTRL_START_FINISH
Definition: ksz9563_driver.h:1063
#define KSZ9563_STATIC_MCAST_TABLE_CTRL_START_FINISH
Definition: ksz9563_driver.h:1075
#define KSZ9563_MMD_1000BT_EEE_WAKE_TX_TIMER
Definition: ksz9563_driver.h:94
void ksz9563FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz9563_driver.c:1433
#define KSZ9563_UNKONWN_MULTICAST_CTRL
Definition: ksz9563_driver.h:137
#define KSZ9563_GLOBAL_PORT_MIRROR_SNOOP_CTRL
Definition: ksz9563_driver.h:183
#define KSZ9563_PORTn_XMII_CTRL0_DUPLEX
Definition: ksz9563_driver.h:1373
#define KSZ9563_PORTn_XMII_CTRL1_IF_TYPE_RGMII
Definition: ksz9563_driver.h:1386
#define KSZ9563_PORTn_MSTP_STATE_LEARNING_DIS
Definition: ksz9563_driver.h:1452
void ksz9563EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz9563_driver.c:901
void ksz9563WriteSwitchReg16(NetInterface *interface, uint16_t address, uint16_t data)
Write switch register (16 bits)
Definition: ksz9563_driver.c:1765
#define KSZ9563_PORTn_ETH_PHY_REG(port, addr)
Definition: ksz9563_driver.h:591
#define KSZ9563_ALU_TABLE_ENTRY2_PORT1_FORWARD
Definition: ksz9563_driver.h:1094
#define KSZ9563_UNKONWN_MULTICAST_CTRL_FWD
Definition: ksz9563_driver.h:950
#define KSZ9563_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT3
Definition: ksz9563_driver.h:954
error_t ksz9563GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz9563_driver.c:1192
void ksz9563WriteMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr, uint16_t data)
Write MMD register.
Definition: ksz9563_driver.c:1621
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
#define KSZ9563_UNKONWN_MULTICAST_CTRL_FWD_MAP
Definition: ksz9563_driver.h:951
error_t ksz9563AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz9563_driver.c:990
void ksz9563SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz9563_driver.c:761
bool_t ksz9563GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz9563_driver.c:568
#define KSZ9563_SWITCH_LUE_CTRL2_FLUSH_OPTION_DYNAMIC
Definition: ksz9563_driver.h:912
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
#define KSZ9563_PORTn_MSTP_STATE_RECEIVE_EN
Definition: ksz9563_driver.h:1451
#define KSZ9563_ALU_TABLE_ENTRY2_PORT2_FORWARD
Definition: ksz9563_driver.h:1093
void ksz9563EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz9563_driver.c:961
error_t ksz9563TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz9563_driver.c:457
#define KSZ9563_STATIC_TABLE_ENTRY1_VALID
Definition: ksz9563_driver.h:1104
SwitchPortState ksz9563GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz9563_driver.c:817
#define KSZ9563_STATIC_TABLE_ENTRY2_OVERRIDE
Definition: ksz9563_driver.h:1111
#define KSZ9563_SWITCH_LUE_CTRL1_FLUSH_MSTP_ENTRIES
Definition: ksz9563_driver.h:900
uint32_t ksz9563GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz9563_driver.c:602
NicDuplexMode ksz9563GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz9563_driver.c:697
#define KSZ9563_PORTn_OP_CTRL0_TAIL_TAG_EN
Definition: ksz9563_driver.h:1360
#define KSZ9563_PORTn_XMII_CTRL1_IF_TYPE
Definition: ksz9563_driver.h:1383
#define KSZ9563_MMDACR_FUNC_DATA_NO_POST_INC
Definition: ksz9563_driver.h:693
#define KSZ9563_SWITCH_LUE_CTRL0_HASH_OPTION_CRC
Definition: ksz9563_driver.h:893
void ksz9563EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz9563_driver.c:931
#define KSZ9563_STATIC_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz9563_driver.h:1113
error_t ksz9563UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz9563_driver.c:516
#define KSZ9563_SWITCH_LUE_CTRL0_RESERVED_MCAST_LOOKUP_EN
Definition: ksz9563_driver.h:890
#define KSZ9563_PORTn_MSTP_STATE_TRANSMIT_EN
Definition: ksz9563_driver.h:1450
#define KSZ9563_STATIC_MCAST_TABLE_CTRL_TABLE_INDEX
Definition: ksz9563_driver.h:1074
#define KSZ9563_ALU_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz9563_driver.h:1091
#define KSZ9563_GLOBAL_PORT_MIRROR_SNOOP_CTRL_IGMP_SNOOP_EN
Definition: ksz9563_driver.h:1002
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
#define KSZ9563_ALU_TABLE_CTRL_VALID_ENTRY_OR_SEARCH_END
Definition: ksz9563_driver.h:1065
#define KSZ9563_SWITCH_OP_SOFT_HARD_RESET
Definition: ksz9563_driver.h:871
const SwitchDriver ksz9563SwitchDriver
KSZ9563 Ethernet switch driver.
Definition: ksz9563_driver.c:45
#define KSZ9563_SWITCH_LUE_CTRL3_AGE_PERIOD_DEFAULT
Definition: ksz9563_driver.h:919
#define KSZ9563_STATIC_MCAST_TABLE_CTRL_ACTION
Definition: ksz9563_driver.h:1077
void ksz9563SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz9563_driver.c:1480
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
uint8_t ksz9563ReadSwitchReg8(NetInterface *interface, uint16_t address)
Read switch register (8 bits)
Definition: ksz9563_driver.c:1718
#define KSZ9563_MMD_LED_MODE_RESERVED_DEFAULT
Definition: ksz9563_driver.h:758
#define KSZ9563_SWITCH_MAC_CTRL0_FRAME_LEN_CHECK_EN
Definition: ksz9563_driver.h:967
error_t ksz9563GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz9563_driver.c:1338
#define KSZ9563_MMD_LED_MODE_LED_MODE_TRI_COLOR_DUAL
Definition: ksz9563_driver.h:755
TCP/IP stack core.
void ksz9563EventHandler(NetInterface *interface)
KSZ9563 event handler.
Definition: ksz9563_driver.c:332
error_t ksz9563DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz9563_driver.c:1112
#define KSZ9563_TAIL_TAG_PORT_BLOCKING_OVERRIDE
Definition: ksz9563_driver.h:59
void ksz9563WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz9563_driver.c:1525
#define KSZ9563_ALU_TABLE_CTRL_ACTION_SEARCH
Definition: ksz9563_driver.h:1071
Helper functions for Ethernet.
uint32_t ksz9563ReadSwitchReg32(NetInterface *interface, uint16_t address)
Read switch register (32 bits)
Definition: ksz9563_driver.c:1903
Debugging facilities.
#define KSZ9563_SWITCH_LUE_CTRL2_FLUSH_OPTION
Definition: ksz9563_driver.h:910
#define KSZ9563_UNKONWN_MULTICAST_CTRL_FWD_MAP_ALL
Definition: ksz9563_driver.h:955