65 #define RX_PRIM priMAC[1]
67 #define RX_SEC secMAC[1]
76 #define ECAT_PRINT_INFO printf
77 #define ECAT_PRINT_WARN printf
78 #define ECAT_PRINT_ERROR printf
96 int dontWaitForLink = 0;
98 HPE_CONFIG_OPTIONS conf = { 0, 0, NULL};
115 conf.option_flags |= OPT_PROMISC;
117 status = hpeConfigOptions(port->
handle, &conf,
sizeof(conf));
129 status = hpeGetMediaStatus(port->
handle, &mstat);
136 if (mstat.media_speed == SPEED_NONE)
141 }
while (mstat.media_speed == SPEED_NONE && t < (now+10));
145 mstat.media_speed, mstat.media_duplex);
150 status= hpeGetMacAddress(port->
handle, mac);
162 ECAT_PRINT_ERROR(
"hpeAllocateReceiveBufferSet failed with status %04x\n", status);
170 ECAT_PRINT_ERROR(
"hpeAttachReceiveBufferSet failed with status %04x\n", status);
189 port->
rx_region = CreateRtRegion (PRIORITY_QUEUING);
190 port->
tx_region = CreateRtRegion (PRIORITY_QUEUING);
206 port->
tx_buffers[i] = (HPETXBUFFERSET *)AllocateRtMemory(
sizeof(HPETXBUFFER) +
sizeof(HPETXBUFFERSET));
208 port->
tx_buffers[i]->buffers[0].fragment_count = 1;
212 port->
tx_buffers[i]->buffers[0].fragments[0].paddr = 0;
241 status= hpeClose(port->
handle);
335 stack = &(port->
stack);
343 port->
tx_buffers[idx]->buffers[0].fragments[0].size = lp;
348 result = hpeGetTransmitterState(port->
handle, &txstate) == E_OK && txstate == HPE_TXBUSY;
349 }
while (result && retries-- > 0);
357 log_RT_event(
'S',(WORD)2);
364 log_RT_event(
'S',(WORD)3);
367 status = hpeStartTransmitter(port->
handle);
375 log_RT_event(
'S',(WORD)4);
405 datagramP->index = idx;
437 stack = &(port->
stack);
444 log_RT_event(
'R',(WORD)2);
446 status = hpeGetReceiveBuffer(port->
handle, &rxbuffer);
449 memcpy(stack->
tempbuf,rxbuffer->ptr, rxbuffer->used);
450 bytesrx = rxbuffer->used;
454 log_RT_event(
'R',(WORD)3);
456 return (bytesrx > 0);
486 stack = &(port->
stack);
498 l = (*rxbuf)[0] + ((
uint16)((*
rxbuf)[1] & 0x0f) << 8);
500 rval = ((*rxbuf)[l] + ((
uint16)(*
rxbuf)[l + 1] << 8));
516 l =
etohs(ecp->elength) & 0x0fff;
524 rval = ((*rxbuf)[l] + ((
uint16)((*
rxbuf)[l + 1]) << 8));
611 if ( ((primrx == 0) && (secrx ==
RX_SEC)) ||
729 int ec_inframe(
int idx,
int stacknumber)