#endif
-const char trbnet_version[] = "$Revision: 4.8 $";
+const char trbnet_version[] = "$Revision: 4.9 $";
#include <stdlib.h>
#include <signal.h>
#ifdef PEXOR
if (dataBufferSize == 0) {
trb_errno = TRB_PEXOR_DMA_ERROR;
+ fprintf(stderr, "DMA: err 0\n");
return -1;
}
if (read(pexorFileHandle,
(void*)dataBuffer, dataBufferSize * 4) != dataBufferSize * 4) {
trb_errno = TRB_PEXOR_DMA_ERROR;
+ fprintf(stderr, "DMA: err 1\n");
return -1;
}
#else
#ifdef PEXOR
if (tmp - dataBuffer >= dataBufferSize) {
trb_errno = TRB_PEXOR_DMA_ERROR;
+ fprintf(stderr, "DMA: err 2\n");
return -1;
}
tmp++;
write32_to_FPGA(CHANNEL_3_SENDER_CONTROL, CMD_REGISTER_WRITE_MEM);
#else
/* Send command to pexor driver */
+ if (write(pexorFileHandle,
+ (void*)(data + ctr), len * 4) != len * 4) {
+ trb_errno = TRB_PEXOR_DEVICE_ERROR;
+ unlockPorts(0);
+ trb_errno = TRB_PEXOR_DEVICE_ERROR;
+ return -1;
+ }
+
pexorDescriptor.trb_address = trb_address;
if (option == 0) {
pexorDescriptor.reg_address = reg_address + ctr;
pexorDescriptor.reg_address = reg_address;
}
pexorDescriptor.arg0 = config;
- pexorDescriptor.arg1 = (unsigned long)(data + ctr);
- pexorDescriptor.arg2 = len;
+ pexorDescriptor.arg1 = len;
pexorDescriptor.command = PEXOR_TRBNETCOM_REG_WRITE_MEM;
pexorDescriptor.dma = pexor_dma;
int status = 0;
trb_errno = TRB_NONE;
-
- if (lockPorts(0) == -1) return -1;
-
#ifndef PEXOR
reg_address &= 0xffff;
#endif
+ if (lockPorts(0) == -1) return -1;
+
/* DEBUG INFO */
if (trb_debug > 0) {
fprintf(stderr, "fpga_register_read started.\n");
int status = 0;
trb_errno = TRB_NONE;
-
- if (lockPorts(0) == -1) return -1;
-
#ifndef PEXOR
reg_address &= 0xffff;
#endif
+ if (lockPorts(0) == -1) return -1;
+
/* DEBUG INFO */
if (trb_debug > 0) {
fprintf(stderr, "fpga_register_write started.\n");