if(LinkStatus == 0) // link down;
{
goto bye;
}
xSemaphoreTake(Xmit_GateSemaphore, portMAX_DELAY); // only let one in
XmitRingDescr[0].Status |= ETX_R;
B = pxNetworkBuffer->pucEthernetBuffer;
B -= 2;
B = (byte*)FlipEndianDW((dword)(B));
XmitRingDescr[0].BuffPtr = B;
XmitRingDescr[0].EnhancedStatus1 = E1TX_PINS | E1TX_IINS | E1TX_INT; // set PINS and IINS --- insert Protocol and IP checksum
XmitRingDescr[0].DataLength = FlipEndianW(pxNetworkBuffer->xDataLength + 2); // need to include the 2 extra byte for alignment
ENET_TDAR = ENET_TDAR_TDAR_MASK; // tell mac one ring full - xmit it
r = xSemaphoreTake(Xmit_ReleaseSemaphore, 5); // we can't let go unto buff can be released or TCP port issues
xSemaphoreGive(Xmit_GateSemaphore);
bye:vReleaseNetworkBufferAndDescriptor( pxNetworkBuffer );
return pdTRUE;
}
The XmitReleaseSemaphore is used in the XMITISR
~~~
Since I’m using BufferAllocation_1, I look at all the networkbuffer to see if any over-run occurred but found none.
I find it interesting that the corrupt values are multiple 0xa5.
Not sure how to debug this. If you have any suggestion please let me know.
Thanks.
Joe