mikroSDK Reference Manual
loopback_driver.h
Go to the documentation of this file.
1
31
#ifndef _LOOPBACK_DRIVER_H
32
#define _LOOPBACK_DRIVER_H
33
34
//Dependencies
35
#include "
core/nic.h
"
36
37
//Queue size
38
#ifndef LOOPBACK_DRIVER_QUEUE_SIZE
39
#define LOOPBACK_DRIVER_QUEUE_SIZE 6
40
#elif (LOOPBACK_DRIVER_QUEUE_SIZE < 1)
41
#error LOOPBACK_DRIVER_QUEUE_SIZE parameter is not valid
42
#endif
43
44
49
typedef
struct
50
{
51
size_t
length;
52
uint8_t data[ETH_MTU];
53
}
LoopbackDriverQueueEntry
;
54
55
56
//Loopback interface driver
57
extern
const
NicDriver
loopbackDriver;
58
59
//Loopback interface related functions
60
error_t
loopbackDriverInit(NetInterface *interface);
61
62
void
loopbackDriverTick(NetInterface *interface);
63
64
void
loopbackDriverEnableIrq(NetInterface *interface);
65
void
loopbackDriverDisableIrq(NetInterface *interface);
66
void
loopbackDriverEventHandler(NetInterface *interface);
67
68
error_t
loopbackDriverSendPacket(NetInterface *interface,
69
const
NetBuffer
*buffer,
size_t
offset, NetTxAncillary *ancillary);
70
71
error_t
loopbackDriverReceivePacket(NetInterface *interface);
72
73
error_t
loopbackDriverUpdateMacAddrFilter(NetInterface *interface);
74
75
#endif
error_t
error_t
Error codes.
Definition
error.h:43
nic.h
Network interface controller abstraction layer.
LoopbackDriverQueueEntry
Loopback interface queue entry.
Definition
loopback_driver.h:50
NetBuffer
Structure describing a buffer that spans multiple chunks.
Definition
net_mem.h:89
NicDriver
NIC driver.
Definition
nic.h:283