vendor.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // Copyright (C) 2016 Michael McMaster <michael@codesrc.com>
  2. //
  3. // This file is part of SCSI2SD.
  4. //
  5. // SCSI2SD is free software: you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation, either version 3 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // SCSI2SD is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with SCSI2SD. If not, see <http://www.gnu.org/licenses/>.
  17. #include "scsi.h"
  18. #include "vendor.h"
  19. // Callback after the DATA OUT phase is complete.
  20. static void doAssignDiskParameters(void)
  21. {
  22. scsiDev.phase = STATUS;
  23. }
  24. int scsiVendorCommand()
  25. {
  26. int commandHandled = 1;
  27. uint8_t command = scsiDev.cdb[0];
  28. if (command == 0xC0)
  29. {
  30. // Define flexible disk format
  31. // OMTI-5204 controller
  32. // http://bitsavers.informatik.uni-stuttgart.de/pdf/sms/OMTI_5x00.pdf
  33. // Stub. Sectors-per-track should be configured by scsi2sd-util
  34. }
  35. else if (command == 0xC2)
  36. {
  37. // Assign Disk Parameters command
  38. // OMTI-5204 controller
  39. // http://bitsavers.informatik.uni-stuttgart.de/pdf/sms/OMTI_5x00.pdf
  40. // Stub to read and discard 10 bytes.
  41. scsiDev.dataLen = 10;
  42. scsiDev.phase = DATA_OUT;
  43. scsiDev.postDataOutHook = doAssignDiskParameters;
  44. }
  45. else
  46. {
  47. commandHandled = 0;
  48. }
  49. return commandHandled;
  50. }