linux/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 #include <pthread.h>
20 
22 typedef struct
23 {
25  int *sock;
29  int (*txbuflength)[EC_MAXBUF];
31  ec_bufT *tempbuf;
35  int (*rxbufstat)[EC_MAXBUF];
37  int (*rxsa)[EC_MAXBUF];
38 } ec_stackT;
39 
41 typedef struct
42 {
43  ec_stackT stack;
44  int sockhandle;
48  int rxbufstat[EC_MAXBUF];
50  int rxsa[EC_MAXBUF];
52  ec_bufT tempinbuf;
53 } ecx_redportt;
54 
56 typedef struct
57 {
58  ec_stackT stack;
59  int sockhandle;
63  int rxbufstat[EC_MAXBUF];
65  int rxsa[EC_MAXBUF];
67  ec_bufT tempinbuf;
69  int tempinbufs;
73  int txbuflength[EC_MAXBUF];
75  ec_bufT txbuf2;
77  int txbuflength2;
79  int lastidx;
81  int redstate;
83  ecx_redportt *redport;
84  pthread_mutex_t getindex_mutex;
85  pthread_mutex_t tx_mutex;
86  pthread_mutex_t rx_mutex;
87 } ecx_portt;
88 
89 extern const uint16 priMAC[3];
90 extern const uint16 secMAC[3];
91 
92 #ifdef EC_VER1
93 extern ecx_portt ecx_port;
95 
96 int ec_setupnic(const char * ifname, int secondary);
97 int ec_closenic(void);
98 void ec_setbufstat(int idx, int bufstat);
99 int ec_getindex(void);
100 int ec_outframe(int idx, int sock);
101 int ec_outframe_red(int idx);
102 int ec_waitinframe(int idx, int timeout);
103 int ec_srconfirm(int idx,int timeout);
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 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif
ecx_portt::rx_mutex
pthread_mutex_t rx_mutex
Definition: linux/nicdrv.h:86
ecx_setbufstat
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
Definition: erika/nicdrv.c:202
ec_bufT
uint8 ec_bufT[EC_BUFSIZE]
Definition: ethercattype.h:87
ec_waitinframe
int ec_waitinframe(int idx, int timeout)
rxbuf
uint8 rxbuf[1024]
Definition: eoe_test.c:50
ecx_redportt
struct ecx_redport ecx_redportt
ecx_srconfirm
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
Definition: erika/nicdrv.c:490
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_outframe
int ec_outframe(int idx, int sock)
txbuf
uint8 txbuf[1024]
Definition: eoe_test.c:40
ec_srconfirm
int ec_srconfirm(int idx, int timeout)
ec_outframe_red
int ec_outframe_red(int idx)
ecx_port
ecx_portt ecx_port
Definition: ethercatmain.c:97
ecx_waitinframe
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
Definition: erika/nicdrv.c:467
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_closenic
int ecx_closenic(ecx_portt *port)
Definition: erika/nicdrv.c:140
ecx_outframe_red
int ecx_outframe_red(ecx_portt *port, int idx)
Definition: erika/nicdrv.c:237
secMAC
const uint16 secMAC[3]
Definition: erika/nicdrv.c:67
ecx_portt::tx_mutex
pthread_mutex_t tx_mutex
Definition: linux/nicdrv.h:85
ec_stackT
Definition: erika/nicdrv.h:19
ecx_portt::getindex_mutex
pthread_mutex_t getindex_mutex
Definition: linux/nicdrv.h:84
uint16
uint16_t uint16
Definition: osal.h:29
ecx_outframe
int ecx_outframe(ecx_portt *port, int idx, int sock)
Definition: erika/nicdrv.c:215
ecx_portt
Definition: erika/nicdrv.h:53
priMAC
const uint16 priMAC[3]
Definition: erika/nicdrv.c:65
ec_setupheader
void ec_setupheader(void *p)
Definition: erika/nicdrv.c:151
ecx_redport
ecx_redportt ecx_redport
Definition: ethercatmain.c:98
ecx_getindex
int ecx_getindex(ecx_portt *port)
Definition: erika/nicdrv.c:168
ecx_portt
struct ecx_port ecx_portt
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