mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 11:04:58 -06:00
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Conflicts: block/vmdk.c
This commit is contained in:
commit
8494a397b6
33 changed files with 1980 additions and 651 deletions
119
hw/ide/atapi.c
119
hw/ide/atapi.c
|
@ -154,10 +154,10 @@ void ide_atapi_io_error(IDEState *s, int ret)
|
|||
{
|
||||
/* XXX: handle more errors */
|
||||
if (ret == -ENOMEDIUM) {
|
||||
ide_atapi_cmd_error(s, SENSE_NOT_READY,
|
||||
ide_atapi_cmd_error(s, NOT_READY,
|
||||
ASC_MEDIUM_NOT_PRESENT);
|
||||
} else {
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
|
||||
ASC_LOGICAL_BLOCK_OOR);
|
||||
}
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ static void ide_atapi_cmd_check_status(IDEState *s)
|
|||
#ifdef DEBUG_IDE_ATAPI
|
||||
printf("atapi_cmd_check_status\n");
|
||||
#endif
|
||||
s->error = MC_ERR | (SENSE_UNIT_ATTENTION << 4);
|
||||
s->error = MC_ERR | (UNIT_ATTENTION << 4);
|
||||
s->status = ERR_STAT;
|
||||
s->nsector = 0;
|
||||
ide_set_irq(s->bus);
|
||||
|
@ -354,7 +354,7 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret)
|
|||
ide_atapi_cmd_read_dma_cb, s);
|
||||
if (!s->bus->dma->aiocb) {
|
||||
/* Note: media not present is the most likely case */
|
||||
ide_atapi_cmd_error(s, SENSE_NOT_READY,
|
||||
ide_atapi_cmd_error(s, NOT_READY,
|
||||
ASC_MEDIUM_NOT_PRESENT);
|
||||
goto eot;
|
||||
}
|
||||
|
@ -505,19 +505,6 @@ static int ide_dvd_read_structure(IDEState *s, int format,
|
|||
static unsigned int event_status_media(IDEState *s,
|
||||
uint8_t *buf)
|
||||
{
|
||||
enum media_event_code {
|
||||
MEC_NO_CHANGE = 0, /* Status unchanged */
|
||||
MEC_EJECT_REQUESTED, /* received a request from user to eject */
|
||||
MEC_NEW_MEDIA, /* new media inserted and ready for access */
|
||||
MEC_MEDIA_REMOVAL, /* only for media changers */
|
||||
MEC_MEDIA_CHANGED, /* only for media changers */
|
||||
MEC_BG_FORMAT_COMPLETED, /* MRW or DVD+RW b/g format completed */
|
||||
MEC_BG_FORMAT_RESTARTED, /* MRW or DVD+RW b/g format restarted */
|
||||
};
|
||||
enum media_status {
|
||||
MS_TRAY_OPEN = 1,
|
||||
MS_MEDIA_PRESENT = 2,
|
||||
};
|
||||
uint8_t event_code, media_status;
|
||||
|
||||
media_status = 0;
|
||||
|
@ -564,27 +551,6 @@ static void cmd_get_event_status_notification(IDEState *s,
|
|||
uint8_t notification_class;
|
||||
uint8_t supported_events;
|
||||
} QEMU_PACKED *gesn_event_header;
|
||||
|
||||
enum notification_class_request_type {
|
||||
NCR_RESERVED1 = 1 << 0,
|
||||
NCR_OPERATIONAL_CHANGE = 1 << 1,
|
||||
NCR_POWER_MANAGEMENT = 1 << 2,
|
||||
NCR_EXTERNAL_REQUEST = 1 << 3,
|
||||
NCR_MEDIA = 1 << 4,
|
||||
NCR_MULTI_HOST = 1 << 5,
|
||||
NCR_DEVICE_BUSY = 1 << 6,
|
||||
NCR_RESERVED2 = 1 << 7,
|
||||
};
|
||||
enum event_notification_class_field {
|
||||
ENC_NO_EVENTS = 0,
|
||||
ENC_OPERATIONAL_CHANGE,
|
||||
ENC_POWER_MANAGEMENT,
|
||||
ENC_EXTERNAL_REQUEST,
|
||||
ENC_MEDIA,
|
||||
ENC_MULTIPLE_HOSTS,
|
||||
ENC_DEVICE_BUSY,
|
||||
ENC_RESERVED,
|
||||
};
|
||||
unsigned int max_len, used_len;
|
||||
|
||||
gesn_cdb = (void *)packet;
|
||||
|
@ -595,7 +561,7 @@ static void cmd_get_event_status_notification(IDEState *s,
|
|||
/* It is fine by the MMC spec to not support async mode operations */
|
||||
if (!(gesn_cdb->polled & 0x01)) { /* asynchronous mode */
|
||||
/* Only polling is supported, asynchronous mode is not. */
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
|
||||
ASC_INV_FIELD_IN_CMD_PACKET);
|
||||
return;
|
||||
}
|
||||
|
@ -606,8 +572,11 @@ static void cmd_get_event_status_notification(IDEState *s,
|
|||
* These are the supported events.
|
||||
*
|
||||
* We currently only support requests of the 'media' type.
|
||||
* Notification class requests and supported event classes are bitmasks,
|
||||
* but they are build from the same values as the "notification class"
|
||||
* field.
|
||||
*/
|
||||
gesn_event_header->supported_events = NCR_MEDIA;
|
||||
gesn_event_header->supported_events = 1 << GESN_MEDIA;
|
||||
|
||||
/*
|
||||
* We use |= below to set the class field; other bits in this byte
|
||||
|
@ -621,8 +590,8 @@ static void cmd_get_event_status_notification(IDEState *s,
|
|||
* notification_class_request_type enum above specifies the
|
||||
* priority: upper elements are higher prio than lower ones.
|
||||
*/
|
||||
if (gesn_cdb->class & NCR_MEDIA) {
|
||||
gesn_event_header->notification_class |= ENC_MEDIA;
|
||||
if (gesn_cdb->class & (1 << GESN_MEDIA)) {
|
||||
gesn_event_header->notification_class |= GESN_MEDIA;
|
||||
used_len = event_status_media(s, buf);
|
||||
} else {
|
||||
gesn_event_header->notification_class = 0x80; /* No event available */
|
||||
|
@ -643,8 +612,8 @@ static void cmd_request_sense(IDEState *s, uint8_t *buf)
|
|||
buf[7] = 10;
|
||||
buf[12] = s->asc;
|
||||
|
||||
if (s->sense_key == SENSE_UNIT_ATTENTION) {
|
||||
s->sense_key = SENSE_NONE;
|
||||
if (s->sense_key == UNIT_ATTENTION) {
|
||||
s->sense_key = NO_SENSE;
|
||||
}
|
||||
|
||||
ide_atapi_cmd_reply(s, 18, max_len);
|
||||
|
@ -676,7 +645,7 @@ static void cmd_get_configuration(IDEState *s, uint8_t *buf)
|
|||
|
||||
/* only feature 0 is supported */
|
||||
if (buf[2] != 0 || buf[3] != 0) {
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
|
||||
ASC_INV_FIELD_IN_CMD_PACKET);
|
||||
return;
|
||||
}
|
||||
|
@ -733,7 +702,7 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
|
|||
switch(action) {
|
||||
case 0: /* current values */
|
||||
switch(code) {
|
||||
case GPMODE_R_W_ERROR_PAGE: /* error recovery */
|
||||
case MODE_PAGE_R_W_ERROR: /* error recovery */
|
||||
cpu_to_ube16(&buf[0], 16 + 6);
|
||||
buf[2] = 0x70;
|
||||
buf[3] = 0;
|
||||
|
@ -742,8 +711,8 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
|
|||
buf[6] = 0;
|
||||
buf[7] = 0;
|
||||
|
||||
buf[8] = 0x01;
|
||||
buf[9] = 0x06;
|
||||
buf[8] = MODE_PAGE_R_W_ERROR;
|
||||
buf[9] = 16 - 10;
|
||||
buf[10] = 0x00;
|
||||
buf[11] = 0x05;
|
||||
buf[12] = 0x00;
|
||||
|
@ -752,7 +721,7 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
|
|||
buf[15] = 0x00;
|
||||
ide_atapi_cmd_reply(s, 16, max_len);
|
||||
break;
|
||||
case GPMODE_AUDIO_CTL_PAGE:
|
||||
case MODE_PAGE_AUDIO_CTL:
|
||||
cpu_to_ube16(&buf[0], 24 + 6);
|
||||
buf[2] = 0x70;
|
||||
buf[3] = 0;
|
||||
|
@ -761,6 +730,8 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
|
|||
buf[6] = 0;
|
||||
buf[7] = 0;
|
||||
|
||||
buf[8] = MODE_PAGE_AUDIO_CTL;
|
||||
buf[9] = 24 - 10;
|
||||
/* Fill with CDROM audio volume */
|
||||
buf[17] = 0;
|
||||
buf[19] = 0;
|
||||
|
@ -769,7 +740,7 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
|
|||
|
||||
ide_atapi_cmd_reply(s, 24, max_len);
|
||||
break;
|
||||
case GPMODE_CAPABILITIES_PAGE:
|
||||
case MODE_PAGE_CAPABILITIES:
|
||||
cpu_to_ube16(&buf[0], 28 + 6);
|
||||
buf[2] = 0x70;
|
||||
buf[3] = 0;
|
||||
|
@ -778,9 +749,9 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
|
|||
buf[6] = 0;
|
||||
buf[7] = 0;
|
||||
|
||||
buf[8] = 0x2a;
|
||||
buf[9] = 0x12;
|
||||
buf[10] = 0x00;
|
||||
buf[8] = MODE_PAGE_CAPABILITIES;
|
||||
buf[9] = 28 - 10;
|
||||
buf[10] = 0x3b; /* read CDR/CDRW/DVDROM/DVDR/DVDRAM */
|
||||
buf[11] = 0x00;
|
||||
|
||||
/* Claim PLAY_AUDIO capability (0x01) since some Linux
|
||||
|
@ -789,14 +760,14 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
|
|||
buf[13] = 3 << 5;
|
||||
buf[14] = (1 << 0) | (1 << 3) | (1 << 5);
|
||||
if (s->tray_locked) {
|
||||
buf[6] |= 1 << 1;
|
||||
buf[14] |= 1 << 1;
|
||||
}
|
||||
buf[15] = 0x00;
|
||||
cpu_to_ube16(&buf[16], 706);
|
||||
buf[18] = 0;
|
||||
buf[15] = 0x00; /* No volume & mute control, no changer */
|
||||
cpu_to_ube16(&buf[16], 704); /* 4x read speed */
|
||||
buf[18] = 0; /* Two volume levels */
|
||||
buf[19] = 2;
|
||||
cpu_to_ube16(&buf[20], 512);
|
||||
cpu_to_ube16(&buf[22], 706);
|
||||
cpu_to_ube16(&buf[20], 512); /* 512k buffer */
|
||||
cpu_to_ube16(&buf[22], 704); /* 4x read speed current */
|
||||
buf[24] = 0;
|
||||
buf[25] = 0;
|
||||
buf[26] = 0;
|
||||
|
@ -813,14 +784,14 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
|
|||
goto error_cmd;
|
||||
default:
|
||||
case 3: /* saved values */
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
|
||||
ASC_SAVING_PARAMETERS_NOT_SUPPORTED);
|
||||
break;
|
||||
}
|
||||
return;
|
||||
|
||||
error_cmd:
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, ASC_INV_FIELD_IN_CMD_PACKET);
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST, ASC_INV_FIELD_IN_CMD_PACKET);
|
||||
}
|
||||
|
||||
static void cmd_test_unit_ready(IDEState *s, uint8_t *buf)
|
||||
|
@ -883,7 +854,7 @@ static void cmd_read_cd(IDEState *s, uint8_t* buf)
|
|||
ide_atapi_cmd_read(s, lba, nb_sectors, 2352);
|
||||
break;
|
||||
default:
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
|
||||
ASC_INV_FIELD_IN_CMD_PACKET);
|
||||
break;
|
||||
}
|
||||
|
@ -896,7 +867,7 @@ static void cmd_seek(IDEState *s, uint8_t* buf)
|
|||
|
||||
lba = ube32_to_cpu(buf + 2);
|
||||
if (lba >= total_sectors) {
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, ASC_LOGICAL_BLOCK_OOR);
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST, ASC_LOGICAL_BLOCK_OOR);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -912,7 +883,7 @@ static void cmd_start_stop_unit(IDEState *s, uint8_t* buf)
|
|||
if (loej) {
|
||||
if (!start && !s->tray_open && s->tray_locked) {
|
||||
sense = bdrv_is_inserted(s->bs)
|
||||
? SENSE_NOT_READY : SENSE_ILLEGAL_REQUEST;
|
||||
? NOT_READY : ILLEGAL_REQUEST;
|
||||
ide_atapi_cmd_error(s, sense, ASC_MEDIA_REMOVAL_PREVENTED);
|
||||
return;
|
||||
}
|
||||
|
@ -971,7 +942,7 @@ static void cmd_read_toc_pma_atip(IDEState *s, uint8_t* buf)
|
|||
break;
|
||||
default:
|
||||
error_cmd:
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
|
||||
ASC_INV_FIELD_IN_CMD_PACKET);
|
||||
}
|
||||
}
|
||||
|
@ -997,11 +968,11 @@ static void cmd_read_dvd_structure(IDEState *s, uint8_t* buf)
|
|||
|
||||
if (format < 0xff) {
|
||||
if (media_is_cd(s)) {
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
|
||||
ASC_INCOMPATIBLE_FORMAT);
|
||||
return;
|
||||
} else if (!media_present(s)) {
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
|
||||
ASC_INV_FIELD_IN_CMD_PACKET);
|
||||
return;
|
||||
}
|
||||
|
@ -1017,7 +988,7 @@ static void cmd_read_dvd_structure(IDEState *s, uint8_t* buf)
|
|||
ret = ide_dvd_read_structure(s, format, buf, buf);
|
||||
|
||||
if (ret < 0) {
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, -ret);
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST, -ret);
|
||||
} else {
|
||||
ide_atapi_cmd_reply(s, ret, max_len);
|
||||
}
|
||||
|
@ -1034,7 +1005,7 @@ static void cmd_read_dvd_structure(IDEState *s, uint8_t* buf)
|
|||
case 0x90: /* TODO: List of recognized format layers */
|
||||
case 0xc0: /* TODO: Write protection status */
|
||||
default:
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
|
||||
ASC_INV_FIELD_IN_CMD_PACKET);
|
||||
break;
|
||||
}
|
||||
|
@ -1106,7 +1077,7 @@ void ide_atapi_cmd(IDEState *s)
|
|||
* condition response unless a higher priority status, defined by the drive
|
||||
* here, is pending.
|
||||
*/
|
||||
if (s->sense_key == SENSE_UNIT_ATTENTION &&
|
||||
if (s->sense_key == UNIT_ATTENTION &&
|
||||
!(atapi_cmd_table[s->io_buffer[0]].flags & ALLOW_UA)) {
|
||||
ide_atapi_cmd_check_status(s);
|
||||
return;
|
||||
|
@ -1119,10 +1090,10 @@ void ide_atapi_cmd(IDEState *s)
|
|||
* states rely on this behavior.
|
||||
*/
|
||||
if (!s->tray_open && bdrv_is_inserted(s->bs) && s->cdrom_changed) {
|
||||
ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT);
|
||||
ide_atapi_cmd_error(s, NOT_READY, ASC_MEDIUM_NOT_PRESENT);
|
||||
|
||||
s->cdrom_changed = 0;
|
||||
s->sense_key = SENSE_UNIT_ATTENTION;
|
||||
s->sense_key = UNIT_ATTENTION;
|
||||
s->asc = ASC_MEDIUM_MAY_HAVE_CHANGED;
|
||||
return;
|
||||
}
|
||||
|
@ -1131,7 +1102,7 @@ void ide_atapi_cmd(IDEState *s)
|
|||
if ((atapi_cmd_table[s->io_buffer[0]].flags & CHECK_READY) &&
|
||||
(!media_present(s) || !bdrv_is_inserted(s->bs)))
|
||||
{
|
||||
ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT);
|
||||
ide_atapi_cmd_error(s, NOT_READY, ASC_MEDIUM_NOT_PRESENT);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1141,5 +1112,5 @@ void ide_atapi_cmd(IDEState *s)
|
|||
return;
|
||||
}
|
||||
|
||||
ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, ASC_ILLEGAL_OPCODE);
|
||||
ide_atapi_cmd_error(s, ILLEGAL_REQUEST, ASC_ILLEGAL_OPCODE);
|
||||
}
|
||||
|
|
|
@ -799,7 +799,7 @@ static void ide_cd_change_cb(void *opaque, bool load)
|
|||
* First indicate to the guest that a CD has been removed. That's
|
||||
* done on the next command the guest sends us.
|
||||
*
|
||||
* Then we set SENSE_UNIT_ATTENTION, by which the guest will
|
||||
* Then we set UNIT_ATTENTION, by which the guest will
|
||||
* detect a new CD in the drive. See ide_atapi_cmd() for details.
|
||||
*/
|
||||
s->cdrom_changed = 1;
|
||||
|
@ -2027,7 +2027,7 @@ static int ide_drive_post_load(void *opaque, int version_id)
|
|||
IDEState *s = opaque;
|
||||
|
||||
if (version_id < 3) {
|
||||
if (s->sense_key == SENSE_UNIT_ATTENTION &&
|
||||
if (s->sense_key == UNIT_ATTENTION &&
|
||||
s->asc == ASC_MEDIUM_MAY_HAVE_CHANGED) {
|
||||
s->cdrom_changed = 1;
|
||||
}
|
||||
|
@ -2039,7 +2039,7 @@ static int ide_drive_pio_post_load(void *opaque, int version_id)
|
|||
{
|
||||
IDEState *s = opaque;
|
||||
|
||||
if (s->end_transfer_fn_idx > ARRAY_SIZE(transfer_end_table)) {
|
||||
if (s->end_transfer_fn_idx >= ARRAY_SIZE(transfer_end_table)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
s->end_transfer_func = transfer_end_table[s->end_transfer_fn_idx];
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "iorange.h"
|
||||
#include "dma.h"
|
||||
#include "sysemu.h"
|
||||
#include "hw/scsi-defs.h"
|
||||
|
||||
/* debug IDE devices */
|
||||
//#define DEBUG_IDE
|
||||
|
@ -280,71 +281,6 @@ typedef struct IDEDMAOps IDEDMAOps;
|
|||
#define GPCMD_GET_MEDIA_STATUS 0xda
|
||||
#define GPCMD_MODE_SENSE_6 0x1a
|
||||
|
||||
/* Mode page codes for mode sense/set */
|
||||
#define GPMODE_R_W_ERROR_PAGE 0x01
|
||||
#define GPMODE_WRITE_PARMS_PAGE 0x05
|
||||
#define GPMODE_AUDIO_CTL_PAGE 0x0e
|
||||
#define GPMODE_POWER_PAGE 0x1a
|
||||
#define GPMODE_FAULT_FAIL_PAGE 0x1c
|
||||
#define GPMODE_TO_PROTECT_PAGE 0x1d
|
||||
#define GPMODE_CAPABILITIES_PAGE 0x2a
|
||||
#define GPMODE_ALL_PAGES 0x3f
|
||||
/* Not in Mt. Fuji, but in ATAPI 2.6 -- depricated now in favor
|
||||
* of MODE_SENSE_POWER_PAGE */
|
||||
#define GPMODE_CDROM_PAGE 0x0d
|
||||
|
||||
/*
|
||||
* Based on values from <linux/cdrom.h> but extending CD_MINS
|
||||
* to the maximum common size allowed by the Orange's Book ATIP
|
||||
*
|
||||
* 90 and 99 min CDs are also available but using them as the
|
||||
* upper limit reduces the effectiveness of the heuristic to
|
||||
* detect DVDs burned to less than 25% of their maximum capacity
|
||||
*/
|
||||
|
||||
/* Some generally useful CD-ROM information */
|
||||
#define CD_MINS 80 /* max. minutes per CD */
|
||||
#define CD_SECS 60 /* seconds per minute */
|
||||
#define CD_FRAMES 75 /* frames per second */
|
||||
#define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */
|
||||
#define CD_MAX_BYTES (CD_MINS * CD_SECS * CD_FRAMES * CD_FRAMESIZE)
|
||||
#define CD_MAX_SECTORS (CD_MAX_BYTES / 512)
|
||||
|
||||
/*
|
||||
* The MMC values are not IDE specific and might need to be moved
|
||||
* to a common header if they are also needed for the SCSI emulation
|
||||
*/
|
||||
|
||||
/* Profile list from MMC-6 revision 1 table 91 */
|
||||
#define MMC_PROFILE_NONE 0x0000
|
||||
#define MMC_PROFILE_CD_ROM 0x0008
|
||||
#define MMC_PROFILE_CD_R 0x0009
|
||||
#define MMC_PROFILE_CD_RW 0x000A
|
||||
#define MMC_PROFILE_DVD_ROM 0x0010
|
||||
#define MMC_PROFILE_DVD_R_SR 0x0011
|
||||
#define MMC_PROFILE_DVD_RAM 0x0012
|
||||
#define MMC_PROFILE_DVD_RW_RO 0x0013
|
||||
#define MMC_PROFILE_DVD_RW_SR 0x0014
|
||||
#define MMC_PROFILE_DVD_R_DL_SR 0x0015
|
||||
#define MMC_PROFILE_DVD_R_DL_JR 0x0016
|
||||
#define MMC_PROFILE_DVD_RW_DL 0x0017
|
||||
#define MMC_PROFILE_DVD_DDR 0x0018
|
||||
#define MMC_PROFILE_DVD_PLUS_RW 0x001A
|
||||
#define MMC_PROFILE_DVD_PLUS_R 0x001B
|
||||
#define MMC_PROFILE_DVD_PLUS_RW_DL 0x002A
|
||||
#define MMC_PROFILE_DVD_PLUS_R_DL 0x002B
|
||||
#define MMC_PROFILE_BD_ROM 0x0040
|
||||
#define MMC_PROFILE_BD_R_SRM 0x0041
|
||||
#define MMC_PROFILE_BD_R_RRM 0x0042
|
||||
#define MMC_PROFILE_BD_RE 0x0043
|
||||
#define MMC_PROFILE_HDDVD_ROM 0x0050
|
||||
#define MMC_PROFILE_HDDVD_R 0x0051
|
||||
#define MMC_PROFILE_HDDVD_RAM 0x0052
|
||||
#define MMC_PROFILE_HDDVD_RW 0x0053
|
||||
#define MMC_PROFILE_HDDVD_R_DL 0x0058
|
||||
#define MMC_PROFILE_HDDVD_RW_DL 0x005A
|
||||
#define MMC_PROFILE_INVALID 0xFFFF
|
||||
|
||||
#define ATAPI_INT_REASON_CD 0x01 /* 0 = data transfer */
|
||||
#define ATAPI_INT_REASON_IO 0x02 /* 1 = transfer to the host */
|
||||
#define ATAPI_INT_REASON_REL 0x04
|
||||
|
@ -366,11 +302,6 @@ typedef struct IDEDMAOps IDEDMAOps;
|
|||
#define CFA_INVALID_ADDRESS 0x21
|
||||
#define CFA_ADDRESS_OVERFLOW 0x2f
|
||||
|
||||
#define SENSE_NONE 0
|
||||
#define SENSE_NOT_READY 2
|
||||
#define SENSE_ILLEGAL_REQUEST 5
|
||||
#define SENSE_UNIT_ATTENTION 6
|
||||
|
||||
#define SMART_READ_DATA 0xd0
|
||||
#define SMART_READ_THRESH 0xd1
|
||||
#define SMART_ATTR_AUTOSAVE 0xd2
|
||||
|
|
|
@ -87,7 +87,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
|
|||
if (!m->aiocb) {
|
||||
qemu_sglist_destroy(&s->sg);
|
||||
/* Note: media not present is the most likely case */
|
||||
ide_atapi_cmd_error(s, SENSE_NOT_READY,
|
||||
ide_atapi_cmd_error(s, NOT_READY,
|
||||
ASC_MEDIUM_NOT_PRESENT);
|
||||
goto done;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue