mirror of
https://github.com/akuker/RASCSI.git
synced 2025-08-14 16:27:46 +00:00
Replaced BOOL
This commit is contained in:
@@ -985,7 +985,7 @@ void SASIDEV::Send()
|
|||||||
|
|
||||||
// Remove block and initialize the result
|
// Remove block and initialize the result
|
||||||
ctrl.blocks--;
|
ctrl.blocks--;
|
||||||
BOOL result = TRUE;
|
BOOL result = true;
|
||||||
|
|
||||||
// Process after data collection (read/data-in only)
|
// Process after data collection (read/data-in only)
|
||||||
if (ctrl.phase == BUS::datain) {
|
if (ctrl.phase == BUS::datain) {
|
||||||
@@ -1077,16 +1077,16 @@ void SASIDEV::Receive()
|
|||||||
|
|
||||||
// Remove the control block and initialize the result
|
// Remove the control block and initialize the result
|
||||||
ctrl.blocks--;
|
ctrl.blocks--;
|
||||||
BOOL result = TRUE;
|
bool result = true;
|
||||||
|
|
||||||
// Process the data out phase
|
// Process the data out phase
|
||||||
if (ctrl.phase == BUS::dataout) {
|
if (ctrl.phase == BUS::dataout) {
|
||||||
if (ctrl.blocks == 0) {
|
if (ctrl.blocks == 0) {
|
||||||
// End with this buffer
|
// End with this buffer
|
||||||
result = XferOut(FALSE);
|
result = XferOut(false);
|
||||||
} else {
|
} else {
|
||||||
// Continue to next buffer (set offset, length)
|
// Continue to next buffer (set offset, length)
|
||||||
result = XferOut(TRUE);
|
result = XferOut(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1128,7 +1128,7 @@ void SASIDEV::Receive()
|
|||||||
// *Reset offset and length
|
// *Reset offset and length
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
BOOL SASIDEV::XferIn(BYTE *buf)
|
bool SASIDEV::XferIn(BYTE *buf)
|
||||||
{
|
{
|
||||||
ASSERT(ctrl.phase == BUS::datain);
|
ASSERT(ctrl.phase == BUS::datain);
|
||||||
LOGTRACE("%s ctrl.cmd[0]=%02X", __PRETTY_FUNCTION__, (unsigned int)ctrl.cmd[0]);
|
LOGTRACE("%s ctrl.cmd[0]=%02X", __PRETTY_FUNCTION__, (unsigned int)ctrl.cmd[0]);
|
||||||
@@ -1136,7 +1136,7 @@ BOOL SASIDEV::XferIn(BYTE *buf)
|
|||||||
// Logical Unit
|
// Logical Unit
|
||||||
DWORD lun = (ctrl.cmd[1] >> 5) & 0x07;
|
DWORD lun = (ctrl.cmd[1] >> 5) & 0x07;
|
||||||
if (!ctrl.unit[lun]) {
|
if (!ctrl.unit[lun]) {
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Limited to read commands
|
// Limited to read commands
|
||||||
@@ -1151,7 +1151,7 @@ BOOL SASIDEV::XferIn(BYTE *buf)
|
|||||||
// If there is an error, go to the status phase
|
// If there is an error, go to the status phase
|
||||||
if (ctrl.length <= 0) {
|
if (ctrl.length <= 0) {
|
||||||
// Cancel data-in
|
// Cancel data-in
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If things are normal, work setting
|
// If things are normal, work setting
|
||||||
@@ -1161,11 +1161,11 @@ BOOL SASIDEV::XferIn(BYTE *buf)
|
|||||||
// Other (impossible)
|
// Other (impossible)
|
||||||
default:
|
default:
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Succeeded in setting the buffer
|
// Succeeded in setting the buffer
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -1174,14 +1174,14 @@ BOOL SASIDEV::XferIn(BYTE *buf)
|
|||||||
// *If cont=true, reset the offset and length
|
// *If cont=true, reset the offset and length
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
BOOL SASIDEV::XferOut(BOOL cont)
|
bool SASIDEV::XferOut(bool cont)
|
||||||
{
|
{
|
||||||
ASSERT(ctrl.phase == BUS::dataout);
|
ASSERT(ctrl.phase == BUS::dataout);
|
||||||
|
|
||||||
// Logical Unit
|
// Logical Unit
|
||||||
DWORD lun = (ctrl.cmd[1] >> 5) & 0x07;
|
DWORD lun = (ctrl.cmd[1] >> 5) & 0x07;
|
||||||
if (!ctrl.unit[lun]) {
|
if (!ctrl.unit[lun]) {
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
Disk *device = ctrl.unit[lun];
|
Disk *device = ctrl.unit[lun];
|
||||||
|
|
||||||
@@ -1191,7 +1191,7 @@ BOOL SASIDEV::XferOut(BOOL cont)
|
|||||||
if (!device->ModeSelect(
|
if (!device->ModeSelect(
|
||||||
ctrl.cmd, ctrl.buffer, ctrl.offset)) {
|
ctrl.cmd, ctrl.buffer, ctrl.offset)) {
|
||||||
// MODE SELECT failed
|
// MODE SELECT failed
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1205,7 +1205,7 @@ BOOL SASIDEV::XferOut(BOOL cont)
|
|||||||
if (device->IsBridge()) {
|
if (device->IsBridge()) {
|
||||||
if (!((SCSIBR*)device)->SendMessage10(ctrl.cmd, ctrl.buffer)) {
|
if (!((SCSIBR*)device)->SendMessage10(ctrl.cmd, ctrl.buffer)) {
|
||||||
// write failed
|
// write failed
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If normal, work setting
|
// If normal, work setting
|
||||||
@@ -1219,7 +1219,7 @@ BOOL SASIDEV::XferOut(BOOL cont)
|
|||||||
LOGTRACE("%s Doing special case write for DaynaPort", __PRETTY_FUNCTION__);
|
LOGTRACE("%s Doing special case write for DaynaPort", __PRETTY_FUNCTION__);
|
||||||
if (!(SCSIDaynaPort*)device->Write(ctrl.cmd, ctrl.buffer, ctrl.length)) {
|
if (!(SCSIDaynaPort*)device->Write(ctrl.cmd, ctrl.buffer, ctrl.length)) {
|
||||||
// write failed
|
// write failed
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
LOGTRACE("%s Done with DaynaPort Write", __PRETTY_FUNCTION__);
|
LOGTRACE("%s Done with DaynaPort Write", __PRETTY_FUNCTION__);
|
||||||
|
|
||||||
@@ -1232,7 +1232,7 @@ BOOL SASIDEV::XferOut(BOOL cont)
|
|||||||
LOGTRACE("%s eCmdVerify Calling Write... cmd: %02X next: %d", __PRETTY_FUNCTION__, (WORD)ctrl.cmd[0], (int)ctrl.next);
|
LOGTRACE("%s eCmdVerify Calling Write... cmd: %02X next: %d", __PRETTY_FUNCTION__, (WORD)ctrl.cmd[0], (int)ctrl.next);
|
||||||
if (!device->Write(ctrl.cmd, ctrl.buffer, ctrl.next - 1)) {
|
if (!device->Write(ctrl.cmd, ctrl.buffer, ctrl.next - 1)) {
|
||||||
// Write failed
|
// Write failed
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you do not need the next block, end here
|
// If you do not need the next block, end here
|
||||||
@@ -1245,7 +1245,7 @@ BOOL SASIDEV::XferOut(BOOL cont)
|
|||||||
ctrl.length = device->WriteCheck(ctrl.next - 1);
|
ctrl.length = device->WriteCheck(ctrl.next - 1);
|
||||||
if (ctrl.length <= 0) {
|
if (ctrl.length <= 0) {
|
||||||
// Cannot write
|
// Cannot write
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If normal, work setting
|
// If normal, work setting
|
||||||
@@ -1267,7 +1267,7 @@ BOOL SASIDEV::XferOut(BOOL cont)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Buffer saved successfully
|
// Buffer saved successfully
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@@ -153,8 +153,8 @@ public:
|
|||||||
int GetSCSIID() {return ctrl.m_scsi_id;} // Get the ID
|
int GetSCSIID() {return ctrl.m_scsi_id;} // Get the ID
|
||||||
void GetCTRL(ctrl_t *buffer); // Get the internal information
|
void GetCTRL(ctrl_t *buffer); // Get the internal information
|
||||||
ctrl_t* GetWorkAddr() { return &ctrl; } // Get the internal information address
|
ctrl_t* GetWorkAddr() { return &ctrl; } // Get the internal information address
|
||||||
virtual BOOL IsSASI() const {return TRUE;} // SASI Check
|
virtual bool IsSASI() const { return true; } // SASI Check
|
||||||
virtual BOOL IsSCSI() const {return FALSE;} // SCSI check
|
virtual bool IsSCSI() const { return false; } // SCSI check
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void DataIn(); // Data in phase
|
void DataIn(); // Data in phase
|
||||||
@@ -190,8 +190,8 @@ protected:
|
|||||||
virtual void Send(); // Send data
|
virtual void Send(); // Send data
|
||||||
virtual void Receive(); // Receive data
|
virtual void Receive(); // Receive data
|
||||||
|
|
||||||
BOOL XferIn(BYTE* buf); // Data transfer IN
|
bool XferIn(BYTE* buf); // Data transfer IN
|
||||||
BOOL XferOut(BOOL cont); // Data transfer OUT
|
bool XferOut(bool cont); // Data transfer OUT
|
||||||
|
|
||||||
// Special operations
|
// Special operations
|
||||||
void FlushUnit(); // Flush the logical unit
|
void FlushUnit(); // Flush the logical unit
|
||||||
|
@@ -499,7 +499,7 @@ void SCSIDEV::Send()
|
|||||||
|
|
||||||
// Block subtraction, result initialization
|
// Block subtraction, result initialization
|
||||||
ctrl.blocks--;
|
ctrl.blocks--;
|
||||||
BOOL result = TRUE;
|
BOOL result = true;
|
||||||
|
|
||||||
// Processing after data collection (read/data-in only)
|
// Processing after data collection (read/data-in only)
|
||||||
if (ctrl.phase == BUS::datain) {
|
if (ctrl.phase == BUS::datain) {
|
||||||
@@ -605,7 +605,7 @@ void SCSIDEV::Receive()
|
|||||||
|
|
||||||
// Block subtraction, result initialization
|
// Block subtraction, result initialization
|
||||||
ctrl.blocks--;
|
ctrl.blocks--;
|
||||||
BOOL result = TRUE;
|
bool result = true;
|
||||||
|
|
||||||
// Processing after receiving data (by phase)
|
// Processing after receiving data (by phase)
|
||||||
LOGTRACE("%s ctrl.phase: %d (%s)",__PRETTY_FUNCTION__, (int)ctrl.phase, BUS::GetPhaseStrRaw(ctrl.phase));
|
LOGTRACE("%s ctrl.phase: %d (%s)",__PRETTY_FUNCTION__, (int)ctrl.phase, BUS::GetPhaseStrRaw(ctrl.phase));
|
||||||
@@ -615,10 +615,10 @@ void SCSIDEV::Receive()
|
|||||||
case BUS::dataout:
|
case BUS::dataout:
|
||||||
if (ctrl.blocks == 0) {
|
if (ctrl.blocks == 0) {
|
||||||
// End with this buffer
|
// End with this buffer
|
||||||
result = XferOut(FALSE);
|
result = XferOut(false);
|
||||||
} else {
|
} else {
|
||||||
// Continue to next buffer (set offset, length)
|
// Continue to next buffer (set offset, length)
|
||||||
result = XferOut(TRUE);
|
result = XferOut(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -96,8 +96,8 @@ public:
|
|||||||
BUS::phase_t Process(); // Run
|
BUS::phase_t Process(); // Run
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
BOOL IsSASI() const {return FALSE;} // SASI Check
|
bool IsSASI() const { return false; } // SASI Check
|
||||||
BOOL IsSCSI() const {return TRUE;} // SCSI check
|
bool IsSCSI() const { return true; } // SCSI check
|
||||||
|
|
||||||
void Error(ERROR_CODES::sense_key sense_key = ERROR_CODES::sense_key::NO_SENSE,
|
void Error(ERROR_CODES::sense_key sense_key = ERROR_CODES::sense_key::NO_SENSE,
|
||||||
ERROR_CODES::asc asc = ERROR_CODES::asc::NO_ADDITIONAL_SENSE_INFORMATION) override; // Common erorr handling
|
ERROR_CODES::asc asc = ERROR_CODES::asc::NO_ADDITIONAL_SENSE_INFORMATION) override; // Common erorr handling
|
||||||
|
Reference in New Issue
Block a user