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