Changeset 778 in vbox
- Timestamp:
- Feb 8, 2007 12:14:10 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r492 r778 1924 1924 Assert(s->uTxDir == PDMBLOCKTXDIR_FROM_DEVICE); 1925 1925 Assert(s->cbElementaryTransfer <= 32); 1926 /* Accept request type of 0 or 1only, and only starting feature 0. */1927 if (( (s->aATAPICmd[1] & 0x03) != 0 && (s->aATAPICmd[1] & 0x03) != 1)|| ataBE2H_U16(&s->aATAPICmd[2]) != 0)1926 /* Accept valid request types only, and only starting feature 0. */ 1927 if ((s->aATAPICmd[1] & 0x03) == 3 || ataBE2H_U16(&s->aATAPICmd[2]) != 0) 1928 1928 { 1929 1929 atapiCmdError(s, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_INV_FIELD_IN_CMD_PACKET); … … 1931 1931 } 1932 1932 memset(pbBuf, '\0', 32); 1933 ataH2BE_U32(pbBuf, 12); 1934 ataH2BE_U16(pbBuf + 6, 8); /* current profile: cd-rom read-only */ 1933 ataH2BE_U32(pbBuf, 16); 1934 /** @todo implement switching between CD-ROM and DVD-ROM profile (the only 1935 * way to differentiate them right now is based on the image size). Also 1936 * implement signalling "no current profile" if no medium is loaded. */ 1937 ataH2BE_U16(pbBuf + 6, 0x08); /* current profile: read-only CD */ 1935 1938 1936 1939 ataH2BE_U16(pbBuf + 8, 0); /* feature 0: list of profiles supported */ 1937 1940 pbBuf[10] = (0 << 2) | (1 << 1) | (1 || 0); /* version 0, persistent, current */ 1938 pbBuf[11] = 4; /* additional bytes for profiles */ 1939 ataH2BE_U16(pbBuf + 12, 8); /* profile: cd-rom read-only */ 1940 pbBuf[14] = (1 << 0); /* current profile */ 1941 pbBuf[11] = 8; /* additional bytes for profiles */ 1942 /* The MMC-3 spec says that DVD-ROM read capability should be reported 1943 * before CD-ROM read capability. */ 1944 ataH2BE_U16(pbBuf + 12, 0x10); /* profile: read-only DVD */ 1945 pbBuf[14] = (0 << 0); /* NOT current profile */ 1946 ataH2BE_U16(pbBuf + 16, 0x08); /* profile: read only CD */ 1947 pbBuf[18] = (1 << 0); /* current profile */ 1948 /* Other profiles we might want to add in the future: 0x40 (BD-ROM) and 0x50 (HDDVD-ROM) */ 1941 1949 s->iSourceSink = ATAFN_SS_NULL; 1942 1950 atapiCmdOK(s); … … 2591 2599 break; 2592 2600 case SCSI_GET_CONFIGURATION: 2593 if (s->cNotifiedMediaChange > 0) 2594 { 2595 s->cNotifiedMediaChange-- ; 2596 atapiCmdError(s, SCSI_SENSE_UNIT_ATTENTION, SCSI_ASC_MEDIUM_MAY_HAVE_CHANGED); /* media changed */ 2597 break; 2598 } 2599 else if (!s->pDrvMount->pfnIsMounted(s->pDrvMount)) 2600 { 2601 atapiCmdError(s, SCSI_SENSE_NOT_READY, SCSI_ASC_MEDIUM_NOT_PRESENT); 2602 break; 2603 } 2601 /* No media change stuff here, it can confuse Linux guests. */ 2604 2602 cbMax = ataBE2H_U16(pbPacket + 7); 2605 2603 ataStartTransfer(s, RT_MIN(cbMax, 32), PDMBLOCKTXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_GET_CONFIGURATION, true);
Note:
See TracChangeset
for help on using the changeset viewer.