lan9355_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
#define LAN9355_SWE_PORT_STATE_PORT0_FORWARDING
Definition: lan9355_driver.h:1170
#define LAN9355_SWE_ALR_RD_DAT_1_PORT_0_1_2
Definition: lan9355_driver.h:1086
error_t lan9355TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add special VLAN tag to Ethernet frame.
Definition: lan9355_driver.c:443
const SwitchDriver lan9355SwitchDriver
LAN9355 Ethernet switch driver.
Definition: lan9355_driver.c:44
#define LAN9355_SWE_ALR_RD_DAT_1_PORT_0_1
Definition: lan9355_driver.h:1083
void lan9355DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: lan9355_driver.c:1518
#define LAN9355_SWE_ALR_RD_DAT_1_PORT_0
Definition: lan9355_driver.h:1079
#define LAN9355_MAC_TX_CFG_IFG_CONFIG_DEFAULT
Definition: lan9355_driver.h:1037
#define LAN9355_SWE_ALR_CMD_MAKE_ENTRY
Definition: lan9355_driver.h:1042
#define LAN9355_SWE_ALR_WR_DAT_1_PORT_0_1
Definition: lan9355_driver.h:1061
void lan9355EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: lan9355_driver.c:910
#define LAN9355_SWE_ALR_CFG_ALR_AGE_EN
Definition: lan9355_driver.h:1097
#define LAN9355_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT
Definition: lan9355_driver.h:1127
#define LAN9355_SWE_ALR_WR_DAT_1_PORT_2
Definition: lan9355_driver.h:1059
#define LAN9355_SWE_PORT_STATE_PORT1_FORWARDING
Definition: lan9355_driver.h:1165
#define LAN9355_SWE_GLOBAL_INGRSS_CFG_MLD_IGMP_MONITOR_PORT_0
Definition: lan9355_driver.h:1128
#define LAN9355_SWE_ALR_WR_DAT_1_PORT_0_2
Definition: lan9355_driver.h:1062
#define LAN9355_SWE_ALR_RD_DAT_1_PORT_0_2
Definition: lan9355_driver.h:1084
#define LAN9355_SWE_PORT_STATE_PORT2_LEARNING
Definition: lan9355_driver.h:1162
uint32_t lan9355ReadSysReg(NetInterface *interface, uint16_t address)
Read system CSR register.
Definition: lan9355_driver.c:1586
#define LAN9355_SWE_GLOBAL_INGRSS_CFG_IGMP_MONITORING_EN
Definition: lan9355_driver.h:1133
error_t lan9355GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: lan9355_driver.c:1287
void lan9355EventHandler(NetInterface *interface)
LAN9355 event handler.
Definition: lan9355_driver.c:297
#define LAN9355_SWE_PORT_STATE_PORT2_FORWARDING
Definition: lan9355_driver.h:1160
#define LAN9355_SWE_ALR_RD_DAT_1_END_OF_TABLE
Definition: lan9355_driver.h:1071
#define LAN9355_SWE_ALR_WR_DAT_1_VALID
Definition: lan9355_driver.h:1050
#define LAN9355_SWE_ALR_WR_DAT_1_STATIC
Definition: lan9355_driver.h:1052
void lan9355SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: lan9355_driver.c:721
#define LAN9355_SWE_ALR_WR_DAT_1_PORT_0
Definition: lan9355_driver.h:1057
void lan9355WriteSwitchReg(NetInterface *interface, uint16_t address, uint32_t data)
Write switch fabric CSR register.
Definition: lan9355_driver.c:1655
#define LAN9355_SWE_INGRSS_PORT_TYP_PORT0
Definition: lan9355_driver.h:1205
#define LAN9355_SWE_ALR_CMD_GET_FIRST_ENTRY
Definition: lan9355_driver.h:1043
#define LAN9355_SWE_ALR_WR_DAT_1_PORT_1_2
Definition: lan9355_driver.h:1063
#define LAN9355_SWE_PORT_MIRROR_RX_MIRRORING_EN
Definition: lan9355_driver.h:1195
error_t lan9355AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: lan9355_driver.c:984
#define LAN9355_SWE_ALR_RD_DAT_1_PORT_1_2
Definition: lan9355_driver.h:1085
void lan9355EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: lan9355_driver.c:878
#define LAN9355_SWE_PORT_MIRROR_MIRRORED_PORT_2
Definition: lan9355_driver.h:1194
void lan9355EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: lan9355_driver.c:942
uint32_t lan9355ReadSwitchReg(NetInterface *interface, uint16_t address)
Read switch fabric CSR register.
Definition: lan9355_driver.c:1694
#define LAN9355_SWE_ALR_CMD_STS_OPERATION_PENDING
Definition: lan9355_driver.h:1091
void lan9355SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: lan9355_driver.c:855
#define LAN9355_SWE_PORT_STATE_PORT1_DISABLED
Definition: lan9355_driver.h:1168
#define LAN9355_SWE_GLOBAL_INGRSS_CFG_MLD_MONITORING_EN
Definition: lan9355_driver.h:1132
__weak_func void lan9355InitHook(NetInterface *interface)
LAN9355 custom configuration.
Definition: lan9355_driver.c:197
#define LAN9355_SWE_PORT_MIRROR_MIRRORED_PORT_1
Definition: lan9355_driver.h:1193
#define LAN9355_MAC_RX_CFG_REJECT_MAC_TYPES
Definition: lan9355_driver.h:1030
#define LAN9355_SWE_PORT_MIRROR_SNIFFER_PORT_0
Definition: lan9355_driver.h:1188
void lan9355FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: lan9355_driver.c:1389
#define LAN9355_SWE_ALR_CFG_AGING_TIME
Definition: lan9355_driver.h:1094
void lan9355FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: lan9355_driver.c:1252
uint32_t lan9355GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: lan9355_driver.c:621
error_t lan9355GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: lan9355_driver.c:1139
#define LAN9355_SWE_ALR_RD_DAT_1_VALID
Definition: lan9355_driver.h:1072
NicDuplexMode lan9355GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: lan9355_driver.c:671
#define LAN9355_SWE_ALR_WR_DAT_1_PORT_0_1_2
Definition: lan9355_driver.h:1064
#define LAN9355_SWE_PORT_STATE_PORT2_LISTENING
Definition: lan9355_driver.h:1161
#define LAN9355_SWE_ALR_CMD_GET_NEXT_ENTRY
Definition: lan9355_driver.h:1044
void lan9355DumpSysReg(NetInterface *interface)
Dump system CSR registers for debugging purpose.
Definition: lan9355_driver.c:1631
#define LAN9355_SWE_PORT_STATE_PORT2_DISABLED
Definition: lan9355_driver.h:1163
void lan9355SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: lan9355_driver.c:1454
#define LAN9355_SWE_ALR_WR_DAT_1_AGE1_OVERRIDE
Definition: lan9355_driver.h:1051
#define LAN9355_SWE_ALR_WR_DAT_1_PORT_1
Definition: lan9355_driver.h:1058
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
void lan9355WriteSysReg(NetInterface *interface, uint16_t address, uint32_t data)
Write system CSR register.
Definition: lan9355_driver.c:1542
error_t lan9355DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: lan9355_driver.c:1089
error_t lan9355UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode special VLAN tag from incoming Ethernet frame.
Definition: lan9355_driver.c:521
void lan9355WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: lan9355_driver.c:1469
error_t lan9355Init(NetInterface *interface)
LAN9355 Ethernet switch initialization.
Definition: lan9355_driver.c:78
#define LAN9355_SWE_PORT_STATE_PORT1_LEARNING
Definition: lan9355_driver.h:1167
TCP/IP stack core.
bool_t lan9355GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: lan9355_driver.c:589
#define LAN9355_SWE_ALR_RD_DAT_1_STATIC
Definition: lan9355_driver.h:1074
#define LAN9355_BM_EGRSS_PORT_TYPE_PORT0_TYPE_CPU
Definition: lan9355_driver.h:1239
#define LAN9355_SWE_ALR_RD_DAT_1_PORT_2
Definition: lan9355_driver.h:1081
LAN9355 3-port Ethernet switch driver.
SwitchPortState lan9355GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: lan9355_driver.c:791
#define LAN9355_SWE_ALR_RD_DAT_1_PORT_1
Definition: lan9355_driver.h:1080
Debugging facilities.
#define LAN9355_SWE_PORT_STATE_PORT1_LISTENING
Definition: lan9355_driver.h:1166
#define LAN9355_SWE_PORT_MIRROR_RX_MIRRORING_FILT_EN
Definition: lan9355_driver.h:1186
uint16_t lan9355ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: lan9355_driver.c:1492