dm9000_driver.c File Reference

DM9000A/B Ethernet controller. More...

#include "core/net.h"
#include "core/ethernet.h"
#include "drivers/eth/dm9000_driver.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

Functions

error_t dm9000Init (NetInterface *interface)
 DM9000 controller initialization. More...
 
__weak_func void dm9000InitHook (NetInterface *interface)
 DM9000 custom configuration. More...
 
void dm9000Tick (NetInterface *interface)
 DM9000 timer handler. More...
 
void dm9000EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void dm9000DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
bool_t dm9000IrqHandler (NetInterface *interface)
 DM9000 interrupt service routine. More...
 
void dm9000EventHandler (NetInterface *interface)
 DM9000 event handler. More...
 
error_t dm9000SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send a packet. More...
 
error_t dm9000ReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t dm9000UpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void dm9000WriteReg (uint8_t address, uint8_t data)
 Write DM9000 register. More...
 
uint8_t dm9000ReadReg (uint8_t address)
 Read DM9000 register. More...
 
void dm9000WritePhyReg (uint8_t address, uint16_t data)
 Write DM9000 PHY register. More...
 
uint16_t dm9000ReadPhyReg (uint8_t address)
 Read DM9000 PHY register. More...
 
uint32_t dm9000CalcCrc (const void *data, size_t length)
 CRC calculation. More...
 

Variables

const NicDriver dm9000Driver
 DM9000 driver. More...
 

Detailed Description

DM9000A/B 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file dm9000_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 32 of file dm9000_driver.c.

Function Documentation

◆ dm9000CalcCrc()

uint32_t dm9000CalcCrc ( const void *  data,
size_t  length 
)

CRC calculation.

Parameters
[in]dataPointer to the data over which to calculate the CRC
[in]lengthNumber of bytes to process
Returns
Resulting CRC value

Definition at line 734 of file dm9000_driver.c.

◆ dm9000DisableIrq()

void dm9000DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 238 of file dm9000_driver.c.

◆ dm9000EnableIrq()

void dm9000EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 223 of file dm9000_driver.c.

◆ dm9000EventHandler()

void dm9000EventHandler ( NetInterface interface)

DM9000 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 328 of file dm9000_driver.c.

◆ dm9000Init()

error_t dm9000Init ( NetInterface interface)

DM9000 controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 72 of file dm9000_driver.c.

◆ dm9000InitHook()

__weak_func void dm9000InitHook ( NetInterface interface)

DM9000 custom configuration.

Parameters
[in]interfaceUnderlying network interface

Definition at line 203 of file dm9000_driver.c.

◆ dm9000IrqHandler()

bool_t dm9000IrqHandler ( NetInterface interface)

DM9000 interrupt service routine.

Parameters
[in]interfaceUnderlying network interface
Returns
TRUE if a higher priority task must be woken. Else FALSE is returned

Definition at line 254 of file dm9000_driver.c.

◆ dm9000ReadPhyReg()

uint16_t dm9000ReadPhyReg ( uint8_t  address)

Read DM9000 PHY register.

Parameters
[in]addressPHY register address
Returns
Register value

Definition at line 704 of file dm9000_driver.c.

◆ dm9000ReadReg()

uint8_t dm9000ReadReg ( uint8_t  address)

Read DM9000 register.

Parameters
[in]addressRegister address
Returns
Register value

Definition at line 659 of file dm9000_driver.c.

◆ dm9000ReceivePacket()

error_t dm9000ReceivePacket ( NetInterface interface)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 485 of file dm9000_driver.c.

◆ dm9000SendPacket()

error_t dm9000SendPacket ( NetInterface interface,
const NetBuffer buffer,
size_t  offset,
NetTxAncillary ancillary 
)

Send a packet.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
[in]ancillaryAdditional options passed to the stack along with the packet
Returns
Error code

Definition at line 415 of file dm9000_driver.c.

◆ dm9000Tick()

void dm9000Tick ( NetInterface interface)

DM9000 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 213 of file dm9000_driver.c.

◆ dm9000UpdateMacAddrFilter()

error_t dm9000UpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 584 of file dm9000_driver.c.

◆ dm9000WritePhyReg()

void dm9000WritePhyReg ( uint8_t  address,
uint16_t  data 
)

Write DM9000 PHY register.

Parameters
[in]addressPHY register address
[in]dataRegister value

Definition at line 674 of file dm9000_driver.c.

◆ dm9000WriteReg()

void dm9000WriteReg ( uint8_t  address,
uint8_t  data 
)

Write DM9000 register.

Parameters
[in]addressRegister address
[in]dataRegister value

Definition at line 644 of file dm9000_driver.c.

Variable Documentation

◆ dm9000Driver

const NicDriver dm9000Driver
error_t dm9000UpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
#define TRUE
Definition: os_port.h:50
void dm9000Tick(NetInterface *interface)
DM9000 timer handler.
error_t dm9000Init(NetInterface *interface)
DM9000 controller initialization.
Definition: dm9000_driver.c:72
#define FALSE
Definition: os_port.h:46
error_t dm9000SendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
#define ETH_MTU
Definition: ethernet.h:116
void dm9000DisableIrq(NetInterface *interface)
Disable interrupts.
void dm9000EventHandler(NetInterface *interface)
DM9000 event handler.
void dm9000EnableIrq(NetInterface *interface)
Enable interrupts.
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:83