An ATAPI drive (_NEC , DVD_RW ND-3520A, 1.04, SCSI CD-ROM) was getting

set as big endian although it appeared not to, possibly because of
SCSI emulation.

We now test for SCSIness in addition to ATAPIness as both can occur.

Added field in cdrom_device structure for SCSIness and that's tested
before unconditionally setting drive bigendian-ness.
This commit is contained in:
rocky
2005-04-28 01:25:53 +00:00
parent 5b0aecf817
commit 54e0e9a52f
3 changed files with 11 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: cdda.h,v 1.19 2005/02/05 23:53:06 rocky Exp $ $Id: cdda.h,v 1.20 2005/04/28 01:25:53 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 2001 Xiph.org Copyright (C) 2001 Xiph.org
@@ -113,6 +113,7 @@ struct cdrom_drive_s {
int is_atapi; int is_atapi;
int is_mmc; int is_mmc;
int is_scsi;
int i_test_flags; /**< Normally set 0. But if we are testing int i_test_flags; /**< Normally set 0. But if we are testing
paranoia operation this can be set to one of paranoia operation this can be set to one of

View File

@@ -1,5 +1,5 @@
/* /*
$Id: interface.c,v 1.22 2005/02/10 01:59:06 rocky Exp $ $Id: interface.c,v 1.23 2005/04/28 01:25:53 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1998 Monty xiphmont@mit.edu Copyright (C) 1998 Monty xiphmont@mit.edu
@@ -121,8 +121,8 @@ cdio_cddap_open(cdrom_drive_t *d)
/* d->select_speed(d,d->maxspeed); most drives are full speed by default */ /* d->select_speed(d,d->maxspeed); most drives are full speed by default */
if ( -1 == d->bigendianp ) { if ( -1 == d->bigendianp ) {
if (yep == cdio_have_atapi(d->p_cdio)) if (1 != d->is_scsi && yep == cdio_have_atapi(d->p_cdio))
/* Is this right? Might we also have to check for SCSI ATAPI? */ /* Is this right? */
d->bigendianp = 1; d->bigendianp = 1;
else else
d->bigendianp = data_bigendianp(d); d->bigendianp = data_bigendianp(d);

View File

@@ -1,5 +1,5 @@
/* /*
$Id: scan_devices.c,v 1.26 2005/02/07 03:36:02 rocky Exp $ $Id: scan_devices.c,v 1.27 2005/04/28 01:25:53 rocky Exp $
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1998 Monty xiphmont@mit.edu Copyright (C) 1998 Monty xiphmont@mit.edu
@@ -211,6 +211,7 @@ cdda_identify_device_cdio(CdIo_t *p_cdio, const char *psz_device,
{ {
cdrom_drive_t *d=NULL; cdrom_drive_t *d=NULL;
int drive_type = 0; int drive_type = 0;
int is_scsi = -1;
char *description=NULL; char *description=NULL;
#ifdef HAVE_LINUX_MAJOR_H #ifdef HAVE_LINUX_MAJOR_H
struct stat st; struct stat st;
@@ -232,6 +233,7 @@ cdda_identify_device_cdio(CdIo_t *p_cdio, const char *psz_device,
case IDE3_MAJOR: case IDE3_MAJOR:
/* Yay, ATAPI... */ /* Yay, ATAPI... */
description=strdup("ATAPI compatible "); description=strdup("ATAPI compatible ");
is_scsi = 0;
break; break;
case CDU31A_CDROM_MAJOR: case CDU31A_CDROM_MAJOR:
/* major indicates this is a cdrom; no ping necessary. */ /* major indicates this is a cdrom; no ping necessary. */
@@ -273,6 +275,7 @@ cdda_identify_device_cdio(CdIo_t *p_cdio, const char *psz_device,
case SCSI_GENERIC_MAJOR: case SCSI_GENERIC_MAJOR:
/* Nope nope nope */ /* Nope nope nope */
description=strdup("SCSI CD-ROM"); description=strdup("SCSI CD-ROM");
is_scsi = 1;
break; break;
default: default:
/* What the hell is this? */ /* What the hell is this? */
@@ -291,8 +294,9 @@ cdda_identify_device_cdio(CdIo_t *p_cdio, const char *psz_device,
d->p_cdio = p_cdio; d->p_cdio = p_cdio;
d->cdda_device_name = strdup(psz_device); d->cdda_device_name = strdup(psz_device);
d->drive_type = drive_type; d->drive_type = drive_type;
d->is_scsi = is_scsi;
d->bigendianp = -1; /* We don't know yet... */ d->bigendianp = -1; /* We don't know yet... */
d->nsectors = -1; d->nsectors = -1; /* We don't know yet... */
d->b_swap_bytes = true; d->b_swap_bytes = true;
{ {