ADIN2111 2-port 10Base-T1L Ethernet switch driver. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL NIC_TRACE_LEVEL |
Functions | |
error_t | adin2111Init (NetInterface *interface) |
ADIN2111 controller initialization. More... | |
__weak_func void | adin2111InitHook (NetInterface *interface) |
ADIN2111 custom configuration. More... | |
void | adin2111Tick (NetInterface *interface) |
ADIN2111 timer handler. More... | |
void | adin2111EnableIrq (NetInterface *interface) |
Enable interrupts. More... | |
void | adin2111DisableIrq (NetInterface *interface) |
Disable interrupts. More... | |
bool_t | adin2111IrqHandler (NetInterface *interface) |
ADIN2111 interrupt service routine. More... | |
void | adin2111EventHandler (NetInterface *interface) |
ADIN2111 event handler. More... | |
void | adin2111LinkChangeEventHandler (NetInterface *interface) |
ADIN2111 link status change event handler. More... | |
error_t | adin2111SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
Send a packet. More... | |
void | adin2111ReceivePacket (NetInterface *interface, uint8_t port) |
Receive a packet. More... | |
error_t | adin2111UpdateMacAddrFilter (NetInterface *interface) |
Configure MAC address filtering. More... | |
bool_t | adin2111GetLinkState (NetInterface *interface, uint8_t port) |
Get link state. More... | |
void | adin2111WriteReg (NetInterface *interface, uint16_t address, uint32_t data) |
Write SPI register. More... | |
uint32_t | adin2111ReadReg (NetInterface *interface, uint16_t address) |
Read SPI register. More... | |
void | adin2111DumpReg (NetInterface *interface) |
Dump SPI registers for debugging purpose. More... | |
void | adin2111WritePhyReg (NetInterface *interface, uint8_t port, uint8_t address, uint16_t data) |
Write PHY register. More... | |
uint16_t | adin2111ReadPhyReg (NetInterface *interface, uint8_t port, uint8_t address) |
Read PHY register. More... | |
void | adin2111DumpPhyReg (NetInterface *interface, uint8_t port) |
Dump PHY registers for debugging purpose. More... | |
void | adin2111WriteMmdReg (NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr, uint16_t data) |
Write MMD register. More... | |
uint16_t | adin2111ReadMmdReg (NetInterface *interface, uint8_t port, uint8_t devAddr, uint16_t regAddr) |
Read MMD register. More... | |
void | adin2111WriteFifo (NetInterface *interface, uint16_t header, const uint8_t *data, size_t length) |
Write TX FIFO. More... | |
void | adin2111ReadFifo (NetInterface *interface, uint8_t port, uint16_t *header, uint8_t *data, size_t length) |
Read RX FIFO. More... | |
Variables | |
const NicDriver | adin2111Driver |
ADIN2111 driver. More... | |
Detailed Description
ADIN2111 2-port 10Base-T1L 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 adin2111_driver.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL NIC_TRACE_LEVEL |
Definition at line 32 of file adin2111_driver.c.
Function Documentation
◆ adin2111DisableIrq()
void adin2111DisableIrq | ( | NetInterface * | interface | ) |
Disable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 263 of file adin2111_driver.c.
◆ adin2111DumpPhyReg()
void adin2111DumpPhyReg | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
Dump PHY registers for debugging purpose.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
Definition at line 1011 of file adin2111_driver.c.
◆ adin2111DumpReg()
void adin2111DumpReg | ( | NetInterface * | interface | ) |
Dump SPI registers for debugging purpose.
- Parameters
-
[in] interface Underlying network interface
Definition at line 915 of file adin2111_driver.c.
◆ adin2111EnableIrq()
void adin2111EnableIrq | ( | NetInterface * | interface | ) |
Enable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 248 of file adin2111_driver.c.
◆ adin2111EventHandler()
void adin2111EventHandler | ( | NetInterface * | interface | ) |
ADIN2111 event handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 383 of file adin2111_driver.c.
◆ adin2111GetLinkState()
bool_t adin2111GetLinkState | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
Get link state.
- Parameters
-
[in] interface Underlying network interface [in] port Port number
- Returns
- Link state
Definition at line 820 of file adin2111_driver.c.
◆ adin2111Init()
error_t adin2111Init | ( | NetInterface * | interface | ) |
ADIN2111 controller initialization.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 71 of file adin2111_driver.c.
◆ adin2111InitHook()
__weak_func void adin2111InitHook | ( | NetInterface * | interface | ) |
ADIN2111 custom configuration.
- Parameters
-
[in] interface Underlying network interface
Definition at line 228 of file adin2111_driver.c.
◆ adin2111IrqHandler()
bool_t adin2111IrqHandler | ( | NetInterface * | interface | ) |
ADIN2111 interrupt service routine.
- Parameters
-
[in] interface Underlying network interface
- Returns
- TRUE if a higher priority task must be woken. Else FALSE is returned
Definition at line 279 of file adin2111_driver.c.
◆ adin2111LinkChangeEventHandler()
void adin2111LinkChangeEventHandler | ( | NetInterface * | interface | ) |
ADIN2111 link status change event handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 479 of file adin2111_driver.c.
◆ adin2111ReadFifo()
void adin2111ReadFifo | ( | NetInterface * | interface, |
uint8_t | port, | ||
uint16_t * | header, | ||
uint8_t * | data, | ||
size_t | length | ||
) |
Read RX FIFO.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [out] header Frame header [out] data Buffer where to store the incoming data [in] length Number of data to read
Definition at line 1178 of file adin2111_driver.c.
◆ adin2111ReadMmdReg()
uint16_t adin2111ReadMmdReg | ( | NetInterface * | interface, |
uint8_t | port, | ||
uint8_t | devAddr, | ||
uint16_t | regAddr | ||
) |
Read MMD register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] devAddr Device address [in] regAddr Register address
- Returns
- MMD register value
Definition at line 1086 of file adin2111_driver.c.
◆ adin2111ReadPhyReg()
uint16_t adin2111ReadPhyReg | ( | 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 976 of file adin2111_driver.c.
◆ adin2111ReadReg()
uint32_t adin2111ReadReg | ( | NetInterface * | interface, |
uint16_t | address | ||
) |
Read SPI register.
- Parameters
-
[in] interface Underlying network interface [in] address System register address
- Returns
- Register value
Definition at line 882 of file adin2111_driver.c.
◆ adin2111ReceivePacket()
void adin2111ReceivePacket | ( | NetInterface * | interface, |
uint8_t | port | ||
) |
Receive a packet.
- Parameters
-
[in] port Port number [in] interface Underlying network interface
Definition at line 682 of file adin2111_driver.c.
◆ adin2111SendPacket()
error_t adin2111SendPacket | ( | NetInterface * | interface, |
const NetBuffer * | buffer, | ||
size_t | offset, | ||
NetTxAncillary * | ancillary | ||
) |
Send a packet.
- Parameters
-
[in] interface Underlying network interface [in] buffer Multi-part buffer containing the data to send [in] offset Offset to the first data byte [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
Definition at line 585 of file adin2111_driver.c.
◆ adin2111Tick()
void adin2111Tick | ( | NetInterface * | interface | ) |
ADIN2111 timer handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 238 of file adin2111_driver.c.
◆ adin2111UpdateMacAddrFilter()
error_t adin2111UpdateMacAddrFilter | ( | NetInterface * | interface | ) |
Configure MAC address filtering.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 734 of file adin2111_driver.c.
◆ adin2111WriteFifo()
void adin2111WriteFifo | ( | NetInterface * | interface, |
uint16_t | header, | ||
const uint8_t * | data, | ||
size_t | length | ||
) |
Write TX FIFO.
- Parameters
-
[in] interface Underlying network interface [in] header Frame header [in] data Pointer to the data being written [in] length Number of data to write
Definition at line 1135 of file adin2111_driver.c.
◆ adin2111WriteMmdReg()
void adin2111WriteMmdReg | ( | NetInterface * | interface, |
uint8_t | port, | ||
uint8_t | devAddr, | ||
uint16_t | regAddr, | ||
uint16_t | data | ||
) |
Write MMD register.
- Parameters
-
[in] interface Underlying network interface [in] port Port number [in] devAddr Device address [in] regAddr Register address [in] data MMD register value
Definition at line 1037 of file adin2111_driver.c.
◆ adin2111WritePhyReg()
void adin2111WritePhyReg | ( | 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 940 of file adin2111_driver.c.
◆ adin2111WriteReg()
void adin2111WriteReg | ( | NetInterface * | interface, |
uint16_t | address, | ||
uint32_t | data | ||
) |
Write SPI register.
- Parameters
-
[in] interface Underlying network interface [in] address Register address [in] data System register value
Definition at line 854 of file adin2111_driver.c.
Variable Documentation
◆ adin2111Driver
const NicDriver adin2111Driver |
ADIN2111 driver.
Definition at line 44 of file adin2111_driver.c.