default:
pexor_msg(KERN_ERR "ERROR> invalid request %x\n", command);
- status = -EFAULT;
+ status = -EINVAL;
goto OUT_IOCTL;
};
(unsigned int)dmastat);
/* reset DMA */
iowrite32(PEXOR_TRB_DMA_RESET, priv->pexor.dma_control_stat);
+ ndelay(1000);
/* do we need to flush the fifo-buffer, no libtrbnet takes care */
- status = -130;
+ status = -201;
goto OUT_IOCTL;
}
}
(unsigned int)dmastat);
/* reset DMA */
iowrite32(PEXOR_TRB_DMA_RESET, priv->pexor.dma_control_stat);
+ ndelay(1000);
/* do we need to flush the fifo-buffer, no libtrbnet takes care */
- status = -131;
+ status = -202;
goto OUT_IOCTL;
}
/* No, end DMA */
break;
}
- if ((sg_ctr + 1) >= priv->dma.nr_sglist) {
+ // if ((sg_ctr + 1) >= priv->dma.nr_sglist) {
+ if ((sg_ctr + 1) >= 2) {
pexor_msg(KERN_ERR
"ERROR> no more DMA buffers available, aborting DMA\n");
/* reset DMA */
iowrite32(PEXOR_TRB_DMA_RESET, priv->pexor.dma_control_stat);
+ ndelay(1000);
/* do we need to flush the fifo-buffer, no libtrbnet takes care */
- status = -132;
+ status = -203;
goto OUT_IOCTL;
}
}
if ((dmaSize % 5) != 0) {
pexor_msg(KERN_ERR
"ERROR> Invalid DMA Size %d\n", dmaSize);
- status = -133;
+ status = -204;
goto OUT_IOCTL;
}
pexor_msg(KERN_ERR
"ERROR> Lost DMA Credentials: 0x%08x != 0x%08x Command: %d\n",
cred1, cred2, command);
- status = -EFAULT;
+ status = -205;
goto OUT_IOCTL;
}
status = pexor_copy_fifo_to_dma(priv, channel);
pexor_dbg(KERN_ERR "FIFO copy to DMA buffer returned Size: %d\n", status);
if (status == -1) {
- status = -EFAULT;
+ status = -206;
goto OUT_IOCTL;
}
}
-
+
OUT_IOCTL:
spin_unlock((&(priv->dma_lock)));
return status;