lan9354_driver.c
Go to the documentation of this file.
Debugging facilities.
NicDuplexMode lan9354GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: lan9354_driver.c:671
error_t lan9354UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode special VLAN tag from incoming Ethernet frame.
Definition: lan9354_driver.c:521
error_t lan9354GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: lan9354_driver.c:1287
void lan9354EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: lan9354_driver.c:942
error_t lan9354Init(NetInterface *interface)
LAN9354 Ethernet switch initialization.
Definition: lan9354_driver.c:78
uint32_t lan9354ReadSwitchReg(NetInterface *interface, uint16_t address)
Read switch fabric CSR register.
Definition: lan9354_driver.c:1694
void lan9354DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: lan9354_driver.c:1518
void lan9354WriteSwitchReg(NetInterface *interface, uint16_t address, uint32_t data)
Write switch fabric CSR register.
Definition: lan9354_driver.c:1655
void lan9354EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: lan9354_driver.c:878
__weak_func void lan9354InitHook(NetInterface *interface)
LAN9354 custom configuration.
Definition: lan9354_driver.c:197
const SwitchDriver lan9354SwitchDriver
LAN9354 Ethernet switch driver.
Definition: lan9354_driver.c:44
void lan9354SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: lan9354_driver.c:855
error_t lan9354GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: lan9354_driver.c:1139
void lan9354SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: lan9354_driver.c:721
uint16_t lan9354ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: lan9354_driver.c:1492
void lan9354SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: lan9354_driver.c:1454
void lan9354WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: lan9354_driver.c:1469
error_t lan9354AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: lan9354_driver.c:984
error_t lan9354DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: lan9354_driver.c:1089
void lan9354WriteSysReg(NetInterface *interface, uint16_t address, uint32_t data)
Write system CSR register.
Definition: lan9354_driver.c:1542
void lan9354EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: lan9354_driver.c:910
void lan9354DumpSysReg(NetInterface *interface)
Dump system CSR registers for debugging purpose.
Definition: lan9354_driver.c:1631
void lan9354FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: lan9354_driver.c:1252
void lan9354FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: lan9354_driver.c:1389
SwitchPortState lan9354GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: lan9354_driver.c:791
uint32_t lan9354ReadSysReg(NetInterface *interface, uint16_t address)
Read system CSR register.
Definition: lan9354_driver.c:1586
bool_t lan9354GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: lan9354_driver.c:589
void lan9354EventHandler(NetInterface *interface)
LAN9354 event handler.
Definition: lan9354_driver.c:297
uint32_t lan9354GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: lan9354_driver.c:621
error_t lan9354TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add special VLAN tag to Ethernet frame.
Definition: lan9354_driver.c:443
LAN9354 3-port Ethernet switch driver.
#define LAN9354_SWE_GLOBAL_INGRSS_CFG_MLD_MONITORING_EN
Definition: lan9354_driver.h:1026
#define LAN9354_SWE_ALR_WR_DAT_1_AGE1_OVERRIDE
Definition: lan9354_driver.h:945
#define LAN9354_SWE_PORT_MIRROR_RX_MIRRORING_FILT_EN
Definition: lan9354_driver.h:1080
#define LAN9354_SWE_PORT_STATE_PORT1_LISTENING
Definition: lan9354_driver.h:1060
#define LAN9354_SWE_ALR_WR_DAT_1_PORT_2
Definition: lan9354_driver.h:953
#define LAN9354_SWE_ALR_CMD_GET_NEXT_ENTRY
Definition: lan9354_driver.h:938
#define LAN9354_SWE_ALR_CFG_AGING_TIME
Definition: lan9354_driver.h:988
#define LAN9354_SWE_ALR_RD_DAT_1_PORT_0_2
Definition: lan9354_driver.h:978
#define LAN9354_SWE_ALR_RD_DAT_1_PORT_0_1_2
Definition: lan9354_driver.h:980
#define LAN9354_SWE_ALR_RD_DAT_1_END_OF_TABLE
Definition: lan9354_driver.h:965
#define LAN9354_SWE_ALR_WR_DAT_1_STATIC
Definition: lan9354_driver.h:946
#define LAN9354_SWE_ALR_WR_DAT_1_PORT_1_2
Definition: lan9354_driver.h:957
#define LAN9354_SWE_ALR_RD_DAT_1_STATIC
Definition: lan9354_driver.h:968
#define LAN9354_SWE_PORT_STATE_PORT2_FORWARDING
Definition: lan9354_driver.h:1054
#define LAN9354_SWE_PORT_MIRROR_RX_MIRRORING_EN
Definition: lan9354_driver.h:1089
#define LAN9354_SWE_GLOBAL_INGRSS_CFG_IGMP_MONITORING_EN
Definition: lan9354_driver.h:1027
#define LAN9354_SWE_ALR_CMD_STS_OPERATION_PENDING
Definition: lan9354_driver.h:985
#define LAN9354_MAC_RX_CFG_REJECT_MAC_TYPES
Definition: lan9354_driver.h:924
#define LAN9354_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT
Definition: lan9354_driver.h:1021
#define LAN9354_SWE_PORT_MIRROR_MIRRORED_PORT_2
Definition: lan9354_driver.h:1088
#define LAN9354_SWE_PORT_MIRROR_MIRRORED_PORT_1
Definition: lan9354_driver.h:1087
#define LAN9354_SWE_PORT_STATE_PORT1_LEARNING
Definition: lan9354_driver.h:1061
#define LAN9354_SWE_PORT_STATE_PORT1_FORWARDING
Definition: lan9354_driver.h:1059
#define LAN9354_SWE_ALR_WR_DAT_1_PORT_0
Definition: lan9354_driver.h:951
#define LAN9354_MAC_TX_CFG_IFG_CONFIG_DEFAULT
Definition: lan9354_driver.h:931
#define LAN9354_SWE_ALR_WR_DAT_1_PORT_0_1_2
Definition: lan9354_driver.h:958
#define LAN9354_SWE_ALR_WR_DAT_1_PORT_1
Definition: lan9354_driver.h:952
#define LAN9354_SWE_INGRSS_PORT_TYP_PORT0
Definition: lan9354_driver.h:1099
#define LAN9354_SWE_ALR_WR_DAT_1_PORT_0_1
Definition: lan9354_driver.h:955
#define LAN9354_SWE_PORT_STATE_PORT1_DISABLED
Definition: lan9354_driver.h:1062
#define LAN9354_SWE_ALR_RD_DAT_1_PORT_2
Definition: lan9354_driver.h:975
#define LAN9354_BM_EGRSS_PORT_TYPE_PORT0_TYPE_CPU
Definition: lan9354_driver.h:1133
#define LAN9354_SWE_ALR_WR_DAT_1_VALID
Definition: lan9354_driver.h:944
#define LAN9354_SWE_ALR_RD_DAT_1_PORT_1
Definition: lan9354_driver.h:974
#define LAN9354_SWE_ALR_CMD_GET_FIRST_ENTRY
Definition: lan9354_driver.h:937
#define LAN9354_SWE_PORT_STATE_PORT2_LISTENING
Definition: lan9354_driver.h:1055
#define LAN9354_SWE_PORT_STATE_PORT0_FORWARDING
Definition: lan9354_driver.h:1064
#define LAN9354_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT_0
Definition: lan9354_driver.h:1022
#define LAN9354_SWE_ALR_RD_DAT_1_PORT_0_1
Definition: lan9354_driver.h:977
#define LAN9354_SWE_PORT_MIRROR_SNIFFER_PORT_0
Definition: lan9354_driver.h:1082
#define LAN9354_SWE_ALR_RD_DAT_1_VALID
Definition: lan9354_driver.h:966
#define LAN9354_SWE_PORT_STATE_PORT2_DISABLED
Definition: lan9354_driver.h:1057
#define LAN9354_SWE_PORT_STATE_PORT2_LEARNING
Definition: lan9354_driver.h:1056
#define LAN9354_SWE_ALR_CMD_MAKE_ENTRY
Definition: lan9354_driver.h:936
#define LAN9354_SWE_ALR_CFG_ALR_AGE_EN
Definition: lan9354_driver.h:991
#define LAN9354_SWE_ALR_RD_DAT_1_PORT_0
Definition: lan9354_driver.h:973
#define LAN9354_SWE_ALR_WR_DAT_1_PORT_0_2
Definition: lan9354_driver.h:956
#define LAN9354_SWE_ALR_RD_DAT_1_PORT_1_2
Definition: lan9354_driver.h:979
TCP/IP stack core.
void * netBufferAt(const NetBuffer *buffer, size_t offset)
Returns a pointer to the data at the specified position.
Definition: net_mem.c:415
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