ksz8794_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
#define KSZ8794_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP
Definition: ksz8794_driver.h:626
#define KSZ8794_GLOBAL_CTRL4_SW4_HALF_DUPLEX_MODE
Definition: ksz8794_driver.h:407
error_t ksz8794TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz8794_driver.c:434
#define KSZ8794_PORT4_IF_CTRL6_IF_MODE_SEL
Definition: ksz8794_driver.h:503
uint32_t ksz8794GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz8794_driver.c:589
error_t ksz8794Init(NetInterface *interface)
KSZ8794 Ethernet switch initialization.
Definition: ksz8794_driver.c:92
#define KSZ8794_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT4
Definition: ksz8794_driver.h:631
error_t ksz8794UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz8794_driver.c:493
#define KSZ8794_GLOBAL_CTRL0_FLUSH_DYNAMIC_MAC_TABLE
Definition: ksz8794_driver.h:378
void ksz8794SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz8794_driver.c:1387
#define KSZ8794_PORTn_CTRL2_LEARNING_DIS
Definition: ksz8794_driver.h:485
uint16_t ksz8794ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz8794_driver.c:1455
#define KSZ8794_GLOBAL_CTRL3_SW5_IGMP_SNOOP_EN
Definition: ksz8794_driver.h:402
error_t ksz8794DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz8794_driver.c:1067
#define KSZ8794_INDIRECT_CTRL0_ADDR_9_8
Definition: ksz8794_driver.h:570
void ksz8794EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz8794_driver.c:895
#define KSZ8794_GLOBAL_CTRL0_FLUSH_STATIC_MAC_TABLE
Definition: ksz8794_driver.h:379
#define KSZ8794_PORT4_IF_CTRL6_IF_MODE_SEL_RGMII
Definition: ksz8794_driver.h:506
KSZ8794 4-port Ethernet switch driver.
#define KSZ8794_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_ALL
Definition: ksz8794_driver.h:632
#define KSZ8794_PORTn_CTRL2_RECEIVE_EN
Definition: ksz8794_driver.h:484
#define KSZ8794_CHIP_ID0_FAMILY_ID_DEFAULT
Definition: ksz8794_driver.h:367
void ksz8794DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz8794_driver.c:1481
__weak_func void ksz8794InitHook(NetInterface *interface)
KSZ8794 custom configuration.
Definition: ksz8794_driver.c:209
void ksz8794EventHandler(NetInterface *interface)
KSZ8794 event handler.
Definition: ksz8794_driver.c:309
#define KSZ8794_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz8794_driver.h:61
const uint8_t ksz8794IngressTailTag[4]
Tail tag rules (host to KSZ8794)
Definition: ksz8794_driver.c:77
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
SwitchPortState ksz8794GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz8794_driver.c:792
#define KSZ8794_GLOBAL_CTRL21_MLD_SNOOP_EN
Definition: ksz8794_driver.h:685
void ksz8794FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz8794_driver.c:1198
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
void ksz8794SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz8794_driver.c:736
NicDuplexMode ksz8794GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz8794_driver.c:672
#define KSZ8794_GLOBAL_CTRL2_MAX_PKT_SIZE_CHECK_DIS
Definition: ksz8794_driver.h:398
error_t ksz8794GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz8794_driver.c:1136
error_t ksz8794GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz8794_driver.c:1246
#define KSZ8794_GLOBAL_CTRL4_SW4_SPEED
Definition: ksz8794_driver.h:409
error_t ksz8794AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz8794_driver.c:965
void ksz8794FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz8794_driver.c:1330
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
void ksz8794WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz8794_driver.c:1432
void ksz8794WriteSwitchReg(NetInterface *interface, uint16_t address, uint8_t data)
Write switch register.
Definition: ksz8794_driver.c:1505
#define KSZ8794_GLOBAL_CTRL10_TAIL_TAG_EN
Definition: ksz8794_driver.h:446
#define KSZ8794_INDIRECT_CTRL0_TABLE_SEL_DYNAMIC_MAC
Definition: ksz8794_driver.h:567
bool_t ksz8794GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz8794_driver.c:545
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
void ksz8794DumpSwitchReg(NetInterface *interface)
Dump switch registers for debugging purpose.
Definition: ksz8794_driver.c:1589
#define KSZ8794_PORTn_CTRL2_TRANSMIT_EN
Definition: ksz8794_driver.h:483
void ksz8794EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz8794_driver.c:923
TCP/IP stack core.
#define KSZ8794_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD
Definition: ksz8794_driver.h:625
void ksz8794EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz8794_driver.c:867
#define KSZ8794_PORT4_IF_CTRL6_IS_1GBPS
Definition: ksz8794_driver.h:497
void ksz8794SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz8794_driver.c:855
const SwitchDriver ksz8794SwitchDriver
KSZ8794 Ethernet switch driver.
Definition: ksz8794_driver.c:45
Helper functions for Ethernet.
uint8_t ksz8794ReadSwitchReg(NetInterface *interface, uint16_t address)
Read switch register.
Definition: ksz8794_driver.c:1546
Debugging facilities.
#define KSZ8794_INDIRECT_CTRL0_TABLE_SEL_STATIC_MAC
Definition: ksz8794_driver.h:565