Skip to content

Commit

Permalink
Add condition that frame must med _TX to be marked as RCVD
Browse files Browse the repository at this point in the history
  • Loading branch information
nakarlsson committed May 14, 2016
1 parent eee5596 commit 4dd1401
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
8 changes: 2 additions & 6 deletions oshw/intime/nicdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,7 @@ int ecx_setupnic(ecx_portt *port, const char *ifname, int secondary)
if (status != E_OK)
{
ECAT_PRINT_ERROR("hpeOpen failed with status %04x ", status);
if(status == E_EXIST) ECAT_PRINT_ERROR("E_EXIST\n");
else if(status == E_STATE) ECAT_PRINT_ERROR("E_STATE\n");
else if(status == E_PARAM) ECAT_PRINT_ERROR("E_PARAM\n");
else if(status == E_INVALID_ADDR) ECAT_PRINT_ERROR("E_INVALID_ADDR\n");
else if(status == E_IO) ECAT_PRINT_ERROR("E_IO\n");
else if(status == E_TIME) ECAT_PRINT_ERROR("E_TIME\n");
else ECAT_PRINT_ERROR("UNKNOWN\n");
result = 0;
goto end;
}
Expand Down Expand Up @@ -534,6 +528,7 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
}
else
{
WaitForRtControl(port->rx_region);
/* non blocking call to retrieve frame from socket */
if (ecx_recvpkt(port, stacknumber))
{
Expand Down Expand Up @@ -572,6 +567,7 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
}
}
}
ReleaseRtControl();
}

/* WKC if mathing frame found */
Expand Down
4 changes: 2 additions & 2 deletions oshw/linux/nicdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
}
else
{
/* check if index exist? */
if (idxf < EC_MAXBUF)
/* check if index exist and someone is waiting for it */
if (idxf < EC_MAXBUF && (*stack->rxbufstat)[idxf] == EC_BUF_TX)
{
rxbuf = &(*stack->rxbuf)[idxf];
/* put it in the buffer array (strip ethernet header) */
Expand Down
4 changes: 2 additions & 2 deletions oshw/rtk/nicdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
}
else
{
/* check if index exist? */
if (idxf < EC_MAXBUF)
/* check if index exist and someone is waiting for it */
if (idxf < EC_MAXBUF && (*stack->rxbufstat)[idxf] == EC_BUF_TX)
{
rxbuf = &(*stack->rxbuf)[idxf];
/* put it in the buffer array (strip ethernet header) */
Expand Down
9 changes: 2 additions & 7 deletions oshw/win32/nicdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ int ecx_inframe(ecx_portt *port, int idx, int stacknumber)
}
else
{
/* check if index exist? */
if (idxf < EC_MAXBUF)
/* check if index exist and someone is waiting for it */
if (idxf < EC_MAXBUF && (*stack->rxbufstat)[idxf] == EC_BUF_TX)
{
rxbuf = &(*stack->rxbuf)[idxf];
/* put it in the buffer array (strip ethernet header) */
Expand Down Expand Up @@ -584,11 +584,6 @@ int ecx_waitinframe(ecx_portt *port, int idx, int timeout)

osal_timer_start (&timer, timeout);
wkc = ecx_waitinframe_red(port, idx, &timer);
/* if nothing received, clear buffer index status so it can be used again */
if (wkc <= EC_NOFRAME)
{
ec_setbufstat(idx, EC_BUF_EMPTY);
}

return wkc;
}
Expand Down

0 comments on commit 4dd1401

Please sign in to comment.