Limit max transfer length to 64K, fix issues with transfer lengths being incorrectly modified
Detail: s/ScsiFs00, s/ScsiFs15 - As a workaround for numerous USB devices that fail when asked to transfer large amounts of data, SCSIFS now limits the maximum transfer length to 64K. This length seems to match the limit used by most operating systems. If necessary this code can be turned off via the XferLenMax64K switch. Additionally, a couple of bugs with the CheckXferLen and UseSpecialScatterBlk code have been fixed: - When CheckXferLen (and XferLenMax64K) limit the block count in the CDB, the code now calculates a new value of R4 to send to the SCSI driver instead of using the original. This ensures there's no ambiguity in the transfer length. - After the SCSI op is completed, the returned value of R4 is then adjusted to represent the real amount of untransferred data from FileCore's perspective. - When the special scatter block is in use, the code now returns to FileCore with R3 pointing to the correct location in the source buffer, and with R4 adjusted to take into account the extra padding that had been inserted. Previously the old code would have returned with R3 and R4 left unmodified (i.e. R3 would have been pointing at SCSIFS's temp scatter list) Admin: Tested in ROM on a rev C2 beagleboard over the course of a few hours with the help of an automated test script. No more 'no sense' errors when attempting large block transfers to USB devices, and no sign of data corruption for large or small transfers. See the forums for more discussion of these issues: http://www.riscosopen.org/forum/forums/4/topics/470 Version 1.18. Tagged as 'SCSIFS-1_18'
Showing with 68 additions and 30 deletions