diff --git a/src/scsi-layer.c b/src/scsi-layer.c index 09d7b43..95e6c7a 100644 --- a/src/scsi-layer.c +++ b/src/scsi-layer.c @@ -399,6 +399,24 @@ static int get_configuration(DeviceHandle *dh) dh->subType = BD_RE; break; + case 0x50: dh->profileDescr = "HD-DVD"; + dh->shortProfile = "HD-DVD"; + dh->mainType = HD_DVD; + dh->subType = HD_DVD; + break; + + case 0x51: dh->profileDescr = "HD-DVD-R"; + dh->shortProfile = "HD-DVD-R"; + dh->mainType = HD_DVD; + dh->subType = HD_DVD_R; + break; + + case 0x52: dh->profileDescr = "HD-DVD-RW"; + dh->shortProfile = "HD-DVD-RW"; + dh->mainType = HD_DVD; + dh->subType = HD_DVD_RW; + break; + default: dh->profileDescr = "Unknown profile"; dh->mainType = UNSUPPORTED; dh->subType = UNSUPPORTED; @@ -875,13 +893,16 @@ static int query_dvd(DeviceHandle *dh, int probe_only) dh->rewriteable = TRUE; break; case 4: dh->bookDescr = "HD DVD-ROM"; - dh->subType = UNSUPPORTED; + dh->subType = HD_DVD; break; case 5: dh->bookDescr = "HD DVD-RAM"; dh->subType = UNSUPPORTED; break; case 6: dh->bookDescr = "HD DVD-R"; - dh->subType = UNSUPPORTED; + dh->subType = HD_DVD_R; + break; + case 7: dh->bookDescr = "HD DVD-RW"; + dh->subType = HD_DVD_RW; break; case 9: dh->bookDescr = "DVD+RW"; dh->rewriteable = TRUE; @@ -1185,6 +1206,22 @@ static int query_type(DeviceHandle *dh, int probe_only) } break; /* unreachable */ + case HD_DVD: + dh->read = read_dvd_sector; + dh->singleRate = 36000.0/8.0; /* 1x = 36 kbit */ + dh->maxRate = 3; + dh->clusterSize = 32; + if(!dh->incomplete) + { ret = query_dvd(dh, probe_only); + return (probe_only == 2 ? TRUE : ret); + } + else + { if(query_dvd(dh, TRUE)) return TRUE; + ret = query_incomplete(dh, probe_only); + return (probe_only == 2 ? TRUE : ret); + } + break; /* unreachable */ + default: /* maybe HD DVD or sth else we do not support */ return FALSE; } @@ -1914,6 +1951,13 @@ static gint64 query_size(Image *image) return dh->readCapacity+1; /* size is the number of the last sector, starting with 0 */ } + /* HD-DVD: no clue. Stick with READ CAPACITY. */ + + if(dh->mainType == HD_DVD) + { Verbose("HD-DVD medium - using size from READ CAPACITY: %" PRId64 " sectors\n", dh->readCapacity+1); + return dh->readCapacity+1; /* size is the number of the last sector, starting with 0 */ + } + /* For DVD media, READ CAPACITY should give the real image size. READ DVD STRUCTURE may be same value or the unformatted size. But some drives appear to have both functions reversed, @@ -2723,6 +2767,7 @@ Image* OpenImageFromDevice(char *device, int query_only) switch(subTypeMasked) { case BD: + case HD_DVD: case DVD: case CD: { char *tmp; diff --git a/src/scsi-layer.h b/src/scsi-layer.h index 2df78a7..3854e68 100644 --- a/src/scsi-layer.h +++ b/src/scsi-layer.h @@ -235,6 +235,10 @@ typedef struct _DeviceHandle #define BD_R 0x41 #define BD_RE 0x42 +#define HD_DVD 0x50 +#define HD_DVD_R 0x51 +#define HD_DVD_RW 0x52 + #define UNSUPPORTED 0x00 /* transport io modes */