Fixed CD-ROM, ZIP, and SCSI disk changeable page arrays to correctly contain only 0's and 0xFF's in addition to page number and page length, and added descriptive #define's for the pages that did not yet have them.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* Definitions for the generic SCSI device command handler.
|
||||
*
|
||||
* Version: @(#)scsi_device.h 1.0.9 2018/10/02
|
||||
* Version: @(#)scsi_device.h 1.0.10 2018/10/07
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -92,23 +92,30 @@
|
||||
|
||||
/* Mode page codes for mode sense/set */
|
||||
#define GPMODE_R_W_ERROR_PAGE 0x01
|
||||
#define GPMODE_DISCONNECT_PAGE 0x02 /* Disconnect/reconnect page */
|
||||
#define GPMODE_FORMAT_DEVICE_PAGE 0x03
|
||||
#define GPMODE_RIGID_DISK_PAGE 0x04 /* Rigid disk geometry page */
|
||||
#define GPMODE_FLEXIBLE_DISK_PAGE 0x05
|
||||
#define GPMODE_CACHING_PAGE 0x08
|
||||
#define GPMODE_CDROM_PAGE 0x0d
|
||||
#define GPMODE_CDROM_AUDIO_PAGE 0x0e
|
||||
#define GPMODE_CAPABILITIES_PAGE 0x2a
|
||||
#define GPMODE_IOMEGA_PAGE 0x2f
|
||||
#define GPMODE_UNK_VENDOR_PAGE 0x30
|
||||
#define GPMODE_ALL_PAGES 0x3f
|
||||
|
||||
/* Mode page codes for presence */
|
||||
#define GPMODEP_R_W_ERROR_PAGE 0x0000000000000002LL
|
||||
#define GPMODEP_UNK_PAGE_02 0x0000000000000004LL
|
||||
#define GPMODEP_UNK_PAGE_03 0x0000000000000008LL
|
||||
#define GPMODEP_UNK_PAGE_04 0x0000000000000010LL
|
||||
#define GPMODEP_UNK_PAGE_05 0x0000000000000020LL
|
||||
#define GPMODEP_UNK_PAGE_08 0x0000000000000100LL
|
||||
#define GPMODEP_DISCONNECT_PAGE 0x0000000000000004LL
|
||||
#define GPMODEP_FORMAT_DEVICE_PAGE 0x0000000000000008LL
|
||||
#define GPMODEP_RIGID_DISK_PAGE 0x0000000000000010LL
|
||||
#define GPMODEP_FLEXIBLE_DISK_PAGE 0x0000000000000020LL
|
||||
#define GPMODEP_CACHING_PAGE 0x0000000000000100LL
|
||||
#define GPMODEP_CDROM_PAGE 0x0000000000002000LL
|
||||
#define GPMODEP_CDROM_AUDIO_PAGE 0x0000000000004000LL
|
||||
#define GPMODEP_CAPABILITIES_PAGE 0x0000040000000000LL
|
||||
#define GPMODEP_UNK_PAGE_2F 0x0000800000000000LL
|
||||
#define GPMODEP_UNK_PAGE_30 0x0001000000000000LL
|
||||
#define GPMODEP_IOMEGA_PAGE 0x0000800000000000LL
|
||||
#define GPMODEP_UNK_VENDOR_PAGE 0x0001000000000000LL
|
||||
#define GPMODEP_ALL_PAGES 0x8000000000000000LL
|
||||
|
||||
/* SCSI Status Codes */
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* Emulation of SCSI fixed disks.
|
||||
*
|
||||
* Version: @(#)scsi_disk.c 1.0.22 2018/10/02
|
||||
* Version: @(#)scsi_disk.c 1.0.23 2018/10/07
|
||||
*
|
||||
* Author: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
@@ -126,22 +126,22 @@ const uint8_t scsi_disk_command_flags[0x100] = {
|
||||
};
|
||||
|
||||
|
||||
uint64_t scsi_disk_mode_sense_page_flags = (GPMODEP_UNK_PAGE_03 |
|
||||
GPMODEP_UNK_PAGE_04 |
|
||||
GPMODEP_UNK_PAGE_30 |
|
||||
uint64_t scsi_disk_mode_sense_page_flags = (GPMODEP_FORMAT_DEVICE_PAGE |
|
||||
GPMODEP_RIGID_DISK_PAGE |
|
||||
GPMODEP_UNK_VENDOR_PAGE |
|
||||
GPMODEP_ALL_PAGES);
|
||||
|
||||
/* This should be done in a better way but for time being, it's been done this way so it's not as huge and more readable. */
|
||||
static const mode_sense_pages_t scsi_disk_mode_sense_pages_default =
|
||||
{ { [0x03] = { 0x03, 0x16, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
[0x04] = { 0x04, 0x16, 0, 0x10, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0, 0 },
|
||||
[0x30] = { 0xB0, 0x16, '8', '6', 'B', 'o', 'x', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
|
||||
{ { [GPMODE_FORMAT_DEVICE_PAGE] = { GPMODE_FORMAT_DEVICE_PAGE, 0x16, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
[GPMODE_RIGID_DISK_PAGE ] = { GPMODE_RIGID_DISK_PAGE, 0x16, 0, 0x10, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0, 0 },
|
||||
[GPMODE_UNK_VENDOR_PAGE ] = { 0xB0, 0x16, '8', '6', 'B', 'o', 'x', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
|
||||
} };
|
||||
|
||||
static const mode_sense_pages_t scsi_disk_mode_sense_pages_changeable =
|
||||
{ { [0x03] = { 0x03, 0x16, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
[0x04] = { 0x04, 0x16, 0, 0x10, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0, 0, 0 },
|
||||
[0x30] = { 0xB0, 0x16, '8', '6', 'B', 'o', 'x', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }
|
||||
{ { [GPMODE_FORMAT_DEVICE_PAGE] = { GPMODE_FORMAT_DEVICE_PAGE, 0x16, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0 },
|
||||
[GPMODE_RIGID_DISK_PAGE ] = { GPMODE_RIGID_DISK_PAGE, 0x16, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0 },
|
||||
[GPMODE_UNK_VENDOR_PAGE ] = { 0xB0, 0x16, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
|
||||
} };
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user