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
49typedef struct
50{
51 size_t length;
52 uint8_t data[ETH_MTU];
54
55
56//Loopback interface driver
57extern const NicDriver loopbackDriver;
58
59//Loopback interface related functions
60error_t loopbackDriverInit(NetInterface *interface);
61
62void loopbackDriverTick(NetInterface *interface);
63
64void loopbackDriverEnableIrq(NetInterface *interface);
65void loopbackDriverDisableIrq(NetInterface *interface);
66void loopbackDriverEventHandler(NetInterface *interface);
67
68error_t loopbackDriverSendPacket(NetInterface *interface,
69 const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary);
70
71error_t loopbackDriverReceivePacket(NetInterface *interface);
72
73error_t loopbackDriverUpdateMacAddrFilter(NetInterface *interface);
74
75#endif
error_t
Error codes.
Definition error.h:43
Network interface controller abstraction layer.
Loopback interface queue entry.
Definition loopback_driver.h:50
Structure describing a buffer that spans multiple chunks.
Definition net_mem.h:89
NIC driver.
Definition nic.h:283