intime/nicdrv.c
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 
33 #include <ioctl.h>
34 #include <stdio.h>
35 #include <string.h>
36 #include <rt.h>
37 #include <traceapi.h>
38 #include "hpeif2.h"
39 
40 #include "ethercattype.h"
41 #include "nicdrv.h"
42 #include "oshw.h"
43 
45 enum
46 {
51 };
52 
53 
60 const uint16 priMAC[3] = { 0x0101, 0x0101, 0x0101 };
62 const uint16 secMAC[3] = { 0x0404, 0x0404, 0x0404 };
63 
65 #define RX_PRIM priMAC[1]
66 
67 #define RX_SEC secMAC[1]
68 
69 #ifdef EC_VER1
70 
73 
74 #endif
75 
76 #define ECAT_PRINT_INFO printf
77 #define ECAT_PRINT_WARN printf
78 #define ECAT_PRINT_ERROR printf
79 
80 /* HPE port settings */
81 const unsigned long interrupt_mode = NO_INTERRUPT;
82 const unsigned long phy_settings = SPEED_100 | DUPLEX_FULL;
83 
89 int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
90 {
91  HPESTATUS status;
92  HPEMEDIASTATUS mstat;
93  time_t now, t;
94  unsigned char mac[6];
95  int i;
96  int dontWaitForLink = 0;
97  int result = 1;
98  HPE_CONFIG_OPTIONS conf = { 0, 0, NULL};
99 
100  status = hpeOpen(ifname, phy_settings, interrupt_mode, &(port->handle));
101  if (status != E_OK)
102  {
103  ECAT_PRINT_ERROR("hpeOpen failed with status %04x ", status);
104  if(status == E_EXIST) ECAT_PRINT_ERROR("E_EXIST\n");
105  else if(status == E_STATE) ECAT_PRINT_ERROR("E_STATE\n");
106  else if(status == E_PARAM) ECAT_PRINT_ERROR("E_PARAM\n");
107  else if(status == E_INVALID_ADDR) ECAT_PRINT_ERROR("E_INVALID_ADDR\n");
108  else if(status == E_IO) ECAT_PRINT_ERROR("E_IO\n");
109  else if(status == E_TIME) ECAT_PRINT_ERROR("E_TIME\n");
110  else ECAT_PRINT_ERROR("UNKNOWN\n");
111  result = 0;
112  goto end;
113  }
114 
115  conf.option_flags |= OPT_PROMISC;
116 
117  status = hpeConfigOptions(port->handle, &conf, sizeof(conf));
118  if (status != E_OK)
119  {
120  ECAT_PRINT_ERROR("hpeConfigOptions failed with status %04x\n", status);
121  // NOTE: HPE driver for Intel 10/100 Mbps device currently doesn't support multicast.
122  result = 0;
123  goto end;
124  }
125 
126  time(&now);
127  do
128  {
129  status = hpeGetMediaStatus(port->handle, &mstat);
130  if (status != E_OK)
131  {
132  ECAT_PRINT_ERROR("hpeGetMediaStatus failed with status %04x\n", status);
133  result = 0;
134  goto end;
135  }
136  if (mstat.media_speed == SPEED_NONE)
137  {
138  RtSleepEx(1000);
139  time(&t);
140  }
141  } while (mstat.media_speed == SPEED_NONE && t < (now+10));
142 
143  if (((mstat.media_speed & phy_settings) == 0) || ((mstat.media_duplex & phy_settings) == 0)) {
144  ECAT_PRINT_ERROR("Media not connected as requested: speed=%u, duplex=%u\n",
145  mstat.media_speed, mstat.media_duplex);
146  result = 0;
147  goto end;
148  }
149 
150  status= hpeGetMacAddress(port->handle, mac);
151  if (status != E_OK)
152  {
153  ECAT_PRINT_ERROR("hpeGetMacAddress failed with status %04x\n", status);
154  result = 0;
155  goto end;
156  }
157 
158  /* allocate 2 receive buffers and attach them */
159  status = hpeAllocateReceiveBufferSet(port->handle, &(port->rx_buffers), EC_MAXBUF, EC_BUFSIZE);
160  if (status != E_OK)
161  {
162  ECAT_PRINT_ERROR("hpeAllocateReceiveBufferSet failed with status %04x\n", status);
163  result = 0;
164  goto end;
165  }
166 
167  status = hpeAttachReceiveBufferSet(port->handle, port->rx_buffers);
168  if (status != E_OK)
169  {
170  ECAT_PRINT_ERROR("hpeAttachReceiveBufferSet failed with status %04x\n", status);
171  result = 0;
172  goto end;
173  }
174 
175  if (secondary)
176  {
177  /* secondary port struct available? */
178  if (port->redport)
179  {
180  /* when using secondary socket it is automatically a redundant setup */
181  port->redstate = ECT_RED_DOUBLE;
182  }
183  }
184  else
185  {
186  port->redstate = ECT_RED_NONE;
187  /* Init regions */
188  port->getindex_region = CreateRtRegion (PRIORITY_QUEUING);
189  port->rx_region = CreateRtRegion (PRIORITY_QUEUING);
190  port->tx_region = CreateRtRegion (PRIORITY_QUEUING);
191  port->lastidx = 0;
192  port->stack.txbuf = &(port->txbuf);
193  port->stack.txbuflength = &(port->txbuflength);
194  port->stack.tempbuf = &(port->tempinbuf);
195  port->stack.rxbuf = &(port->rxbuf);
196  port->stack.rxbufstat = &(port->rxbufstat);
197  port->stack.rxsa = &(port->rxsa);
198  }
199 
200  /* setup ethernet headers in tx buffers so we don't have to repeat it */
201  for (i = 0; i < EC_MAXBUF; i++)
202  {
203  ec_setupheader(&(port->txbuf[i]));
204  port->rxbufstat[i] = EC_BUF_EMPTY;
205  // allocate 1 transmit buffer of two fragments and 500 bytes and attach it
206  port->tx_buffers[i] = (HPETXBUFFERSET *)AllocateRtMemory(sizeof(HPETXBUFFER) + sizeof(HPETXBUFFERSET));
207  port->tx_buffers[i]->buffer_count = 1;
208  port->tx_buffers[i]->buffers[0].fragment_count = 1;
209  // first fragment is the fixed header, second is dynamic data
210  port->tx_buffers[i]->buffers[0].fragments[0].ptr = port->txbuf[i];
211  port->tx_buffers[i]->buffers[0].fragments[0].size = EC_BUFSIZE;
212  port->tx_buffers[i]->buffers[0].fragments[0].paddr = 0;
213  }
214  ec_setupheader(&(port->txbuf2));
215 
216 end:
217  return result;
218 }
219 
224 {
225  HPESTATUS status;
226  int i;
227 
228  if (port->tx_buffers)
229  {
230  for (i = 0; i < EC_MAXBUF; i++)
231  {
232  FreeRtMemory(port->tx_buffers[i]);
233  port->tx_buffers[i] = NULL;
234  }
235  }
236  if (port->rx_buffers)
237  {
238  hpeFreeReceiveBufferSet(port->handle, &(port->rx_buffers));
239  }
240 
241  status= hpeClose(port->handle);
242  if (status != E_OK)
243  {
244  ECAT_PRINT_ERROR("hpeClose failed with status %04x\n", status);
245  }
246  return 0;
247 }
248 
254 void ec_setupheader(void *p)
255 {
256  ec_etherheadert *bp;
257  bp = (ec_etherheadert *)p;
258  bp->da0 = oshw_htons(0xffff);
259  bp->da1 = oshw_htons(0xffff);
260  bp->da2 = oshw_htons(0xffff);
261  bp->sa0 = oshw_htons(priMAC[0]);
262  bp->sa1 = oshw_htons(priMAC[1]);
263  bp->sa2 = oshw_htons(priMAC[2]);
264  bp->etype = oshw_htons(ETH_P_ECAT);
265 }
266 
271 {
272  uint8 idx;
273  int cnt;
274 
275  WaitForRtControl(port->getindex_region);
276 
277  idx = port->lastidx + 1;
278  /* index can't be larger than buffer array */
279  if (idx >= EC_MAXBUF)
280  {
281  idx = 0;
282  }
283  cnt = 0;
284  /* try to find unused index */
285  while ((port->rxbufstat[idx] != EC_BUF_EMPTY) && (cnt < EC_MAXBUF))
286  {
287  idx++;
288  cnt++;
289  if (idx >= EC_MAXBUF)
290  {
291  idx = 0;
292  }
293  }
294  port->rxbufstat[idx] = EC_BUF_ALLOC;
295  if ( port->redstate != ECT_RED_NONE)
296  {
297  port->redport->rxbufstat[idx] = EC_BUF_ALLOC;
298  }
299 
300  port->lastidx = idx;
301  ReleaseRtControl();
302 
303  return idx;
304 }
305 
310 void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
311 {
312  port->rxbufstat[idx] = bufstat;
313  if (port->redstate != ECT_RED_NONE)
314  {
315  port->redport->rxbufstat[idx] = bufstat;
316  }
317 }
318 
324 int ecx_outframe(ecx_portt *port, int idx, int stacknumber)
325 {
326  HPESTATUS status;
327  DWORD txstate;
328  int lp;
329  ec_stackT *stack;
330  int result = 0;
331  int retries = 1024;
332 
333  if (!stacknumber)
334  {
335  stack = &(port->stack);
336  }
337  else
338  {
339  stack = &(port->redport->stack);
340  }
341  lp = (*stack->txbuflength)[idx];
342  port->tx_buffers[idx]->buffer_count = 1;
343  port->tx_buffers[idx]->buffers[0].fragments[0].size = lp;
344 
345  // wait for transmit to complete
346  do
347  {
348  result = hpeGetTransmitterState(port->handle, &txstate) == E_OK && txstate == HPE_TXBUSY;
349  } while (result && retries-- > 0);
350 
351  if (result)
352  {
353  result = -1;
354  goto end;
355  }
356 
357  log_RT_event('S',(WORD)2);
358  status = hpeAttachTransmitBufferSet(port->handle, port->tx_buffers[idx]);
359  if (status != E_OK)
360  {
361  result = -2;
362  goto end;
363  }
364  log_RT_event('S',(WORD)3);
365 
366  (*stack->rxbufstat)[idx] = EC_BUF_TX;
367  status = hpeStartTransmitter(port->handle);
368  if (status != E_OK)
369  {
370  (*stack->rxbufstat)[idx] = EC_BUF_EMPTY;
371  result = -3;
372  goto end;
373  }
374 
375  log_RT_event('S',(WORD)4);
376  result = lp;
377 
378 end:
379 
380  return result;
381 }
382 
387 int ecx_outframe_red(ecx_portt *port, int idx)
388 {
389  HPESTATUS status;
390  ec_comt *datagramP;
391  ec_etherheadert *ehp;
392  int rval;
393 
394  ehp = (ec_etherheadert *)&(port->txbuf[idx]);
395  /* rewrite MAC source address 1 to primary */
396  ehp->sa1 = oshw_htons(priMAC[1]);
397  /* transmit over primary socket*/
398  rval = ecx_outframe(port, idx, 0);
399  if (port->redstate != ECT_RED_NONE)
400  {
401  ehp = (ec_etherheadert *)&(port->txbuf2);
402  /* use dummy frame for secondary socket transmit (BRD) */
403  datagramP = (ec_comt*)&(port->txbuf2)[ETH_HEADERSIZE];
404  /* write index to frame */
405  datagramP->index = idx;
406  /* rewrite MAC source address 1 to secondary */
407  ehp->sa1 = oshw_htons(secMAC[1]);
408  /* transmit over secondary socket */
409  //send(sockhandle2, &ec_txbuf2, ec_txbuflength2 , 0);
410  // OBS! redundant not ACTIVE for BFIN, just added to compile
411  //ASSERT (0);
412  hpeAttachTransmitBufferSet(port->redport->handle, port->tx_buffers[idx]);
413  port->redport->rxbufstat[idx] = EC_BUF_TX;
414  status = hpeStartTransmitter(port->redport->handle);
415  if (status != E_OK)
416  {
417  (*stack->rxbufstat)[idx] = EC_BUF_EMPTY;
418  }
419  }
420 
421  return rval;
422 }
423 
428 static int ecx_recvpkt(ecx_portt *port, int stacknumber)
429 {
430  HPEBUFFER *rxbuffer;
431  HPESTATUS status;
432  ec_stackT *stack;
433  int bytesrx = 0;
434 
435  if (!stacknumber)
436  {
437  stack = &(port->stack);
438  }
439  else
440  {
441  stack = &(port->redport->stack);
442  }
443 
444  log_RT_event('R',(WORD)2);
445 
446  status = hpeGetReceiveBuffer(port->handle, &rxbuffer);
447  if (status == E_OK)
448  {
449  memcpy(stack->tempbuf,rxbuffer->ptr, rxbuffer->used);
450  bytesrx = rxbuffer->used;
451  port->tempinbufs = bytesrx;
452  // TODO case no interrupt
453  }
454  log_RT_event('R',(WORD)3);
455 
456  return (bytesrx > 0);
457 }
458 
474 int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
475 {
476  uint16 l;
477  int rval;
478  uint8 idxf;
479  ec_etherheadert *ehp;
480  ec_comt *ecp;
481  ec_stackT *stack;
482  ec_bufT *rxbuf;
483 
484  if (!stacknumber)
485  {
486  stack = &(port->stack);
487  }
488  else
489  {
490  stack = &(port->redport->stack);
491  }
492 
493  rval = EC_NOFRAME;
494  rxbuf = &(*stack->rxbuf)[idx];
495  /* check if requested index is already in buffer ? */
496  if ((idx < EC_MAXBUF) && ( (*stack->rxbufstat)[idx] == EC_BUF_RCVD))
497  {
498  l = (*rxbuf)[0] + ((uint16)((*rxbuf)[1] & 0x0f) << 8);
499  /* return WKC */
500  rval = ((*rxbuf)[l] + ((uint16)(*rxbuf)[l + 1] << 8));
501  /* mark as completed */
502  (*stack->rxbufstat)[idx] = EC_BUF_COMPLETE;
503  }
504  else
505  {
506  WaitForRtControl(port->rx_region);
507  /* non blocking call to retrieve frame from socket */
508  if (ecx_recvpkt(port, stacknumber))
509  {
510  rval = EC_OTHERFRAME;
511  ehp = (ec_etherheadert*)(stack->tempbuf);
512  /* check if it is an EtherCAT frame */
513  if (ehp->etype == oshw_htons(ETH_P_ECAT))
514  {
515  ecp =(ec_comt*)(&(*stack->tempbuf)[ETH_HEADERSIZE]);
516  l = etohs(ecp->elength) & 0x0fff;
517  idxf = ecp->index;
518  /* found index equals requested index ? */
519  if (idxf == idx)
520  {
521  /* yes, put it in the buffer array (strip ethernet header) */
522  memcpy(rxbuf, &(*stack->tempbuf)[ETH_HEADERSIZE], (*stack->txbuflength)[idx] - ETH_HEADERSIZE);
523  /* return WKC */
524  rval = ((*rxbuf)[l] + ((uint16)((*rxbuf)[l + 1]) << 8));
525  /* mark as completed */
526  (*stack->rxbufstat)[idx] = EC_BUF_COMPLETE;
527  /* store MAC source word 1 for redundant routing info */
528  (*stack->rxsa)[idx] = oshw_ntohs(ehp->sa1);
529  }
530  else
531  {
532  /* check if index exist and someone is waiting for it */
533  if (idxf < EC_MAXBUF && (*stack->rxbufstat)[idxf] == EC_BUF_TX)
534  {
535  rxbuf = &(*stack->rxbuf)[idxf];
536  /* put it in the buffer array (strip ethernet header) */
537  memcpy(rxbuf, &(*stack->tempbuf)[ETH_HEADERSIZE], (*stack->txbuflength)[idxf] - ETH_HEADERSIZE);
538  /* mark as received */
539  (*stack->rxbufstat)[idxf] = EC_BUF_RCVD;
540  (*stack->rxsa)[idxf] = oshw_ntohs(ehp->sa1);
541  }
542  }
543  }
544  }
545  ReleaseRtControl();
546  }
547 
548  /* WKC if matching frame found */
549  return rval;
550 }
551 
563 static int ecx_waitinframe_red(ecx_portt *port, int idx, osal_timert *timer)
564 {
565  osal_timert timer2;
566  int wkc = EC_NOFRAME;
567  int wkc2 = EC_NOFRAME;
568  int primrx, secrx;
569 
570  /* if not in redundant mode then always assume secondary is OK */
571  if (port->redstate == ECT_RED_NONE)
572  {
573  wkc2 = 0;
574  }
575  do
576  {
577  /* only read frame if not already in */
578  if (wkc <= EC_NOFRAME)
579  wkc = ecx_inframe(port, idx, 0);
580  /* only try secondary if in redundant mode */
581  if (port->redstate != ECT_RED_NONE)
582  {
583  /* only read frame if not already in */
584  if (wkc2 <= EC_NOFRAME)
585  {
586  wkc2 = ecx_inframe(port, idx, 1);
587  }
588  }
589  /* wait for both frames to arrive or timeout */
590  } while (((wkc <= EC_NOFRAME) || (wkc2 <= EC_NOFRAME)) && !osal_timer_is_expired(timer));
591  /* only do redundant functions when in redundant mode */
592  if (port->redstate != ECT_RED_NONE)
593  {
594  /* primrx if the received MAC source on primary socket */
595  primrx = 0;
596  if (wkc > EC_NOFRAME) primrx = port->rxsa[idx];
597  /* secrx if the received MAC source on psecondary socket */
598  secrx = 0;
599  if (wkc2 > EC_NOFRAME) secrx = port->redport->rxsa[idx];
600 
601  /* primary socket got secondary frame and secondary socket got primary frame */
602  /* normal situation in redundant mode */
603  if ( ((primrx == RX_SEC) && (secrx == RX_PRIM)) )
604  {
605  /* copy secondary buffer to primary */
606  memcpy(&(port->rxbuf[idx]), &(port->redport->rxbuf[idx]), port->txbuflength[idx] - ETH_HEADERSIZE);
607  wkc = wkc2;
608  }
609  /* primary socket got nothing or primary frame, and secondary socket got secondary frame */
610  /* we need to resend TX packet */
611  if ( ((primrx == 0) && (secrx == RX_SEC)) ||
612  ((primrx == RX_PRIM) && (secrx == RX_SEC)) )
613  {
614  /* If both primary and secondary have partial connection retransmit the primary received
615  * frame over the secondary socket. The result from the secondary received frame is a combined
616  * frame that traversed all slaves in standard order. */
617  if ( (primrx == RX_PRIM) && (secrx == RX_SEC) )
618  {
619  /* copy primary rx to tx buffer */
620  memcpy(&(port->txbuf[idx][ETH_HEADERSIZE]), &(port->rxbuf[idx]), port->txbuflength[idx] - ETH_HEADERSIZE);
621  }
622  osal_timer_start (&timer2, EC_TIMEOUTRET);
623  /* resend secondary tx */
624  ecx_outframe(port,idx,1);
625  do
626  {
627  /* retrieve frame */
628  wkc2 = ecx_inframe(port, idx, 1);
629  } while ((wkc2 <= EC_NOFRAME) && !osal_timer_is_expired(&timer2));
630  if (wkc2 > EC_NOFRAME)
631  {
632  /* copy secondary result to primary rx buffer */
633  memcpy(&(port->rxbuf[idx]), &(port->redport->rxbuf[idx]), port->txbuflength[idx] - ETH_HEADERSIZE);
634  wkc = wkc2;
635  }
636  }
637  }
638 
639  /* return WKC or EC_NOFRAME */
640  return wkc;
641 }
642 
649 int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
650 {
651  int wkc;
652  osal_timert timer;
653 
654  if (timeout == 0 && (port->redstate == ECT_RED_NONE))
655  {
656  int loop_cnt = 0;
657  /* Allow us to consume MAX buffer number of frames */
658  do
659  {
660  wkc = ecx_inframe(port, idx, 0);
661  loop_cnt++;
662  } while (wkc <= EC_NOFRAME && (loop_cnt <= EC_MAXBUF));
663  }
664  else
665  {
666  osal_timer_start (&timer, timeout);
667  wkc = ecx_waitinframe_red(port, idx, &timer);
668  }
669 
670  return wkc;
671 }
672 
684 int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
685 {
686  int wkc = EC_NOFRAME;
687  osal_timert timer1;
688 
689  osal_timer_start (&timer1, timeout);
690  /* tx frame on primary and if in redundant mode a dummy on secondary */
691  ecx_outframe_red(port, idx);
692  wkc = ecx_waitinframe_red(port, idx, &timer1);
693 
694  return wkc;
695 }
696 
697 #ifdef EC_VER1
698 
699 int ec_setupnic(const char *ifname, int secondary)
700 {
701  return ecx_setupnic(&ecx_port, ifname, secondary);
702 }
703 
704 int ec_closenic(void)
705 {
706  return ecx_closenic(&ecx_port);
707 }
708 
709 int ec_getindex(void)
710 {
711  return ecx_getindex(&ecx_port);
712 }
713 
714 void ec_setbufstat(int idx, int bufstat)
715 {
716  ecx_setbufstat(&ecx_port, idx, bufstat);
717 }
718 
719 int ec_outframe(int idx, int stacknumber)
720 {
721  return ecx_outframe(&ecx_port, idx, stacknumber);
722 }
723 
724 int ec_outframe_red(int idx)
725 {
726  return ecx_outframe_red(&ecx_port, idx);
727 }
728 
729 int ec_inframe(int idx, int stacknumber)
730 {
731  return ecx_inframe(&ecx_port, idx, stacknumber);
732 }
733 
734 int ec_waitinframe(int idx, int timeout)
735 {
736  return ecx_waitinframe(&ecx_port, idx, timeout);
737 }
738 
739 int ec_srconfirm(int idx, int timeout)
740 {
741  return ecx_srconfirm(&ecx_port, idx, timeout);
742 }
743 
744 #endif
ecx_portt::tx_region
RTHANDLE tx_region
Definition: intime/nicdrv.h:83
ec_bufT
uint8 ec_bufT[EC_BUFSIZE]
Definition: ethercattype.h:87
ecx_redportt::rxbuf
ec_bufT rxbuf[EC_MAXBUF]
Definition: erika/nicdrv.h:43
interrupt_mode
const unsigned long interrupt_mode
Definition: intime/nicdrv.c:81
wkc
int wkc
Definition: aliastool.c:47
ecx_redportt::handle
HPEHANDLE handle
Definition: intime/nicdrv.h:50
ecx_portt::rxsa
int rxsa[EC_MAXBUF]
Definition: erika/nicdrv.h:62
ec_waitinframe
int ec_waitinframe(int idx, int timeout)
rxbuf
uint8 rxbuf[1024]
Definition: eoe_test.c:50
ECAT_PRINT_ERROR
#define ECAT_PRINT_ERROR
Definition: intime/nicdrv.c:78
etohs
#define etohs(A)
Definition: ethercattype.h:536
ECT_RED_DOUBLE
@ ECT_RED_DOUBLE
Definition: intime/nicdrv.c:50
ecx_portt::txbuf
ec_bufT txbuf[EC_MAXBUF]
Definition: erika/nicdrv.h:68
ec_closenic
int ec_closenic(void)
ecx_setbufstat
void ecx_setbufstat(ecx_portt *port, int idx, int bufstat)
Definition: intime/nicdrv.c:310
ec_setupnic
int ec_setupnic(const char *ifname, int secondary)
ecx_outframe
int ecx_outframe(ecx_portt *port, int idx, int stacknumber)
Definition: intime/nicdrv.c:324
ecx_port
Definition: vxworks/nicdrv.h:67
EC_NOFRAME
#define EC_NOFRAME
Definition: ethercattype.h:41
ecx_portt::txbuflength
int txbuflength[EC_MAXBUF]
Definition: erika/nicdrv.h:70
ec_setbufstat
void ec_setbufstat(int idx, int bufstat)
EC_MAXBUF
#define EC_MAXBUF
Definition: ethercattype.h:62
priMAC
const uint16 priMAC[3]
Definition: intime/nicdrv.c:60
ec_stackT::tempbuf
ec_bufT * tempbuf
Definition: erika/nicdrv.h:28
osal_timer_is_expired
boolean osal_timer_is_expired(osal_timert *self)
Definition: erika/osal.c:74
EC_BUFSIZE
#define EC_BUFSIZE
Definition: ethercattype.h:58
ec_outframe
int ec_outframe(int idx, int sock)
oshw_htons
uint16 oshw_htons(uint16 host)
Definition: erika/oshw.c:31
ecx_getindex
int ecx_getindex(ecx_portt *port)
Definition: intime/nicdrv.c:270
EC_BUF_TX
@ EC_BUF_TX
Definition: ethercattype.h:182
ec_stackT::rxsa
int(* rxsa)[EC_MAXBUF]
Definition: erika/nicdrv.h:34
nicdrv.h
Headerfile for nicdrv.c.
ec_srconfirm
int ec_srconfirm(int idx, int timeout)
EC_BUF_COMPLETE
@ EC_BUF_COMPLETE
Definition: ethercattype.h:186
ecx_redportt::rxbufstat
int rxbufstat[EC_MAXBUF]
Definition: erika/nicdrv.h:45
ecx_portt::rx_buffers
HPERXBUFFERSET * rx_buffers
Definition: intime/nicdrv.h:87
secMAC
const uint16 secMAC[3]
Definition: intime/nicdrv.c:62
oshw.h
Headerfile for oshw.c.
ec_outframe_red
int ec_outframe_red(int idx)
uint8
uint8_t uint8
Definition: osal.h:28
ecx_portt::txbuf2
ec_bufT txbuf2
Definition: erika/nicdrv.h:72
ecx_portt::tx_buffers
HPETXBUFFERSET * tx_buffers[EC_MAXBUF]
Definition: intime/nicdrv.h:88
ETH_P_ECAT
#define ETH_P_ECAT
Definition: ethercattype.h:459
ecx_closenic
int ecx_closenic(ecx_portt *port)
Definition: intime/nicdrv.c:223
ec_comt
PACKED_BEGIN struct PACKED ec_comt
ecx_port
ecx_portt ecx_port
Definition: ethercatmain.c:97
ecx_portt::rxbuf
ec_bufT rxbuf[EC_MAXBUF]
Definition: erika/nicdrv.h:58
ecx_portt::getindex_region
RTHANDLE getindex_region
Definition: intime/nicdrv.h:82
ec_getindex
int ec_getindex(void)
ec_stackT::txbuflength
int(* txbuflength)[EC_MAXBUF]
Definition: erika/nicdrv.h:26
ec_stackT::rxbuf
ec_bufT(* rxbuf)[EC_MAXBUF]
Definition: erika/nicdrv.h:30
EC_TIMEOUTRET
#define EC_TIMEOUTRET
Definition: ethercattype.h:64
ecx_recvpkt
static int ecx_recvpkt(ecx_portt *port, int stacknumber)
Definition: intime/nicdrv.c:428
ecx_portt::handle
HPEHANDLE handle
Definition: intime/nicdrv.h:86
osal_timer
Definition: osal.h:42
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
ecx_srconfirm
int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
Definition: intime/nicdrv.c:684
ecx_inframe
int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
Definition: intime/nicdrv.c:474
uint16
uint16_t uint16
Definition: osal.h:29
ecx_waitinframe_red
static int ecx_waitinframe_red(ecx_portt *port, int idx, osal_timert *timer)
Definition: intime/nicdrv.c:563
osal_timer_start
void osal_timer_start(osal_timert *self, uint32 timeout_usec)
Definition: erika/osal.c:59
EC_BUF_ALLOC
@ EC_BUF_ALLOC
Definition: ethercattype.h:180
RX_SEC
#define RX_SEC
Definition: intime/nicdrv.c:67
ecx_portt::rx_region
RTHANDLE rx_region
Definition: intime/nicdrv.h:84
oshw_ntohs
uint16 oshw_ntohs(uint16 network)
Definition: erika/oshw.c:43
ecx_portt::rxbufstat
int rxbufstat[EC_MAXBUF]
Definition: erika/nicdrv.h:60
ecx_portt::redport
ecx_redportt * redport
Definition: erika/nicdrv.h:80
ecx_portt::tempinbufs
int tempinbufs
Definition: erika/nicdrv.h:66
EC_BUF_RCVD
@ EC_BUF_RCVD
Definition: ethercattype.h:184
ec_stackT::txbuf
ec_bufT(* txbuf)[EC_MAXBUF]
Definition: erika/nicdrv.h:24
ecx_setupnic
int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
Definition: intime/nicdrv.c:89
ecx_portt
Definition: erika/nicdrv.h:53
ecx_waitinframe
int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
Definition: intime/nicdrv.c:649
ECT_RED_NONE
@ ECT_RED_NONE
Definition: intime/nicdrv.c:48
ec_etherheadert
PACKED_BEGIN struct PACKED ec_etherheadert
ec_setupheader
void ec_setupheader(void *p)
Definition: intime/nicdrv.c:254
ecx_redport
ecx_redportt ecx_redport
Definition: ethercatmain.c:98
phy_settings
const unsigned long phy_settings
Definition: intime/nicdrv.c:82
ecx_portt::redstate
int redstate
Definition: erika/nicdrv.h:78
ethercattype.h
General typedefs and defines for EtherCAT.
ec_stackT::rxbufstat
int(* rxbufstat)[EC_MAXBUF]
Definition: erika/nicdrv.h:32
EC_OTHERFRAME
#define EC_OTHERFRAME
Definition: ethercattype.h:43
RX_PRIM
#define RX_PRIM
Definition: intime/nicdrv.c:65
EC_BUF_EMPTY
@ EC_BUF_EMPTY
Definition: ethercattype.h:178
ETH_HEADERSIZE
#define ETH_HEADERSIZE
Definition: ethercattype.h:103
ecx_portt::lastidx
int lastidx
Definition: erika/nicdrv.h:76
ecx_outframe_red
int ecx_outframe_red(ecx_portt *port, int idx)
Definition: intime/nicdrv.c:387
ecx_redportt
Definition: erika/nicdrv.h:38
ecx_redportt::rxsa
int rxsa[EC_MAXBUF]
Definition: erika/nicdrv.h:47


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