lan9303_driver.c
Go to the documentation of this file.
Debugging facilities.
NicDuplexMode lan9303GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: lan9303_driver.c:671
error_t lan9303DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: lan9303_driver.c:1058
error_t lan9303AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: lan9303_driver.c:953
void lan9303EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: lan9303_driver.c:867
void lan9303WriteSwitchReg(NetInterface *interface, uint16_t address, uint32_t data)
Write switch fabric CSR register.
Definition: lan9303_driver.c:1624
void lan9303SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: lan9303_driver.c:1423
void lan9303DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: lan9303_driver.c:1487
error_t lan9303Init(NetInterface *interface)
LAN9303 Ethernet switch initialization.
Definition: lan9303_driver.c:78
error_t lan9303UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode special VLAN tag from incoming Ethernet frame.
Definition: lan9303_driver.c:521
void lan9303SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: lan9303_driver.c:855
error_t lan9303GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: lan9303_driver.c:1108
void lan9303FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: lan9303_driver.c:1221
void lan9303EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: lan9303_driver.c:899
void lan9303SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: lan9303_driver.c:721
const SwitchDriver lan9303SwitchDriver
LAN9303 Ethernet switch driver.
Definition: lan9303_driver.c:44
bool_t lan9303GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: lan9303_driver.c:589
void lan9303FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: lan9303_driver.c:1358
void lan9303WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: lan9303_driver.c:1438
void lan9303EventHandler(NetInterface *interface)
LAN9303 event handler.
Definition: lan9303_driver.c:297
SwitchPortState lan9303GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: lan9303_driver.c:791
error_t lan9303TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add special VLAN tag to Ethernet frame.
Definition: lan9303_driver.c:443
uint32_t lan9303ReadSysReg(NetInterface *interface, uint16_t address)
Read system CSR register.
Definition: lan9303_driver.c:1555
uint32_t lan9303ReadSwitchReg(NetInterface *interface, uint16_t address)
Read switch fabric CSR register.
Definition: lan9303_driver.c:1663
error_t lan9303GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: lan9303_driver.c:1256
uint32_t lan9303GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: lan9303_driver.c:621
void lan9303DumpSysReg(NetInterface *interface)
Dump system CSR registers for debugging purpose.
Definition: lan9303_driver.c:1600
__weak_func void lan9303InitHook(NetInterface *interface)
LAN9303 custom configuration.
Definition: lan9303_driver.c:197
void lan9303WriteSysReg(NetInterface *interface, uint16_t address, uint32_t data)
Write system CSR register.
Definition: lan9303_driver.c:1511
void lan9303EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: lan9303_driver.c:911
uint16_t lan9303ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: lan9303_driver.c:1461
LAN9303 3-port Ethernet switch driver.
#define LAN9303_SWE_ALR_RD_DAT_1_STATIC
Definition: lan9303_driver.h:849
#define LAN9303_SWE_ALR_WR_DAT_1_PORT_1_2
Definition: lan9303_driver.h:839
#define LAN9303_SWE_PORT_STATE_PORT1_FORWARDING
Definition: lan9303_driver.h:919
#define LAN9303_SWE_ALR_RD_DAT_1_PORT_1
Definition: lan9303_driver.h:855
#define LAN9303_SWE_ALR_WR_DAT_1_AGE_OVERRIDE
Definition: lan9303_driver.h:827
#define LAN9303_SWE_PORT_MIRROR_SNIFFER_PORT_0
Definition: lan9303_driver.h:942
#define LAN9303_SWE_ALR_WR_DAT_1_PORT_0_1_2
Definition: lan9303_driver.h:840
#define LAN9303_SWE_PORT_MIRROR_MIRRORED_PORT_1
Definition: lan9303_driver.h:947
#define LAN9303_SWE_INGRSS_PORT_TYP_PORT0
Definition: lan9303_driver.h:959
#define LAN9303_SWE_ALR_CMD_MAKE_ENTRY
Definition: lan9303_driver.h:818
#define LAN9303_SWE_ALR_CMD_GET_FIRST_ENTRY
Definition: lan9303_driver.h:819
#define LAN9303_SWE_GLOBAL_INGRSS_CFG_IGMP_MONITOR_PORT_0
Definition: lan9303_driver.h:883
#define LAN9303_SWE_ALR_RD_DAT_1_END_OF_TABLE
Definition: lan9303_driver.h:848
#define LAN9303_SWE_PORT_MIRROR_MIRRORED_PORT_2
Definition: lan9303_driver.h:948
#define LAN9303_SWE_ALR_WR_DAT_1_VALID
Definition: lan9303_driver.h:826
#define LAN9303_SWE_PORT_STATE_PORT1_DISABLED
Definition: lan9303_driver.h:922
#define LAN9303_SWE_ALR_RD_DAT_1_PORT_0_2
Definition: lan9303_driver.h:859
#define LAN9303_SWE_ALR_WR_DAT_1_STATIC
Definition: lan9303_driver.h:828
#define LAN9303_SWE_ALR_RD_DAT_1_PORT_0_1_2
Definition: lan9303_driver.h:861
#define LAN9303_SWE_ALR_RD_DAT_1_VALID
Definition: lan9303_driver.h:847
#define LAN9303_SWE_ALR_CMD_STS_MAKE_PENDING
Definition: lan9303_driver.h:866
#define LAN9303_MAC_TX_CFG_IFG_CONFIG_DEFAULT
Definition: lan9303_driver.h:813
#define LAN9303_MAC_RX_CFG_REJECT_MAC_TYPES
Definition: lan9303_driver.h:807
#define LAN9303_SWE_ALR_WR_DAT_1_PORT_1
Definition: lan9303_driver.h:834
#define LAN9303_SWE_GLOBAL_INGRSS_CFG_IGMP_MONITOR_PORT
Definition: lan9303_driver.h:882
#define LAN9303_SWE_PORT_MIRROR_RX_MIRRORING_FILT_EN
Definition: lan9303_driver.h:940
#define LAN9303_SWE_PORT_STATE_PORT0_FORWARDING
Definition: lan9303_driver.h:924
#define LAN9303_SWE_PORT_STATE_PORT2_LEARNING
Definition: lan9303_driver.h:916
#define LAN9303_SWE_ALR_RD_DAT_1_PORT_0
Definition: lan9303_driver.h:854
#define LAN9303_SWE_GLOBAL_INGRSS_CFG_IGMP_MONITORING_EN
Definition: lan9303_driver.h:887
#define LAN9303_SWE_PORT_STATE_PORT2_DISABLED
Definition: lan9303_driver.h:917
#define LAN9303_SWE_PORT_STATE_PORT2_LISTENING
Definition: lan9303_driver.h:915
#define LAN9303_SWE_ALR_CMD_GET_NEXT_ENTRY
Definition: lan9303_driver.h:820
#define LAN9303_SWE_PORT_STATE_PORT1_LISTENING
Definition: lan9303_driver.h:920
#define LAN9303_SWE_ALR_WR_DAT_1_PORT_0_1
Definition: lan9303_driver.h:837
#define LAN9303_SWE_ALR_WR_DAT_1_PORT_0_2
Definition: lan9303_driver.h:838
#define LAN9303_SWE_ALR_WR_DAT_1_PORT_2
Definition: lan9303_driver.h:835
#define LAN9303_SWE_PORT_MIRROR_RX_MIRRORING_EN
Definition: lan9303_driver.h:949
#define LAN9303_SWE_PORT_STATE_PORT1_LEARNING
Definition: lan9303_driver.h:921
#define LAN9303_SWE_ALR_WR_DAT_1_PORT_0
Definition: lan9303_driver.h:833
#define LAN9303_SWE_ALR_RD_DAT_1_PORT_1_2
Definition: lan9303_driver.h:860
#define LAN9303_SWE_ALR_RD_DAT_1_PORT_2
Definition: lan9303_driver.h:856
#define LAN9303_SWE_ALR_RD_DAT_1_PORT_0_1
Definition: lan9303_driver.h:858
#define LAN9303_BM_EGRSS_PORT_TYPE_PORT0_TYPE_CPU
Definition: lan9303_driver.h:993
#define LAN9303_SWE_PORT_STATE_PORT2_FORWARDING
Definition: lan9303_driver.h:914
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