ksz8895_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
bool_t ksz8895GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: ksz8895_driver.c:517
KSZ8895 5-port Ethernet switch driver.
void ksz8895SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: ksz8895_driver.c:776
void ksz8895SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: ksz8895_driver.c:1142
const uint8_t ksz8895IngressTailTag[5]
Tail tag rules (host to KSZ8895)
Definition: ksz8895_driver.c:77
error_t ksz8895GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: ksz8895_driver.c:1041
error_t ksz8895GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: ksz8895_driver.c:1187
error_t ksz8895TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: ksz8895_driver.c:419
NicDuplexMode ksz8895GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: ksz8895_driver.c:603
#define KSZ8895_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: ksz8895_driver.h:62
#define KSZ8895_GLOBAL_CTRL10_TAIL_TAG_EN
Definition: ksz8895_driver.h:472
__weak_func void ksz8895InitHook(NetInterface *interface)
KSZ8895 custom configuration.
Definition: ksz8895_driver.c:194
void ksz8895WriteSwitchReg(NetInterface *interface, uint8_t address, uint8_t data)
Write switch register.
Definition: ksz8895_driver.c:1392
const SwitchDriver ksz8895SwitchDriver
KSZ8895 Ethernet switch driver.
Definition: ksz8895_driver.c:45
#define KSZ8895_PORTn_CTRL2_LEARNING_DIS
Definition: ksz8895_driver.h:512
SwitchPortState ksz8895GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: ksz8895_driver.c:713
#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_PORT5
Definition: ksz8895_driver.h:654
error_t ksz8895DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: ksz8895_driver.c:972
#define KSZ8895_GLOBAL_CTRL4_SW5_HALF_DUPLEX_MODE
Definition: ksz8895_driver.h:440
void ksz8895DumpSwitchReg(NetInterface *interface)
Dump switch registers for debugging purpose.
Definition: ksz8895_driver.c:1503
void ksz8895SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: ksz8895_driver.c:657
#define KSZ8895_GLOBAL_CTRL0_FLUSH_STATIC_MAC_TABLE
Definition: ksz8895_driver.h:406
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP
Definition: ksz8895_driver.h:648
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
void ksz8895EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: ksz8895_driver.c:788
void ksz8895EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: ksz8895_driver.c:828
void ksz8895FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: ksz8895_driver.c:1103
#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD_MAP_ALL
Definition: ksz8895_driver.h:655
#define KSZ8895_PORTn_CTRL2_RECEIVE_EN
Definition: ksz8895_driver.h:511
void ksz8895EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: ksz8895_driver.c:816
#define KSZ8895_GLOBAL_CTRL0_FLUSH_DYNAMIC_MAC_TABLE
Definition: ksz8895_driver.h:405
error_t ksz8895UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: ksz8895_driver.c:474
#define KSZ8895_INDIRECT_CTRL0_TABLE_SEL_DYNAMIC_MAC
Definition: ksz8895_driver.h:594
error_t ksz8895AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: ksz8895_driver.c:870
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
#define KSZ8895_PORTn_CTRL2_TRANSMIT_EN
Definition: ksz8895_driver.h:510
#define KSZ8895_INDIRECT_CTRL0_TABLE_SEL_STATIC_MAC
Definition: ksz8895_driver.h:592
void ksz8895WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: ksz8895_driver.c:1319
void ksz8895EventHandler(NetInterface *interface)
KSZ8895 event handler.
Definition: ksz8895_driver.c:294
#define KSZ8895_GLOBAL_CTRL16_UNKNOWN_MCAST_FWD
Definition: ksz8895_driver.h:647
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
uint16_t ksz8895ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: ksz8895_driver.c:1342
void ksz8895FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: ksz8895_driver.c:1271
TCP/IP stack core.
#define KSZ8895_GLOBAL_CTRL3_SW5_IGMP_SNOOP_EN
Definition: ksz8895_driver.h:432
uint32_t ksz8895GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: ksz8895_driver.c:549
error_t ksz8895Init(NetInterface *interface)
KSZ8895 Ethernet switch initialization.
Definition: ksz8895_driver.c:93
void ksz8895DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: ksz8895_driver.c:1368
#define KSZ8895_CHIP_ID0_FAMILY_ID_DEFAULT
Definition: ksz8895_driver.h:394
Helper functions for Ethernet.
uint8_t ksz8895ReadSwitchReg(NetInterface *interface, uint8_t address)
Read switch register.
Definition: ksz8895_driver.c:1447
Debugging facilities.
#define KSZ8895_GLOBAL_CTRL4_SW5_SPEED
Definition: ksz8895_driver.h:442