BlueSCSI_config.h 3.9 KB

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