ksz9897_driver.c
uint16_t ksz9897ReadMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr)
Read MMD register.
Definition: ksz9897_driver.c:1677
#define KSZ9897_STATIC_MCAST_TABLE_CTRL
Definition: ksz9897_driver.h:203
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
#define KSZ9897_SWITCH_LUE_CTRL1_FLUSH_MSTP_ENTRIES
Definition: ksz9897_driver.h:1089
void ksz9897WriteSwitchReg16(NetInterface *interface, uint16_t address, uint16_t data)
Write switch register (16 bits)
Definition: ksz9897_driver.c:1793
error_t ksz9897TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz9897_driver.c:473
error_t ksz9897DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz9897_driver.c:1128
#define KSZ9897_SWITCH_LUE_CTRL3_AGE_PERIOD_DEFAULT
Definition: ksz9897_driver.h:1108
#define KSZ9897_UNKONWN_MULTICAST_CTRL_FWD
Definition: ksz9897_driver.h:1143
#define KSZ9897_ALU_TABLE_CTRL_VALID_ENTRY_OR_SEARCH_END
Definition: ksz9897_driver.h:1266
#define KSZ9897_SWITCH_LUE_CTRL0_AGE_COUNT_DEFAULT
Definition: ksz9897_driver.h:1078
#define KSZ9897_ALU_TABLE_ENTRY2_PORT6_FORWARD
Definition: ksz9897_driver.h:1294
void ksz9897EventHandler(NetInterface *interface)
KSZ9897 event handler.
Definition: ksz9897_driver.c:348
#define KSZ9897_ALU_TABLE_ENTRY2_PORT7_FORWARD
Definition: ksz9897_driver.h:1293
#define KSZ9897_PORTn_XMII_CTRL1_IF_TYPE_RGMII
Definition: ksz9897_driver.h:1389
void ksz9897EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz9897_driver.c:917
error_t ksz9897Init(NetInterface *interface)
KSZ9897 Ethernet switch initialization.
Definition: ksz9897_driver.c:94
#define KSZ9897_PORTn_MSTP_STATE_TRANSMIT_EN
Definition: ksz9897_driver.h:1454
void ksz9897WriteSwitchReg32(NetInterface *interface, uint16_t address, uint32_t data)
Write switch register (32 bits)
Definition: ksz9897_driver.c:1885
error_t ksz9897GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz9897_driver.c:1208
#define KSZ9897_ALU_TABLE_ENTRY2_PORT4_FORWARD
Definition: ksz9897_driver.h:1296
void ksz9897SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz9897_driver.c:777
void ksz9897WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz9897_driver.c:1553
#define KSZ9897_PORTn_MSTP_STATE_LEARNING_DIS
Definition: ksz9897_driver.h:1456
#define KSZ9897_MMD_LED_MODE_RESERVED_DEFAULT
Definition: ksz9897_driver.h:927
#define KSZ9897_STATIC_MCAST_TABLE_CTRL_TABLE_SELECT
Definition: ksz9897_driver.h:1277
#define KSZ9897_GLOBAL_PORT_MIRROR_SNOOP_CTRL_IGMP_SNOOP_EN
Definition: ksz9897_driver.h:1203
error_t ksz9897UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz9897_driver.c:532
void ksz9897FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz9897_driver.c:1305
#define KSZ9897_MMD_LED_MODE_LED_MODE_TRI_COLOR_DUAL
Definition: ksz9897_driver.h:924
KSZ9897 7-port Gigabit Ethernet switch driver.
#define KSZ9897_PORTn_XMII_CTRL1_IF_TYPE
Definition: ksz9897_driver.h:1388
#define KSZ9897_STATIC_MCAST_TABLE_CTRL_ACTION
Definition: ksz9897_driver.h:1278
void ksz9897DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz9897_driver.c:1623
uint8_t ksz9897ReadSwitchReg8(NetInterface *interface, uint16_t address)
Read switch register (8 bits)
Definition: ksz9897_driver.c:1746
#define KSZ9897_PORTn_XMII_CTRL0_SPEED_10_100
Definition: ksz9897_driver.h:1380
const uint16_t ksz9897IngressTailTag[6]
Tail tag rules (host to KSZ9897)
Definition: ksz9897_driver.c:77
#define KSZ9897_PORTn_MSTP_STATE_RECEIVE_EN
Definition: ksz9897_driver.h:1455
#define KSZ9897_ALU_TABLE_ENTRY2_PORT2_FORWARD
Definition: ksz9897_driver.h:1298
uint16_t ksz9897ReadSwitchReg16(NetInterface *interface, uint16_t address)
Read switch register (16 bits)
Definition: ksz9897_driver.c:1837
void ksz9897SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz9897_driver.c:1508
#define KSZ9897_PORTn_XMII_CTRL0_DUPLEX
Definition: ksz9897_driver.h:1378
const SwitchDriver ksz9897SwitchDriver
KSZ9897 Ethernet switch driver.
Definition: ksz9897_driver.c:45
#define KSZ9897_GLOBAL_PORT_MIRROR_SNOOP_CTRL
Definition: ksz9897_driver.h:192
#define KSZ9897_PORTn_OP_CTRL0_TAIL_TAG_EN
Definition: ksz9897_driver.h:1365
#define KSZ9897_STATIC_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz9897_driver.h:1318
#define KSZ9897_GLOBAL_PORT_MIRROR_SNOOP_CTRL_MLD_SNOOP_EN
Definition: ksz9897_driver.h:1205
#define KSZ9897_ALU_TABLE_CTRL_START_FINISH
Definition: ksz9897_driver.h:1264
#define KSZ9897_ALU_TABLE_ENTRY2_PORT1_FORWARD
Definition: ksz9897_driver.h:1299
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
uint32_t ksz9897GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz9897_driver.c:618
#define KSZ9897_ALU_TABLE_CTRL_ACTION_SEARCH
Definition: ksz9897_driver.h:1272
#define KSZ9897_UNKONWN_MULTICAST_CTRL_FWD_MAP
Definition: ksz9897_driver.h:1144
#define KSZ9897_SWITCH_LUE_CTRL2_FLUSH_OPTION_DYNAMIC
Definition: ksz9897_driver.h:1101
#define KSZ9897_ALU_TABLE_ENTRY2_PORT3_FORWARD
Definition: ksz9897_driver.h:1297
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
#define KSZ9897_STATIC_TABLE_ENTRY2_OVERRIDE
Definition: ksz9897_driver.h:1316
uint32_t ksz9897ReadSwitchReg32(NetInterface *interface, uint16_t address)
Read switch register (32 bits)
Definition: ksz9897_driver.c:1931
__weak_func void ksz9897InitHook(NetInterface *interface)
KSZ9897 custom configuration.
Definition: ksz9897_driver.c:248
void ksz9897EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz9897_driver.c:977
void ksz9897EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz9897_driver.c:947
#define KSZ9897_SWITCH_LUE_CTRL1_FLUSH_ALU_TABLE
Definition: ksz9897_driver.h:1088
#define KSZ9897_UNKONWN_MULTICAST_CTRL_FWD_MAP_ALL
Definition: ksz9897_driver.h:1152
#define KSZ9897_SWITCH_MAC_CTRL0_FRAME_LEN_CHECK_EN
Definition: ksz9897_driver.h:1168
#define KSZ9897_MMDACR_FUNC_DATA_NO_POST_INC
Definition: ksz9897_driver.h:861
#define KSZ9897_STATIC_TABLE_ENTRY1_VALID
Definition: ksz9897_driver.h:1309
#define KSZ9897_SWITCH_OP_START_SWITCH
Definition: ksz9897_driver.h:1068
error_t ksz9897GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz9897_driver.c:1354
#define KSZ9897_SWITCH_LUE_CTRL0_RESERVED_MCAST_LOOKUP_EN
Definition: ksz9897_driver.h:1079
#define KSZ9897_PORTn_XMII_CTRL1_RGMII_ID_EG
Definition: ksz9897_driver.h:1386
#define KSZ9897_UNKONWN_MULTICAST_CTRL
Definition: ksz9897_driver.h:146
#define KSZ9897_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz9897_driver.h:66
#define KSZ9897_PORTn_XMII_CTRL1_SPEED_1000
Definition: ksz9897_driver.h:1384
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
void ksz9897SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz9897_driver.c:896
#define KSZ9897_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT6
Definition: ksz9897_driver.h:1150
uint16_t ksz9897ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz9897_driver.c:1587
#define KSZ9897_SWITCH_LUE_CTRL2_FLUSH_OPTION
Definition: ksz9897_driver.h:1099
#define KSZ9897_PORTn_XMII_CTRL1_RGMII_ID_IG
Definition: ksz9897_driver.h:1385
#define KSZ9897_TAIL_TAG_PORT_BLOCKING_OVERRIDE
Definition: ksz9897_driver.h:67
bool_t ksz9897GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz9897_driver.c:584
void ksz9897WriteSwitchReg8(NetInterface *interface, uint16_t address, uint8_t data)
Write switch register (8 bits)
Definition: ksz9897_driver.c:1703
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
#define KSZ9897_STATIC_MCAST_TABLE_CTRL_TABLE_INDEX
Definition: ksz9897_driver.h:1275
void ksz9897WriteMmdReg(NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr, uint16_t data)
Write MMD register.
Definition: ksz9897_driver.c:1649
SwitchPortState ksz9897GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz9897_driver.c:833
#define KSZ9897_ALU_TABLE_ENTRY2_PORT5_FORWARD
Definition: ksz9897_driver.h:1295
#define KSZ9897_SWITCH_LUE_CTRL0_HASH_OPTION_CRC
Definition: ksz9897_driver.h:1082
TCP/IP stack core.
Helper functions for Ethernet.
NicDuplexMode ksz9897GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz9897_driver.c:713
void ksz9897FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz9897_driver.c:1461
#define KSZ9897_ALU_TABLE_ENTRY2_PORT_FORWARD
Definition: ksz9897_driver.h:1292
Debugging facilities.
#define KSZ9897_PORTn_ETH_PHY_REG(port, addr)
Definition: ksz9897_driver.h:759
#define KSZ9897_STATIC_MCAST_TABLE_CTRL_START_FINISH
Definition: ksz9897_driver.h:1276
error_t ksz9897AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz9897_driver.c:1006