Merge pull request #1 from hefloryd/macosx

PR fixes
pull/286/head
Marc Butler 2019-05-11 12:52:50 +10:00 committed by GitHub
commit a416222b33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 18 deletions

View File

@ -46,7 +46,7 @@ enum
{
/** No redundancy, single NIC mode */
ECT_RED_NONE,
/** Double redundant NIC connecetion */
/** Double redundant NIC connection */
ECT_RED_DOUBLE
};
@ -55,7 +55,7 @@ enum
* EtherCAT does not care about MAC addressing, but it is used here to
* differentiate the route the packet traverses through the EtherCAT
* segment. This is needed to fund out the packet flow in redundant
* confihurations. */
* configurations. */
const uint16 priMAC[3] = { 0x0101, 0x0101, 0x0101 };
/** Secondary source MAC address used for EtherCAT. */
const uint16 secMAC[3] = { 0x0404, 0x0404, 0x0404 };
@ -358,7 +358,7 @@ static int ecx_recvpkt(ecx_portt *port, int stacknumber)
/** Non blocking receive frame function. Uses RX buffer and index to combine
* read frame with transmitted frame. To compensate for received frames that
* are out-of-order all frames are stored in their respective indexed buffer.
* If a frame was placed in the buffer previously, the function retreives it
* If a frame was placed in the buffer previously, the function retrieves it
* from that buffer index without calling ec_recvpkt. If the requested index
* is not already in the buffer it calls ec_recvpkt to fetch it. There are
* three options now, 1 no frame read, so exit. 2 frame read but other
@ -414,7 +414,7 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
ecp =(ec_comt*)(&(*stack->tempbuf)[ETH_HEADERSIZE]);
l = etohs(ecp->elength) & 0x0fff;
idxf = ecp->index;
/* found index equals reqested index ? */
/* found index equals requested index ? */
if (idxf == idx)
{
/* yes, put it in the buffer array (strip ethernet header) */
@ -441,7 +441,7 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
else
{
assert(0);
/* strange things happend */
/* strange things happened */
}
}
}
@ -450,7 +450,7 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
}
/* WKC if mathing frame found */
/* WKC if matching frame found */
return rval;
}
@ -493,10 +493,10 @@ static int ecx_waitinframe_red(ecx_portt *port, int idx, osal_timert *timer)
/* only do redundant functions when in redundant mode */
if (port->redstate != ECT_RED_NONE)
{
/* primrx if the reveived MAC source on primary socket */
/* primrx if the received MAC source on primary socket */
primrx = 0;
if (wkc > EC_NOFRAME) primrx = port->rxsa[idx];
/* secrx if the reveived MAC source on psecondary socket */
/* secrx if the received MAC source on psecondary socket */
secrx = 0;
if (wkc2 > EC_NOFRAME) secrx = port->redport->rxsa[idx];
@ -560,7 +560,7 @@ int ecx_waitinframe(ecx_portt *port, int idx, int timeout)
return wkc;
}
/** Blocking send and recieve frame function. Used for non processdata frames.
/** Blocking send and receive frame function. Used for non processdata frames.
* A datagram is build into a frame and transmitted via this function. It waits
* for an answer and returns the workcounter. The function retries if time is
* left and the result is WKC=0 or no frame received.
@ -588,18 +588,13 @@ int ecx_srconfirm(ecx_portt *port, int idx, int timeout)
}
else
{
/* normally use partial timout for rx */
/* normally use partial timeout for rx */
osal_timer_start (&timer2, EC_TIMEOUTRET);
}
/* get frame from primary or if in redundant mode possibly from secondary */
wkc = ecx_waitinframe_red(port, idx, &timer2);
/* wait for answer with WKC>=0 or otherwise retry until timeout */
} while ((wkc <= EC_NOFRAME) && !osal_timer_is_expired (&timer1));
/* if nothing received, clear buffer index status so it can be used again */
if (wkc <= EC_NOFRAME)
{
ecx_setbufstat(port, idx, EC_BUF_EMPTY);
}
return wkc;
}

View File

@ -50,7 +50,7 @@ ec_adaptert * oshw_find_adapters(void)
/* Iterate all devices and create a local copy holding the name and
* decsription.
* description.
*/
ids = if_nameindex ();
@ -70,7 +70,7 @@ ec_adaptert * oshw_find_adapters(void)
ret_adapter = adapter;
}
/* fetch description and name, in linux we use the same on both */
/* fetch description and name, in Linux we use the same on both */
adapter->next = NULL;
if (ids[i].if_name)
@ -106,7 +106,7 @@ ec_adaptert * oshw_find_adapters(void)
void oshw_free_adapters(ec_adaptert * adapter)
{
ec_adaptert * next_adapter;
/* Iterate the linked list and free all elemnts holding
/* Iterate the linked list and free all elements holding
* adapter information
*/
if(adapter)