Add M.O. drive models.
This commit is contained in:
@@ -1573,8 +1573,8 @@ load_mo(config_t* cfg, const char* cat)
|
|||||||
|
|
||||||
for (c = 0; c < MO_NUM; c++) {
|
for (c = 0; c < MO_NUM; c++) {
|
||||||
sprintf(temp, "mo_%02i_parameters", c + 1);
|
sprintf(temp, "mo_%02i_parameters", c + 1);
|
||||||
p = config_get_string(cat, temp, "none");
|
p = config_get_string(cat, temp, "0, none");
|
||||||
sscanf(p, "%s", s);
|
sscanf(p, "%u, %s", (unsigned*)&mo_drives[c].type, s);
|
||||||
mo_drives[c].bus_type = mo_string_to_bus(s);
|
mo_drives[c].bus_type = mo_string_to_bus(s);
|
||||||
|
|
||||||
/* Default values, needed for proper operation of the Settings dialog. */
|
/* Default values, needed for proper operation of the Settings dialog. */
|
||||||
@@ -1654,7 +1654,7 @@ save_mo(const config_t* cfg, const char* cat)
|
|||||||
config_delete_var(cat, temp);
|
config_delete_var(cat, temp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sprintf(tmp2, "%s",
|
sprintf(tmp2, "%u, %s", mo_drives[c].type,
|
||||||
mo_bus_to_string(mo_drives[c].bus_type));
|
mo_bus_to_string(mo_drives[c].bus_type));
|
||||||
config_set_string(cat, temp, tmp2);
|
config_set_string(cat, temp, tmp2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1388,12 +1388,6 @@ do_command(void *p, uint8_t *cdb)
|
|||||||
buf_alloc(dev, 65536);
|
buf_alloc(dev, 65536);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(mode_sense_page_flags & (1LL << (uint64_t) (cdb[2] & 0x3f)))) {
|
|
||||||
invalid_field(dev);
|
|
||||||
buf_free(dev);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(dev->buffer, 0, len);
|
memset(dev->buffer, 0, len);
|
||||||
alloc_length = len;
|
alloc_length = len;
|
||||||
|
|
||||||
@@ -1524,9 +1518,9 @@ do_command(void *p, uint8_t *cdb)
|
|||||||
dev->buffer[7] = 0x20; /* Wide bus supported */
|
dev->buffer[7] = 0x20; /* Wide bus supported */
|
||||||
}
|
}
|
||||||
|
|
||||||
ide_padstr8(dev->buffer + 8, 8, "VARCEM "); /* Vendor */
|
ide_padstr8(dev->buffer + 8, 8, mo_drive_types[dev->drv->type].vendor); /* Vendor */
|
||||||
ide_padstr8(dev->buffer + 16, 16, "MAGNETO OPTICAL "); /* Product */
|
ide_padstr8(dev->buffer + 16, 16, mo_drive_types[dev->drv->type].model); /* Product */
|
||||||
ide_padstr8(dev->buffer + 32, 4, "1.00"); /* Revision */
|
ide_padstr8(dev->buffer + 32, 4, mo_drive_types[dev->drv->type].revision); /* Revision */
|
||||||
idx = 36;
|
idx = 36;
|
||||||
|
|
||||||
if (max_len == 96) {
|
if (max_len == 96) {
|
||||||
@@ -2175,8 +2169,14 @@ packet_write(void *p, uint32_t val, int length)
|
|||||||
static void
|
static void
|
||||||
mo_identify(ide_t *ide, int ide_has_dma)
|
mo_identify(ide_t *ide, int ide_has_dma)
|
||||||
{
|
{
|
||||||
ide_padstr((char *) (ide->buffer + 23), "1.00", 8); /* Firmware */
|
char model[40];
|
||||||
ide_padstr((char *) (ide->buffer + 27), "VARCEM MAGNETO OPTICAL", 40); /* Model */
|
mo_t* mo = (mo_t*)ide->p;
|
||||||
|
|
||||||
|
memset(model, 0, 40);
|
||||||
|
snprintf(model, 40, "%s %s", mo_drive_types[mo_drives[mo->id].type].vendor, mo_drive_types[mo_drives[mo->id].type].model);
|
||||||
|
|
||||||
|
ide_padstr((char *) (ide->buffer + 23), mo_drive_types[mo_drives[mo->id].type].revision, 8); /* Firmware */
|
||||||
|
ide_padstr((char *) (ide->buffer + 27), model, 40); /* Model */
|
||||||
|
|
||||||
if (ide_has_dma) {
|
if (ide_has_dma) {
|
||||||
ide->buffer[80] = 0x30; /*Supported ATA versions : ATA/ATAPI-4 ATA/ATAPI-5*/
|
ide->buffer[80] = 0x30; /*Supported ATA versions : ATA/ATAPI-4 ATA/ATAPI-5*/
|
||||||
@@ -2486,7 +2486,7 @@ mo_load(mo_t *dev, const wchar_t *fn)
|
|||||||
fseek(dev->drv->f, 0, SEEK_END);
|
fseek(dev->drv->f, 0, SEEK_END);
|
||||||
size = ftell(dev->drv->f);
|
size = ftell(dev->drv->f);
|
||||||
|
|
||||||
for(i = 0; i < sizeof(mo_types); i++)
|
for(i = 0; i < KNOWN_MO_TYPES; i++)
|
||||||
{
|
{
|
||||||
if(size == mo_types[i].disk_size)
|
if(size == mo_types[i].disk_size)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ typedef struct {
|
|||||||
uint32_t medium_size,
|
uint32_t medium_size,
|
||||||
base;
|
base;
|
||||||
uint16_t sector_size;
|
uint16_t sector_size;
|
||||||
|
uint8_t type;
|
||||||
|
|
||||||
void *priv;
|
void *priv;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user