ksz8567_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
#define KSZ8567_ALU_TABLE_ENTRY2_PORT7_FORWARD
Definition: ksz8567_driver.h:1510
#define KSZ8567_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz8567_driver.h:66
#define KSZ8567_ALU_TABLE_CTRL_START_FINISH
Definition: ksz8567_driver.h:1481
#define KSZ8567_STATIC_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz8567_driver.h:1535
#define KSZ8567_ALU_TABLE_ENTRY2_PORT2_FORWARD
Definition: ksz8567_driver.h:1515
#define KSZ8567_UNKONWN_MULTICAST_CTRL_FWD_MAP
Definition: ksz8567_driver.h:1353
uint32_t ksz8567ReadSwitchReg32(NetInterface *interface, uint16_t address)
Read switch register (32 bits)
Definition: ksz8567_driver.c:1929
uint8_t ksz8567ReadSwitchReg8(NetInterface *interface, uint16_t address)
Read switch register (8 bits)
Definition: ksz8567_driver.c:1744
error_t ksz8567UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz8567_driver.c:535
void ksz8567EventHandler(NetInterface *interface)
KSZ8567 event handler.
Definition: ksz8567_driver.c:351
#define KSZ8567_STATIC_MCAST_TABLE_CTRL_START_FINISH
Definition: ksz8567_driver.h:1493
KSZ8567 7-port Ethernet switch driver.
#define KSZ8567_ALU_TABLE_ENTRY2_PORT1_FORWARD
Definition: ksz8567_driver.h:1516
#define KSZ8567_UNKONWN_MULTICAST_CTRL_FWD
Definition: ksz8567_driver.h:1352
#define KSZ8567_SWITCH_LUE_CTRL2_FLUSH_OPTION
Definition: ksz8567_driver.h:1308
#define KSZ8567_PORTn_XMII_CTRL1_RGMII_ID_IG
Definition: ksz8567_driver.h:1806
#define KSZ8567_SWITCH_LUE_CTRL0_RESERVED_MCAST_LOOKUP_EN
Definition: ksz8567_driver.h:1288
const uint16_t ksz8567IngressTailTag[6]
Tail tag rules (host to KSZ8567)
Definition: ksz8567_driver.c:77
#define KSZ8567_PORTn_XMII_CTRL1_RGMII_ID_EG
Definition: ksz8567_driver.h:1807
const SwitchDriver ksz8567SwitchDriver
KSZ8567 Ethernet switch driver.
Definition: ksz8567_driver.c:45
void ksz8567EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz8567_driver.c:915
void ksz8567SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz8567_driver.c:894
#define KSZ8567_STATIC_TABLE_ENTRY1_VALID
Definition: ksz8567_driver.h:1526
uint16_t ksz8567ReadMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr)
Read MMD register.
Definition: ksz8567_driver.c:1675
#define KSZ8567_SWITCH_MAC_CTRL0_FRAME_LEN_CHECK_EN
Definition: ksz8567_driver.h:1377
#define KSZ8567_MMDACR_FUNC_DATA_NO_POST_INC
Definition: ksz8567_driver.h:1054
#define KSZ8567_UNKONWN_MULTICAST_CTRL_FWD_MAP_ALL
Definition: ksz8567_driver.h:1361
error_t ksz8567DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz8567_driver.c:1126
#define KSZ8567_ALU_TABLE_ENTRY2_PORT5_FORWARD
Definition: ksz8567_driver.h:1512
#define KSZ8567_ALU_TABLE_ENTRY2_PORT6_FORWARD
Definition: ksz8567_driver.h:1511
#define KSZ8567_ALU_TABLE_ENTRY2_PORT4_FORWARD
Definition: ksz8567_driver.h:1513
uint16_t ksz8567ReadSwitchReg16(NetInterface *interface, uint16_t address)
Read switch register (16 bits)
Definition: ksz8567_driver.c:1835
void ksz8567SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz8567_driver.c:775
#define KSZ8567_PORTn_ETH_PHY_REG(port, addr)
Definition: ksz8567_driver.h:970
#define KSZ8567_STATIC_MCAST_TABLE_CTRL_TABLE_INDEX
Definition: ksz8567_driver.h:1492
#define KSZ8567_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT6
Definition: ksz8567_driver.h:1359
#define KSZ8567_TAIL_TAG_PORT_BLOCKING_OVERRIDE
Definition: ksz8567_driver.h:67
#define KSZ8567_PORTn_MSTP_STATE_LEARNING_DIS
Definition: ksz8567_driver.h:1877
#define KSZ8567_GLOBAL_PORT_MIRROR_SNOOP_CTRL
Definition: ksz8567_driver.h:208
void ksz8567EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz8567_driver.c:945
#define KSZ8567_SWITCH_LUE_CTRL1_FLUSH_MSTP_ENTRIES
Definition: ksz8567_driver.h:1298
#define KSZ8567_PORTn_OP_CTRL0_TAIL_TAG_EN
Definition: ksz8567_driver.h:1787
void ksz8567WriteSwitchReg8(NetInterface *interface, uint16_t address, uint8_t data)
Write switch register (8 bits)
Definition: ksz8567_driver.c:1701
#define KSZ8567_ALU_TABLE_CTRL_VALID_ENTRY_OR_SEARCH_END
Definition: ksz8567_driver.h:1483
#define KSZ8567_STATIC_MCAST_TABLE_CTRL_ACTION
Definition: ksz8567_driver.h:1495
#define KSZ8567_ALU_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz8567_driver.h:1509
error_t ksz8567Init(NetInterface *interface)
KSZ8567 Ethernet switch initialization.
Definition: ksz8567_driver.c:94
#define KSZ8567_GLOBAL_PORT_MIRROR_SNOOP_CTRL_IGMP_SNOOP_EN
Definition: ksz8567_driver.h:1412
NicDuplexMode ksz8567GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz8567_driver.c:711
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
error_t ksz8567GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz8567_driver.c:1352
#define KSZ8567_SWITCH_LUE_CTRL1_FLUSH_ALU_TABLE
Definition: ksz8567_driver.h:1297
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
#define KSZ8567_SWITCH_OP_START_SWITCH
Definition: ksz8567_driver.h:1270
void ksz8567WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz8567_driver.c:1551
#define KSZ8567_MMD_LED_MODE_RESERVED_DEFAULT
Definition: ksz8567_driver.h:1115
#define KSZ8567_SWITCH_LUE_CTRL0_AGE_COUNT_DEFAULT
Definition: ksz8567_driver.h:1287
void ksz8567DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz8567_driver.c:1621
#define KSZ8567_SWITCH_LUE_CTRL0_HASH_OPTION_CRC
Definition: ksz8567_driver.h:1291
void ksz8567WriteSwitchReg16(NetInterface *interface, uint16_t address, uint16_t data)
Write switch register (16 bits)
Definition: ksz8567_driver.c:1791
#define KSZ8567_PORTn_MSTP_STATE_RECEIVE_EN
Definition: ksz8567_driver.h:1876
error_t ksz8567AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz8567_driver.c:1004
#define KSZ8567_ALU_TABLE_ENTRY2_PORT3_FORWARD
Definition: ksz8567_driver.h:1514
#define KSZ8567_PORTn_MSTP_STATE_TRANSMIT_EN
Definition: ksz8567_driver.h:1875
#define KSZ8567_PORTn_XMII_CTRL0_DUPLEX
Definition: ksz8567_driver.h:1799
#define KSZ8567_SWITCH_LUE_CTRL2_FLUSH_OPTION_DYNAMIC
Definition: ksz8567_driver.h:1310
error_t ksz8567GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz8567_driver.c:1206
#define KSZ8567_PORTn_XMII_CTRL0_SPEED_10_100
Definition: ksz8567_driver.h:1801
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
uint16_t ksz8567ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz8567_driver.c:1585
#define KSZ8567_GLOBAL_PORT_MIRROR_SNOOP_CTRL_MLD_SNOOP_EN
Definition: ksz8567_driver.h:1414
bool_t ksz8567GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz8567_driver.c:587
void ksz8567FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz8567_driver.c:1459
#define KSZ8567_PORTn_XMII_CTRL1_IF_TYPE_RGMII
Definition: ksz8567_driver.h:1810
#define KSZ8567_SWITCH_LUE_CTRL3_AGE_PERIOD_DEFAULT
Definition: ksz8567_driver.h:1317
SwitchPortState ksz8567GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz8567_driver.c:831
#define KSZ8567_STATIC_MCAST_TABLE_CTRL
Definition: ksz8567_driver.h:221
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
#define KSZ8567_PORTn_XMII_CTRL1_SPEED_1000
Definition: ksz8567_driver.h:1805
#define KSZ8567_MMD_LED_MODE_LED_MODE_SINGLE
Definition: ksz8567_driver.h:1113
#define KSZ8567_UNKONWN_MULTICAST_CTRL
Definition: ksz8567_driver.h:162
void ksz8567FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz8567_driver.c:1303
TCP/IP stack core.
uint32_t ksz8567GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz8567_driver.c:621
void ksz8567WriteMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr, uint16_t data)
Write MMD register.
Definition: ksz8567_driver.c:1647
#define KSZ8567_STATIC_TABLE_ENTRY2_OVERRIDE
Definition: ksz8567_driver.h:1533
__weak_func void ksz8567InitHook(NetInterface *interface)
KSZ8567 custom configuration.
Definition: ksz8567_driver.c:251
#define KSZ8567_ALU_TABLE_CTRL_ACTION_SEARCH
Definition: ksz8567_driver.h:1489
void ksz8567SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz8567_driver.c:1506
Helper functions for Ethernet.
void ksz8567WriteSwitchReg32(NetInterface *interface, uint16_t address, uint32_t data)
Write switch register (32 bits)
Definition: ksz8567_driver.c:1883
void ksz8567EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz8567_driver.c:975
Debugging facilities.
error_t ksz8567TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz8567_driver.c:476
#define KSZ8567_STATIC_MCAST_TABLE_CTRL_TABLE_SELECT
Definition: ksz8567_driver.h:1494
#define KSZ8567_PORTn_XMII_CTRL1_IF_TYPE
Definition: ksz8567_driver.h:1809