linux/nicdrv.h
Go to the documentation of this file.
1 /*
2  * Simple Open EtherCAT Master Library
3  *
4  * File : nicdrv.h
5  * Version : 1.3.0
6  * Date : 24-02-2013
7  * Copyright (C) 2005-2013 Speciaal Machinefabriek Ketels v.o.f.
8  * Copyright (C) 2005-2013 Arthur Ketels
9  * Copyright (C) 2008-2009 TU/e Technische Universiteit Eindhoven
10  *
11  * SOEM is free software; you can redistribute it and/or modify it under
12  * the terms of the GNU General Public License version 2 as published by the Free
13  * Software Foundation.
14  *
15  * SOEM is distributed in the hope that it will be useful, but WITHOUT ANY
16  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18  * for more details.
19  *
20  * As a special exception, if other files instantiate templates or use macros
21  * or inline functions from this file, or you compile this file and link it
22  * with other works to produce a work based on this file, this file does not
23  * by itself cause the resulting work to be covered by the GNU General Public
24  * License. However the source code for this file must still be made available
25  * in accordance with section (3) of the GNU General Public License.
26  *
27  * This exception does not invalidate any other reasons why a work based on
28  * this file might be covered by the GNU General Public License.
29  *
30  * The EtherCAT Technology, the trade name and logo “EtherCAT” are the intellectual
31  * property of, and protected by Beckhoff Automation GmbH. You can use SOEM for
32  * the sole purpose of creating, using and/or selling or otherwise distributing
33  * an EtherCAT network master provided that an EtherCAT Master License is obtained
34  * from Beckhoff Automation GmbH.
35  *
36  * In case you did not receive a copy of the EtherCAT Master License along with
37  * SOEM write to Beckhoff Automation GmbH, Eiserstraße 5, D-33415 Verl, Germany
38  * (www.beckhoff.com).
39  */
40 
46 #ifndef _nicdrvh_
47 #define _nicdrvh_
48 
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 #include <pthread.h>
55 
57 typedef struct
58 {
60  int *sock;
62  ec_bufT (*txbuf)[EC_MAXBUF];
64  int (*txbuflength)[EC_MAXBUF];
68  ec_bufT (*rxbuf)[EC_MAXBUF];
70  int (*rxbufstat)[EC_MAXBUF];
72  int (*rxsa)[EC_MAXBUF];
73 } ec_stackT;
74 
76 typedef struct
77 {
83  int rxbufstat[EC_MAXBUF];
85  int rxsa[EC_MAXBUF];
88 } ecx_redportt;
89 
91 typedef struct
92 {
98  int rxbufstat[EC_MAXBUF];
100  int rxsa[EC_MAXBUF];
108  int txbuflength[EC_MAXBUF];
114  int lastidx;
116  int redstate;
119  pthread_mutex_t getindex_mutex;
120  pthread_mutex_t tx_mutex;
121  pthread_mutex_t rx_mutex;
122 } ecx_portt;
123 
124 extern const uint16 priMAC[3];
125 extern const uint16 secMAC[3];
126 
127 #ifdef EC_VER1
128 extern ecx_portt ecx_port;
129 extern ecx_redportt ecx_redport;
130 
131 int ec_setupnic(const char * ifname, int secondary);
132 int ec_closenic(void);
133 void ec_setbufstat(int idx, int bufstat);
134 int ec_getindex(void);
135 int ec_outframe(int idx, int sock);
136 int ec_outframe_red(int idx);
137 int ec_waitinframe(int idx, int timeout);
138 int ec_srconfirm(int idx,int timeout);
139 #endif
140 
141 void ec_setupheader(void *p);
142 int ecx_setupnic(ecx_portt *port, const char * ifname, int secondary);
143 int ecx_closenic(ecx_portt *port);
144 void ecx_setbufstat(ecx_portt *port, int idx, int bufstat);
145 int ecx_getindex(ecx_portt *port);
146 int ecx_outframe(ecx_portt *port, int idx, int sock);
147 int ecx_outframe_red(ecx_portt *port, int idx);
148 int ecx_waitinframe(ecx_portt *port, int idx, int timeout);
149 int ecx_srconfirm(ecx_portt *port, int idx,int timeout);
150 
151 #ifdef __cplusplus
152 }
153 #endif
154 
155 #endif
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
Definition: linux/nicdrv.c:592
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
Definition: linux/nicdrv.c:278
#define EC_MAXBUF
Definition: ethercattype.h:88
ec_bufT txbuf2
Definition: linux/nicdrv.h:110
ec_bufT * tempbuf
Definition: linux/nicdrv.h:66
int txbuflength2
Definition: linux/nicdrv.h:112
uint16_t uint16
Definition: osal.h:34
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
Definition: linux/nicdrv.c:564
int ecx_closenic(ecx_portt *port)
Definition: linux/nicdrv.c:207
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
Definition: linux/nicdrv.c:116
ec_stackT stack
Definition: linux/nicdrv.h:93
int ecx_outframe_red(ecx_portt *port, int idx)
Definition: linux/nicdrv.c:316
pthread_mutex_t tx_mutex
Definition: linux/nicdrv.h:120
ec_stackT stack
Definition: linux/nicdrv.h:78
ec_bufT tempinbuf
Definition: linux/nicdrv.h:102
const uint16 secMAC[3]
Definition: linux/nicdrv.c:103
int tempinbufs
Definition: linux/nicdrv.h:104
ecx_redportt * redport
Definition: linux/nicdrv.h:118
int sockhandle
Definition: linux/nicdrv.h:94
int ecx_outframe(ecx_portt *port, int idx, int sock)
Definition: linux/nicdrv.c:291
pthread_mutex_t getindex_mutex
Definition: linux/nicdrv.h:119
uint8 ec_bufT[EC_BUFSIZE]
Definition: ethercattype.h:111
ec_bufT tempinbuf
Definition: linux/nicdrv.h:87
void ec_setupheader(void *p)
Definition: linux/nicdrv.c:222
const uint16 priMAC[3]
Definition: linux/nicdrv.c:101
int * sock
Definition: linux/nicdrv.h:60
pthread_mutex_t rx_mutex
Definition: linux/nicdrv.h:121
int ecx_getindex(ecx_portt *port)
Definition: linux/nicdrv.c:239


youbot_driver
Author(s): Jan Paulus
autogenerated on Mon Jun 10 2019 15:46:24