2018-05-03 13:47:57 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2022-08-26 01:01:39 +00:00
|
|
|
// SCSI Target Emulator RaSCSI Reloaded
|
2018-05-03 13:47:57 +00:00
|
|
|
// for Raspberry Pi
|
|
|
|
//
|
|
|
|
// Powered by XM6 TypeG Technology.
|
2020-07-04 14:57:44 +00:00
|
|
|
// Copyright (C) 2016-2020 GIMONS
|
2018-05-03 13:47:57 +00:00
|
|
|
//
|
2020-07-06 03:56:25 +00:00
|
|
|
// [ GPIO-SCSI bus ]
|
2018-05-03 13:47:57 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2022-09-10 21:40:24 +00:00
|
|
|
#include "hal/gpiobus.h"
|
2022-02-13 19:30:02 +00:00
|
|
|
#include "config.h"
|
2022-10-25 00:21:40 +00:00
|
|
|
#include "hal/sbc_version.h"
|
|
|
|
#include "hal/systimer.h"
|
2020-10-19 12:31:06 +00:00
|
|
|
#include "log.h"
|
2022-10-25 00:21:40 +00:00
|
|
|
#include "os.h"
|
2022-09-25 21:49:24 +00:00
|
|
|
#include <array>
|
2022-10-25 00:21:40 +00:00
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <sys/time.h>
|
2022-10-04 15:23:42 +00:00
|
|
|
#ifdef __linux__
|
2022-09-25 21:49:24 +00:00
|
|
|
#include <sys/epoll.h>
|
|
|
|
#endif
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
#if defined CONNECT_TYPE_STANDARD
|
|
|
|
#include "hal/gpiobus_standard.h"
|
|
|
|
#elif defined CONNECT_TYPE_FULLSPEC
|
|
|
|
#include "hal/gpiobus_fullspec.h"
|
|
|
|
#elif defined CONNECT_TYPE_AIBOM
|
|
|
|
#include "hal/gpiobus_aibom.h"
|
|
|
|
#elif defined CONNECT_TYPE_GAMERNIUM
|
|
|
|
#include "hal/gpiobus_gamernium.h"
|
|
|
|
#else
|
|
|
|
#error Invalid connection type or none specified
|
|
|
|
#endif
|
2022-09-25 21:49:24 +00:00
|
|
|
|
2018-05-03 13:47:57 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2022-10-25 00:21:40 +00:00
|
|
|
// Constant declarations (bus control timing)
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
// SCSI Bus timings taken from:
|
|
|
|
// https://www.staff.uni-mainz.de/tacke/scsi/SCSI2-05.html
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_ARBITRATION_DELAY_NS = 2400;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_ASSERTION_PERIOD_NS = 90;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_BUS_CLEAR_DELAY_NS = 800;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_BUS_FREE_DELAY_NS = 800;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_BUS_SET_DELAY_NS = 1800;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_BUS_SETTLE_DELAY_NS = 400;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_CABLE_SKEW_DELAY_NS = 10;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_DATA_RELEASE_DELAY_NS = 400;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_DESKEW_DELAY_NS = 45;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_DISCONNECTION_DELAY_US = 200;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_HOLD_TIME_NS = 45;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_NEGATION_PERIOD_NS = 90;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_POWER_ON_TO_SELECTION_TIME_S = 10; // (recommended)
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_RESET_TO_SELECTION_TIME_US = 250 * 1000; // (recommended)
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_RESET_HOLD_TIME_US = 25;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_SELECTION_ABORT_TIME_US = 200;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_SELECTION_TIMEOUT_DELAY_NS = 250 * 1000; // (recommended)
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_FAST_ASSERTION_PERIOD_NS = 30;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_FAST_CABLE_SKEW_DELAY_NS = 5;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_FAST_DESKEW_DELAY_NS = 20;
|
|
|
|
[[maybe_unused]] const static int SCSI_DELAY_FAST_HOLD_TIME_NS = 10;
|
|
|
|
[[maybe_unused]] const static int 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.
|
|
|
|
const static int SCSI_DELAY_SEND_DATA_DAYNAPORT_US = 100;
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
using namespace std;
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Nothing SBC hardware specific should be done in this function
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::Init(mode_e mode)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
// Save operation mode
|
|
|
|
actmode = mode;
|
|
|
|
return true;
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
2021-07-26 18:33:36 +00:00
|
|
|
void GPIOBUS::Cleanup()
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2020-08-07 19:25:05 +00:00
|
|
|
#if defined(__x86_64__) || defined(__X86__)
|
2022-10-25 00:21:40 +00:00
|
|
|
return;
|
2020-08-07 19:25:05 +00:00
|
|
|
#else
|
2022-10-25 00:21:40 +00:00
|
|
|
// Release SEL signal interrupt
|
2020-07-04 14:57:44 +00:00
|
|
|
#ifdef USE_SEL_EVENT_ENABLE
|
2022-10-25 00:21:40 +00:00
|
|
|
close(selevreq.fd);
|
|
|
|
#endif // USE_SEL_EVENT_ENABLE
|
|
|
|
|
|
|
|
// Set control signals
|
2022-10-25 16:30:32 +00:00
|
|
|
PinSetSignal(PIN_ENB, RASCSI_PIN_OFF);
|
|
|
|
PinSetSignal(PIN_ACT, RASCSI_PIN_OFF);
|
|
|
|
PinSetSignal(PIN_TAD, RASCSI_PIN_OFF);
|
|
|
|
PinSetSignal(PIN_IND, RASCSI_PIN_OFF);
|
|
|
|
PinSetSignal(PIN_DTD, RASCSI_PIN_OFF);
|
2022-10-25 00:21:40 +00:00
|
|
|
PinConfig(PIN_ACT, GPIO_INPUT);
|
|
|
|
PinConfig(PIN_TAD, GPIO_INPUT);
|
|
|
|
PinConfig(PIN_IND, GPIO_INPUT);
|
|
|
|
PinConfig(PIN_DTD, GPIO_INPUT);
|
|
|
|
|
|
|
|
// Initialize all signals
|
|
|
|
for (int i = 0; SignalTable[i] >= 0; i++) {
|
|
|
|
int pin = SignalTable[i];
|
2022-10-25 16:30:32 +00:00
|
|
|
PinSetSignal(pin, RASCSI_PIN_OFF);
|
2022-10-25 00:21:40 +00:00
|
|
|
PinConfig(pin, GPIO_INPUT);
|
|
|
|
PullConfig(pin, GPIO_PULLNONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set drive strength back to 8mA
|
|
|
|
DrvConfig(3);
|
2020-08-07 19:25:05 +00:00
|
|
|
#endif // ifdef __x86_64__ || __X86__
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
2021-07-26 18:33:36 +00:00
|
|
|
void GPIOBUS::Reset()
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
2020-08-07 19:25:05 +00:00
|
|
|
#if defined(__x86_64__) || defined(__X86__)
|
2022-10-25 00:21:40 +00:00
|
|
|
return;
|
2020-08-07 19:25:05 +00:00
|
|
|
#else
|
2022-10-25 00:21:40 +00:00
|
|
|
int i;
|
|
|
|
int j;
|
|
|
|
|
|
|
|
// Turn off active signal
|
|
|
|
SetControl(PIN_ACT, ACT_OFF);
|
|
|
|
|
|
|
|
// Set all signals to off
|
|
|
|
for (i = 0;; i++) {
|
|
|
|
j = SignalTable[i];
|
|
|
|
if (j < 0) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-10-25 16:30:32 +00:00
|
|
|
SetSignal(j, RASCSI_PIN_OFF);
|
2022-10-25 00:21:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (actmode == mode_e::TARGET) {
|
|
|
|
// Target mode
|
|
|
|
|
|
|
|
// Set target signal to input
|
|
|
|
SetControl(PIN_TAD, TAD_IN);
|
2022-10-25 16:30:32 +00:00
|
|
|
SetMode(PIN_BSY, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_MSG, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_CD, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_REQ, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_IO, RASCSI_PIN_IN);
|
2022-10-25 00:21:40 +00:00
|
|
|
|
|
|
|
// Set the initiator signal to input
|
|
|
|
SetControl(PIN_IND, IND_IN);
|
2022-10-25 16:30:32 +00:00
|
|
|
SetMode(PIN_SEL, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_ATN, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_ACK, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_RST, RASCSI_PIN_IN);
|
2022-10-25 00:21:40 +00:00
|
|
|
|
|
|
|
// Set data bus signals to input
|
|
|
|
SetControl(PIN_DTD, DTD_IN);
|
2022-10-25 16:30:32 +00:00
|
|
|
SetMode(PIN_DT0, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT1, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT2, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT3, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT4, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT5, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT6, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT7, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DP, RASCSI_PIN_IN);
|
2022-10-25 00:21:40 +00:00
|
|
|
} else {
|
|
|
|
// Initiator mode
|
|
|
|
|
|
|
|
// Set target signal to input
|
|
|
|
SetControl(PIN_TAD, TAD_IN);
|
2022-10-25 16:30:32 +00:00
|
|
|
SetMode(PIN_BSY, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_MSG, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_CD, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_REQ, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_IO, RASCSI_PIN_IN);
|
2022-10-25 00:21:40 +00:00
|
|
|
|
|
|
|
// Set the initiator signal to output
|
|
|
|
SetControl(PIN_IND, IND_OUT);
|
2022-10-25 16:30:32 +00:00
|
|
|
SetMode(PIN_SEL, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_ATN, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_ACK, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_RST, RASCSI_PIN_OUT);
|
2022-10-25 00:21:40 +00:00
|
|
|
|
|
|
|
// Set the data bus signals to output
|
|
|
|
SetControl(PIN_DTD, DTD_OUT);
|
2022-10-25 16:30:32 +00:00
|
|
|
SetMode(PIN_DT0, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT1, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT2, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT3, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT4, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT5, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT6, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT7, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DP, RASCSI_PIN_OUT);
|
2022-10-25 00:21:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Initialize all signals
|
|
|
|
signals = 0;
|
2020-08-07 19:25:05 +00:00
|
|
|
#endif // ifdef __x86_64__ || __X86__
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetENB(bool ast)
|
2020-07-04 14:57:44 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
PinSetSignal(PIN_ENB, ast ? ENB_ON : ENB_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetBSY() const
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_BSY);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
Refactoring, device handling extensions, additional settings, improved error handling, 64 bit OS support, fixed issues (#184)
* Device type unification, support of removable media
* Added support for .hdr extension
* Removable flag cleanup
* Manpage update
* Enriched PbOperation with PbDevice
* Added file size to PbImageFile
* Added device list support
* Set image_file
* Make remote interface more robust by ignoring SIGPIPE
* Return status only once
* Fixed typo
* Error handling update
* When starting rascsi parse everything before attaching devices
* Added dry run mode
* Comment update
* Updated logging
* Added Device base class, Disk class inherits from it
* Renaming
* Use vectors for controllers and disks, as preparation for using maps
* Updated file support handling
* Comment update
* DaynaPort and Bridge inherit from Device instead of Disk
* ProcessCmd() now works with devices instead of disks
* Renaming
* Added DeviceFactory
* Improved factory
* Comment update
* protected disk_t
* Code cleanup, added translations
* Device name can be set for rascsi
* rasctl can set device name
* Manpage update
* Manpage update
* Formatting update
* Check for missing name
* Initialize fd
* Initialize type
* Fixed string length issue
* Updated capacity formatting
* Fixed typo
* Split PbDevice into device and device definition
* Added TODO
* Renaming
* Renaming
* Device types can be explicitly specified with -t (no FILE:TYPE syntax anymore)
* Fixed compile-time issue
* Removed unused Append mode, updated read-only handling
* Type handling and manpage update
* Cleanup
* rasctl parser cleanup
* Review
* Constructor update
* Added .hdr (SCRM) support to web interface, tested web interface
* Default folder can be set remotely
* Removed deprecated operation
* DETACH supports all parameters in order to detach all devices
* include cleanup
* Logging should not depend on NDEBUG, for RaSCSI it is not peformance-critical
* INFO is default log level
* Exception renaming
* Updated GetPaddedName()
* Inheritance update
* Added BlockDevice class
* Removed unused code
* Updated typedefs
* Revert "Updated typedefs"
This reverts commit 546b46215a4d9b65067a11698e59ab1123cc6d64.
* Removed unused code
* Fixed warnign
* Use standard C++ integer types, use streams to resolve printf data type issues
* Added TODOs
* Added TODO
* Renaming
* Added TODO
* Added TODO
* Improved dry-run
* Code cleanup
* Updated handling of unknown options, code review and cleanup
* Manpage update
* Added PrimaryDevice
* Include cleanup
* Added pure virtual methods
* Comment updates
* Split rasutil
* Replaced some occurrences of BOOL
* Removed obsolete RASCSI definition in xm6.h
* Removed unused code, updated TODOs, replaced BOOL
* Added capacity check (issue #192)
* Fixed (most likely) https://github.com/akuker/RASCSI/issues/191
* Fixed wrong error messages
* For root the default image folder is /home/pi/images, updated error handling
* Dynaport code review
* Improved error handling
* Implemented READ CAPACITY(16)
* Comment update
* Commands can be 16 bytes long
* Implemented READ/WRITE/VERIFY(16)
* Comment update
* Renamed method to reflect the name of the respective SCSI command
* Do not created devices during dryRun
* Fixed padding of SCSIHD_APPLE vendor and product
* Initial implementation
* Updated ReportLuns
* Byte count update
* Fixed typo
* Finalized REPORT LUNS
* Removed TODO
* Updated TODO
* TODO update
* Updated device factory
* Comment update
* 64 bit update, tested on Ubuntu 64 bit system
* Removed assertion
* SCSI hard disks always have Apple specific mode pages (resolves issue #193)
* Error messsage update, 64 bit cleanup
* Reduced streams usage
* Updated handling of device flags
* MOs are protectable
* Removed duplicate error code handling
* Removed duplicate code
* Fixed CmdReadToc buffer overflow (https://github.com/akuker/RASCSI/issues/194)
* Added naive implementation of GET EVENT STATUS NOTIFICATION to avoid wranings
* HD must set removable device bit if the media is removable
* Removed duplicate logging
* Updated daynaport additional length
* Removed broken daynaport REQUEST SENSE. Successfully tested with my Mac.
* EnableInterface should not always return TRUE
* Updated Inquiry
* Updated LUN handling
* Replaced incorrect free by delete
* Updated comments and write-protection handling
* Made default HD name consistent
* STATUS_NOERROR is default
* Fixed Eject
* More eject handling updates
* Manpage updates
* Logging update
* Changed debug level
* Logging update
* Log capacity of all media types
* Logging update
* Encapsulated disk.blocks
* Encapsulated sector size
* Added overrides
* Added more overrides
* Fixed error message
* Fixed typos
* Fixed logging
* Added logging
* Use PrimaryDevice when calling Inquiry
* Comment update
* Changed default buffer size for testing
* Reverted last change
* Removed debug output
* De-inlined methods because optimized code did not work with them inlined
* Web interface can attach Daynaport again
* Improved handling of read-only hard disks
* Fixed issue with "all" semantics of DETACH
* rasctl supports adding removable media devices without providing a filename
* Removed unused flag in PbDeviceDefinition
* Updated rasctl output for ecjected media (resolves issue #199)
* Validate default folder name when changing default folder
2021-08-21 21:45:30 +00:00
|
|
|
void GPIOBUS::SetBSY(bool ast)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
// Set BSY signal
|
|
|
|
SetSignal(PIN_BSY, ast);
|
|
|
|
|
|
|
|
if (actmode == mode_e::TARGET) {
|
|
|
|
if (ast) {
|
|
|
|
// Turn on ACTIVE signal
|
|
|
|
SetControl(PIN_ACT, ACT_ON);
|
|
|
|
|
|
|
|
// Set Target signal to output
|
|
|
|
SetControl(PIN_TAD, TAD_OUT);
|
|
|
|
|
2022-10-25 03:21:57 +00:00
|
|
|
SetMode(PIN_BSY, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_MSG, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_CD, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_REQ, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_IO, RASCSI_PIN_OUT);
|
2022-10-25 00:21:40 +00:00
|
|
|
} else {
|
|
|
|
// Turn off the ACTIVE signal
|
|
|
|
SetControl(PIN_ACT, ACT_OFF);
|
|
|
|
|
|
|
|
// Set the target signal to input
|
|
|
|
SetControl(PIN_TAD, TAD_IN);
|
|
|
|
|
2022-10-25 03:21:57 +00:00
|
|
|
SetMode(PIN_BSY, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_MSG, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_CD, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_REQ, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_IO, RASCSI_PIN_IN);
|
2022-10-25 00:21:40 +00:00
|
|
|
}
|
|
|
|
}
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetSEL() const
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_SEL);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetSEL(bool ast)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
if (actmode == mode_e::INITIATOR && ast) {
|
|
|
|
// Turn on ACTIVE signal
|
|
|
|
SetControl(PIN_ACT, ACT_ON);
|
|
|
|
}
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Set SEL signal
|
|
|
|
SetSignal(PIN_SEL, ast);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetATN() const
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_ATN);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetATN(bool ast)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
SetSignal(PIN_ATN, ast);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetACK() const
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_ACK);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetACK(bool ast)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
SetSignal(PIN_ACK, ast);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetACT() const
|
2020-10-19 12:31:06 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_ACT);
|
2020-10-19 12:31:06 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetACT(bool ast)
|
2020-10-19 12:31:06 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
SetSignal(PIN_ACT, ast);
|
2020-10-19 12:31:06 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetRST() const
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_RST);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetRST(bool ast)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
SetSignal(PIN_RST, ast);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetMSG() const
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_MSG);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetMSG(bool ast)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
SetSignal(PIN_MSG, ast);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetCD() const
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_CD);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetCD(bool ast)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
SetSignal(PIN_CD, ast);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetIO()
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
bool ast = GetSignal(PIN_IO);
|
|
|
|
|
|
|
|
if (actmode == mode_e::INITIATOR) {
|
|
|
|
// Change the data input/output direction by IO signal
|
|
|
|
if (ast) {
|
|
|
|
SetControl(PIN_DTD, DTD_IN);
|
2022-10-25 03:21:57 +00:00
|
|
|
SetMode(PIN_DT0, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT1, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT2, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT3, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT4, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT5, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT6, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT7, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DP, RASCSI_PIN_IN);
|
2022-10-25 00:21:40 +00:00
|
|
|
} else {
|
|
|
|
SetControl(PIN_DTD, DTD_OUT);
|
2022-10-25 03:21:57 +00:00
|
|
|
SetMode(PIN_DT0, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT1, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT2, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT3, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT4, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT5, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT6, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT7, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DP, RASCSI_PIN_OUT);
|
2022-10-25 00:21:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ast;
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetIO(bool ast)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
SetSignal(PIN_IO, ast);
|
|
|
|
|
|
|
|
if (actmode == mode_e::TARGET) {
|
|
|
|
// Change the data input/output direction by IO signal
|
|
|
|
if (ast) {
|
|
|
|
SetControl(PIN_DTD, DTD_OUT);
|
|
|
|
SetDAT(0);
|
2022-10-25 03:21:57 +00:00
|
|
|
SetMode(PIN_DT0, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT1, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT2, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT3, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT4, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT5, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT6, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DT7, RASCSI_PIN_OUT);
|
|
|
|
SetMode(PIN_DP, RASCSI_PIN_OUT);
|
2022-10-25 00:21:40 +00:00
|
|
|
} else {
|
|
|
|
SetControl(PIN_DTD, DTD_IN);
|
2022-10-25 03:21:57 +00:00
|
|
|
SetMode(PIN_DT0, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT1, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT2, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT3, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT4, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT5, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT6, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DT7, RASCSI_PIN_IN);
|
|
|
|
SetMode(PIN_DP, RASCSI_PIN_IN);
|
2022-10-25 00:21:40 +00:00
|
|
|
}
|
|
|
|
}
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetREQ() const
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_REQ);
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
void GPIOBUS::SetREQ(bool ast)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
SetSignal(PIN_REQ, ast);
|
2020-07-04 14:57:44 +00:00
|
|
|
}
|
|
|
|
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::GetDP() const
|
2020-07-04 14:57:44 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
return GetSignal(PIN_DP);
|
2020-07-04 14:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-07-06 03:56:25 +00:00
|
|
|
// Receive command handshake
|
2020-07-04 14:57:44 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
int GPIOBUS::CommandHandShake(BYTE *buf)
|
2020-07-04 14:57:44 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
// Only works in TARGET mode
|
|
|
|
if (actmode != mode_e::TARGET) {
|
|
|
|
return 0;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
DisableIRQ();
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Assert REQ signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for ACK signal
|
2022-10-25 03:21:57 +00:00
|
|
|
bool ret = WaitSignal(PIN_ACK, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait until the signal line stabilizes
|
|
|
|
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Get data
|
|
|
|
*buf = GetDAT();
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Disable REQ signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Timeout waiting for ACK assertion
|
|
|
|
if (!ret) {
|
|
|
|
EnableIRQ();
|
|
|
|
return 0;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for ACK to clear
|
2022-10-25 03:21:57 +00:00
|
|
|
ret = WaitSignal(PIN_ACK, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Timeout waiting for ACK to clear
|
|
|
|
if (!ret) {
|
|
|
|
EnableIRQ();
|
|
|
|
return 0;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// The ICD AdSCSI ST, AdSCSI Plus ST and AdSCSI Micro ST host adapters allow SCSI devices to be connected
|
|
|
|
// to the ACSI bus of Atari ST/TT computers and some clones. ICD-aware drivers prepend a $1F byte in front
|
|
|
|
// of the CDB (effectively resulting in a custom SCSI command) in order to get access to the full SCSI
|
|
|
|
// command set. Native ACSI is limited to the low SCSI command classes with command bytes < $20.
|
|
|
|
// Most other host adapters (e.g. LINK96/97 and the one by Inventronik) and also several devices (e.g.
|
|
|
|
// UltraSatan or GigaFile) that can directly be connected to the Atari's ACSI port also support ICD
|
|
|
|
// semantics. I fact, these semantics have become a standard in the Atari world.
|
2022-02-05 01:45:10 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// RaSCSI becomes ICD compatible by ignoring the prepended $1F byte before processing the CDB.
|
|
|
|
if (*buf == 0x1F) {
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_ON);
|
2022-02-05 01:45:10 +00:00
|
|
|
|
2022-10-25 03:21:57 +00:00
|
|
|
ret = WaitSignal(PIN_ACK, RASCSI_PIN_ON);
|
2022-02-05 01:45:10 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
|
2022-02-05 01:45:10 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Get the actual SCSI command
|
|
|
|
*buf = GetDAT();
|
2022-02-05 01:45:10 +00:00
|
|
|
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_OFF);
|
2022-02-05 01:45:10 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
if (!ret) {
|
|
|
|
EnableIRQ();
|
|
|
|
return 0;
|
|
|
|
}
|
2022-02-05 01:45:10 +00:00
|
|
|
|
2022-10-25 03:21:57 +00:00
|
|
|
WaitSignal(PIN_ACK, RASCSI_PIN_OFF);
|
2022-02-05 01:45:10 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
if (!ret) {
|
|
|
|
EnableIRQ();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2022-02-05 01:45:10 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
int command_byte_count = GetCommandByteCount(*buf);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Increment buffer pointer
|
|
|
|
buf++;
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
int bytes_received;
|
|
|
|
for (bytes_received = 1; bytes_received < command_byte_count; bytes_received++) {
|
|
|
|
// Assert REQ signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for ACK signal
|
2022-10-25 03:21:57 +00:00
|
|
|
ret = WaitSignal(PIN_ACK, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait until the signal line stabilizes
|
|
|
|
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Get data
|
|
|
|
*buf = GetDAT();
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Clear the REQ signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for ACK assertion
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for ACK to clear
|
2022-10-25 03:21:57 +00:00
|
|
|
ret = WaitSignal(PIN_ACK, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for ACK to clear
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Advance the buffer pointer to receive the next byte
|
|
|
|
buf++;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
EnableIRQ();
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
return bytes_received;
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-07-06 03:56:25 +00:00
|
|
|
// Data reception handshake
|
2018-05-03 13:47:57 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2021-07-26 18:33:36 +00:00
|
|
|
int GPIOBUS::ReceiveHandShake(BYTE *buf, int count)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
|
|
|
|
int i;
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Disable IRQs
|
|
|
|
DisableIRQ();
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
if (actmode == mode_e::TARGET) {
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
// Assert the REQ signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for ACK
|
2022-10-25 03:21:57 +00:00
|
|
|
bool ret = WaitSignal(PIN_ACK, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait until the signal line stabilizes
|
|
|
|
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Get data
|
|
|
|
*buf = GetDAT();
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Clear the REQ signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for ACK signal
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for ACK to clear
|
2022-10-25 03:21:57 +00:00
|
|
|
ret = WaitSignal(PIN_ACK, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for ACK to clear
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Advance the buffer pointer to receive the next byte
|
|
|
|
buf++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Get phase
|
|
|
|
uint32_t phase = Acquire() & GPIO_MCI;
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
// Wait for the REQ signal to be asserted
|
2022-10-25 03:21:57 +00:00
|
|
|
bool ret = WaitSignal(PIN_REQ, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for REQ signal
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Phase error
|
|
|
|
if ((signals & GPIO_MCI) != phase) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait until the signal line stabilizes
|
|
|
|
SysTimer::SleepNsec(SCSI_DELAY_BUS_SETTLE_DELAY_NS);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Get data
|
|
|
|
*buf = GetDAT();
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Assert the ACK signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_ACK, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for REQ to clear
|
2022-10-25 03:21:57 +00:00
|
|
|
ret = WaitSignal(PIN_REQ, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Clear the ACK signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_ACK, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for REQ to clear
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Phase error
|
|
|
|
if ((signals & GPIO_MCI) != phase) {
|
|
|
|
break;
|
|
|
|
}
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Advance the buffer pointer to receive the next byte
|
|
|
|
buf++;
|
|
|
|
}
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Re-enable IRQ
|
|
|
|
EnableIRQ();
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Return the number of bytes received
|
|
|
|
return i;
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-07-06 03:56:25 +00:00
|
|
|
// Data transmission handshake
|
2018-05-03 13:47:57 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2021-07-26 18:33:36 +00:00
|
|
|
int GPIOBUS::SendHandShake(BYTE *buf, int count, int delay_after_bytes)
|
2018-05-03 13:47:57 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
int i;
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Disable IRQs
|
|
|
|
DisableIRQ();
|
2021-04-05 19:17:05 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
if (actmode == mode_e::TARGET) {
|
|
|
|
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);
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Set the DATA signals
|
|
|
|
SetDAT(*buf);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for ACK to clear
|
2022-10-25 03:21:57 +00:00
|
|
|
bool ret = WaitSignal(PIN_ACK, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for ACK to clear
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Already waiting for ACK to clear
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Assert the REQ signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for ACK
|
2022-10-25 03:21:57 +00:00
|
|
|
ret = WaitSignal(PIN_ACK, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Clear REQ signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_REQ, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for ACK to clear
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Advance the data buffer pointer to receive the next byte
|
|
|
|
buf++;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for ACK to clear
|
2022-10-25 03:21:57 +00:00
|
|
|
WaitSignal(PIN_ACK, RASCSI_PIN_OFF);
|
2022-10-25 00:21:40 +00:00
|
|
|
} else {
|
|
|
|
// Get Phase
|
|
|
|
uint32_t phase = Acquire() & GPIO_MCI;
|
2021-04-05 19:17:05 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
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);
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Set the DATA signals
|
|
|
|
SetDAT(*buf);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for REQ to be asserted
|
2022-10-25 03:21:57 +00:00
|
|
|
bool ret = WaitSignal(PIN_REQ, RASCSI_PIN_ON);
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for REQ to be asserted
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Phase error
|
|
|
|
if ((signals & GPIO_MCI) != phase) {
|
|
|
|
break;
|
|
|
|
}
|
2020-10-19 12:31:06 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Already waiting for REQ assertion
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Assert the ACK signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_ACK, RASCSI_PIN_ON);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Wait for REQ to clear
|
2022-10-25 03:21:57 +00:00
|
|
|
ret = WaitSignal(PIN_REQ, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Clear the ACK signal
|
2022-10-25 03:21:57 +00:00
|
|
|
SetSignal(PIN_ACK, RASCSI_PIN_OFF);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for timeout waiting for REQ to clear
|
|
|
|
if (!ret) {
|
|
|
|
break;
|
|
|
|
}
|
2018-05-03 13:47:57 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Phase error
|
|
|
|
if ((signals & GPIO_MCI) != phase) {
|
|
|
|
break;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Advance the data buffer pointer to receive the next byte
|
|
|
|
buf++;
|
|
|
|
}
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Re-enable IRQ
|
|
|
|
EnableIRQ();
|
|
|
|
|
|
|
|
// Return number of transmissions
|
|
|
|
return i;
|
2020-07-04 14:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef USE_SEL_EVENT_ENABLE
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-07-06 03:56:25 +00:00
|
|
|
// SEL signal event polling
|
2020-07-04 14:57:44 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
SASI code removal, error handling update, bug fixes, code cleanup (#806)
Summary ov most important changes triggered by the SASI code removal:
- Removed the SASI controller code
- New controller management. There is a new controller base class AbstractController and a class ControllerManager managing the controller lifecycle. The lifecycle management was removed from rasci.cpp and is covered by unit tests.
- New device management. The DeviceFactory manages the device lifecycle instead of rascsi.cpp. The new code is covered by unit tests.
- The lifecycle managment uses C++ collections with variable size instead of arrays with hard-coded sizes.
- The ScsiController method contains most of what was previously contained in scsidev_ctrl.cpp plus the code from sasidev_ctrl.cpp that was relevant for SCSI.
- scsi_command_util contains helper methods used for identical SCSI command implementations of more than one device
- Devices know their controllers, so that the controller instance does not need to be passed to each SCSI command. This change helps to decouple the devices from the controller. The phase_handler interface is also part of this decoupling.
- Use scsi_command_exception for propagating SCSI command execution errors, This resolves issues with the previous error handling, which was based on return values and often on magic numbers.
- Removed legacy SCSI error codes, all errors are now encoded by sense_key::, asc:: and status::.
- Fixed various warnings reported with -Wextra, -Weffc++ and -Wpedantic.
- Use constructor member initialization lists (recommended for ISO C++)
- Consistently use new/delete instead of malloc/free (recommended for ISO C++), resulting in better type safety and error handling
- Replaced variable sized arrays on the stack (violates ISO C++ and can cause a stack overflow)
- Replaced NULL by nullptr (recommended for C++), resulting in better type safety
- Use more const member functions in order to avoid side effects
- The format device page can now also be changed for hard disk drives (Fujitsu M2624S supports this, for instance), not just for MOs.
- Better encapsulation, updated access specifiers in many places
- Removed unused methods and method arguments
- Fixed a number of TODOs
- Added/updated unit tests for a lot of non-legacy classes
- Makefile support for creating HTML coverage reports with lcov/genhtml
2022-09-03 14:53:53 +00:00
|
|
|
bool GPIOBUS::PollSelectEvent()
|
2020-07-04 14:57:44 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
errno = 0;
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
if (epoll_event epev; epoll_wait(epfd, &epev, 1, -1) <= 0) {
|
|
|
|
LOGWARN("%s epoll_wait failed", __PRETTY_FUNCTION__)
|
|
|
|
LOGWARN("[%08X] %s", errno, strerror(errno))
|
|
|
|
return false;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
if (gpioevent_data gpev; read(selevreq.fd, &gpev, sizeof(gpev)) < 0) {
|
|
|
|
LOGWARN("%s read failed", __PRETTY_FUNCTION__)
|
|
|
|
LOGWARN("[%08X] %s", errno, strerror(errno))
|
2022-10-01 15:56:06 +00:00
|
|
|
return false;
|
2022-10-25 00:21:40 +00:00
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
return true;
|
2020-07-04 14:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-07-06 03:56:25 +00:00
|
|
|
// Cancel SEL signal event
|
2020-07-04 14:57:44 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2021-07-26 18:33:36 +00:00
|
|
|
void GPIOBUS::ClearSelectEvent()
|
2020-07-04 14:57:44 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
2018-05-03 13:47:57 +00:00
|
|
|
}
|
2022-10-25 00:21:40 +00:00
|
|
|
#endif // USE_SEL_EVENT_ENABLE
|
2018-05-03 13:47:57 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-07-06 03:56:25 +00:00
|
|
|
// Signal table
|
2018-05-03 13:47:57 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2022-10-25 00:21:40 +00:00
|
|
|
const array<int, 19> GPIOBUS::SignalTable = {PIN_DT0, PIN_DT1, PIN_DT2, PIN_DT3, PIN_DT4, PIN_DT5, PIN_DT6,
|
|
|
|
PIN_DT7, PIN_DP, PIN_SEL, PIN_ATN, PIN_RST, PIN_ACK, PIN_BSY,
|
|
|
|
PIN_MSG, PIN_CD, PIN_IO, PIN_REQ, -1};
|
2020-07-04 14:57:44 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-07-06 03:56:25 +00:00
|
|
|
// Create work table
|
2020-07-04 14:57:44 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2021-07-26 18:33:36 +00:00
|
|
|
void GPIOBUS::MakeTable(void)
|
2020-07-04 14:57:44 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
|
|
|
|
const array<int, 9> pintbl = {PIN_DT0, PIN_DT1, PIN_DT2, PIN_DT3, PIN_DT4, PIN_DT5, PIN_DT6, PIN_DT7, PIN_DP};
|
|
|
|
|
|
|
|
array<bool, 256> tblParity;
|
|
|
|
|
|
|
|
// Create parity table
|
|
|
|
for (uint32_t i = 0; i < 0x100; i++) {
|
|
|
|
uint32_t bits = i;
|
|
|
|
uint32_t parity = 0;
|
|
|
|
for (int j = 0; j < 8; j++) {
|
|
|
|
parity ^= bits & 1;
|
|
|
|
bits >>= 1;
|
|
|
|
}
|
|
|
|
parity = ~parity;
|
|
|
|
tblParity[i] = parity & 1;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
|
|
|
#if SIGNAL_CONTROL_MODE == 0
|
2022-10-25 00:21:40 +00:00
|
|
|
// Mask and setting data generation
|
|
|
|
for (auto &tbl : tblDatMsk) {
|
|
|
|
tbl.fill(-1);
|
|
|
|
}
|
|
|
|
for (auto &tbl : tblDatSet) {
|
|
|
|
tbl.fill(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (uint32_t i = 0; i < 0x100; i++) {
|
|
|
|
// Bit string for inspection
|
|
|
|
uint32_t bits = i;
|
|
|
|
|
|
|
|
// Get parity
|
|
|
|
if (tblParity[i]) {
|
|
|
|
bits |= (1 << 8);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Bit check
|
|
|
|
for (int j = 0; j < 9; j++) {
|
|
|
|
// Index and shift amount calculation
|
|
|
|
int index = pintbl[j] / 10;
|
|
|
|
int shift = (pintbl[j] % 10) * 3;
|
|
|
|
|
|
|
|
// Mask data
|
|
|
|
tblDatMsk[index][i] &= ~(0x7 << shift);
|
|
|
|
|
|
|
|
// Setting data
|
|
|
|
if (bits & 1) {
|
|
|
|
tblDatSet[index][i] |= (1 << shift);
|
|
|
|
}
|
|
|
|
|
|
|
|
bits >>= 1;
|
|
|
|
}
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
#else
|
2022-10-25 00:21:40 +00:00
|
|
|
for (uint32_t i = 0; i < 0x100; i++) {
|
|
|
|
// Bit string for inspection
|
|
|
|
uint32_t bits = i;
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Get parity
|
|
|
|
if (tblParity[i]) {
|
|
|
|
bits |= (1 << 8);
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
|
|
|
#if SIGNAL_CONTROL_MODE == 1
|
2022-10-25 00:21:40 +00:00
|
|
|
// Negative logic is inverted
|
|
|
|
bits = ~bits;
|
2020-07-04 14:57:44 +00:00
|
|
|
#endif
|
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Create GPIO register information
|
|
|
|
uint32_t gpclr = 0;
|
|
|
|
uint32_t gpset = 0;
|
|
|
|
for (int j = 0; j < 9; j++) {
|
|
|
|
if (bits & 1) {
|
|
|
|
gpset |= (1 << pintbl[j]);
|
|
|
|
} else {
|
|
|
|
gpclr |= (1 << pintbl[j]);
|
|
|
|
}
|
|
|
|
bits >>= 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
tblDatMsk[i] = gpclr;
|
|
|
|
tblDatSet[i] = gpset;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-07-06 03:56:25 +00:00
|
|
|
// Wait for signal change
|
2020-07-04 14:57:44 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2022-09-21 06:27:51 +00:00
|
|
|
bool GPIOBUS::WaitSignal(int pin, int ast)
|
2020-07-04 14:57:44 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Get current time
|
|
|
|
uint32_t now = SysTimer::GetTimerLow();
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Calculate timeout (3000ms)
|
|
|
|
uint32_t timeout = 3000 * 1000;
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// end immediately if the signal has changed
|
|
|
|
do {
|
|
|
|
// Immediately upon receiving a reset
|
|
|
|
Acquire();
|
|
|
|
if (GetRST()) {
|
|
|
|
return false;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Check for the signal edge
|
|
|
|
if (((signals >> pin) ^ ~ast) & 1) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
} while ((SysTimer::GetTimerLow() - now) < timeout);
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// We timed out waiting for the signal
|
|
|
|
return false;
|
2020-07-04 14:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2022-10-25 00:21:40 +00:00
|
|
|
// Generic Phase Acquisition (Doesn't read GPIO)
|
2020-07-04 14:57:44 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2022-10-25 00:21:40 +00:00
|
|
|
BUS::phase_t GPIOBUS::GetPhaseRaw(uint32_t raw_data)
|
2020-07-04 14:57:44 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
|
|
|
// Selection Phase
|
|
|
|
if (GetPinRaw(raw_data, PIN_SEL)) {
|
|
|
|
if (GetPinRaw(raw_data, PIN_IO)) {
|
|
|
|
return BUS::phase_t::reselection;
|
|
|
|
} else {
|
|
|
|
return BUS::phase_t::selection;
|
|
|
|
}
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Bus busy phase
|
|
|
|
if (!GetPinRaw(raw_data, PIN_BSY)) {
|
|
|
|
return BUS::phase_t::busfree;
|
|
|
|
}
|
2020-07-04 14:57:44 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
// Get target phase from bus signal line
|
|
|
|
int mci = GetPinRaw(raw_data, PIN_MSG) ? 0x04 : 0x00;
|
|
|
|
mci |= GetPinRaw(raw_data, PIN_CD) ? 0x02 : 0x00;
|
|
|
|
mci |= GetPinRaw(raw_data, PIN_IO) ? 0x01 : 0x00;
|
|
|
|
return GetPhase(mci);
|
2020-07-04 14:57:44 +00:00
|
|
|
}
|
|
|
|
|
2020-10-19 12:31:06 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2022-10-25 00:21:40 +00:00
|
|
|
// Get the number of bytes for a command
|
2020-10-19 12:31:06 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2022-10-25 00:21:40 +00:00
|
|
|
int GPIOBUS::GetCommandByteCount(BYTE opcode)
|
2020-10-19 12:31:06 +00:00
|
|
|
{
|
2022-10-25 00:21:40 +00:00
|
|
|
GPIO_FUNCTION_TRACE
|
2020-10-19 12:31:06 +00:00
|
|
|
|
2022-10-25 00:21:40 +00:00
|
|
|
if (opcode == 0x88 || opcode == 0x8A || opcode == 0x8F || opcode == 0x91 || opcode == 0x9E || opcode == 0x9F) {
|
|
|
|
return 16;
|
|
|
|
} else if (opcode == 0xA0) {
|
|
|
|
return 12;
|
|
|
|
} else if (opcode == 0x05 || (opcode >= 0x20 && opcode <= 0x7D)) {
|
|
|
|
return 10;
|
|
|
|
} else {
|
|
|
|
return 6;
|
|
|
|
}
|
Refactoring, device handling extensions, additional settings, improved error handling, 64 bit OS support, fixed issues (#184)
* Device type unification, support of removable media
* Added support for .hdr extension
* Removable flag cleanup
* Manpage update
* Enriched PbOperation with PbDevice
* Added file size to PbImageFile
* Added device list support
* Set image_file
* Make remote interface more robust by ignoring SIGPIPE
* Return status only once
* Fixed typo
* Error handling update
* When starting rascsi parse everything before attaching devices
* Added dry run mode
* Comment update
* Updated logging
* Added Device base class, Disk class inherits from it
* Renaming
* Use vectors for controllers and disks, as preparation for using maps
* Updated file support handling
* Comment update
* DaynaPort and Bridge inherit from Device instead of Disk
* ProcessCmd() now works with devices instead of disks
* Renaming
* Added DeviceFactory
* Improved factory
* Comment update
* protected disk_t
* Code cleanup, added translations
* Device name can be set for rascsi
* rasctl can set device name
* Manpage update
* Manpage update
* Formatting update
* Check for missing name
* Initialize fd
* Initialize type
* Fixed string length issue
* Updated capacity formatting
* Fixed typo
* Split PbDevice into device and device definition
* Added TODO
* Renaming
* Renaming
* Device types can be explicitly specified with -t (no FILE:TYPE syntax anymore)
* Fixed compile-time issue
* Removed unused Append mode, updated read-only handling
* Type handling and manpage update
* Cleanup
* rasctl parser cleanup
* Review
* Constructor update
* Added .hdr (SCRM) support to web interface, tested web interface
* Default folder can be set remotely
* Removed deprecated operation
* DETACH supports all parameters in order to detach all devices
* include cleanup
* Logging should not depend on NDEBUG, for RaSCSI it is not peformance-critical
* INFO is default log level
* Exception renaming
* Updated GetPaddedName()
* Inheritance update
* Added BlockDevice class
* Removed unused code
* Updated typedefs
* Revert "Updated typedefs"
This reverts commit 546b46215a4d9b65067a11698e59ab1123cc6d64.
* Removed unused code
* Fixed warnign
* Use standard C++ integer types, use streams to resolve printf data type issues
* Added TODOs
* Added TODO
* Renaming
* Added TODO
* Added TODO
* Improved dry-run
* Code cleanup
* Updated handling of unknown options, code review and cleanup
* Manpage update
* Added PrimaryDevice
* Include cleanup
* Added pure virtual methods
* Comment updates
* Split rasutil
* Replaced some occurrences of BOOL
* Removed obsolete RASCSI definition in xm6.h
* Removed unused code, updated TODOs, replaced BOOL
* Added capacity check (issue #192)
* Fixed (most likely) https://github.com/akuker/RASCSI/issues/191
* Fixed wrong error messages
* For root the default image folder is /home/pi/images, updated error handling
* Dynaport code review
* Improved error handling
* Implemented READ CAPACITY(16)
* Comment update
* Commands can be 16 bytes long
* Implemented READ/WRITE/VERIFY(16)
* Comment update
* Renamed method to reflect the name of the respective SCSI command
* Do not created devices during dryRun
* Fixed padding of SCSIHD_APPLE vendor and product
* Initial implementation
* Updated ReportLuns
* Byte count update
* Fixed typo
* Finalized REPORT LUNS
* Removed TODO
* Updated TODO
* TODO update
* Updated device factory
* Comment update
* 64 bit update, tested on Ubuntu 64 bit system
* Removed assertion
* SCSI hard disks always have Apple specific mode pages (resolves issue #193)
* Error messsage update, 64 bit cleanup
* Reduced streams usage
* Updated handling of device flags
* MOs are protectable
* Removed duplicate error code handling
* Removed duplicate code
* Fixed CmdReadToc buffer overflow (https://github.com/akuker/RASCSI/issues/194)
* Added naive implementation of GET EVENT STATUS NOTIFICATION to avoid wranings
* HD must set removable device bit if the media is removable
* Removed duplicate logging
* Updated daynaport additional length
* Removed broken daynaport REQUEST SENSE. Successfully tested with my Mac.
* EnableInterface should not always return TRUE
* Updated Inquiry
* Updated LUN handling
* Replaced incorrect free by delete
* Updated comments and write-protection handling
* Made default HD name consistent
* STATUS_NOERROR is default
* Fixed Eject
* More eject handling updates
* Manpage updates
* Logging update
* Changed debug level
* Logging update
* Log capacity of all media types
* Logging update
* Encapsulated disk.blocks
* Encapsulated sector size
* Added overrides
* Added more overrides
* Fixed error message
* Fixed typos
* Fixed logging
* Added logging
* Use PrimaryDevice when calling Inquiry
* Comment update
* Changed default buffer size for testing
* Reverted last change
* Removed debug output
* De-inlined methods because optimized code did not work with them inlined
* Web interface can attach Daynaport again
* Improved handling of read-only hard disks
* Fixed issue with "all" semantics of DETACH
* rasctl supports adding removable media devices without providing a filename
* Removed unused flag in PbDeviceDefinition
* Updated rasctl output for ecjected media (resolves issue #199)
* Validate default folder name when changing default folder
2021-08-21 21:45:30 +00:00
|
|
|
}
|