lan9353_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
SwitchPortState lan9353GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: lan9353_driver.c:791
void lan9353SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: lan9353_driver.c:1454
#define LAN9353_SWE_PORT_MIRROR_MIRRORED_PORT_1
Definition: lan9353_driver.h:1187
void lan9353EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: lan9353_driver.c:910
error_t lan9353Init(NetInterface *interface)
LAN9353 Ethernet switch initialization.
Definition: lan9353_driver.c:78
LAN9353 3-port Ethernet switch driver.
void lan9353FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: lan9353_driver.c:1252
#define LAN9353_SWE_ALR_CMD_STS_OPERATION_PENDING
Definition: lan9353_driver.h:1085
const SwitchDriver lan9353SwitchDriver
LAN9353 Ethernet switch driver.
Definition: lan9353_driver.c:44
void lan9353SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: lan9353_driver.c:855
#define LAN9353_SWE_PORT_MIRROR_RX_MIRRORING_EN
Definition: lan9353_driver.h:1189
#define LAN9353_SWE_ALR_RD_DAT_1_PORT_1_2
Definition: lan9353_driver.h:1079
error_t lan9353UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode special VLAN tag from incoming Ethernet frame.
Definition: lan9353_driver.c:521
bool_t lan9353GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: lan9353_driver.c:589
error_t lan9353GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: lan9353_driver.c:1139
#define LAN9353_SWE_ALR_CMD_GET_NEXT_ENTRY
Definition: lan9353_driver.h:1038
NicDuplexMode lan9353GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: lan9353_driver.c:671
error_t lan9353AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: lan9353_driver.c:984
error_t lan9353DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: lan9353_driver.c:1089
#define LAN9353_SWE_PORT_STATE_PORT2_DISABLED
Definition: lan9353_driver.h:1157
#define LAN9353_SWE_ALR_RD_DAT_1_VALID
Definition: lan9353_driver.h:1066
#define LAN9353_MAC_RX_CFG_REJECT_MAC_TYPES
Definition: lan9353_driver.h:1024
#define LAN9353_SWE_ALR_WR_DAT_1_STATIC
Definition: lan9353_driver.h:1046
#define LAN9353_SWE_PORT_MIRROR_SNIFFER_PORT_0
Definition: lan9353_driver.h:1182
#define LAN9353_SWE_PORT_STATE_PORT1_LEARNING
Definition: lan9353_driver.h:1161
#define LAN9353_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT_0
Definition: lan9353_driver.h:1122
#define LAN9353_SWE_PORT_STATE_PORT1_DISABLED
Definition: lan9353_driver.h:1162
#define LAN9353_SWE_ALR_WR_DAT_1_PORT_0_2
Definition: lan9353_driver.h:1056
#define LAN9353_SWE_ALR_RD_DAT_1_PORT_0
Definition: lan9353_driver.h:1073
#define LAN9353_SWE_ALR_WR_DAT_1_AGE1_OVERRIDE
Definition: lan9353_driver.h:1045
#define LAN9353_SWE_ALR_CMD_GET_FIRST_ENTRY
Definition: lan9353_driver.h:1037
#define LAN9353_SWE_ALR_WR_DAT_1_VALID
Definition: lan9353_driver.h:1044
#define LAN9353_SWE_ALR_WR_DAT_1_PORT_2
Definition: lan9353_driver.h:1053
#define LAN9353_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT
Definition: lan9353_driver.h:1121
void lan9353WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: lan9353_driver.c:1469
#define LAN9353_SWE_ALR_WR_DAT_1_PORT_0_1_2
Definition: lan9353_driver.h:1058
error_t lan9353GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: lan9353_driver.c:1287
#define LAN9353_SWE_INGRSS_PORT_TYP_PORT0
Definition: lan9353_driver.h:1199
#define LAN9353_SWE_PORT_STATE_PORT0_FORWARDING
Definition: lan9353_driver.h:1164
void lan9353WriteSysReg(NetInterface *interface, uint16_t address, uint32_t data)
Write system CSR register.
Definition: lan9353_driver.c:1542
#define LAN9353_SWE_ALR_RD_DAT_1_STATIC
Definition: lan9353_driver.h:1068
void lan9353FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: lan9353_driver.c:1389
#define LAN9353_SWE_PORT_MIRROR_MIRRORED_PORT_2
Definition: lan9353_driver.h:1188
#define LAN9353_SWE_ALR_WR_DAT_1_PORT_1_2
Definition: lan9353_driver.h:1057
#define LAN9353_SWE_ALR_CFG_AGING_TIME
Definition: lan9353_driver.h:1088
#define LAN9353_SWE_ALR_RD_DAT_1_PORT_2
Definition: lan9353_driver.h:1075
#define LAN9353_SWE_ALR_RD_DAT_1_END_OF_TABLE
Definition: lan9353_driver.h:1065
#define LAN9353_SWE_ALR_CMD_MAKE_ENTRY
Definition: lan9353_driver.h:1036
#define LAN9353_SWE_PORT_STATE_PORT2_LISTENING
Definition: lan9353_driver.h:1155
#define LAN9353_SWE_GLOBAL_INGRSS_CFG_IGMP_MONITORING_EN
Definition: lan9353_driver.h:1127
#define LAN9353_SWE_ALR_CFG_ALR_AGE_EN
Definition: lan9353_driver.h:1091
void lan9353DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: lan9353_driver.c:1518
#define LAN9353_SWE_ALR_RD_DAT_1_PORT_0_1
Definition: lan9353_driver.h:1077
uint16_t lan9353ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: lan9353_driver.c:1492
void lan9353EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: lan9353_driver.c:942
#define LAN9353_SWE_ALR_WR_DAT_1_PORT_0
Definition: lan9353_driver.h:1051
void lan9353EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: lan9353_driver.c:878
#define LAN9353_SWE_PORT_STATE_PORT2_LEARNING
Definition: lan9353_driver.h:1156
#define LAN9353_SWE_ALR_WR_DAT_1_PORT_1
Definition: lan9353_driver.h:1052
void lan9353DumpSysReg(NetInterface *interface)
Dump system CSR registers for debugging purpose.
Definition: lan9353_driver.c:1631
uint32_t lan9353ReadSwitchReg(NetInterface *interface, uint16_t address)
Read switch fabric CSR register.
Definition: lan9353_driver.c:1694
#define LAN9353_SWE_ALR_RD_DAT_1_PORT_1
Definition: lan9353_driver.h:1074
#define LAN9353_SWE_ALR_RD_DAT_1_PORT_0_2
Definition: lan9353_driver.h:1078
uint32_t lan9353ReadSysReg(NetInterface *interface, uint16_t address)
Read system CSR register.
Definition: lan9353_driver.c:1586
#define LAN9353_SWE_PORT_STATE_PORT1_FORWARDING
Definition: lan9353_driver.h:1159
#define LAN9353_BM_EGRSS_PORT_TYPE_PORT0_TYPE_CPU
Definition: lan9353_driver.h:1233
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
void * netBufferAt(const NetBuffer *buffer, size_t offset, size_t length)
Returns a pointer to a data segment.
Definition: net_mem.c:418
#define LAN9353_MAC_TX_CFG_IFG_CONFIG_DEFAULT
Definition: lan9353_driver.h:1031
#define LAN9353_SWE_GLOBAL_INGRSS_CFG_MLD_MONITORING_EN
Definition: lan9353_driver.h:1126
void lan9353WriteSwitchReg(NetInterface *interface, uint16_t address, uint32_t data)
Write switch fabric CSR register.
Definition: lan9353_driver.c:1655
__weak_func void lan9353InitHook(NetInterface *interface)
LAN9353 custom configuration.
Definition: lan9353_driver.c:197
TCP/IP stack core.
#define LAN9353_SWE_ALR_RD_DAT_1_PORT_0_1_2
Definition: lan9353_driver.h:1080
#define LAN9353_SWE_PORT_STATE_PORT2_FORWARDING
Definition: lan9353_driver.h:1154
#define LAN9353_SWE_PORT_MIRROR_RX_MIRRORING_FILT_EN
Definition: lan9353_driver.h:1180
void lan9353SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: lan9353_driver.c:721
error_t lan9353TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add special VLAN tag to Ethernet frame.
Definition: lan9353_driver.c:443
void lan9353EventHandler(NetInterface *interface)
LAN9353 event handler.
Definition: lan9353_driver.c:297
Debugging facilities.
uint32_t lan9353GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: lan9353_driver.c:621
#define LAN9353_SWE_ALR_WR_DAT_1_PORT_0_1
Definition: lan9353_driver.h:1055
#define LAN9353_SWE_PORT_STATE_PORT1_LISTENING
Definition: lan9353_driver.h:1160