88E6060 6-port Ethernet switch driver More...
#include "core/net.h"
#include "core/ethernet_misc.h"
#include "drivers/switch/mv88e6060_driver.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL NIC_TRACE_LEVEL |
Functions | |
error_t | mv88e6060Init (NetInterface *interface) |
88E6060 Ethernet switch initialization More... | |
__weak_func void | mv88e6060InitHook (NetInterface *interface) |
88E6060 custom configuration More... | |
void | mv88e6060Tick (NetInterface *interface) |
88E6060 timer handler More... | |
void | mv88e6060EnableIrq (NetInterface *interface) |
Enable interrupts. More... | |
void | mv88e6060DisableIrq (NetInterface *interface) |
Disable interrupts. More... | |
void | mv88e6060EventHandler (NetInterface *interface) |
88E6060 event handler More... | |
error_t | mv88e6060TagFrame (NetInterface *interface, NetBuffer *buffer, size_t *offset, NetTxAncillary *ancillary) |
Add ingress trailer to Ethernet frame. More... | |
error_t | mv88e6060UntagFrame (NetInterface *interface, uint8_t **frame, size_t *length, NetRxAncillary *ancillary) |
Decode egress trailer from incoming Ethernet frame. More... | |
bool_t | mv88e6060GetLinkState (NetInterface *interface, uint8_t port) |
Get link state. More... | |
uint32_t | mv88e6060GetLinkSpeed (NetInterface *interface, uint8_t port) |
Get link speed. More... | |
NicDuplexMode | mv88e6060GetDuplexMode (NetInterface *interface, uint8_t port) |
Get duplex mode. More... | |
void | mv88e6060SetPortState (NetInterface *interface, uint8_t port, SwitchPortState state) |
Set port state. More... | |
SwitchPortState | mv88e6060GetPortState (NetInterface *interface, uint8_t port) |
Get port state. More... | |
void | mv88e6060SetAgingTime (NetInterface *interface, uint32_t agingTime) |
Set aging time for dynamic filtering entries. More... | |
void | mv88e6060EnableIgmpSnooping (NetInterface *interface, bool_t enable) |
Enable IGMP snooping. More... | |
void | mv88e6060EnableMldSnooping (NetInterface *interface, bool_t enable) |
Enable MLD snooping. More... | |
void | mv88e6060EnableRsvdMcastTable (NetInterface *interface, bool_t enable) |
Enable reserved multicast table. More... | |
error_t | mv88e6060AddStaticFdbEntry (NetInterface *interface, const SwitchFdbEntry *entry) |
Add a new entry to the static MAC table. More... | |
error_t | mv88e6060DeleteStaticFdbEntry (NetInterface *interface, const SwitchFdbEntry *entry) |
Remove an entry from the static MAC table. More... | |
error_t | mv88e6060GetStaticFdbEntry (NetInterface *interface, uint_t index, SwitchFdbEntry *entry) |
Read an entry from the static MAC table. More... | |
void | mv88e6060FlushStaticFdbTable (NetInterface *interface) |
Flush static MAC table. More... | |
error_t | mv88e6060GetDynamicFdbEntry (NetInterface *interface, uint_t index, SwitchFdbEntry *entry) |
Read an entry from the dynamic MAC table. More... | |
void | mv88e6060FlushDynamicFdbTable (NetInterface *interface, uint8_t port) |
Flush dynamic MAC table. More... | |
void | mv88e6060SetUnknownMcastFwdPorts (NetInterface *interface, bool_t enable, uint32_t forwardPorts) |
Set forward ports for unknown multicast packets. More... | |
void | mv88e6060WriteSmiReg (NetInterface *interface, uint8_t deviceAddr, uint8_t regAddr, uint16_t data) |
Write SMI register. More... | |
uint16_t | mv88e6060ReadSmiReg (NetInterface *interface, uint8_t deviceAddr, uint8_t regAddr) |
Read SMI register. More... | |
void | mv88e6060WritePhyReg (NetInterface *interface, uint8_t port, uint8_t address, uint16_t data) |
Write PHY register. More... | |
uint16_t | mv88e6060ReadPhyReg (NetInterface *interface, uint8_t port, uint8_t address) |
Read PHY register. More... | |
void | mv88e6060DumpPhyReg (NetInterface *interface, uint8_t port) |
Dump PHY registers for debugging purpose. More... | |
void | mv88e6060WriteSwitchPortReg (NetInterface *interface, uint8_t port, uint8_t address, uint16_t data) |
Write switch port register. More... | |
uint16_t | mv88e6060ReadSwitchPortReg (NetInterface *interface, uint8_t port, uint8_t address) |
Read switch port register. More... | |
void | mv88e6060WriteSwitchGlobalReg (NetInterface *interface, uint8_t address, uint16_t data) |
Write switch global register. More... | |
uint16_t | mv88e6060ReadSwitchGlobalReg (NetInterface *interface, uint8_t address) |
Read switch global register. More... | |
Variables | |
const SwitchDriver | mv88e6060SwitchDriver |
88E6060 Ethernet switch driver More... | |
const uint32_t | mv88e6060IngressTrailer [6] |
Ingress trailer (CPU to 88E6060) More... | |
Detailed Description
88E6060 6-port Ethernet switch driver
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file mv88e6060_driver.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL NIC_TRACE_LEVEL |
Definition at line 32 of file mv88e6060_driver.c.
Function Documentation
◆ mv88e6060AddStaticFdbEntry()
error_t mv88e6060AddStaticFdbEntry | ( | NetInterface * | interface, |
const SwitchFdbEntry * | entry | ||
) |
Add a new entry to the static MAC table.
- Parameters
-
[in] interface Underlying network interface [in] entry Pointer to the forwarding database entry
- Returns
- Error code
Definition at line 834 of file mv88e6060_driver.c.
◆ mv88e6060DeleteStaticFdbEntry()
error_t mv88e6060DeleteStaticFdbEntry | ( | NetInterface * | interface, |
const SwitchFdbEntry * | entry | ||
) |
Remove an entry from the static MAC table.
- Parameters
-
[in] interface Underlying network interface [in] entry Forwarding database entry to remove from the table
- Returns
- Error code
Definition at line 918 of file mv88e6060_driver.c.
◆ mv88e6060DisableIrq()
void mv88e6060DisableIrq | ( | NetInterface * | interface | ) |
Disable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 299 of file mv88e6060_driver.c.
◆ mv88e6060DumpPhyReg()
void mv88e6060DumpPhyReg | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
Dump PHY registers for debugging purpose.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
Definition at line 1511 of file mv88e6060_driver.c.
◆ mv88e6060EnableIgmpSnooping()
void mv88e6060EnableIgmpSnooping | ( | NetInterface * | interface, |
bool_t | enable | ||
) |
Enable IGMP snooping.
- Parameters
-
[in] interface Underlying network interface [in] enable Enable or disable IGMP snooping
Definition at line 768 of file mv88e6060_driver.c.
◆ mv88e6060EnableIrq()
void mv88e6060EnableIrq | ( | NetInterface * | interface | ) |
Enable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 289 of file mv88e6060_driver.c.
◆ mv88e6060EnableMldSnooping()
void mv88e6060EnableMldSnooping | ( | NetInterface * | interface, |
bool_t | enable | ||
) |
Enable MLD snooping.
- Parameters
-
[in] interface Underlying network interface [in] enable Enable or disable MLD snooping
Definition at line 780 of file mv88e6060_driver.c.
◆ mv88e6060EnableRsvdMcastTable()
void mv88e6060EnableRsvdMcastTable | ( | NetInterface * | interface, |
bool_t | enable | ||
) |
Enable reserved multicast table.
- Parameters
-
[in] interface Underlying network interface [in] enable Enable or disable reserved group addresses
Definition at line 792 of file mv88e6060_driver.c.
◆ mv88e6060EventHandler()
void mv88e6060EventHandler | ( | NetInterface * | interface | ) |
88E6060 event handler
- Parameters
-
[in] interface Underlying network interface
Definition at line 309 of file mv88e6060_driver.c.
◆ mv88e6060FlushDynamicFdbTable()
void mv88e6060FlushDynamicFdbTable | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
Flush dynamic MAC table.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
Definition at line 1289 of file mv88e6060_driver.c.
◆ mv88e6060FlushStaticFdbTable()
void mv88e6060FlushStaticFdbTable | ( | NetInterface * | interface | ) |
Flush static MAC table.
- Parameters
-
[in] interface Underlying network interface
Definition at line 1102 of file mv88e6060_driver.c.
◆ mv88e6060GetDuplexMode()
NicDuplexMode mv88e6060GetDuplexMode | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
Get duplex mode.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
- Returns
- Duplex mode
Definition at line 598 of file mv88e6060_driver.c.
◆ mv88e6060GetDynamicFdbEntry()
error_t mv88e6060GetDynamicFdbEntry | ( | NetInterface * | interface, |
uint_t | index, | ||
SwitchFdbEntry * | entry | ||
) |
Read an entry from the dynamic MAC table.
- Parameters
-
[in] interface Underlying network interface [in] index Zero-based index of the entry to read [out] entry Pointer to the forwarding database entry
- Returns
- Error code
Definition at line 1137 of file mv88e6060_driver.c.
◆ mv88e6060GetLinkSpeed()
uint32_t mv88e6060GetLinkSpeed | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
Get link speed.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
- Returns
- Link speed
Definition at line 559 of file mv88e6060_driver.c.
◆ mv88e6060GetLinkState()
bool_t mv88e6060GetLinkState | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
Get link state.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
- Returns
- Link state
Definition at line 527 of file mv88e6060_driver.c.
◆ mv88e6060GetPortState()
SwitchPortState mv88e6060GetPortState | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
Get port state.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
- Returns
- Port state
Definition at line 688 of file mv88e6060_driver.c.
◆ mv88e6060GetStaticFdbEntry()
error_t mv88e6060GetStaticFdbEntry | ( | NetInterface * | interface, |
uint_t | index, | ||
SwitchFdbEntry * | entry | ||
) |
Read an entry from the static MAC table.
- Parameters
-
[in] interface Underlying network interface [in] index Zero-based index of the entry to read [out] entry Pointer to the forwarding database entry
- Returns
- Error code
Definition at line 975 of file mv88e6060_driver.c.
◆ mv88e6060Init()
error_t mv88e6060Init | ( | NetInterface * | interface | ) |
88E6060 Ethernet switch initialization
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 94 of file mv88e6060_driver.c.
◆ mv88e6060InitHook()
__weak_func void mv88e6060InitHook | ( | NetInterface * | interface | ) |
88E6060 custom configuration
- Parameters
-
[in] interface Underlying network interface
Definition at line 209 of file mv88e6060_driver.c.
◆ mv88e6060ReadPhyReg()
uint16_t mv88e6060ReadPhyReg | ( | NetInterface * | interface, |
uint8_t | port, | ||
uint8_t | address | ||
) |
Read PHY register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] address PHY register address
- Returns
- Register value
Definition at line 1482 of file mv88e6060_driver.c.
◆ mv88e6060ReadSmiReg()
uint16_t mv88e6060ReadSmiReg | ( | NetInterface * | interface, |
uint8_t | deviceAddr, | ||
uint8_t | regAddr | ||
) |
Read SMI register.
- Parameters
-
[in] interface Underlying network interface [in] deviceAddr SMI device address [in] regAddr Register address
- Returns
- Register value
Definition at line 1426 of file mv88e6060_driver.c.
◆ mv88e6060ReadSwitchGlobalReg()
uint16_t mv88e6060ReadSwitchGlobalReg | ( | NetInterface * | interface, |
uint8_t | address | ||
) |
Read switch global register.
- Parameters
-
[in] interface Underlying network interface [in] address Switch global register address
- Returns
- Register value
Definition at line 1609 of file mv88e6060_driver.c.
◆ mv88e6060ReadSwitchPortReg()
uint16_t mv88e6060ReadSwitchPortReg | ( | NetInterface * | interface, |
uint8_t | port, | ||
uint8_t | address | ||
) |
Read switch port register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] address Switch port register address
- Returns
- Register value
Definition at line 1562 of file mv88e6060_driver.c.
◆ mv88e6060SetAgingTime()
void mv88e6060SetAgingTime | ( | NetInterface * | interface, |
uint32_t | agingTime | ||
) |
Set aging time for dynamic filtering entries.
- Parameters
-
[in] interface Underlying network interface [in] agingTime Aging time, in seconds
Definition at line 740 of file mv88e6060_driver.c.
◆ mv88e6060SetPortState()
void mv88e6060SetPortState | ( | NetInterface * | interface, |
uint8_t | port, | ||
SwitchPortState | state | ||
) |
Set port state.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] state Port state
Definition at line 637 of file mv88e6060_driver.c.
◆ mv88e6060SetUnknownMcastFwdPorts()
void mv88e6060SetUnknownMcastFwdPorts | ( | NetInterface * | interface, |
bool_t | enable, | ||
uint32_t | forwardPorts | ||
) |
Set forward ports for unknown multicast packets.
- Parameters
-
[in] interface Underlying network interface [in] enable Enable or disable forwarding of unknown multicast packets [in] forwardPorts Port map
Definition at line 1385 of file mv88e6060_driver.c.
◆ mv88e6060TagFrame()
error_t mv88e6060TagFrame | ( | NetInterface * | interface, |
NetBuffer * | buffer, | ||
size_t * | offset, | ||
NetTxAncillary * | ancillary | ||
) |
Add ingress trailer to Ethernet frame.
- Parameters
-
[in] interface Underlying network interface [in] buffer Multi-part buffer containing the payload [in,out] offset Offset to the first payload byte [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
Definition at line 425 of file mv88e6060_driver.c.
◆ mv88e6060Tick()
void mv88e6060Tick | ( | NetInterface * | interface | ) |
88E6060 timer handler
- Parameters
-
[in] interface Underlying network interface
Definition at line 219 of file mv88e6060_driver.c.
◆ mv88e6060UntagFrame()
error_t mv88e6060UntagFrame | ( | NetInterface * | interface, |
uint8_t ** | frame, | ||
size_t * | length, | ||
NetRxAncillary * | ancillary | ||
) |
Decode egress trailer from incoming Ethernet frame.
- Parameters
-
[in] interface Underlying network interface [in,out] frame Pointer to the received Ethernet frame [in,out] length Length of the frame, in bytes [in,out] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
Definition at line 480 of file mv88e6060_driver.c.
◆ mv88e6060WritePhyReg()
void mv88e6060WritePhyReg | ( | NetInterface * | interface, |
uint8_t | port, | ||
uint8_t | address, | ||
uint16_t | data | ||
) |
Write PHY register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] address PHY register address [in] data Register value
Definition at line 1457 of file mv88e6060_driver.c.
◆ mv88e6060WriteSmiReg()
void mv88e6060WriteSmiReg | ( | NetInterface * | interface, |
uint8_t | deviceAddr, | ||
uint8_t | regAddr, | ||
uint16_t | data | ||
) |
Write SMI register.
- Parameters
-
[in] interface Underlying network interface [in] deviceAddr SMI device address [in] regAddr Register address [in] data Register value
Definition at line 1400 of file mv88e6060_driver.c.
◆ mv88e6060WriteSwitchGlobalReg()
void mv88e6060WriteSwitchGlobalReg | ( | NetInterface * | interface, |
uint8_t | address, | ||
uint16_t | data | ||
) |
Write switch global register.
- Parameters
-
[in] interface Underlying network interface [in] address Switch global register address [in] data Register value
Definition at line 1593 of file mv88e6060_driver.c.
◆ mv88e6060WriteSwitchPortReg()
void mv88e6060WriteSwitchPortReg | ( | NetInterface * | interface, |
uint8_t | port, | ||
uint8_t | address, | ||
uint16_t | data | ||
) |
Write switch port register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] address Switch port register address [in] data Register value
Definition at line 1536 of file mv88e6060_driver.c.
Variable Documentation
◆ mv88e6060IngressTrailer
const uint32_t mv88e6060IngressTrailer[6] |
Ingress trailer (CPU to 88E6060)
Definition at line 77 of file mv88e6060_driver.c.
◆ mv88e6060SwitchDriver
const SwitchDriver mv88e6060SwitchDriver |
88E6060 Ethernet switch driver
Definition at line 45 of file mv88e6060_driver.c.