Add ATAPI Read Format Capacities command to Zip drive - fixes various Linuxes when Zip enabled.
This commit is contained in:
parent
63b431cc9e
commit
b164fe1e4f
1 changed files with 46 additions and 0 deletions
|
|
@ -31,6 +31,8 @@
|
||||||
/*cmd[1] = mode
|
/*cmd[1] = mode
|
||||||
cmd[6-x] = password*/
|
cmd[6-x] = password*/
|
||||||
|
|
||||||
|
#define ATAPI_READ_FORMAT_CAPACITIES 0x23
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
CMD_POS_IDLE = 0,
|
CMD_POS_IDLE = 0,
|
||||||
|
|
@ -1006,6 +1008,50 @@ static int scsi_zip_command(uint8_t *cdb, void *p)
|
||||||
bus_state = BUS_CD | BUS_IO;
|
bus_state = BUS_CD | BUS_IO;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ATAPI_READ_FORMAT_CAPACITIES:
|
||||||
|
if (data->is_atapi)
|
||||||
|
{
|
||||||
|
len = cdb[8] | (cdb[7] << 8);
|
||||||
|
|
||||||
|
/*List header*/
|
||||||
|
scsi_add_data(0, data);
|
||||||
|
scsi_add_data(0, data);
|
||||||
|
scsi_add_data(0, data);
|
||||||
|
scsi_add_data(16, data); /*list length*/
|
||||||
|
|
||||||
|
/*Current/Maximum capacity header*/
|
||||||
|
scsi_add_data((ZIP_SECTORS >> 24) & 0xff, data);
|
||||||
|
scsi_add_data((ZIP_SECTORS >> 16) & 0xff, data);
|
||||||
|
scsi_add_data((ZIP_SECTORS >> 8) & 0xff, data);
|
||||||
|
scsi_add_data( ZIP_SECTORS & 0xff, data);
|
||||||
|
if (data->disc_loaded)
|
||||||
|
scsi_add_data(2, data); /*Formatted media - current media capacity*/
|
||||||
|
else
|
||||||
|
scsi_add_data(3, data); /*Maximum formattable capacity*/
|
||||||
|
scsi_add_data(512 >> 16, data);
|
||||||
|
scsi_add_data(512 >> 8, data);
|
||||||
|
scsi_add_data(512 & 0xff, data);
|
||||||
|
|
||||||
|
/*Formattable capacity descriptor*/
|
||||||
|
scsi_add_data((ZIP_SECTORS >> 24) & 0xff, data);
|
||||||
|
scsi_add_data((ZIP_SECTORS >> 16) & 0xff, data);
|
||||||
|
scsi_add_data((ZIP_SECTORS >> 8) & 0xff, data);
|
||||||
|
scsi_add_data( ZIP_SECTORS & 0xff, data);
|
||||||
|
scsi_add_data(0, data);
|
||||||
|
scsi_add_data(512 >> 16, data);
|
||||||
|
scsi_add_data(512 >> 8, data);
|
||||||
|
scsi_add_data(512 & 0xff, data);
|
||||||
|
|
||||||
|
data->cmd_pos = CMD_POS_IDLE;
|
||||||
|
bus_state = BUS_IO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scsi_zip_illegal(data);
|
||||||
|
bus_state = BUS_CD | BUS_IO;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fatal("Bad SCSI ZIP command %02x\n", cdb[0]);
|
fatal("Bad SCSI ZIP command %02x\n", cdb[0]);
|
||||||
scsi_zip_illegal(data);
|
scsi_zip_illegal(data);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue