ksz8795_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
void ksz8795DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz8795_driver.c:1465
void ksz8795WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz8795_driver.c:1416
void ksz8795SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz8795_driver.c:738
#define KSZ8795_CHIP_ID0_FAMILY_ID_DEFAULT
Definition: ksz8795_driver.h:399
__weak_func void ksz8795InitHook(NetInterface *interface)
KSZ8795 custom configuration.
Definition: ksz8795_driver.c:210
#define KSZ8795_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz8795_driver.h:62
error_t ksz8795AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz8795_driver.c:967
error_t ksz8795DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz8795_driver.c:1069
#define KSZ8795_PORT5_IF_CTRL6_IF_MODE_SEL
Definition: ksz8795_driver.h:536
#define KSZ8795_GLOBAL_CTRL21_MLD_SNOOP_EN
Definition: ksz8795_driver.h:727
#define KSZ8795_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD
Definition: ksz8795_driver.h:664
#define KSZ8795_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_ALL
Definition: ksz8795_driver.h:672
error_t ksz8795UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz8795_driver.c:494
error_t ksz8795Init(NetInterface *interface)
KSZ8795 Ethernet switch initialization.
Definition: ksz8795_driver.c:93
#define KSZ8795_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT5
Definition: ksz8795_driver.h:671
error_t ksz8795GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz8795_driver.c:1138
#define KSZ8795_PORTn_CTRL2_LEARNING_DIS
Definition: ksz8795_driver.h:518
const uint8_t ksz8795IngressTailTag[5]
Tail tag rules (host to KSZ8795)
Definition: ksz8795_driver.c:77
#define KSZ8795_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP
Definition: ksz8795_driver.h:665
void ksz8795SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz8795_driver.c:1371
#define KSZ8795_PORTn_CTRL2_RECEIVE_EN
Definition: ksz8795_driver.h:517
void ksz8795EventHandler(NetInterface *interface)
KSZ8795 event handler.
Definition: ksz8795_driver.c:310
#define KSZ8795_GLOBAL_CTRL10_TAIL_TAG_EN
Definition: ksz8795_driver.h:479
#define KSZ8795_PORT5_IF_CTRL6_IF_MODE_SEL_GMII
Definition: ksz8795_driver.h:539
NicDuplexMode ksz8795GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz8795_driver.c:674
#define KSZ8795_PORT5_IF_CTRL6_IF_MODE_SEL_RGMII
Definition: ksz8795_driver.h:540
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
#define KSZ8795_INDIRECT_CTRL0_TABLE_SEL_STATIC_MAC
Definition: ksz8795_driver.h:599
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
const SwitchDriver ksz8795SwitchDriver
KSZ8795 Ethernet switch driver.
Definition: ksz8795_driver.c:45
SwitchPortState ksz8795GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz8795_driver.c:794
uint32_t ksz8795GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz8795_driver.c:590
#define KSZ8795_GLOBAL_CTRL4_SW5_SPEED
Definition: ksz8795_driver.h:441
KSZ8795 5-port Ethernet switch driver.
void ksz8795EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz8795_driver.c:869
#define KSZ8795_GLOBAL_CTRL3_SW5_IGMP_SNOOP_EN
Definition: ksz8795_driver.h:434
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
#define KSZ8795_PORTn_CTRL2_TRANSMIT_EN
Definition: ksz8795_driver.h:516
void ksz8795EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz8795_driver.c:925
bool_t ksz8795GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz8795_driver.c:546
void ksz8795EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz8795_driver.c:897
void ksz8795DumpSwitchReg(NetInterface *interface)
Dump switch registers for debugging purpose.
Definition: ksz8795_driver.c:1573
uint8_t ksz8795ReadSwitchReg(NetInterface *interface, uint16_t address)
Read switch register.
Definition: ksz8795_driver.c:1530
#define KSZ8795_INDIRECT_CTRL0_TABLE_SEL_DYNAMIC_MAC
Definition: ksz8795_driver.h:601
#define KSZ8795_PORT5_IF_CTRL6_IS_1GBPS
Definition: ksz8795_driver.h:530
uint16_t ksz8795ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz8795_driver.c:1439
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
error_t ksz8795TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz8795_driver.c:435
#define KSZ8795_GLOBAL_CTRL4_SW5_HALF_DUPLEX_MODE
Definition: ksz8795_driver.h:439
#define KSZ8795_GLOBAL_CTRL2_MAX_PKT_SIZE_CHECK_DIS
Definition: ksz8795_driver.h:430
void ksz8795WriteSwitchReg(NetInterface *interface, uint16_t address, uint8_t data)
Write switch register.
Definition: ksz8795_driver.c:1489
#define KSZ8795_GLOBAL_CTRL0_FLUSH_STATIC_MAC_TABLE
Definition: ksz8795_driver.h:411
void ksz8795FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz8795_driver.c:1324
TCP/IP stack core.
void ksz8795FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz8795_driver.c:1200
Helper functions for Ethernet.
#define KSZ8795_INDIRECT_CTRL0_ADDR_9_8
Definition: ksz8795_driver.h:604
void ksz8795SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz8795_driver.c:857
error_t ksz8795GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz8795_driver.c:1240
Debugging facilities.
#define KSZ8795_GLOBAL_CTRL0_FLUSH_DYNAMIC_MAC_TABLE
Definition: ksz8795_driver.h:410