Updates for pull request comments

This commit is contained in:
Tony Kuker 2021-05-23 14:44:34 -05:00
parent 3c5d68a1f4
commit 4a72d2ecea
5 changed files with 19 additions and 13 deletions

View File

@ -46,15 +46,15 @@ SASIDEV::SASIDEV(Device *dev)
// Work initialization
ctrl.phase = BUS::busfree;
ctrl.m_scsi_id = -1;
ctrl.m_scsi_id = UNKNOWN_SCSI_ID;
ctrl.bus = NULL;
memset(ctrl.cmd, 0x00, sizeof(ctrl.cmd));
ctrl.status = 0x00;
ctrl.message = 0x00;
#ifdef RASCSI
ctrl.execstart = 0;
#endif // RASCSI
ctrl.bufsize = std::max(0x800, ETH_FRAME_LEN + 16 + ETH_FCS_LEN);
// The initial buffer size will default to either the default buffer size OR
// the size of an Ethernet message, whichever is larger.
ctrl.bufsize = std::max(DEFAULT_BUFFER_SIZE, ETH_FRAME_LEN + 16 + ETH_FCS_LEN);
ctrl.buffer = (BYTE *)malloc(ctrl.bufsize);
memset(ctrl.buffer, 0x00, ctrl.bufsize);
ctrl.blocks = 0;
@ -1161,7 +1161,6 @@ void FASTCALL SASIDEV::CmdRead6()
DataIn();
}
//---------------------------------------------------------------------------
//
// This Send Message command is used by the DaynaPort SCSI/Link
@ -1189,9 +1188,9 @@ void FASTCALL SASIDEV::DaynaPortWrite()
}
// Reallocate buffer (because it is not transfer for each block)
if (ctrl.bufsize < 0x1000000) {
if (ctrl.bufsize < DAYNAPORT_BUFFER_SIZE) {
free(ctrl.buffer);
ctrl.bufsize = 0x1000000;
ctrl.bufsize = DAYNAPORT_BUFFER_SIZE;
ctrl.buffer = (BYTE *)malloc(ctrl.bufsize);
}

View File

@ -35,6 +35,10 @@ public:
UnitMax = 8 // Maximum number of logical units
};
const int UNKNOWN_SCSI_ID = -1;
const int DEFAULT_BUFFER_SIZE = 0x800;
const int DAYNAPORT_BUFFER_SIZE = 0x1000000;
#ifdef RASCSI
// For timing adjustments
enum {

View File

@ -1121,8 +1121,8 @@ int FASTCALL GPIOBUS::SendHandShake(BYTE *buf, int count, int delay_after_bytes)
if (actmode == TARGET) {
for (i = 0; i < count; i++) {
if(i==delay_after_bytes){
LOGTRACE("%s DELAYING for 100us after %d bytes", __PRETTY_FUNCTION__, (int)delay_after_bytes);
SysTimer::SleepUsec(100);
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);
}
// Set the DATA signals
@ -1163,9 +1163,8 @@ int FASTCALL GPIOBUS::SendHandShake(BYTE *buf, int count, int delay_after_bytes)
phase = Aquire() & GPIO_MCI;
for (i = 0; i < count; i++) {
if(i==delay_after_bytes){
SysTimer::SleepUsec(100);
SysTimer::SleepUsec(SCSI_DELAY_SEND_DATA_DAYNAPORT_US);
}
// Set the DATA signals

View File

@ -458,6 +458,11 @@
#define SCSI_DELAY_FAST_HOLD_TIME_NS 10
#define SCSI_DELAY_FAST_NEGATION_PERIOD_NS 30
// The DaynaPort SCSI Link do a short delay in the middle of transfering
// a packet. This is the number of uS that will be delayed between the
// header and the actual data.
#define SCSI_DELAY_SEND_DATA_DAYNAPORT_US 100
//---------------------------------------------------------------------------
//
// Class definition

View File

@ -17,12 +17,11 @@
#include "spdlog/sinks/sink.h"
#define SPDLOGWRAPPER(loglevel, ...) \
do \
{ \
char logbuf[_MAX_FNAME*2]; \
snprintf(logbuf, sizeof(logbuf), __VA_ARGS__); \
spdlog::log(loglevel, logbuf); \
} while (0);
};
#ifdef NDEBUG
// If we're doing a non-debug build, we want to skip the overhead of