erika/nicdrv.h
Go to the documentation of this file.
1 /*
2  * Licensed under the GNU General Public License version 2 with exceptions. See
3  * LICENSE file in the project root for full license information
4  */
5 
11 #ifndef _nicdrvh_
12 #define _nicdrvh_
13 
14 #ifdef __cplusplus
15 extern "C"
16 {
17 #endif
18 
19 typedef struct
20 {
22  int *sock;
26  int (*txbuflength)[EC_MAXBUF];
32  int (*rxbufstat)[EC_MAXBUF];
34  int (*rxsa)[EC_MAXBUF];
35 } ec_stackT;
36 
38 typedef struct
39 {
45  int rxbufstat[EC_MAXBUF];
47  int rxsa[EC_MAXBUF];
50 } ecx_redportt;
51 
53 typedef struct
54 {
60  int rxbufstat[EC_MAXBUF];
62  int rxsa[EC_MAXBUF];
70  int txbuflength[EC_MAXBUF];
76  int lastidx;
78  int redstate;
81 
83  int dev_id;
84 
85  // TODO: add mutex support
86 } ecx_portt;
87 
88 extern const uint16 priMAC[3];
89 extern const uint16 secMAC[3];
90 
91 #ifdef EC_VER1
92 extern ecx_portt ecx_port;
94 
95 int ec_setupnic(const char * ifname, int secondary);
96 int ec_closenic(void);
97 void ec_setbufstat(int idx, int bufstat);
98 int ec_getindex(void);
99 int ec_outframe(int idx, int sock);
100 int ec_outframe_red(int idx);
101 int ec_waitinframe(int idx, int timeout);
102 int ec_srconfirm(int idx,int timeout);
103 int ec_inframe(int idx, int stacknumber);
104 #endif
105 
106 void ec_setupheader(void *p);
107 int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary);
108 int ecx_closenic(ecx_portt *port);
109 void ecx_setbufstat(ecx_portt *port, int idx, int bufstat);
110 int ecx_getindex(ecx_portt *port);
111 int ecx_outframe(ecx_portt *port, int idx, int sock);
112 int ecx_outframe_red(ecx_portt *port, int idx);
113 int ecx_waitinframe(ecx_portt *port, int idx, int timeout);
114 int ecx_srconfirm(ecx_portt *port, int idx,int timeout);
115 
116 int ecx_inframe(ecx_portt *port, int idx, int stacknumber);
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif
ec_bufT
uint8 ec_bufT[EC_BUFSIZE]
Definition: ethercattype.h:87
ec_waitinframe
int ec_waitinframe(int idx, int timeout)
ecx_portt::sockhandle
int sockhandle
Definition: erika/nicdrv.h:56
ec_setupheader
void ec_setupheader(void *p)
Definition: erika/nicdrv.c:151
rxbuf
uint8 rxbuf[1024]
Definition: eoe_test.c:50
ecx_redportt
struct ecx_redport ecx_redportt
ec_closenic
int ec_closenic(void)
ec_setupnic
int ec_setupnic(const char *ifname, int secondary)
ec_setbufstat
void ec_setbufstat(int idx, int bufstat)
EC_MAXBUF
#define EC_MAXBUF
Definition: ethercattype.h:62
ec_stackT::tempbuf
ec_bufT * tempbuf
Definition: erika/nicdrv.h:28
priMAC
const uint16 priMAC[3]
Definition: erika/nicdrv.c:65
ec_outframe
int ec_outframe(int idx, int sock)
ecx_outframe_red
int ecx_outframe_red(ecx_portt *port, int idx)
Definition: erika/nicdrv.c:237
ecx_portt::txbuflength2
int txbuflength2
Definition: erika/nicdrv.h:74
txbuf
uint8 txbuf[1024]
Definition: eoe_test.c:40
ecx_getindex
int ecx_getindex(ecx_portt *port)
Definition: erika/nicdrv.c:168
ec_srconfirm
int ec_srconfirm(int idx, int timeout)
ec_outframe_red
int ec_outframe_red(int idx)
ecx_portt::txbuf2
ec_bufT txbuf2
Definition: erika/nicdrv.h:72
ecx_outframe
int ecx_outframe(ecx_portt *port, int idx, int sock)
Definition: erika/nicdrv.c:215
ecx_port
ecx_portt ecx_port
Definition: ethercatmain.c:97
ec_getindex
int ec_getindex(void)
ecx_setupnic
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
Definition: erika/nicdrv.c:90
ecx_portt::stack
ec_stackT stack
Definition: erika/nicdrv.h:55
ecx_redportt::stack
ec_stackT stack
Definition: erika/nicdrv.h:40
ecx_portt::tempinbuf
ec_bufT tempinbuf
Definition: erika/nicdrv.h:64
ec_stackT
Definition: erika/nicdrv.h:19
uint16
uint16_t uint16
Definition: osal.h:29
ecx_inframe
int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
Definition: erika/nicdrv.c:303
ecx_portt::redport
ecx_redportt * redport
Definition: erika/nicdrv.h:80
ecx_portt::tempinbufs
int tempinbufs
Definition: erika/nicdrv.h:66
ecx_closenic
int ecx_closenic(ecx_portt *port)
Definition: erika/nicdrv.c:140
ecx_setbufstat
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
Definition: erika/nicdrv.c:202
ecx_redportt::sockhandle
int sockhandle
Definition: erika/nicdrv.h:41
ecx_portt
Definition: erika/nicdrv.h:53
ecx_portt::dev_id
int dev_id
Definition: erika/nicdrv.h:83
ecx_redport
ecx_redportt ecx_redport
Definition: ethercatmain.c:98
ecx_redportt::tempinbuf
ec_bufT tempinbuf
Definition: erika/nicdrv.h:49
secMAC
const uint16 secMAC[3]
Definition: erika/nicdrv.c:67
ecx_portt::redstate
int redstate
Definition: erika/nicdrv.h:78
ec_stackT::sock
int * sock
Definition: erika/nicdrv.h:22
ecx_waitinframe
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
Definition: erika/nicdrv.c:467
ecx_portt
struct ecx_port ecx_portt
ecx_srconfirm
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
Definition: erika/nicdrv.c:490
ecx_portt::lastidx
int lastidx
Definition: erika/nicdrv.h:76
ecx_redportt
Definition: erika/nicdrv.h:38


soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Wed Mar 2 2022 01:01:49