ksz8565_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
#define KSZ8565_STATIC_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz8565_driver.h:1332
#define KSZ8565_TAIL_TAG_PORT_BLOCKING_OVERRIDE
Definition: ksz8565_driver.h:65
error_t ksz8565Init(NetInterface *interface)
KSZ8565 Ethernet switch initialization.
Definition: ksz8565_driver.c:93
#define KSZ8565_PORT5_XMII_CTRL1_SPEED_1000
Definition: ksz8565_driver.h:1596
#define KSZ8565_UNKONWN_MULTICAST_CTRL_FWD_MAP_ALL
Definition: ksz8565_driver.h:1166
void ksz8565EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz8565_driver.c:974
#define KSZ8565_STATIC_MCAST_TABLE_CTRL_ACTION
Definition: ksz8565_driver.h:1294
NicDuplexMode ksz8565GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz8565_driver.c:710
SwitchPortState ksz8565GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz8565_driver.c:830
void ksz8565EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz8565_driver.c:944
#define KSZ8565_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz8565_driver.h:64
const SwitchDriver ksz8565SwitchDriver
KSZ8565 Ethernet switch driver.
Definition: ksz8565_driver.c:45
#define KSZ8565_GLOBAL_PORT_MIRROR_SNOOP_CTRL_IGMP_SNOOP_EN
Definition: ksz8565_driver.h:1215
#define KSZ8565_SWITCH_LUE_CTRL0_AGE_COUNT_DEFAULT
Definition: ksz8565_driver.h:1096
uint32_t ksz8565GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz8565_driver.c:620
#define KSZ8565_MMDACR_FUNC_DATA_NO_POST_INC
Definition: ksz8565_driver.h:875
#define KSZ8565_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT5
Definition: ksz8565_driver.h:1165
void ksz8565WriteSwitchReg32(NetInterface *interface, uint16_t address, uint32_t data)
Write switch register (32 bits)
Definition: ksz8565_driver.c:1877
bool_t ksz8565GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz8565_driver.c:586
#define KSZ8565_ALU_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz8565_driver.h:1308
#define KSZ8565_SWITCH_LUE_CTRL3_AGE_PERIOD_DEFAULT
Definition: ksz8565_driver.h:1126
#define KSZ8565_PORT5_XMII_CTRL1_IF_TYPE
Definition: ksz8565_driver.h:1600
error_t ksz8565AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz8565_driver.c:1003
#define KSZ8565_PORTn_MSTP_STATE_TRANSMIT_EN
Definition: ksz8565_driver.h:1664
const uint16_t ksz8565IngressTailTag[5]
Tail tag rules (host to KSZ8565)
Definition: ksz8565_driver.c:77
void ksz8565WriteSwitchReg8(NetInterface *interface, uint16_t address, uint8_t data)
Write switch register (8 bits)
Definition: ksz8565_driver.c:1695
#define KSZ8565_STATIC_TABLE_ENTRY2_OVERRIDE
Definition: ksz8565_driver.h:1330
#define KSZ8565_UNKONWN_MULTICAST_CTRL_FWD
Definition: ksz8565_driver.h:1159
#define KSZ8565_GLOBAL_PORT_MIRROR_SNOOP_CTRL_MLD_SNOOP_EN
Definition: ksz8565_driver.h:1217
void ksz8565FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz8565_driver.c:1302
#define KSZ8565_PORTn_OP_CTRL0_TAIL_TAG_EN
Definition: ksz8565_driver.h:1578
void ksz8565SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz8565_driver.c:774
#define KSZ8565_ALU_TABLE_CTRL_VALID_ENTRY_OR_SEARCH_END
Definition: ksz8565_driver.h:1282
#define KSZ8565_SWITCH_MAC_CTRL0_FRAME_LEN_CHECK_EN
Definition: ksz8565_driver.h:1180
uint16_t ksz8565ReadSwitchReg16(NetInterface *interface, uint16_t address)
Read switch register (16 bits)
Definition: ksz8565_driver.c:1829
void ksz8565FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz8565_driver.c:1452
#define KSZ8565_SWITCH_LUE_CTRL2_FLUSH_OPTION_DYNAMIC
Definition: ksz8565_driver.h:1119
uint8_t ksz8565ReadSwitchReg8(NetInterface *interface, uint16_t address)
Read switch register (8 bits)
Definition: ksz8565_driver.c:1738
void ksz8565SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz8565_driver.c:1500
#define KSZ8565_SWITCH_OP_START_SWITCH
Definition: ksz8565_driver.h:1079
#define KSZ8565_ALU_TABLE_ENTRY2_PORT1_FORWARD
Definition: ksz8565_driver.h:1313
void ksz8565EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz8565_driver.c:914
void ksz8565WriteMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr, uint16_t data)
Write MMD register.
Definition: ksz8565_driver.c:1641
#define KSZ8565_ALU_TABLE_ENTRY2_PORT2_FORWARD
Definition: ksz8565_driver.h:1312
#define KSZ8565_PORT5_XMII_CTRL1_IF_TYPE_RGMII
Definition: ksz8565_driver.h:1601
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
#define KSZ8565_STATIC_MCAST_TABLE_CTRL_TABLE_SELECT
Definition: ksz8565_driver.h:1293
error_t ksz8565UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz8565_driver.c:534
#define KSZ8565_PORTn_MSTP_STATE_RECEIVE_EN
Definition: ksz8565_driver.h:1665
void ksz8565WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz8565_driver.c:1545
error_t ksz8565DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz8565_driver.c:1125
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
#define KSZ8565_SWITCH_LUE_CTRL2_FLUSH_OPTION
Definition: ksz8565_driver.h:1117
void ksz8565SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz8565_driver.c:893
#define KSZ8565_PORTn_ETH_PHY_REG(port, addr)
Definition: ksz8565_driver.h:791
#define KSZ8565_ALU_TABLE_ENTRY2_PORT5_FORWARD
Definition: ksz8565_driver.h:1309
__weak_func void ksz8565InitHook(NetInterface *interface)
KSZ8565 custom configuration.
Definition: ksz8565_driver.c:250
#define KSZ8565_STATIC_MCAST_TABLE_CTRL
Definition: ksz8565_driver.h:218
uint32_t ksz8565ReadSwitchReg32(NetInterface *interface, uint16_t address)
Read switch register (32 bits)
Definition: ksz8565_driver.c:1923
#define KSZ8565_PORT5_XMII_CTRL1_RGMII_ID_EG
Definition: ksz8565_driver.h:1598
#define KSZ8565_UNKONWN_MULTICAST_CTRL
Definition: ksz8565_driver.h:159
#define KSZ8565_SWITCH_LUE_CTRL1_FLUSH_ALU_TABLE
Definition: ksz8565_driver.h:1106
#define KSZ8565_MMD_LED_MODE_RESERVED_DEFAULT
Definition: ksz8565_driver.h:936
#define KSZ8565_PORT5_XMII_CTRL1_RGMII_ID_IG
Definition: ksz8565_driver.h:1597
#define KSZ8565_STATIC_MCAST_TABLE_CTRL_TABLE_INDEX
Definition: ksz8565_driver.h:1291
#define KSZ8565_ALU_TABLE_ENTRY2_PORT4_FORWARD
Definition: ksz8565_driver.h:1310
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
uint16_t ksz8565ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz8565_driver.c:1579
#define KSZ8565_GLOBAL_PORT_MIRROR_SNOOP_CTRL
Definition: ksz8565_driver.h:205
#define KSZ8565_MMD_LED_MODE_LED_MODE_SINGLE
Definition: ksz8565_driver.h:934
#define KSZ8565_PORTn_MSTP_STATE_LEARNING_DIS
Definition: ksz8565_driver.h:1666
error_t ksz8565GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz8565_driver.c:1205
#define KSZ8565_STATIC_TABLE_ENTRY1_VALID
Definition: ksz8565_driver.h:1323
#define KSZ8565_PORT5_XMII_CTRL0_SPEED_10_100
Definition: ksz8565_driver.h:1592
#define KSZ8565_SWITCH_LUE_CTRL1_FLUSH_MSTP_ENTRIES
Definition: ksz8565_driver.h:1107
#define KSZ8565_STATIC_MCAST_TABLE_CTRL_START_FINISH
Definition: ksz8565_driver.h:1292
#define KSZ8565_UNKONWN_MULTICAST_CTRL_FWD_MAP
Definition: ksz8565_driver.h:1160
#define KSZ8565_ALU_TABLE_CTRL_ACTION_SEARCH
Definition: ksz8565_driver.h:1288
void ksz8565WriteSwitchReg16(NetInterface *interface, uint16_t address, uint16_t data)
Write switch register (16 bits)
Definition: ksz8565_driver.c:1785
void ksz8565DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz8565_driver.c:1615
#define KSZ8565_PORT5_XMII_CTRL0_DUPLEX
Definition: ksz8565_driver.h:1590
error_t ksz8565TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz8565_driver.c:475
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
error_t ksz8565GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz8565_driver.c:1351
#define KSZ8565_SWITCH_LUE_CTRL0_HASH_OPTION_CRC
Definition: ksz8565_driver.h:1100
TCP/IP stack core.
#define KSZ8565_ALU_TABLE_ENTRY2_PORT3_FORWARD
Definition: ksz8565_driver.h:1311
KSZ8565 5-port Ethernet switch driver.
void ksz8565EventHandler(NetInterface *interface)
KSZ8565 event handler.
Definition: ksz8565_driver.c:350
#define KSZ8565_ALU_TABLE_CTRL_START_FINISH
Definition: ksz8565_driver.h:1280
Helper functions for Ethernet.
Debugging facilities.
uint16_t ksz8565ReadMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr)
Read MMD register.
Definition: ksz8565_driver.c:1669
#define KSZ8565_SWITCH_LUE_CTRL0_RESERVED_MCAST_LOOKUP_EN
Definition: ksz8565_driver.h:1097