From e955d5019805600b41bfce3f6b0e7dc4572e4293 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 3 Mar 2007 14:09:46 +0000 Subject: [PATCH] Determine physical interface SCSI,ATA,SATA,USB,... (for future use) --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/mmc.c | 32 ++++++++++++++++++++------------ libburn/transport.h | 3 +++ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 712c419..1529488 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.03.01.120945" +#define Cdrskin_timestamP "2007.03.03.141240" diff --git a/libburn/mmc.c b/libburn/mmc.c index 86ffc83..51c8020 100644 --- a/libburn/mmc.c +++ b/libburn/mmc.c @@ -1489,6 +1489,8 @@ void mmc_get_configuration(struct burn_drive *d) int len, cp, descr_len = 0, feature_code, prf_number, only_current = 1; unsigned char *descr, *prf, *up_to, *prf_end; struct command c; + int phys_if_std = 0; + char *phys_name = ""; d->current_profile = 0; d->current_profile_text[0] = 0; @@ -1619,28 +1621,29 @@ void mmc_get_configuration(struct burn_drive *d) !!(descr[4] & 2)); #endif /* Libburn_print_feature_descriptorS */ -#ifdef Libburn_print_feature_descriptorS } else if (feature_code == 0x01) { - int pys_if_std = 0; - char *phys_name = ""; - - pys_if_std = (descr[4] << 24) | (descr[5] << 16) | + phys_if_std = (descr[4] << 24) | (descr[5] << 16) | (descr[6] << 8) | descr[9]; - if (pys_if_std == 1) + if (phys_if_std == 1) phys_name = "SCSI Family"; - else if(pys_if_std == 2) + else if(phys_if_std == 2) phys_name = "ATAPI"; - else if(pys_if_std == 3 || pys_if_std == 4 || - pys_if_std == 6) + else if(phys_if_std == 3 || phys_if_std == 4 || + phys_if_std == 6) phys_name = "IEEE 1394 FireWire"; - else if(pys_if_std == 7) + else if(phys_if_std == 7) phys_name = "Serial ATAPI"; - else if(pys_if_std == 7) + else if(phys_if_std == 8) phys_name = "USB"; + d->phys_if_std = phys_if_std; + strcpy(d->phys_if_name, phys_name); + +#ifdef Libburn_print_feature_descriptorS + fprintf(stderr, "LIBBURN_EXPERIMENTAL : Phys. Interface Standard %Xh \"%s\"\n", - pys_if_std, phys_name); + phys_if_std, phys_name); } else if (feature_code == 0x107) { @@ -2233,6 +2236,11 @@ int mmc_setup_drive(struct burn_drive *d) d->format_unit = mmc_format_unit; d->read_format_capacities = mmc_read_format_capacities; + + /* ts A70302 */ + d->phys_if_std = -1; + d->phys_if_name[0] = 0; + /* ts A61020 */ d->start_lba = -2000000000; d->end_lba = -2000000000; diff --git a/libburn/transport.h b/libburn/transport.h index 8838b8b..ec4e5d2 100644 --- a/libburn/transport.h +++ b/libburn/transport.h @@ -129,6 +129,9 @@ struct burn_drive int lun; char *devname; + /* ts A70302: mmc5r03c.pdf 5.3.2 Physical Interface Standard */ + int phys_if_std; /* 1=SCSI, 2=ATAPI, 3,4,6=FireWire, 7=SATA, 8=USB */ + char phys_if_name[80]; /* MMC-5 5.3.2 table 91 , e.g. "SCSI Family" */ /* see os.h for name of particular os-*.h where this is defined */ BURN_OS_TRANSPORT_DRIVE_ELEMENTS