ksz8873_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
SwitchPortState ksz8873GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz8873_driver.c:714
error_t ksz8873GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz8873_driver.c:1005
error_t ksz8873TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz8873_driver.c:408
#define KSZ8873_INDIRECT_CTRL0_TABLE_SEL_DYNAMIC_MAC
Definition: ksz8873_driver.h:532
void ksz8873DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz8873_driver.c:1302
void ksz8873EventHandler(NetInterface *interface)
KSZ8873 event handler.
Definition: ksz8873_driver.c:283
#define KSZ8873_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz8873_driver.h:60
#define KSZ8873_GLOBAL_CTRL3_IGMP_SNOOP_EN
Definition: ksz8873_driver.h:359
#define KSZ8873_PORTn_CTRL2_LEARNING_DIS
Definition: ksz8873_driver.h:438
__weak_func void ksz8873InitHook(NetInterface *interface)
KSZ8873 custom configuration.
Definition: ksz8873_driver.c:183
void ksz8873EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz8873_driver.c:817
#define KSZ8873_INDIRECT_CTRL0_TABLE_SEL_STATIC_MAC
Definition: ksz8873_driver.h:530
uint16_t ksz8873ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz8873_driver.c:1276
void ksz8873DumpSwitchReg(NetInterface *interface)
Dump switch registers for debugging purpose.
Definition: ksz8873_driver.c:1437
#define KSZ8873_PORTn_CTRL2_RECEIVE_EN
Definition: ksz8873_driver.h:437
error_t ksz8873UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz8873_driver.c:463
void ksz8873WriteSwitchReg(NetInterface *interface, uint8_t address, uint8_t data)
Write switch register.
Definition: ksz8873_driver.c:1326
void ksz8873EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz8873_driver.c:789
void ksz8873SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz8873_driver.c:777
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
uint32_t ksz8873GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz8873_driver.c:550
error_t ksz8873GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz8873_driver.c:1107
#define KSZ8873_GLOBAL_CTRL1_TAIL_TAG_EN
Definition: ksz8873_driver.h:340
void ksz8873EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz8873_driver.c:829
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
const SwitchDriver ksz8873SwitchDriver
KSZ8873 Ethernet switch driver.
Definition: ksz8873_driver.c:45
#define KSZ8873_CHIP_ID0_FAMILY_ID_DEFAULT
Definition: ksz8873_driver.h:324
void ksz8873SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz8873_driver.c:1238
void ksz8873WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz8873_driver.c:1253
void ksz8873FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz8873_driver.c:1191
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
void ksz8873SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz8873_driver.c:658
uint8_t ksz8873ReadSwitchReg(NetInterface *interface, uint8_t address)
Read switch register.
Definition: ksz8873_driver.c:1381
#define KSZ8873_PORTn_CTRL2_TRANSMIT_EN
Definition: ksz8873_driver.h:436
const uint8_t ksz8873IngressTailTag[3]
Tail tag rules (host to KSZ8873)
Definition: ksz8873_driver.c:77
KSZ8873 3-port Ethernet switch driver.
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
NicDuplexMode ksz8873GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz8873_driver.c:604
#define KSZ8873_GLOBAL_CTRL4_PORT3_DUPLEX_MODE_SEL
Definition: ksz8873_driver.h:364
void ksz8873FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz8873_driver.c:1067
TCP/IP stack core.
error_t ksz8873DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz8873_driver.c:941
error_t ksz8873AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz8873_driver.c:842
#define KSZ8873_GLOBAL_CTRL0_FLUSH_STATIC_MAC_TABLE
Definition: ksz8873_driver.h:335
Helper functions for Ethernet.
error_t ksz8873Init(NetInterface *interface)
KSZ8873 Ethernet switch initialization.
Definition: ksz8873_driver.c:91
Debugging facilities.
bool_t ksz8873GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz8873_driver.c:506
#define KSZ8873_GLOBAL_CTRL4_PORT3_SPEED_SEL
Definition: ksz8873_driver.h:366
#define KSZ8873_GLOBAL_CTRL0_FLUSH_DYNAMIC_MAC_TABLE
Definition: ksz8873_driver.h:334