From 73347ba495f80f8f764ff8a892d8d3792ecb0eba Mon Sep 17 00:00:00 2001 From: Michael McMaster Date: Wed, 29 Mar 2017 19:52:34 +1000 Subject: [PATCH] Add missing files --- src/firmware/vendor.c | 58 +++++++++++++++++++++++++++++++++++++++++++ src/firmware/vendor.h | 22 ++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100755 src/firmware/vendor.c create mode 100755 src/firmware/vendor.h diff --git a/src/firmware/vendor.c b/src/firmware/vendor.c new file mode 100755 index 00000000..3d508e04 --- /dev/null +++ b/src/firmware/vendor.c @@ -0,0 +1,58 @@ +// Copyright (C) 2016 Michael McMaster +// +// This file is part of SCSI2SD. +// +// SCSI2SD is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// SCSI2SD is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with SCSI2SD. If not, see . + +#include "scsi.h" +#include "vendor.h" + + +// Callback after the DATA OUT phase is complete. +static void doAssignDiskParameters(void) +{ + scsiDev.phase = STATUS; +} + +int scsiVendorCommand() +{ + int commandHandled = 1; + + uint8_t command = scsiDev.cdb[0]; + + if (command == 0xC0) + { + // Define flexible disk format + // OMTI-5204 controller + // http://bitsavers.informatik.uni-stuttgart.de/pdf/sms/OMTI_5x00.pdf + // Stub. Sectors-per-track should be configured by scsi2sd-util + } + else if (command == 0xC2) + { + // Assign Disk Parameters command + // OMTI-5204 controller + // http://bitsavers.informatik.uni-stuttgart.de/pdf/sms/OMTI_5x00.pdf + // Stub to read and discard 10 bytes. + scsiDev.dataLen = 10; + scsiDev.phase = DATA_OUT; + scsiDev.postDataOutHook = doAssignDiskParameters; + } + else + { + commandHandled = 0; + } + + return commandHandled; +} + diff --git a/src/firmware/vendor.h b/src/firmware/vendor.h new file mode 100755 index 00000000..7e267f1d --- /dev/null +++ b/src/firmware/vendor.h @@ -0,0 +1,22 @@ +// Copyright (C) 2016 Michael McMaster +// +// This file is part of SCSI2SD. +// +// SCSI2SD is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// SCSI2SD is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with SCSI2SD. If not, see . +#ifndef S2S_VENDOR_H +#define S2S_VENDOR_H + +int scsiVendorCommand(void); + +#endif -- 2.38.5