-const char trbnet_version[] = "$Revision: 2.91 $";
+const char trbnet_version[] = "$Revision: 2.92 $";
#include <stdlib.h>
#include <signal.h>
static int trb_init_transfer(uint8_t channel)
{
uint32_t tmp = 0;
-
+
if (channel >= 4) {
trb_errno = TRB_INVALID_CHANNEL;
return -1;
/* Check for TX not Busy */
read32_from_FPGA(CHANNEL_N_SENDER_STATUS | ((channel * 2 + 1) << 4), &tmp);
+ if (tmp != 0) {
+ /* FIFO_TOGGLE_BIT-BUG Workaround */
+ com_reset();
+ }
+ read32_from_FPGA(CHANNEL_N_SENDER_STATUS | ((channel * 2 + 1) << 4), &tmp);
if (tmp != 0) {
trb_errno = TRB_TX_BUSY;
return -1;
}
/* Check receiver FIFO empty*/
+ read32_from_FPGA(CHANNEL_N_RECEIVER_FIFO_STATUS | ((channel * 2 + 1) << 4),
+ &tmp);
+ if ((tmp & MASK_FIFO_EMPTY) == 0) {
+ /* FIFO_TOGGLE_BIT-BUG Workaround */
+ com_reset();
+ }
read32_from_FPGA(CHANNEL_N_RECEIVER_FIFO_STATUS | ((channel * 2 + 1) << 4),
&tmp);
if ((tmp & MASK_FIFO_EMPTY) == 0) {