- Timestamp:
- Jan 4, 2017 2:07:41 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevATA.cpp
r65075 r65110 61 61 #include <VBox/sup.h> 62 62 #include <VBox/scsi.h> 63 #include <VBox/scsiinline.h> 63 64 #include <VBox/ata.h> 64 65 … … 1097 1098 pbDst[i ^ 1] = ' '; 1098 1099 } 1099 }1100 1101 1102 static void ataR3SCSIPadStr(uint8_t *pbDst, const char *pbSrc, uint32_t cbSize)1103 {1104 for (uint32_t i = 0; i < cbSize; i++)1105 {1106 if (*pbSrc)1107 pbDst[i] = *pbSrc++;1108 else1109 pbDst[i] = ' ';1110 }1111 }1112 1113 1114 DECLINLINE(void) ataH2BE_U16(uint8_t *pbBuf, uint16_t val)1115 {1116 pbBuf[0] = val >> 8;1117 pbBuf[1] = val;1118 }1119 1120 1121 DECLINLINE(void) ataH2BE_U24(uint8_t *pbBuf, uint32_t val)1122 {1123 pbBuf[0] = val >> 16;1124 pbBuf[1] = val >> 8;1125 pbBuf[2] = val;1126 }1127 1128 1129 DECLINLINE(void) ataH2BE_U32(uint8_t *pbBuf, uint32_t val)1130 {1131 pbBuf[0] = val >> 24;1132 pbBuf[1] = val >> 16;1133 pbBuf[2] = val >> 8;1134 pbBuf[3] = val;1135 }1136 1137 1138 DECLINLINE(uint16_t) ataBE2H_U16(const uint8_t *pbBuf)1139 {1140 return (pbBuf[0] << 8) | pbBuf[1];1141 }1142 1143 1144 DECLINLINE(uint32_t) ataBE2H_U24(const uint8_t *pbBuf)1145 {1146 return (pbBuf[0] << 16) | (pbBuf[1] << 8) | pbBuf[2];1147 }1148 1149 1150 DECLINLINE(uint32_t) ataBE2H_U32(const uint8_t *pbBuf)1151 {1152 return (pbBuf[0] << 24) | (pbBuf[1] << 16) | (pbBuf[2] << 8) | pbBuf[3];1153 }1154 1155 1156 DECLINLINE(void) ataLBA2MSF(uint8_t *pbBuf, uint32_t iATAPILBA)1157 {1158 iATAPILBA += 150;1159 pbBuf[0] = (iATAPILBA / 75) / 60;1160 pbBuf[1] = (iATAPILBA / 75) % 60;1161 pbBuf[2] = iATAPILBA % 75;1162 }1163 1164 1165 DECLINLINE(uint32_t) ataMSF2LBA(const uint8_t *pbBuf)1166 {1167 return (pbBuf[0] * 60 + pbBuf[1]) * 75 + pbBuf[2];1168 1100 } 1169 1101 … … 1845 1777 *pbBuf++ = 0x00; 1846 1778 /* MSF */ 1847 ataLBA2MSF(pbBuf, i);1779 scsiLBA2MSF(pbBuf, i); 1848 1780 pbBuf += 3; 1849 1781 *pbBuf++ = 0x01; /* mode 1 data */ … … 1950 1882 case SCSI_MODE_SELECT_10: 1951 1883 { 1952 size_t cbBlkDescLength = ataBE2H_U16(&s->CTX_SUFF(pbIOBuffer)[6]);1884 size_t cbBlkDescLength = scsiBE2H_U16(&s->CTX_SUFF(pbIOBuffer)[6]); 1953 1885 1954 1886 SCSILogModePage(szBuf, sizeof(szBuf) - 1, … … 1991 1923 case SCSI_WRITE_10: 1992 1924 case SCSI_WRITE_AND_VERIFY_10: 1993 iATAPILBA = ataBE2H_U32(s->aATAPICmd + 2);1994 cSectors = ataBE2H_U16(s->aATAPICmd + 7);1925 iATAPILBA = scsiBE2H_U32(s->aATAPICmd + 2); 1926 cSectors = scsiBE2H_U16(s->aATAPICmd + 7); 1995 1927 break; 1996 1928 case SCSI_READ_12: 1997 1929 case SCSI_WRITE_12: 1998 iATAPILBA = ataBE2H_U32(s->aATAPICmd + 2);1999 cSectors = ataBE2H_U32(s->aATAPICmd + 6);1930 iATAPILBA = scsiBE2H_U32(s->aATAPICmd + 2); 1931 cSectors = scsiBE2H_U32(s->aATAPICmd + 6); 2000 1932 break; 2001 1933 case SCSI_READ_CD: 2002 iATAPILBA = ataBE2H_U32(s->aATAPICmd + 2);2003 cSectors = ataBE2H_U24(s->aATAPICmd + 6);1934 iATAPILBA = scsiBE2H_U32(s->aATAPICmd + 2); 1935 cSectors = scsiBE2H_U24(s->aATAPICmd + 6); 2004 1936 break; 2005 1937 case SCSI_READ_CD_MSF: 2006 iATAPILBA = ataMSF2LBA(s->aATAPICmd + 3);2007 cSectors = ataMSF2LBA(s->aATAPICmd + 6) - iATAPILBA;1938 iATAPILBA = scsiMSF2LBA(s->aATAPICmd + 3); 1939 cSectors = scsiMSF2LBA(s->aATAPICmd + 6) - iATAPILBA; 2008 1940 break; 2009 1941 default: … … 2034 1966 case SCSI_WRITE_10: 2035 1967 case SCSI_WRITE_AND_VERIFY_10: 2036 ataH2BE_U32(aATAPICmd + 2, iATAPILBA);2037 ataH2BE_U16(aATAPICmd + 7, cReqSectors);1968 scsiH2BE_U32(aATAPICmd + 2, iATAPILBA); 1969 scsiH2BE_U16(aATAPICmd + 7, cReqSectors); 2038 1970 break; 2039 1971 case SCSI_READ_12: 2040 1972 case SCSI_WRITE_12: 2041 ataH2BE_U32(aATAPICmd + 2, iATAPILBA);2042 ataH2BE_U32(aATAPICmd + 6, cReqSectors);1973 scsiH2BE_U32(aATAPICmd + 2, iATAPILBA); 1974 scsiH2BE_U32(aATAPICmd + 6, cReqSectors); 2043 1975 break; 2044 1976 case SCSI_READ_CD: 2045 ataH2BE_U32(aATAPICmd + 2, iATAPILBA);2046 ataH2BE_U24(aATAPICmd + 6, cReqSectors);1977 scsiH2BE_U32(aATAPICmd + 2, iATAPILBA); 1978 scsiH2BE_U24(aATAPICmd + 6, cReqSectors); 2047 1979 break; 2048 1980 case SCSI_READ_CD_MSF: 2049 ataLBA2MSF(aATAPICmd + 3, iATAPILBA);2050 ataLBA2MSF(aATAPICmd + 6, iATAPILBA + cReqSectors);1981 scsiLBA2MSF(aATAPICmd + 3, iATAPILBA); 1982 scsiLBA2MSF(aATAPICmd + 6, iATAPILBA + cReqSectors); 2051 1983 break; 2052 1984 } … … 2067 1999 case SCSI_WRITE_10: 2068 2000 case SCSI_WRITE_AND_VERIFY_10: 2069 ataH2BE_U32(s->aATAPICmd + 2, iATAPILBA);2070 ataH2BE_U16(s->aATAPICmd + 7, cSectors - cSectorsMax);2001 scsiH2BE_U32(s->aATAPICmd + 2, iATAPILBA); 2002 scsiH2BE_U16(s->aATAPICmd + 7, cSectors - cSectorsMax); 2071 2003 break; 2072 2004 case SCSI_READ_12: 2073 2005 case SCSI_WRITE_12: 2074 ataH2BE_U32(s->aATAPICmd + 2, iATAPILBA);2075 ataH2BE_U32(s->aATAPICmd + 6, cSectors - cSectorsMax);2006 scsiH2BE_U32(s->aATAPICmd + 2, iATAPILBA); 2007 scsiH2BE_U32(s->aATAPICmd + 6, cSectors - cSectorsMax); 2076 2008 break; 2077 2009 case SCSI_READ_CD: 2078 ataH2BE_U32(s->aATAPICmd + 2, iATAPILBA);2079 ataH2BE_U24(s->aATAPICmd + 6, cSectors - cSectorsMax);2010 scsiH2BE_U32(s->aATAPICmd + 2, iATAPILBA); 2011 scsiH2BE_U24(s->aATAPICmd + 6, cSectors - cSectorsMax); 2080 2012 break; 2081 2013 case SCSI_READ_CD_MSF: 2082 ataLBA2MSF(s->aATAPICmd + 3, iATAPILBA);2083 ataLBA2MSF(s->aATAPICmd + 6, iATAPILBA + cSectors - cSectorsMax);2014 scsiLBA2MSF(s->aATAPICmd + 3, iATAPILBA); 2015 scsiLBA2MSF(s->aATAPICmd + 6, iATAPILBA + cSectors - cSectorsMax); 2084 2016 break; 2085 2017 default: … … 2163 2095 * invisible as possible to the guest. */ 2164 2096 Log3(("ATAPI PT inquiry data before (%d): %.*Rhxs\n", cbTransfer, cbTransfer, s->CTX_SUFF(pbIOBuffer))); 2165 ataR3SCSIPadStr(s->CTX_SUFF(pbIOBuffer) + 8, "VBOX", 8);2166 ataR3SCSIPadStr(s->CTX_SUFF(pbIOBuffer) + 16, "CD-ROM", 16);2167 ataR3SCSIPadStr(s->CTX_SUFF(pbIOBuffer) + 32, "1.0", 4);2097 scsiPadStr(s->CTX_SUFF(pbIOBuffer) + 8, "VBOX", 8); 2098 scsiPadStr(s->CTX_SUFF(pbIOBuffer) + 16, "CD-ROM", 16); 2099 scsiPadStr(s->CTX_SUFF(pbIOBuffer) + 32, "1.0", 4); 2168 2100 } 2169 2101 … … 2213 2145 int format = s->aATAPICmd[7]; 2214 2146 2215 uint16_t max_len = ataBE2H_U16(&s->aATAPICmd[8]);2147 uint16_t max_len = scsiBE2H_U16(&s->aATAPICmd[8]); 2216 2148 2217 2149 memset(buf, 0, max_len); … … 2270 2202 2271 2203 /* FIXME: 0x30000 per spec? */ 2272 ataH2BE_U32(buf + 8, 0); /* start sector */2273 ataH2BE_U32(buf + 12, total_sectors - 1); /* end sector */2274 ataH2BE_U32(buf + 16, total_sectors - 1); /* l0 end sector */2204 scsiH2BE_U32(buf + 8, 0); /* start sector */ 2205 scsiH2BE_U32(buf + 12, total_sectors - 1); /* end sector */ 2206 scsiH2BE_U32(buf + 16, total_sectors - 1); /* l0 end sector */ 2275 2207 2276 2208 /* Size of buffer, not including 2 byte size field */ 2277 ataH2BE_U32(&buf[0], 2048 + 2);2209 scsiH2BE_U32(&buf[0], 2048 + 2); 2278 2210 2279 2211 /* 2k data + 4 byte header */ … … 2286 2218 2287 2219 /* Size of buffer, not including 2 byte size field */ 2288 ataH2BE_U16(buf, 4 + 2);2220 scsiH2BE_U16(buf, 4 + 2); 2289 2221 2290 2222 /* 4 byte header + 4 byte data */ … … 2298 2230 case 0x04: /* DVD disc manufacturing information */ 2299 2231 /* Size of buffer, not including 2 byte size field */ 2300 ataH2BE_U16(buf, 2048 + 2);2232 scsiH2BE_U16(buf, 2048 + 2); 2301 2233 2302 2234 /* 2k data + 4 byte header */ … … 2311 2243 buf[4] = 0x00; /* Physical format */ 2312 2244 buf[5] = 0x40; /* Not writable, is readable */ 2313 ataH2BE_U16((buf + 6), 2048 + 4);2245 scsiH2BE_U16((buf + 6), 2048 + 4); 2314 2246 2315 2247 buf[8] = 0x01; /* Copyright info */ 2316 2248 buf[9] = 0x40; /* Not writable, is readable */ 2317 ataH2BE_U16((buf + 10), 4 + 4);2249 scsiH2BE_U16((buf + 10), 4 + 4); 2318 2250 2319 2251 buf[12] = 0x03; /* BCA info */ 2320 2252 buf[13] = 0x40; /* Not writable, is readable */ 2321 ataH2BE_U16((buf + 14), 188 + 4);2253 scsiH2BE_U16((buf + 14), 188 + 4); 2322 2254 2323 2255 buf[16] = 0x04; /* Manufacturing info */ 2324 2256 buf[17] = 0x40; /* Not writable, is readable */ 2325 ataH2BE_U16((buf + 18), 2048 + 4);2257 scsiH2BE_U16((buf + 18), 2048 + 4); 2326 2258 2327 2259 /* Size of buffer, not including 2 byte size field */ 2328 ataH2BE_U16(buf, 16 + 2);2260 scsiH2BE_U16(buf, 16 + 2); 2329 2261 2330 2262 /* data written + 4 byte header */ … … 2380 2312 Assert(s->uTxDir == PDMMEDIATXDIR_FROM_DEVICE); 2381 2313 Assert(s->cbElementaryTransfer <= 8); 2382 ataH2BE_U32(pbBuf, s->cTotalSectors - 1);2383 ataH2BE_U32(pbBuf + 4, 2048);2314 scsiH2BE_U32(pbBuf, s->cTotalSectors - 1); 2315 scsiH2BE_U32(pbBuf + 4, 2048); 2384 2316 s->iSourceSink = ATAFN_SS_NULL; 2385 2317 atapiR3CmdOK(s); … … 2395 2327 Assert(s->cbElementaryTransfer <= 34); 2396 2328 memset(pbBuf, '\0', 34); 2397 ataH2BE_U16(pbBuf, 32);2329 scsiH2BE_U16(pbBuf, 32); 2398 2330 pbBuf[2] = (0 << 4) | (3 << 2) | (2 << 0); /* not erasable, complete session, complete disc */ 2399 2331 pbBuf[3] = 1; /* number of first track */ … … 2406 2338 pbBuf[10] = 0; /* number of sessions (MSB) */ 2407 2339 pbBuf[11] = 0; /* number of sessions (MSB) */ 2408 ataH2BE_U32(pbBuf + 16, 0x00ffffff); /* last session lead-in start time is not available */2409 ataH2BE_U32(pbBuf + 20, 0x00ffffff); /* last possible start time for lead-out is not available */2340 scsiH2BE_U32(pbBuf + 16, 0x00ffffff); /* last session lead-in start time is not available */ 2341 scsiH2BE_U32(pbBuf + 20, 0x00ffffff); /* last possible start time for lead-out is not available */ 2410 2342 s->iSourceSink = ATAFN_SS_NULL; 2411 2343 atapiR3CmdOK(s); … … 2421 2353 Assert(s->cbElementaryTransfer <= 36); 2422 2354 /* Accept address/number type of 1 only, and only track 1 exists. */ 2423 if ((s->aATAPICmd[1] & 0x03) != 1 || ataBE2H_U32(&s->aATAPICmd[2]) != 1)2355 if ((s->aATAPICmd[1] & 0x03) != 1 || scsiBE2H_U32(&s->aATAPICmd[2]) != 1) 2424 2356 { 2425 2357 atapiR3CmdErrorSimple(s, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_INV_FIELD_IN_CMD_PACKET); … … 2427 2359 } 2428 2360 memset(pbBuf, '\0', 36); 2429 ataH2BE_U16(pbBuf, 34);2361 scsiH2BE_U16(pbBuf, 34); 2430 2362 pbBuf[2] = 1; /* track number (LSB) */ 2431 2363 pbBuf[3] = 1; /* session number (LSB) */ … … 2433 2365 pbBuf[6] = (0 << 7) | (0 << 6) | (0 << 5) | (0 << 6) | (1 << 0); /* not reserved track, not blank, not packet writing, not fixed packet, data mode 1 */ 2434 2366 pbBuf[7] = (0 << 1) | (0 << 0); /* last recorded address not valid, next recordable address not valid */ 2435 ataH2BE_U32(pbBuf + 8, 0); /* track start address is 0 */2436 ataH2BE_U32(pbBuf + 24, s->cTotalSectors); /* track size */2367 scsiH2BE_U32(pbBuf + 8, 0); /* track start address is 0 */ 2368 scsiH2BE_U32(pbBuf + 24, s->cTotalSectors); /* track size */ 2437 2369 pbBuf[32] = 0; /* track number (MSB) */ 2438 2370 pbBuf[33] = 0; /* session number (MSB) */ … … 2448 2380 return 0; 2449 2381 2450 ataH2BE_U16(pbBuf, 0x0); /* feature 0: list of profiles supported */2382 scsiH2BE_U16(pbBuf, 0x0); /* feature 0: list of profiles supported */ 2451 2383 pbBuf[2] = (0 << 2) | (1 << 1) | (1 << 0); /* version 0, persistent, current */ 2452 2384 pbBuf[3] = 8; /* additional bytes for profiles */ 2453 2385 /* The MMC-3 spec says that DVD-ROM read capability should be reported 2454 2386 * before CD-ROM read capability. */ 2455 ataH2BE_U16(pbBuf + 4, 0x10); /* profile: read-only DVD */2387 scsiH2BE_U16(pbBuf + 4, 0x10); /* profile: read-only DVD */ 2456 2388 pbBuf[6] = (0 << 0); /* NOT current profile */ 2457 ataH2BE_U16(pbBuf + 8, 0x08); /* profile: read only CD */2389 scsiH2BE_U16(pbBuf + 8, 0x08); /* profile: read only CD */ 2458 2390 pbBuf[10] = (1 << 0); /* current profile */ 2459 2391 … … 2467 2399 return 0; 2468 2400 2469 ataH2BE_U16(pbBuf, 0x1); /* feature 0001h: Core Feature */2401 scsiH2BE_U16(pbBuf, 0x1); /* feature 0001h: Core Feature */ 2470 2402 pbBuf[2] = (0x2 << 2) | RT_BIT(1) | RT_BIT(0); /* Version | Persistent | Current */ 2471 2403 pbBuf[3] = 8; /* Additional length */ 2472 ataH2BE_U16(pbBuf + 4, 0x00000002); /* Physical interface ATAPI. */2404 scsiH2BE_U16(pbBuf + 4, 0x00000002); /* Physical interface ATAPI. */ 2473 2405 pbBuf[8] = RT_BIT(0); /* DBE */ 2474 2406 /* Rest is reserved. */ … … 2483 2415 return 0; 2484 2416 2485 ataH2BE_U16(pbBuf, 0x2); /* feature 0002h: Morphing Feature */2417 scsiH2BE_U16(pbBuf, 0x2); /* feature 0002h: Morphing Feature */ 2486 2418 pbBuf[2] = (0x1 << 2) | RT_BIT(1) | RT_BIT(0); /* Version | Persistent | Current */ 2487 2419 pbBuf[3] = 4; /* Additional length */ … … 2498 2430 return 0; 2499 2431 2500 ataH2BE_U16(pbBuf, 0x3); /* feature 0003h: Removable Medium Feature */2432 scsiH2BE_U16(pbBuf, 0x3); /* feature 0003h: Removable Medium Feature */ 2501 2433 pbBuf[2] = (0x2 << 2) | RT_BIT(1) | RT_BIT(0); /* Version | Persistent | Current */ 2502 2434 pbBuf[3] = 4; /* Additional length */ … … 2514 2446 return 0; 2515 2447 2516 ataH2BE_U16(pbBuf, 0x10); /* feature 0010h: Random Readable Feature */2448 scsiH2BE_U16(pbBuf, 0x10); /* feature 0010h: Random Readable Feature */ 2517 2449 pbBuf[2] = (0x0 << 2) | RT_BIT(1) | RT_BIT(0); /* Version | Persistent | Current */ 2518 2450 pbBuf[3] = 8; /* Additional length */ 2519 ataH2BE_U32(pbBuf + 4, 2048); /* Logical block size. */2520 ataH2BE_U16(pbBuf + 8, 0x10); /* Blocking (0x10 for DVD, CD is not defined). */2451 scsiH2BE_U32(pbBuf + 4, 2048); /* Logical block size. */ 2452 scsiH2BE_U16(pbBuf + 8, 0x10); /* Blocking (0x10 for DVD, CD is not defined). */ 2521 2453 pbBuf[10] = 0; /* PP not present */ 2522 2454 /* Rest is reserved. */ … … 2531 2463 return 0; 2532 2464 2533 ataH2BE_U16(pbBuf, 0x1e); /* feature 001Eh: CD Read Feature */2465 scsiH2BE_U16(pbBuf, 0x1e); /* feature 001Eh: CD Read Feature */ 2534 2466 pbBuf[2] = (0x2 << 2) | RT_BIT(1) | RT_BIT(0); /* Version | Persistent | Current */ 2535 2467 pbBuf[3] = 0; /* Additional length */ … … 2546 2478 return 0; 2547 2479 2548 ataH2BE_U16(pbBuf, 0x100); /* feature 0100h: Power Management Feature */2480 scsiH2BE_U16(pbBuf, 0x100); /* feature 0100h: Power Management Feature */ 2549 2481 pbBuf[2] = (0x0 << 2) | RT_BIT(1) | RT_BIT(0); /* Version | Persistent | Current */ 2550 2482 pbBuf[3] = 0; /* Additional length */ … … 2559 2491 return 0; 2560 2492 2561 ataH2BE_U16(pbBuf, 0x105); /* feature 0105h: Timeout Feature */2493 scsiH2BE_U16(pbBuf, 0x105); /* feature 0105h: Timeout Feature */ 2562 2494 pbBuf[2] = (0x0 << 2) | RT_BIT(1) | RT_BIT(0); /* Version | Persistent | Current */ 2563 2495 pbBuf[3] = 4; /* Additional length */ … … 2572 2504 uint32_t cbBuf = s->cbIOBuffer; 2573 2505 uint32_t cbCopied = 0; 2574 uint16_t u16Sfn = ataBE2H_U16(&s->aATAPICmd[2]);2506 uint16_t u16Sfn = scsiBE2H_U16(&s->aATAPICmd[2]); 2575 2507 2576 2508 Assert(s->uTxDir == PDMMEDIATXDIR_FROM_DEVICE); … … 2586 2518 * way to differentiate them right now is based on the image size). */ 2587 2519 if (s->cTotalSectors) 2588 ataH2BE_U16(pbBuf + 6, 0x08); /* current profile: read-only CD */2520 scsiH2BE_U16(pbBuf + 6, 0x08); /* current profile: read-only CD */ 2589 2521 else 2590 ataH2BE_U16(pbBuf + 6, 0x00); /* current profile: none -> no media */2522 scsiH2BE_U16(pbBuf + 6, 0x00); /* current profile: none -> no media */ 2591 2523 cbBuf -= 8; 2592 2524 pbBuf += 8; … … 2625 2557 2626 2558 /* Set data length now - the field is not included in the final length. */ 2627 ataH2BE_U32(s->CTX_SUFF(pbIOBuffer), s->cbIOBuffer - cbBuf - 4);2559 scsiH2BE_U32(s->CTX_SUFF(pbIOBuffer), s->cbIOBuffer - cbBuf - 4); 2628 2560 2629 2561 /* Other profiles we might want to add in the future: 0x40 (BD-ROM) and 0x50 (HDDVD-ROM) */ … … 2657 2589 case ATA_EVENT_STATUS_MEDIA_NEW: 2658 2590 /* mount */ 2659 ataH2BE_U16(pbBuf + 0, 6);2591 scsiH2BE_U16(pbBuf + 0, 6); 2660 2592 pbBuf[2] = 0x04; /* media */ 2661 2593 pbBuf[3] = 0x5e; /* supported = busy|media|external|power|operational */ … … 2669 2601 case ATA_EVENT_STATUS_MEDIA_REMOVED: 2670 2602 /* umount */ 2671 ataH2BE_U16(pbBuf + 0, 6);2603 scsiH2BE_U16(pbBuf + 0, 6); 2672 2604 pbBuf[2] = 0x04; /* media */ 2673 2605 pbBuf[3] = 0x5e; /* supported = busy|media|external|power|operational */ … … 2681 2613 2682 2614 case ATA_EVENT_STATUS_MEDIA_EJECT_REQUESTED: /* currently unused */ 2683 ataH2BE_U16(pbBuf + 0, 6);2615 scsiH2BE_U16(pbBuf + 0, 6); 2684 2616 pbBuf[2] = 0x04; /* media */ 2685 2617 pbBuf[3] = 0x5e; /* supported = busy|media|external|power|operational */ … … 2692 2624 case ATA_EVENT_STATUS_UNCHANGED: 2693 2625 default: 2694 ataH2BE_U16(pbBuf + 0, 6);2626 scsiH2BE_U16(pbBuf + 0, 6); 2695 2627 pbBuf[2] = 0x01; /* operational change request / notification */ 2696 2628 pbBuf[3] = 0x5e; /* supported = busy|media|external|power|operational */ … … 2728 2660 pbBuf[6] = 0; /* reserved */ 2729 2661 pbBuf[7] = 0; /* reserved */ 2730 ataR3SCSIPadStr(pbBuf + 8, s->szInquiryVendorId, 8);2731 ataR3SCSIPadStr(pbBuf + 16, s->szInquiryProductId, 16);2732 ataR3SCSIPadStr(pbBuf + 32, s->szInquiryRevision, 4);2662 scsiPadStr(pbBuf + 8, s->szInquiryVendorId, 8); 2663 scsiPadStr(pbBuf + 16, s->szInquiryProductId, 16); 2664 scsiPadStr(pbBuf + 32, s->szInquiryRevision, 4); 2733 2665 s->iSourceSink = ATAFN_SS_NULL; 2734 2666 atapiR3CmdOK(s); … … 2743 2675 Assert(s->uTxDir == PDMMEDIATXDIR_FROM_DEVICE); 2744 2676 Assert(s->cbElementaryTransfer <= 16); 2745 ataH2BE_U16(&pbBuf[0], 16 + 6);2677 scsiH2BE_U16(&pbBuf[0], 16 + 6); 2746 2678 pbBuf[2] = (uint8_t)s->MediaTrackType; 2747 2679 pbBuf[3] = 0; … … 2771 2703 Assert(s->uTxDir == PDMMEDIATXDIR_FROM_DEVICE); 2772 2704 Assert(s->cbElementaryTransfer <= 40); 2773 ataH2BE_U16(&pbBuf[0], 38);2705 scsiH2BE_U16(&pbBuf[0], 38); 2774 2706 pbBuf[2] = (uint8_t)s->MediaTrackType; 2775 2707 pbBuf[3] = 0; … … 2792 2724 pbBuf[14] |= 1 << 1; /* report lock state */ 2793 2725 pbBuf[15] = 0; /* no subchannel reads supported, no separate audio volume control, no changer etc. */ 2794 ataH2BE_U16(&pbBuf[16], 5632); /* (obsolete) claim 32x speed support */2795 ataH2BE_U16(&pbBuf[18], 2); /* number of audio volume levels */2796 ataH2BE_U16(&pbBuf[20], s->cbIOBuffer / _1K); /* buffer size supported in Kbyte */2797 ataH2BE_U16(&pbBuf[22], 5632); /* (obsolete) current read speed 32x */2726 scsiH2BE_U16(&pbBuf[16], 5632); /* (obsolete) claim 32x speed support */ 2727 scsiH2BE_U16(&pbBuf[18], 2); /* number of audio volume levels */ 2728 scsiH2BE_U16(&pbBuf[20], s->cbIOBuffer / _1K); /* buffer size supported in Kbyte */ 2729 scsiH2BE_U16(&pbBuf[22], 5632); /* (obsolete) current read speed 32x */ 2798 2730 pbBuf[24] = 0; /* reserved */ 2799 2731 pbBuf[25] = 0; /* reserved for digital audio (see idx 15) */ 2800 ataH2BE_U16(&pbBuf[26], 0); /* (obsolete) maximum write speed */2801 ataH2BE_U16(&pbBuf[28], 0); /* (obsolete) current write speed */2802 ataH2BE_U16(&pbBuf[30], 0); /* copy management revision supported 0=no CSS */2732 scsiH2BE_U16(&pbBuf[26], 0); /* (obsolete) maximum write speed */ 2733 scsiH2BE_U16(&pbBuf[28], 0); /* (obsolete) current write speed */ 2734 scsiH2BE_U16(&pbBuf[30], 0); /* copy management revision supported 0=no CSS */ 2803 2735 pbBuf[32] = 0; /* reserved */ 2804 2736 pbBuf[33] = 0; /* reserved */ 2805 2737 pbBuf[34] = 0; /* reserved */ 2806 2738 pbBuf[35] = 1; /* rotation control CAV */ 2807 ataH2BE_U16(&pbBuf[36], 0); /* current write speed */2808 ataH2BE_U16(&pbBuf[38], 0); /* number of write speed performance descriptors */2739 scsiH2BE_U16(&pbBuf[36], 0); /* current write speed */ 2740 scsiH2BE_U16(&pbBuf[38], 0); /* number of write speed performance descriptors */ 2809 2741 s->iSourceSink = ATAFN_SS_NULL; 2810 2742 atapiR3CmdOK(s); … … 2832 2764 Assert(s->uTxDir == PDMMEDIATXDIR_FROM_DEVICE); 2833 2765 Assert(s->cbElementaryTransfer <= 8); 2834 ataH2BE_U16(pbBuf, 0);2766 scsiH2BE_U16(pbBuf, 0); 2835 2767 /* no current LBA */ 2836 2768 pbBuf[2] = 0; … … 2838 2770 pbBuf[4] = 0; 2839 2771 pbBuf[5] = 1; 2840 ataH2BE_U16(pbBuf + 6, 0);2772 scsiH2BE_U16(pbBuf + 6, 0); 2841 2773 s->iSourceSink = ATAFN_SS_NULL; 2842 2774 atapiR3CmdOK(s); … … 2871 2803 { 2872 2804 *q++ = 0; /* reserved */ 2873 ataLBA2MSF(q, 0);2805 scsiLBA2MSF(q, 0); 2874 2806 q += 3; 2875 2807 } … … 2877 2809 { 2878 2810 /* sector 0 */ 2879 ataH2BE_U32(q, 0);2811 scsiH2BE_U32(q, 0); 2880 2812 q += 4; 2881 2813 } … … 2889 2821 { 2890 2822 *q++ = 0; /* reserved */ 2891 ataLBA2MSF(q, s->cTotalSectors);2823 scsiLBA2MSF(q, s->cTotalSectors); 2892 2824 q += 3; 2893 2825 } 2894 2826 else 2895 2827 { 2896 ataH2BE_U32(q, s->cTotalSectors);2828 scsiH2BE_U32(q, s->cTotalSectors); 2897 2829 q += 4; 2898 2830 } 2899 2831 cbSize = q - pbBuf; 2900 ataH2BE_U16(pbBuf, cbSize - 2);2832 scsiH2BE_U16(pbBuf, cbSize - 2); 2901 2833 if (cbSize < s->cbTotalTransfer) 2902 2834 s->cbTotalTransfer = cbSize; … … 2926 2858 { 2927 2859 pbBuf[8] = 0; /* reserved */ 2928 ataLBA2MSF(&pbBuf[9], 0);2860 scsiLBA2MSF(&pbBuf[9], 0); 2929 2861 } 2930 2862 else 2931 2863 { 2932 2864 /* sector 0 */ 2933 ataH2BE_U32(pbBuf + 8, 0);2865 scsiH2BE_U32(pbBuf + 8, 0); 2934 2866 } 2935 2867 s->iSourceSink = ATAFN_SS_NULL; … … 2987 2919 { 2988 2920 *q++ = 0; /* reserved */ 2989 ataLBA2MSF(q, s->cTotalSectors);2921 scsiLBA2MSF(q, s->cTotalSectors); 2990 2922 q += 3; 2991 2923 } 2992 2924 else 2993 2925 { 2994 ataH2BE_U32(q, s->cTotalSectors);2926 scsiH2BE_U32(q, s->cTotalSectors); 2995 2927 q += 4; 2996 2928 } … … 3006 2938 { 3007 2939 *q++ = 0; /* reserved */ 3008 ataLBA2MSF(q, 0);2940 scsiLBA2MSF(q, 0); 3009 2941 q += 3; 3010 2942 } … … 3012 2944 { 3013 2945 /* sector 0 */ 3014 ataH2BE_U32(q, 0);2946 scsiH2BE_U32(q, 0); 3015 2947 q += 4; 3016 2948 } 3017 2949 3018 2950 cbSize = q - pbBuf; 3019 ataH2BE_U16(pbBuf, cbSize - 2);2951 scsiH2BE_U16(pbBuf, cbSize - 2); 3020 2952 if (cbSize < s->cbTotalTransfer) 3021 2953 s->cbTotalTransfer = cbSize; … … 3050 2982 break; 3051 2983 case SCSI_GET_EVENT_STATUS_NOTIFICATION: 3052 cbMax = ataBE2H_U16(pbPacket + 7);2984 cbMax = scsiBE2H_U16(pbPacket + 7); 3053 2985 ataR3StartTransfer(s, RT_MIN(cbMax, 8), PDMMEDIATXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_GET_EVENT_STATUS_NOTIFICATION, true); 3054 2986 break; … … 3056 2988 { 3057 2989 uint8_t uPageControl, uPageCode; 3058 cbMax = ataBE2H_U16(pbPacket + 7);2990 cbMax = scsiBE2H_U16(pbPacket + 7); 3059 2991 uPageControl = pbPacket[2] >> 6; 3060 2992 uPageCode = pbPacket[2] & 0x3f; … … 3118 3050 } 3119 3051 if (pbPacket[0] == SCSI_READ_10) 3120 cSectors = ataBE2H_U16(pbPacket + 7);3052 cSectors = scsiBE2H_U16(pbPacket + 7); 3121 3053 else 3122 cSectors = ataBE2H_U32(pbPacket + 6);3123 iATAPILBA = ataBE2H_U32(pbPacket + 2);3054 cSectors = scsiBE2H_U32(pbPacket + 6); 3055 iATAPILBA = scsiBE2H_U32(pbPacket + 2); 3124 3056 if (cSectors == 0) 3125 3057 { … … 3161 3093 } 3162 3094 cSectors = (pbPacket[6] << 16) | (pbPacket[7] << 8) | pbPacket[8]; 3163 iATAPILBA = ataBE2H_U32(pbPacket + 2);3095 iATAPILBA = scsiBE2H_U32(pbPacket + 2); 3164 3096 if (cSectors == 0) 3165 3097 { … … 3217 3149 break; 3218 3150 } 3219 iATAPILBA = ataBE2H_U32(pbPacket + 2);3151 iATAPILBA = scsiBE2H_U32(pbPacket + 2); 3220 3152 if (iATAPILBA > s->cTotalSectors) 3221 3153 { … … 3283 3215 case SCSI_MECHANISM_STATUS: 3284 3216 { 3285 cbMax = ataBE2H_U16(pbPacket + 8);3217 cbMax = scsiBE2H_U16(pbPacket + 8); 3286 3218 ataR3StartTransfer(s, RT_MIN(cbMax, 8), PDMMEDIATXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_MECHANISM_STATUS, true); 3287 3219 break; … … 3302 3234 break; 3303 3235 } 3304 cbMax = ataBE2H_U16(pbPacket + 7);3236 cbMax = scsiBE2H_U16(pbPacket + 7); 3305 3237 /* SCSI MMC-3 spec says format is at offset 2 (lower 4 bits), 3306 3238 * but Linux kernel uses offset 9 (topmost 2 bits). Hope that … … 3351 3283 break; 3352 3284 } 3353 cbMax = ataBE2H_U16(pbPacket + 7);3285 cbMax = scsiBE2H_U16(pbPacket + 7); 3354 3286 ataR3StartTransfer(s, RT_MIN(cbMax, 34), PDMMEDIATXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_READ_DISC_INFORMATION, true); 3355 3287 break; … … 3366 3298 break; 3367 3299 } 3368 cbMax = ataBE2H_U16(pbPacket + 7);3300 cbMax = scsiBE2H_U16(pbPacket + 7); 3369 3301 ataR3StartTransfer(s, RT_MIN(cbMax, 36), PDMMEDIATXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_READ_TRACK_INFORMATION, true); 3370 3302 break; 3371 3303 case SCSI_GET_CONFIGURATION: 3372 3304 /* No media change stuff here, it can confuse Linux guests. */ 3373 cbMax = ataBE2H_U16(pbPacket + 7);3305 cbMax = scsiBE2H_U16(pbPacket + 7); 3374 3306 ataR3StartTransfer(s, RT_MIN(cbMax, 80), PDMMEDIATXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_GET_CONFIGURATION, true); 3375 3307 break; 3376 3308 case SCSI_INQUIRY: 3377 cbMax = ataBE2H_U16(pbPacket + 3);3309 cbMax = scsiBE2H_U16(pbPacket + 3); 3378 3310 ataR3StartTransfer(s, RT_MIN(cbMax, 36), PDMMEDIATXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_INQUIRY, true); 3379 3311 break; 3380 3312 case SCSI_READ_DVD_STRUCTURE: 3381 3313 { 3382 cbMax = ataBE2H_U16(pbPacket + 8);3314 cbMax = scsiBE2H_U16(pbPacket + 8); 3383 3315 ataR3StartTransfer(s, RT_MIN(cbMax, 4), PDMMEDIATXDIR_FROM_DEVICE, ATAFN_BT_ATAPI_CMD, ATAFN_SS_ATAPI_READ_DVD_STRUCTURE, true); 3384 3316 break; … … 3411 3343 goto sendcmd; 3412 3344 case SCSI_ERASE_10: 3413 iATAPILBA = ataBE2H_U32(pbPacket + 2);3414 cbTransfer = ataBE2H_U16(pbPacket + 7);3345 iATAPILBA = scsiBE2H_U32(pbPacket + 2); 3346 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3415 3347 Log2(("ATAPI PT: lba %d\n", iATAPILBA)); 3416 3348 uTxDir = PDMMEDIATXDIR_TO_DEVICE; … … 3421 3353 goto sendcmd; 3422 3354 case SCSI_GET_CONFIGURATION: 3423 cbTransfer = ataBE2H_U16(pbPacket + 7);3355 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3424 3356 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3425 3357 goto sendcmd; 3426 3358 case SCSI_GET_EVENT_STATUS_NOTIFICATION: 3427 cbTransfer = ataBE2H_U16(pbPacket + 7);3359 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3428 3360 if (ASMAtomicReadU32(&s->MediaEventStatus) != ATA_EVENT_STATUS_UNCHANGED) 3429 3361 { … … 3438 3370 goto sendcmd; 3439 3371 case SCSI_INQUIRY: 3440 cbTransfer = ataBE2H_U16(pbPacket + 3);3372 cbTransfer = scsiBE2H_U16(pbPacket + 3); 3441 3373 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3442 3374 goto sendcmd; … … 3444 3376 goto sendcmd; 3445 3377 case SCSI_MECHANISM_STATUS: 3446 cbTransfer = ataBE2H_U16(pbPacket + 8);3378 cbTransfer = scsiBE2H_U16(pbPacket + 8); 3447 3379 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3448 3380 goto sendcmd; 3449 3381 case SCSI_MODE_SELECT_10: 3450 cbTransfer = ataBE2H_U16(pbPacket + 7);3382 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3451 3383 uTxDir = PDMMEDIATXDIR_TO_DEVICE; 3452 3384 goto sendcmd; 3453 3385 case SCSI_MODE_SENSE_10: 3454 cbTransfer = ataBE2H_U16(pbPacket + 7);3386 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3455 3387 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3456 3388 goto sendcmd; … … 3467 3399 goto sendcmd; 3468 3400 case SCSI_READ_10: 3469 iATAPILBA = ataBE2H_U32(pbPacket + 2);3470 cSectors = ataBE2H_U16(pbPacket + 7);3401 iATAPILBA = scsiBE2H_U32(pbPacket + 2); 3402 cSectors = scsiBE2H_U16(pbPacket + 7); 3471 3403 Log2(("ATAPI PT: lba %d sectors %d\n", iATAPILBA, cSectors)); 3472 3404 s->cbATAPISector = 2048; … … 3475 3407 goto sendcmd; 3476 3408 case SCSI_READ_12: 3477 iATAPILBA = ataBE2H_U32(pbPacket + 2);3478 cSectors = ataBE2H_U32(pbPacket + 6);3409 iATAPILBA = scsiBE2H_U32(pbPacket + 2); 3410 cSectors = scsiBE2H_U32(pbPacket + 6); 3479 3411 Log2(("ATAPI PT: lba %d sectors %d\n", iATAPILBA, cSectors)); 3480 3412 s->cbATAPISector = 2048; … … 3483 3415 goto sendcmd; 3484 3416 case SCSI_READ_BUFFER: 3485 cbTransfer = ataBE2H_U24(pbPacket + 6);3417 cbTransfer = scsiBE2H_U24(pbPacket + 6); 3486 3418 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3487 3419 goto sendcmd; 3488 3420 case SCSI_READ_BUFFER_CAPACITY: 3489 cbTransfer = ataBE2H_U16(pbPacket + 7);3421 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3490 3422 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3491 3423 goto sendcmd; … … 3505 3437 3506 3438 if (pbPacket[0] == SCSI_READ_CD) 3507 iLbaStart = ataBE2H_U32(&pbPacket[2]);3439 iLbaStart = scsiBE2H_U32(&pbPacket[2]); 3508 3440 else 3509 iLbaStart = ataMSF2LBA(&pbPacket[3]);3441 iLbaStart = scsiMSF2LBA(&pbPacket[3]); 3510 3442 3511 3443 if (s->pTrackList) … … 3536 3468 3537 3469 if (pbPacket[0] == SCSI_READ_CD) 3538 cbTransfer = ataBE2H_U24(pbPacket + 6) * s->cbATAPISector;3470 cbTransfer = scsiBE2H_U24(pbPacket + 6) * s->cbATAPISector; 3539 3471 else /* SCSI_READ_MSF */ 3540 3472 { 3541 cSectors = ataMSF2LBA(pbPacket + 6) - ataMSF2LBA(pbPacket + 3);3473 cSectors = scsiMSF2LBA(pbPacket + 6) - scsiMSF2LBA(pbPacket + 3); 3542 3474 if (cSectors > 32) 3543 3475 cSectors = 32; /* Limit transfer size to 64~74K. Safety first. In any case this can only harm software doing CDDA extraction. */ … … 3548 3480 } 3549 3481 case SCSI_READ_DISC_INFORMATION: 3550 cbTransfer = ataBE2H_U16(pbPacket + 7);3482 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3551 3483 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3552 3484 goto sendcmd; 3553 3485 case SCSI_READ_DVD_STRUCTURE: 3554 cbTransfer = ataBE2H_U16(pbPacket + 8);3486 cbTransfer = scsiBE2H_U16(pbPacket + 8); 3555 3487 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3556 3488 goto sendcmd; 3557 3489 case SCSI_READ_FORMAT_CAPACITIES: 3558 cbTransfer = ataBE2H_U16(pbPacket + 7);3490 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3559 3491 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3560 3492 goto sendcmd; 3561 3493 case SCSI_READ_SUBCHANNEL: 3562 cbTransfer = ataBE2H_U16(pbPacket + 7);3494 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3563 3495 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3564 3496 goto sendcmd; 3565 3497 case SCSI_READ_TOC_PMA_ATIP: 3566 cbTransfer = ataBE2H_U16(pbPacket + 7);3498 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3567 3499 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3568 3500 goto sendcmd; 3569 3501 case SCSI_READ_TRACK_INFORMATION: 3570 cbTransfer = ataBE2H_U16(pbPacket + 7);3502 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3571 3503 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3572 3504 goto sendcmd; … … 3574 3506 goto sendcmd; 3575 3507 case SCSI_REPORT_KEY: 3576 cbTransfer = ataBE2H_U16(pbPacket + 8);3508 cbTransfer = scsiBE2H_U16(pbPacket + 8); 3577 3509 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3578 3510 goto sendcmd; … … 3593 3525 goto sendcmd; 3594 3526 case SCSI_SEND_CUE_SHEET: 3595 cbTransfer = ataBE2H_U24(pbPacket + 6);3527 cbTransfer = scsiBE2H_U24(pbPacket + 6); 3596 3528 uTxDir = PDMMEDIATXDIR_TO_DEVICE; 3597 3529 goto sendcmd; 3598 3530 case SCSI_SEND_DVD_STRUCTURE: 3599 cbTransfer = ataBE2H_U16(pbPacket + 8);3531 cbTransfer = scsiBE2H_U16(pbPacket + 8); 3600 3532 uTxDir = PDMMEDIATXDIR_TO_DEVICE; 3601 3533 goto sendcmd; 3602 3534 case SCSI_SEND_EVENT: 3603 cbTransfer = ataBE2H_U16(pbPacket + 8);3535 cbTransfer = scsiBE2H_U16(pbPacket + 8); 3604 3536 uTxDir = PDMMEDIATXDIR_TO_DEVICE; 3605 3537 goto sendcmd; 3606 3538 case SCSI_SEND_KEY: 3607 cbTransfer = ataBE2H_U16(pbPacket + 8);3539 cbTransfer = scsiBE2H_U16(pbPacket + 8); 3608 3540 uTxDir = PDMMEDIATXDIR_TO_DEVICE; 3609 3541 goto sendcmd; 3610 3542 case SCSI_SEND_OPC_INFORMATION: 3611 cbTransfer = ataBE2H_U16(pbPacket + 7);3543 cbTransfer = scsiBE2H_U16(pbPacket + 7); 3612 3544 uTxDir = PDMMEDIATXDIR_TO_DEVICE; 3613 3545 goto sendcmd; … … 3617 3549 goto sendcmd; 3618 3550 case SCSI_SET_STREAMING: 3619 cbTransfer = ataBE2H_U16(pbPacket + 9);3551 cbTransfer = scsiBE2H_U16(pbPacket + 9); 3620 3552 uTxDir = PDMMEDIATXDIR_TO_DEVICE; 3621 3553 goto sendcmd; … … 3632 3564 case SCSI_WRITE_10: 3633 3565 case SCSI_WRITE_AND_VERIFY_10: 3634 iATAPILBA = ataBE2H_U32(pbPacket + 2);3635 cSectors = ataBE2H_U16(pbPacket + 7);3566 iATAPILBA = scsiBE2H_U32(pbPacket + 2); 3567 cSectors = scsiBE2H_U16(pbPacket + 7); 3636 3568 if (s->pTrackList) 3637 3569 s->cbATAPISector = ATAPIPassthroughTrackListGetSectorSizeFromLba(s->pTrackList, iATAPILBA); … … 3643 3575 goto sendcmd; 3644 3576 case SCSI_WRITE_12: 3645 iATAPILBA = ataBE2H_U32(pbPacket + 2);3646 cSectors = ataBE2H_U32(pbPacket + 6);3577 iATAPILBA = scsiBE2H_U32(pbPacket + 2); 3578 cSectors = scsiBE2H_U32(pbPacket + 6); 3647 3579 if (s->pTrackList) 3648 3580 s->cbATAPISector = ATAPIPassthroughTrackListGetSectorSizeFromLba(s->pTrackList, iATAPILBA); … … 3666 3598 break; 3667 3599 default: 3668 cbTransfer = ataBE2H_U16(pbPacket + 6);3600 cbTransfer = scsiBE2H_U16(pbPacket + 6); 3669 3601 uTxDir = PDMMEDIATXDIR_TO_DEVICE; 3670 3602 goto sendcmd; … … 3672 3604 break; 3673 3605 case SCSI_REPORT_LUNS: /* Not part of MMC-3, but used by Windows. */ 3674 cbTransfer = ataBE2H_U32(pbPacket + 6);3606 cbTransfer = scsiBE2H_U32(pbPacket + 6); 3675 3607 uTxDir = PDMMEDIATXDIR_FROM_DEVICE; 3676 3608 goto sendcmd;
Note:
See TracChangeset
for help on using the changeset viewer.