ksz8864_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
void ksz8864SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz8864_driver.c:794
error_t ksz8864Init(NetInterface *interface)
KSZ8864 Ethernet switch initialization.
Definition: ksz8864_driver.c:92
uint32_t ksz8864GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz8864_driver.c:557
void ksz8864DumpSwitchReg(NetInterface *interface)
Dump switch registers for debugging purpose.
Definition: ksz8864_driver.c:1522
KSZ8864 4-port Ethernet switch driver.
void ksz8864SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz8864_driver.c:675
#define KSZ8864_INDIRECT_CTRL0_TABLE_SEL_DYNAMIC_MAC
Definition: ksz8864_driver.h:549
#define KSZ8864_GLOBAL_CTRL10_TAIL_TAG_EN
Definition: ksz8864_driver.h:428
void ksz8864EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz8864_driver.c:834
error_t ksz8864AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz8864_driver.c:888
error_t ksz8864GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz8864_driver.c:1162
#define KSZ8864_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD
Definition: ksz8864_driver.h:595
#define KSZ8864_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP
Definition: ksz8864_driver.h:596
#define KSZ8864_PORTn_CTRL2_RECEIVE_EN
Definition: ksz8864_driver.h:467
bool_t ksz8864GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz8864_driver.c:520
#define KSZ8864_GLOBAL_CTRL3_SW4_IGMP_SNOOP_EN
Definition: ksz8864_driver.h:386
void ksz8864WriteSwitchReg(NetInterface *interface, uint8_t address, uint8_t data)
Write switch register.
Definition: ksz8864_driver.c:1411
void ksz8864EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz8864_driver.c:846
#define KSZ8864_PORTn_CTRL2_LEARNING_DIS
Definition: ksz8864_driver.h:468
const SwitchDriver ksz8864SwitchDriver
KSZ8864 Ethernet switch driver.
Definition: ksz8864_driver.c:45
#define KSZ8864_INDIRECT_CTRL0_TABLE_SEL_STATIC_MAC
Definition: ksz8864_driver.h:547
uint8_t ksz8864ReadSwitchReg(NetInterface *interface, uint8_t address)
Read switch register.
Definition: ksz8864_driver.c:1466
__weak_func void ksz8864InitHook(NetInterface *interface)
KSZ8864 custom configuration.
Definition: ksz8864_driver.c:193
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
error_t ksz8864UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz8864_driver.c:477
error_t ksz8864DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz8864_driver.c:991
#define KSZ8864_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz8864_driver.h:59
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
#define KSZ8864_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_ALL
Definition: ksz8864_driver.h:602
#define KSZ8864_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT4
Definition: ksz8864_driver.h:601
NicDuplexMode ksz8864GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz8864_driver.c:616
const uint8_t ksz8864IngressTailTag[4]
Tail tag rules (host to KSZ8864)
Definition: ksz8864_driver.c:77
#define KSZ8864_GLOBAL_CTRL0_FLUSH_STATIC_MAC_TABLE
Definition: ksz8864_driver.h:361
void ksz8864SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz8864_driver.c:1293
void ksz8864WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz8864_driver.c:1338
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
void ksz8864FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz8864_driver.c:1122
#define KSZ8864_PORTn_CTRL2_TRANSMIT_EN
Definition: ksz8864_driver.h:466
void ksz8864EventHandler(NetInterface *interface)
KSZ8864 event handler.
Definition: ksz8864_driver.c:293
SwitchPortState ksz8864GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz8864_driver.c:731
void ksz8864EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz8864_driver.c:806
uint16_t ksz8864ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz8864_driver.c:1361
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
error_t ksz8864TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz8864_driver.c:422
error_t ksz8864GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz8864_driver.c:1060
#define KSZ8864_GLOBAL_CTRL4_SW4_HALF_DUPLEX_MODE
Definition: ksz8864_driver.h:394
#define KSZ8864_CHIP_ID0_FAMILY_ID_DEFAULT
Definition: ksz8864_driver.h:352
void ksz8864DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz8864_driver.c:1387
void ksz8864FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz8864_driver.c:1246
TCP/IP stack core.
#define KSZ8864_GLOBAL_CTRL4_SW4_SPEED
Definition: ksz8864_driver.h:396
#define KSZ8864_GLOBAL_CTRL0_FLUSH_DYNAMIC_MAC_TABLE
Definition: ksz8864_driver.h:360
Helper functions for Ethernet.
Debugging facilities.