KSZ8851 Ethernet controller. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL NIC_TRACE_LEVEL |
Functions | |
error_t | ksz8851Init (NetInterface *interface) |
KSZ8851 controller initialization. More... | |
__weak_func void | ksz8851InitHook (NetInterface *interface) |
KSZ8851 custom configuration. More... | |
void | ksz8851Tick (NetInterface *interface) |
KSZ8851 timer handler. More... | |
void | ksz8851EnableIrq (NetInterface *interface) |
Enable interrupts. More... | |
void | ksz8851DisableIrq (NetInterface *interface) |
Disable interrupts. More... | |
bool_t | ksz8851IrqHandler (NetInterface *interface) |
KSZ8851 interrupt service routine. More... | |
void | ksz8851EventHandler (NetInterface *interface) |
KSZ8851 event handler. More... | |
error_t | ksz8851SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
Send a packet. More... | |
error_t | ksz8851ReceivePacket (NetInterface *interface) |
Receive a packet. More... | |
error_t | ksz8851UpdateMacAddrFilter (NetInterface *interface) |
Configure MAC address filtering. More... | |
void | ksz8851WriteReg (NetInterface *interface, uint8_t address, uint16_t data) |
Write KSZ8851 register. More... | |
uint16_t | ksz8851ReadReg (NetInterface *interface, uint8_t address) |
Read KSZ8851 register. More... | |
void | ksz8851WriteFifo (NetInterface *interface, const uint8_t *data, size_t length) |
Write TX FIFO. More... | |
void | ksz8851ReadFifo (NetInterface *interface, uint8_t *data, size_t length) |
Read RX FIFO. More... | |
void | ksz8851SetBit (NetInterface *interface, uint8_t address, uint16_t mask) |
Set bit field. More... | |
void | ksz8851ClearBit (NetInterface *interface, uint8_t address, uint16_t mask) |
Clear bit field. More... | |
uint32_t | ksz8851CalcCrc (const void *data, size_t length) |
CRC calculation. More... | |
void | ksz8851DumpReg (NetInterface *interface) |
Dump registers for debugging purpose. More... | |
Variables | |
const NicDriver | ksz8851Driver |
KSZ8851 driver. More... | |
Detailed Description
KSZ8851 Ethernet controller.
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 ksz8851_driver.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL NIC_TRACE_LEVEL |
Definition at line 32 of file ksz8851_driver.c.
Function Documentation
◆ ksz8851CalcCrc()
uint32_t ksz8851CalcCrc | ( | const void * | data, |
size_t | length | ||
) |
CRC calculation.
- Parameters
-
[in] data Pointer to the data over which to calculate the CRC [in] length Number of bytes to process
- Returns
- Resulting CRC value
Definition at line 874 of file ksz8851_driver.c.
◆ ksz8851ClearBit()
void ksz8851ClearBit | ( | NetInterface * | interface, |
uint8_t | address, | ||
uint16_t | mask | ||
) |
Clear bit field.
- Parameters
-
[in] interface Underlying network interface [in] address Register address [in] mask Bits to clear in the target register
Definition at line 856 of file ksz8851_driver.c.
◆ ksz8851DisableIrq()
void ksz8851DisableIrq | ( | NetInterface * | interface | ) |
Disable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 218 of file ksz8851_driver.c.
◆ ksz8851DumpReg()
void ksz8851DumpReg | ( | NetInterface * | interface | ) |
Dump registers for debugging purpose.
- Parameters
-
[in] interface Underlying network interface
Definition at line 914 of file ksz8851_driver.c.
◆ ksz8851EnableIrq()
void ksz8851EnableIrq | ( | NetInterface * | interface | ) |
Enable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 203 of file ksz8851_driver.c.
◆ ksz8851EventHandler()
void ksz8851EventHandler | ( | NetInterface * | interface | ) |
KSZ8851 event handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 306 of file ksz8851_driver.c.
◆ ksz8851Init()
error_t ksz8851Init | ( | NetInterface * | interface | ) |
KSZ8851 controller initialization.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 71 of file ksz8851_driver.c.
◆ ksz8851InitHook()
__weak_func void ksz8851InitHook | ( | NetInterface * | interface | ) |
KSZ8851 custom configuration.
- Parameters
-
[in] interface Underlying network interface
Definition at line 183 of file ksz8851_driver.c.
◆ ksz8851IrqHandler()
bool_t ksz8851IrqHandler | ( | NetInterface * | interface | ) |
KSZ8851 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 234 of file ksz8851_driver.c.
◆ ksz8851ReadFifo()
void ksz8851ReadFifo | ( | NetInterface * | interface, |
uint8_t * | data, | ||
size_t | length | ||
) |
Read RX FIFO.
- Parameters
-
[in] interface Underlying network interface [out] data Buffer where to store the incoming data [in] length Number of data to read
Definition at line 766 of file ksz8851_driver.c.
◆ ksz8851ReadReg()
uint16_t ksz8851ReadReg | ( | NetInterface * | interface, |
uint8_t | address | ||
) |
Read KSZ8851 register.
- Parameters
-
[in] interface Underlying network interface [in] address Register address
- Returns
- Register value
Definition at line 658 of file ksz8851_driver.c.
◆ ksz8851ReceivePacket()
error_t ksz8851ReceivePacket | ( | NetInterface * | interface | ) |
Receive a packet.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 468 of file ksz8851_driver.c.
◆ ksz8851SendPacket()
error_t ksz8851SendPacket | ( | 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 392 of file ksz8851_driver.c.
◆ ksz8851SetBit()
void ksz8851SetBit | ( | NetInterface * | interface, |
uint8_t | address, | ||
uint16_t | mask | ||
) |
Set bit field.
- Parameters
-
[in] interface Underlying network interface [in] address Register address [in] mask Bits to set in the target register
Definition at line 838 of file ksz8851_driver.c.
◆ ksz8851Tick()
void ksz8851Tick | ( | NetInterface * | interface | ) |
KSZ8851 timer handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 193 of file ksz8851_driver.c.
◆ ksz8851UpdateMacAddrFilter()
error_t ksz8851UpdateMacAddrFilter | ( | NetInterface * | interface | ) |
Configure MAC address filtering.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 549 of file ksz8851_driver.c.
◆ ksz8851WriteFifo()
void ksz8851WriteFifo | ( | NetInterface * | interface, |
const uint8_t * | data, | ||
size_t | length | ||
) |
Write TX FIFO.
- Parameters
-
[in] interface Underlying network interface [in] data Pointer to the data being written [in] length Number of data to write
Definition at line 715 of file ksz8851_driver.c.
◆ ksz8851WriteReg()
void ksz8851WriteReg | ( | NetInterface * | interface, |
uint8_t | address, | ||
uint16_t | data | ||
) |
Write KSZ8851 register.
- Parameters
-
[in] interface Underlying network interface [in] address Register address [in] data Register value
Definition at line 606 of file ksz8851_driver.c.