31#ifndef _MCF5225X_ETH_DRIVER_H
32#define _MCF5225X_ETH_DRIVER_H
35#ifndef MCF5225X_ETH_TX_BUFFER_COUNT
36 #define MCF5225X_ETH_TX_BUFFER_COUNT 2
37#elif (MCF5225X_ETH_TX_BUFFER_COUNT < 1)
38 #error MCF5225X_ETH_TX_BUFFER_COUNT parameter is not valid
42#ifndef MCF5225X_ETH_TX_BUFFER_SIZE
43 #define MCF5225X_ETH_TX_BUFFER_SIZE 1536
44#elif (MCF5225X_ETH_TX_BUFFER_SIZE != 1536)
45 #error MCF5225X_ETH_TX_BUFFER_SIZE parameter is not valid
49#ifndef MCF5225X_ETH_RX_BUFFER_COUNT
50 #define MCF5225X_ETH_RX_BUFFER_COUNT 4
51#elif (MCF5225X_ETH_RX_BUFFER_COUNT < 1)
52 #error MCF5225X_ETH_RX_BUFFER_COUNT parameter is not valid
56#ifndef MCF5225X_ETH_RX_BUFFER_SIZE
57 #define MCF5225X_ETH_RX_BUFFER_SIZE 1536
58#elif (MCF5225X_ETH_RX_BUFFER_SIZE != 1536)
59 #error MCF5225X_ETH_RX_BUFFER_SIZE parameter is not valid
63#ifndef MCF5225X_ETH_IRQ_LEVEL
64 #define MCF5225X_ETH_IRQ_LEVEL 4
65#elif (MCF5225X_ETH_IRQ_LEVEL < 0)
66 #error MCF5225X_ETH_IRQ_LEVEL parameter is not valid
70#ifndef MCF5225X_ETH_IRQ_PRIORITY
71 #define MCF5225X_ETH_IRQ_PRIORITY 1
72#elif (MCF5225X_ETH_IRQ_PRIORITY < 0)
73 #error MCF5225X_ETH_IRQ_PRIORITY parameter is not valid
77#define FEC_ALIGN16(p) ((void *) ((((uint32_t) (p)) + 15) & 0xFFFFFFF0))
80#define FEC_TX_BD_R 0x8000
81#define FEC_TX_BD_TO1 0x4000
82#define FEC_TX_BD_W 0x2000
83#define FEC_TX_BD_TO2 0x1000
84#define FEC_TX_BD_L 0x0800
85#define FEC_TX_BD_TC 0x0400
86#define FEC_TX_BD_ABC 0x0200
89#define FEC_RX_BD_E 0x8000
90#define FEC_RX_BD_RO1 0x4000
91#define FEC_RX_BD_W 0x2000
92#define FEC_RX_BD_RO2 0x1000
93#define FEC_RX_BD_L 0x0800
94#define FEC_RX_BD_M 0x0100
95#define FEC_RX_BD_BC 0x0080
96#define FEC_RX_BD_MC 0x0040
97#define FEC_RX_BD_LG 0x0020
98#define FEC_RX_BD_NO 0x0010
99#define FEC_RX_BD_CR 0x0004
100#define FEC_RX_BD_OV 0x0002
101#define FEC_RX_BD_TR 0x0001
137error_t mcf5225xEthInit(NetInterface *interface);
138void mcf5225xEthInitGpio(NetInterface *interface);
139void mcf5225xEthInitBufferDesc(NetInterface *interface);
141void mcf5225xEthTick(NetInterface *interface);
143void mcf5225xEthEnableIrq(NetInterface *interface);
144void mcf5225xEthDisableIrq(NetInterface *interface);
145void mcf5225xEthEventHandler(NetInterface *interface);
147error_t mcf5225xEthSendPacket(NetInterface *interface,
148 const NetBuffer *buffer,
size_t offset, NetTxAncillary *ancillary);
150error_t mcf5225xEthReceivePacket(NetInterface *interface);
152error_t mcf5225xEthUpdateMacAddrFilter(NetInterface *interface);
153error_t mcf5225xEthUpdateMacConfig(NetInterface *interface);
155void mcf5225xEthWritePhyReg(uint8_t opcode, uint8_t phyAddr,
156 uint8_t regAddr, uint16_t data);
158uint16_t mcf5225xEthReadPhyReg(uint8_t opcode, uint8_t phyAddr,
161uint32_t mcf5225xEthCalcCrc(
const void *data,
size_t length);
error_t
Error codes.
Definition error.h:43
Receive buffer descriptor.
Definition mcf5225x_eth_driver.h:126
Transmit buffer descriptor.
Definition mcf5225x_eth_driver.h:114
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89
NIC driver.
Definition nic.h:283