lan9370_driver.c
void nicNotifyLinkChange(NetInterface *interface)
Process link state change notification.
Definition: nic.c:559
#define LAN9370_STATIC_TABLE_ENTRY2_OVERRIDE
Definition: lan9370_driver.h:357
#define LAN9370_SWITCH_LUE_CTRL1_FLUSH_ALU_TABLE
Definition: lan9370_driver.h:254
#define LAN9370_STATIC_TABLE_ENTRY2_PORT_FORWARD
Definition: lan9370_driver.h:359
#define LAN9370_SWITCH_LUE_CTRL2_FLUSH_OPTION_DYNAMIC
Definition: lan9370_driver.h:268
#define LAN9370_SWITCH_LUE_AGE_AGE_PERIOD_19_8_DEFAULT
Definition: lan9370_driver.h:279
#define LAN9370_GLOBAL_CTRL0_APB_PHY_REG_BLK
Definition: lan9370_driver.h:229
#define LAN9370_SWITCH_LUE_CTRL0_HASH_OPTION_CRC
Definition: lan9370_driver.h:248
LAN9370 5-port 100Base-T1 Ethernet switch driver.
#define LAN9370_SWITCH_LUE_CTRL2_FLUSH_OPTION
Definition: lan9370_driver.h:266
void lan9370SetPortState(NetInterface *interface, uint8_t port, SwitchPortState state)
Set port state.
Definition: lan9370_driver.c:726
void lan9370EnableMldSnooping(NetInterface *interface, bool_t enable)
Enable MLD snooping.
Definition: lan9370_driver.c:900
#define LAN9370_STATIC_MCAST_TABLE_CTRL_START_FINISH
Definition: lan9370_driver.h:312
#define LAN9370_PORTn_MSTP_STATE_LEARNING_DIS
Definition: lan9370_driver.h:440
#define LAN9370_PORTn_MAC_CTRL0_FR_LEN_CHK
Definition: lan9370_driver.h:433
#define LAN9370_STATIC_MCAST_TABLE_CTRL_ACTION_READ
Definition: lan9370_driver.h:322
#define LAN9370_STATIC_TABLE_ENTRY1_VALID
Definition: lan9370_driver.h:350
#define LAN9370_ALU_TABLE_ENTRY2_PORT2_FORWARD
Definition: lan9370_driver.h:339
#define LAN9370_STATIC_MCAST_TABLE_CTRL
Definition: lan9370_driver.h:102
error_t lan9370DeleteStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Remove an entry from the static MAC table.
Definition: lan9370_driver.c:1080
#define LAN9370_TAIL_TAG_PORT_BLOCKING_OVERRIDE
Definition: lan9370_driver.h:64
void lan9370WriteExtReg(NetInterface *interface, uint8_t port, uint8_t bank, uint8_t addr, uint16_t data)
Write extended register.
Definition: lan9370_driver.c:1620
error_t lan9370UntagFrame(NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary)
Decode tail tag from incoming Ethernet frame.
Definition: lan9370_driver.c:513
void lan9370EventHandler(NetInterface *interface)
LAN9370 event handler.
Definition: lan9370_driver.c:329
uint8_t lan9370ReadSwitchReg8(NetInterface *interface, uint16_t address)
Read switch register (8 bits)
Definition: lan9370_driver.c:1719
#define LAN9370_GLOBAL_PORT_MIRROR_SNOOP_CTRL_IGMP_SNOOP_EN
Definition: lan9370_driver.h:292
#define LAN9370_PORTn_XMII_CTRL1_MII_INTF_SEL
Definition: lan9370_driver.h:427
error_t lan9370GetStaticFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the static MAC table.
Definition: lan9370_driver.c:1159
#define LAN9370_STATIC_MCAST_TABLE_CTRL_TABLE_SELECT_STATIC
Definition: lan9370_driver.h:317
#define LAN9370_PORTn_XMII_CTRL1_MII_INTF_SEL_RGMII
Definition: lan9370_driver.h:428
void lan9370SetUnknownMcastFwdPorts(NetInterface *interface, bool_t enable, uint32_t forwardPorts)
Set forward ports for unknown multicast packets.
Definition: lan9370_driver.c:1452
#define LAN9370_ALU_TABLE_ENTRY2_PORT3_FORWARD
Definition: lan9370_driver.h:338
void lan9370FlushDynamicFdbTable(NetInterface *interface, uint8_t port)
Flush dynamic MAC table.
Definition: lan9370_driver.c:1405
void lan9370WriteSwitchReg32(NetInterface *interface, uint16_t address, uint32_t data)
Write switch register (32 bits)
Definition: lan9370_driver.c:1858
error_t lan9370AddStaticFdbEntry(NetInterface *interface, const SwitchFdbEntry *entry)
Add a new entry to the static MAC table.
Definition: lan9370_driver.c:959
#define LAN9370_ALU_TABLE_ENTRY2_PORT1_FORWARD
Definition: lan9370_driver.h:340
void lan9370FlushStaticFdbTable(NetInterface *interface)
Flush static MAC table.
Definition: lan9370_driver.c:1256
error_t ethPadFrame(NetBuffer *buffer, size_t *length)
Ethernet frame padding.
Definition: ethernet_misc.c:147
#define LAN9370_PORTn_XMII_CTRL1_RGMII_ID_IG
Definition: lan9370_driver.h:424
bool_t lan9370GetLinkState(NetInterface *interface, uint8_t port)
Get link state.
Definition: lan9370_driver.c:565
#define LAN9370_UNKONWN_MULTICAST_CTRL_FWD
Definition: lan9370_driver.h:282
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
void lan9370DumpPhyReg(NetInterface *interface, uint8_t port)
Dump PHY registers for debugging purpose.
Definition: lan9370_driver.c:1594
const SwitchDriver lan9370SwitchDriver
LAN9370 Ethernet switch driver.
Definition: lan9370_driver.c:45
#define LAN9370_ALU_TABLE_ENTRY2_PORT_FORWARD
Definition: lan9370_driver.h:335
void lan9370WritePhyReg(NetInterface *interface, uint8_t port, uint8_t address, uint16_t data)
Write PHY register.
Definition: lan9370_driver.c:1497
uint16_t lan9370ReadPhyReg(NetInterface *interface, uint8_t port, uint8_t address)
Read PHY register.
Definition: lan9370_driver.c:1544
#define LAN9370_PORTn_XMII_CTRL1_RGMII_SPEED_1000
Definition: lan9370_driver.h:422
#define LAN9370_VPHY_SPECIAL_CTRL_SPI_INDIRECT_EN
Definition: lan9370_driver.h:383
uint16_t lan9370ReadSwitchReg16(NetInterface *interface, uint16_t address)
Read switch register (16 bits)
Definition: lan9370_driver.c:1810
#define LAN9370_EXT_REG_CTL_WRITE_CONTROL
Definition: lan9370_driver.h:208
#define LAN9370_ALU_TABLE_ENTRY2_PORT5_FORWARD
Definition: lan9370_driver.h:336
#define LAN9370_UNKONWN_MULTICAST_CTRL_FWD_MAP_ALL
Definition: lan9370_driver.h:289
#define LAN9370_PORTn_OP_CTRL0_TAIL_TAG_EN
Definition: lan9370_driver.h:401
void lan9370WriteSwitchReg8(NetInterface *interface, uint16_t address, uint8_t data)
Write switch register (8 bits)
Definition: lan9370_driver.c:1676
#define LAN9370_ALU_TABLE_CTRL_ACTION_SEARCH
Definition: lan9370_driver.h:307
uint32_t lan9370ReadSwitchReg32(NetInterface *interface, uint16_t address)
Read switch register (32 bits)
Definition: lan9370_driver.c:1904
#define LAN9370_SWITCH_LUE_CTRL3_AGE_PERIOD_7_0
Definition: lan9370_driver.h:274
#define LAN9370_SWITCH_LUE_CTRL1_FLUSH_MSTP_ENTRIES
Definition: lan9370_driver.h:255
#define LAN9370_EXT_REG_CTL_READ_CONTROL
Definition: lan9370_driver.h:207
#define LAN9370_ALU_TABLE_ENTRY2_PORT4_FORWARD
Definition: lan9370_driver.h:337
error_t lan9370TagFrame(NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary)
Add tail tag to Ethernet frame.
Definition: lan9370_driver.c:454
#define LAN9370_STATIC_MCAST_TABLE_CTRL_ACTION_WRITE
Definition: lan9370_driver.h:321
error_t netBufferAppend(NetBuffer *dest, const void *src, size_t length)
Append data a multi-part buffer.
Definition: net_mem.c:604
NicDuplexMode lan9370GetDuplexMode(NetInterface *interface, uint8_t port)
Get duplex mode.
Definition: lan9370_driver.c:672
void lan9370EnableIgmpSnooping(NetInterface *interface, bool_t enable)
Enable IGMP snooping.
Definition: lan9370_driver.c:870
__weak_func void lan9370InitHook(NetInterface *interface)
LAN9370 custom configuration.
Definition: lan9370_driver.c:229
#define LAN9370_ALU_TABLE_CTRL_VALID_ENTRY_OR_SEARCH_END
Definition: lan9370_driver.h:301
#define LAN9370_EXT_REG_CTL_REGISTER_BANK
Definition: lan9370_driver.h:209
#define LAN9370_PORTn_XMII_CTRL0_SPEED_10_100
Definition: lan9370_driver.h:416
#define LAN9370_UNKONWN_MULTICAST_CTRL_FWD_MAP
Definition: lan9370_driver.h:283
#define LAN9370_PORTn_MSTP_STATE_TRANSMIT_EN
Definition: lan9370_driver.h:438
uint32_t lan9370GetLinkSpeed(NetInterface *interface, uint8_t port)
Get link speed.
Definition: lan9370_driver.c:599
#define LAN9370_PORTn_MSTP_STATE_RECEIVE_EN
Definition: lan9370_driver.h:439
#define LAN9370_GLOBAL_PORT_MIRROR_SNOOP_CTRL
Definition: lan9370_driver.h:100
const uint16_t lan9370IngressTailTag[5]
Tail tag rules (host to LAN9370)
Definition: lan9370_driver.c:77
#define LAN9370_BASIC_STATUS_LINK_STATUS
Definition: lan9370_driver.h:174
void lan9370SetAgingTime(NetInterface *interface, uint32_t agingTime)
Set aging time for dynamic filtering entries.
Definition: lan9370_driver.c:845
#define LAN9370_SWITCH_LUE_CTRL0_AGE_COUNT_DEFAULT
Definition: lan9370_driver.h:244
#define LAN9370_EXT_REG_CTL_REGISTER_ADDR
Definition: lan9370_driver.h:214
#define LAN9370_PORTn_XMII_CTRL0_DUPLEX
Definition: lan9370_driver.h:414
uint16_t lan9370ReadExtReg(NetInterface *interface, uint8_t port, uint8_t bank, uint8_t addr)
Read extended register.
Definition: lan9370_driver.c:1649
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
#define LAN9370_SWITCH_LUE_AGE_AGE_PERIOD_19_8
Definition: lan9370_driver.h:278
#define LAN9370_GLOBAL_PORT_MIRROR_SNOOP_CTRL_MLD_SNOOP_EN
Definition: lan9370_driver.h:294
#define LAN9370_PORTn_T1_PHY_REG(port, addr)
Definition: lan9370_driver.h:145
error_t lan9370Init(NetInterface *interface)
LAN9370 Ethernet switch initialization.
Definition: lan9370_driver.c:97
TCP/IP stack core.
#define LAN9370_STATIC_MCAST_TABLE_CTRL_TABLE_INDEX
Definition: lan9370_driver.h:311
#define LAN9370_UNKONWN_MULTICAST_CTRL_FWD_MAP_PORT5
Definition: lan9370_driver.h:288
void lan9370WriteSwitchReg16(NetInterface *interface, uint16_t address, uint16_t data)
Write switch register (16 bits)
Definition: lan9370_driver.c:1766
error_t lan9370GetDynamicFdbEntry(NetInterface *interface, uint_t index, SwitchFdbEntry *entry)
Read an entry from the dynamic MAC table.
Definition: lan9370_driver.c:1304
#define LAN9370_PORTn_XMII_CTRL1_RGMII_ID_EG
Definition: lan9370_driver.h:425
Helper functions for Ethernet.
#define LAN9370_ALU_TABLE_CTRL_START_FINISH
Definition: lan9370_driver.h:299
#define LAN9370_STATIC_MCAST_TABLE_CTRL_DIRECT_ACCESS
Definition: lan9370_driver.h:315
#define LAN9370_SWITCH_OP_START_SWITCH
Definition: lan9370_driver.h:238
#define LAN9370_TAIL_TAG_NORMAL_ADDR_LOOKUP
Definition: lan9370_driver.h:63
#define LAN9370_SWITCH_LUE_CTRL3_AGE_PERIOD_7_0_DEFAULT
Definition: lan9370_driver.h:275
Debugging facilities.
#define LAN9370_SWITCH_LUE_CTRL0_DROP_INVALID_VID
Definition: lan9370_driver.h:242
#define LAN9370_SWITCH_LUE_CTRL0_RESERVED_LUE_EN
Definition: lan9370_driver.h:245
void lan9370EnableRsvdMcastTable(NetInterface *interface, bool_t enable)
Enable reserved multicast table.
Definition: lan9370_driver.c:930
SwitchPortState lan9370GetPortState(NetInterface *interface, uint8_t port)
Get port state.
Definition: lan9370_driver.c:782