diff --git a/doc/rasctl.1 b/doc/rasctl.1 index 9e35f1d5..8828352f 100644 --- a/doc/rasctl.1 +++ b/doc/rasctl.1 @@ -70,11 +70,13 @@ The optional block size. For SCSI drives 512, 1024, 2048 or 4096 bytes, default Path to the disk image file. See the rascsi(1) man page for allowable file types. .TP .BR \-t\fI " " \fITYPE -Specifies the device type. This type overrides the type derived from the file extension of the specified image. See the rascsi(1) man page for the available device types. Legacy drive types are: - hd: Hard disk (SCSI or SASI) - mo: Magneto-Optical disk +Specifies the device type. This type overrides the type derived from the file extension of the specified image. See the rascsi(1) man page for the available device types. For some types there are shortcuts (only the first letter is required): + hd: SCSI hard disk drive + rm: SCSI removable media drive cd: CD-ROM - bridge: Bridge device (This is only applicable to the Sharp X68000) + mo: Magneto-Optical disk + bridge: Bridge device (Only applicable to the Sharp X68000) + daynaport: Daynaport network adapter .TP .BR \-u\fI " " \fIVENDOR:PRODUCT:REVISION The vendor, product and revision for the device, to be returned with the INQUIRY data. A complete set of name components must be provided. VENDOR may have up to 8, PRODUCT up to 16, REVISION up to 4 characters. Padding with blanks to the maxium length is automatically applied. Once set the name of a device cannot be changed. diff --git a/doc/rasctl_man_page.txt b/doc/rasctl_man_page.txt index a8bf44a5..54f17b60 100644 --- a/doc/rasctl_man_page.txt +++ b/doc/rasctl_man_page.txt @@ -67,25 +67,26 @@ OPTIONS -t TYPE Specifies the device type. This type overrides the type derived from the file extension of the specified image. See the - rascsi(1) man page for the available device types. Legacy drive - types are: - hd: Hard disk (SCSI or SASI) - mo: Magneto-Optical disk + rascsi(1) man page for the available device types. For some + types there are shortcuts (only the first letter is required): + hd: SCSI hard disk drive + rm: SCSI removable media drive cd: CD-ROM - bridge: Bridge device (This is only applicable to the Sharp - X68000) + mo: Magneto-Optical disk + bridge: Bridge device (Only applicable to the Sharp X68000) + daynaport: Daynaport network adapter -u VENDOR:PRODUCT:REVISION - The vendor, product and revision for the device, to be returned + The vendor, product and revision for the device, to be returned with the INQUIRY data. A complete set of name components must be provided. VENDOR may have up to 8, PRODUCT up to 16, REVISION up to 4 characters. Padding with blanks to the maxium length is au‐ - tomatically applied. Once set the name of a device cannot be + tomatically applied. Once set the name of a device cannot be changed. -u UNIT - Unit number (0 or 1). This will default to 0. This option is - only used when there are multiple SCSI devices on a shared SCSI + Unit number (0 or 1). This will default to 0. This option is + only used when there are multiple SCSI devices on a shared SCSI controller. (This is not common) EXAMPLES diff --git a/src/raspberrypi/devices/disk.cpp b/src/raspberrypi/devices/disk.cpp index 2bb6148f..0ff3a8c8 100644 --- a/src/raspberrypi/devices/disk.cpp +++ b/src/raspberrypi/devices/disk.cpp @@ -519,9 +519,7 @@ bool Disk::Eject(bool force) // The image file for this drive is not in use anymore FileSupport *file_support = dynamic_cast(this); if (file_support) { - Filepath filepath; - file_support->GetPath(filepath); - file_support->UnreserveFile(filepath); + file_support->UnreserveFile(); } } diff --git a/src/raspberrypi/devices/file_support.cpp b/src/raspberrypi/devices/file_support.cpp index 87dfc83c..e5fbea61 100644 --- a/src/raspberrypi/devices/file_support.cpp +++ b/src/raspberrypi/devices/file_support.cpp @@ -20,9 +20,9 @@ void FileSupport::ReserveFile(const Filepath& path, int id, int lun) reserved_files[path.GetPath()] = make_pair(id, lun); } -void FileSupport::UnreserveFile(const Filepath& path) +void FileSupport::UnreserveFile() { - reserved_files.erase(path.GetPath()); + reserved_files.erase(diskpath.GetPath()); } bool FileSupport::GetIdsForReservedFile(const Filepath& path, int& id, int& unit) const diff --git a/src/raspberrypi/devices/file_support.h b/src/raspberrypi/devices/file_support.h index 09438816..12378168 100644 --- a/src/raspberrypi/devices/file_support.h +++ b/src/raspberrypi/devices/file_support.h @@ -37,7 +37,7 @@ public: static const map GetReservedFiles() { return reserved_files; } const static void SetReservedFiles(const map& files_in_use) { FileSupport::reserved_files = files_in_use; } void ReserveFile(const Filepath&, int, int); - void UnreserveFile(const Filepath&); + void UnreserveFile(); bool GetIdsForReservedFile(const Filepath&, int&, int&) const; static void UnreserveAll(); diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index aad7e8d4..4589055f 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -867,9 +867,7 @@ bool ProcessCmd(int fd, const PbDeviceDefinition& pb_device, const PbOperation o FileSupport *file_support = dynamic_cast(device); if (file_support) { - Filepath filepath; - file_support->GetPath(filepath); - file_support->UnreserveFile(filepath); + file_support->UnreserveFile(); } // Re-map the controller, remember the device type because the device gets lost when re-mapping diff --git a/src/raspberrypi/rasctl.cpp b/src/raspberrypi/rasctl.cpp index c2c69bf0..e4406bb9 100644 --- a/src/raspberrypi/rasctl.cpp +++ b/src/raspberrypi/rasctl.cpp @@ -382,7 +382,7 @@ PbDeviceType ParseType(const char *optarg) return type; } else { - // Parse legacy types + // Parse type shortcuts switch (tolower(optarg[0])) { case 'c': return SCCD; @@ -393,8 +393,14 @@ PbDeviceType ParseType(const char *optarg) case 'd': return SCDP; + case 'h': + return SCHD; + case 'm': return SCMO; + + case 'r': + return SCRM; } }