rtems/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
int ec_outframe(int idx, int sock)
void ec_setupheader(void *p)
Definition: erika/nicdrv.c:151
int ec_setupnic(const char *ifname, int secondary)
uint8 txbuf[1024]
Definition: eoe_test.c:40
#define EC_MAXBUF
Definition: ethercattype.h:62
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
Definition: erika/nicdrv.c:467
uint16_t uint16
Definition: osal.h:29
int ecx_outframe(ecx_portt *port, int idx, int sock)
Definition: erika/nicdrv.c:215
ecx_portt ecx_port
Definition: ethercatmain.c:97
int ecx_outframe_red(ecx_portt *port, int idx)
Definition: erika/nicdrv.c:237
int ec_srconfirm(int idx, int timeout)
void ec_setbufstat(int idx, int bufstat)
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
Definition: erika/nicdrv.c:490
int ecx_closenic(ecx_portt *port)
Definition: erika/nicdrv.c:140
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
Definition: erika/nicdrv.c:202
struct ecx_port ecx_portt
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
Definition: erika/nicdrv.c:90
ecx_redportt ecx_redport
Definition: ethercatmain.c:98
int ec_outframe_red(int idx)
uint8 ec_bufT[EC_BUFSIZE]
Definition: ethercattype.h:87
int ec_closenic(void)
int ecx_getindex(ecx_portt *port)
Definition: erika/nicdrv.c:168
int ec_getindex(void)
const uint16 secMAC[3]
Definition: erika/nicdrv.c:67
int ec_waitinframe(int idx, int timeout)
struct ecx_redport ecx_redportt
const uint16 priMAC[3]
Definition: erika/nicdrv.c:65
uint8 rxbuf[1024]
Definition: eoe_test.c:50


soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Mon Feb 28 2022 23:46:57