Updates for pull request comments

This commit is contained in:
Tony Kuker 2021-05-23 14:44:47 -05:00
parent 4a72d2ecea
commit fa80c7fb9a
3 changed files with 8 additions and 1 deletions

View File

@ -221,7 +221,7 @@ int FASTCALL SCSIDaynaPort::Read(const DWORD *cdb, BYTE *buf, DWORD block)
// Some of the packets we receive will not be for us. So, we'll keep pulling messages
// until the buffer is empty, or we've read X times. (X is just a made up number)
while(read_count < 50)
while(read_count < MAX_READ_RETRIES)
{
read_count++;

View File

@ -78,6 +78,12 @@ public:
static const BYTE CMD_SCSILINK_SETMODE = 0x80;
static const BYTE CMD_SCSILINK_SETMAC = 0x40;
// When we're reading the Linux tap device, most of the messages will not be for us, so we
// need to filter through those. However, we don't want to keep re-reading the packets
// indefinitely. So, we'll pick a large-ish number that will cause the emulated DaynaPort
// to respond with "no data" after MAX_READ_RETRIES tries.
static const int MAX_READ_RETRIES = 50;
// The READ response has a header which consists of:
// 2 bytes - payload size
// 4 bytes - status flags

View File

@ -1164,6 +1164,7 @@ int FASTCALL GPIOBUS::SendHandShake(BYTE *buf, int count, int delay_after_bytes)
for (i = 0; i < count; i++) {
if(i==delay_after_bytes){
LOGTRACE("%s DELAYING for %dus after %d bytes", __PRETTY_FUNCTION__, SCSI_DELAY_SEND_DATA_DAYNAPORT_US, (int)delay_after_bytes);
SysTimer::SleepUsec(SCSI_DELAY_SEND_DATA_DAYNAPORT_US);
}