BlueSCSI_config.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // Compile-time configuration parameters.
  2. // Other settings can be set by ini file at runtime.
  3. #pragma once
  4. #include <BlueSCSI_platform.h>
  5. // Use variables for version number
  6. #define FW_VER_NUM "2024.09.16"
  7. #define FW_VER_SUFFIX "dev" // 3 char only - 'dev' or 'rel'
  8. #define BLUESCSI_FW_VERSION FW_VER_NUM "-" FW_VER_SUFFIX
  9. // Configuration and log file paths
  10. #define CONFIGFILE "bluescsi.ini"
  11. #define CONFIGFILE_BAD "bluescsi.ini.txt"
  12. #define LOGFILE "log.txt"
  13. #define CRASHFILE "err.txt"
  14. // Log buffer size in bytes, must be a power of 2
  15. #ifndef LOGBUFSIZE
  16. #define LOGBUFSIZE 16384
  17. #endif
  18. #define LOG_SAVE_INTERVAL_MS 1000
  19. // Watchdog timeout
  20. // Watchdog will first issue a bus reset and if that does not help, crashdump.
  21. #define WATCHDOG_BUS_RESET_TIMEOUT 15000
  22. #define WATCHDOG_CRASH_TIMEOUT 30000
  23. // HDD image file format
  24. #define HDIMG_ID_POS 2 // Position to embed ID number
  25. #define HDIMG_LUN_POS 3 // Position to embed LUN numbers
  26. #define HDIMG_BLK_POS 5 // Position to embed block size numbers
  27. #define MAX_FILE_PATH 64 // Maximum file name length
  28. // Image definition options
  29. #define IMAGE_INDEX_MAX 9 // Maximum number of 'IMG0' style statements parsed
  30. // SCSI config
  31. #define NUM_SCSIID 8 // Maximum number of supported SCSI-IDs (The minimum is 0)
  32. #define NUM_SCSILUN 1 // Maximum number of LUNs supported (Currently has to be 1)
  33. #define READ_PARITY_CHECK 0 // Perform read parity check (unverified)
  34. // SCSI raw fallback configuration when no image files are detected
  35. // Presents the whole SD card as an SCSI drive
  36. #define RAW_FALLBACK_ENABLE 1
  37. #define RAW_FALLBACK_SCSI_ID 1
  38. #define RAW_FALLBACK_BLOCKSIZE 512
  39. // Default SCSI drive information (can be overridden in INI file)
  40. // Selected based on device type (fixed, removable, optical, floppy, mag-optical, tape)
  41. // Each entry has {vendor, product, version, serial}
  42. // If serial number is left empty, SD card serial number is used.
  43. #define DRIVEINFO_FIXED {"BlueSCSI", "HARDDRIVE", PLATFORM_REVISION, ""}
  44. #define DRIVEINFO_REMOVABLE {"BlueSCSI", "REMOVABLE", PLATFORM_REVISION, ""}
  45. #define DRIVEINFO_OPTICAL {"BlueSCSI", "CDROM", PLATFORM_REVISION, ""}
  46. #define DRIVEINFO_FLOPPY {"BlueSCSI", "FLOPPY", PLATFORM_REVISION, ""}
  47. #define DRIVEINFO_MAGOPT {"BlueSCSI", "MO_DRIVE", PLATFORM_REVISION, ""}
  48. #define DRIVEINFO_NETWORK {"Dayna", "SCSI/Link", "2.0f", ""}
  49. #define DRIVEINFO_TAPE {"BlueSCSI", "TAPE", PLATFORM_REVISION, ""}
  50. // Default SCSI drive information when Apple quirks are enabled
  51. #define APPLE_DRIVEINFO_FIXED {"QUANTUM", "BlueSCSI Pico", "1.0", ""}
  52. #define APPLE_DRIVEINFO_REMOVABLE {"IOMEGA", "BETA230", "2.02", ""}
  53. #define APPLE_DRIVEINFO_OPTICAL {"BlueSCSI", "CD-ROM CDU-55S", "1.9a", ""}
  54. #define APPLE_DRIVEINFO_FLOPPY {"TEAC", "FD235HS", "1.44", ""}
  55. #define APPLE_DRIVEINFO_MAGOPT {"MOST", "RMD-5200", "1.0", ""}
  56. #define APPLE_DRIVEINFO_NETWORK {"Dayna", "SCSI/Link", "2.0f", ""}
  57. #define APPLE_DRIVEINFO_TAPE {"BlueSCSI", "APPLE_TAPE", "", ""}
  58. // Default Iomega ZIP drive information
  59. #define IOMEGA_DRIVEINFO_ZIP100 {"IOMEGA", "ZIP 100", "D.13", ""}
  60. #define IOMEGA_DRIVEINFO_ZIP250 {"IOMEGA", "ZIP 250", "42.S", ""}
  61. #define IOMEGA_DRIVEINFO_JAZ {"iomega", "jaz", "", ""}
  62. // Default delay for SCSI phases.
  63. // Can be adjusted in ini file
  64. #define DEFAULT_SCSI_DELAY_US 10
  65. #define DEFAULT_REQ_TYPE_SETUP_NS 500
  66. // Use prefetch buffer in read requests
  67. #ifndef PREFETCH_BUFFER_SIZE
  68. #define PREFETCH_BUFFER_SIZE 8192
  69. #endif
  70. /**
  71. * @filename - name of the file to be evaluated for block size
  72. * @scsiId - ID of the device we're looking to get the block size for
  73. * @default_size - if block size cant be determined use this value
  74. */
  75. int getBlockSize(char *filename, int scsiId, int default_size);
  76. int getImgDir(int scsiId, char* dirname);
  77. int getImg(int scsiId, int img_index, char* filename);
  78. int getToolBoxSharedDir(char * dir_name);