From c62c8facd85060edbf844d11fbf384885c8e83ba Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 23 Sep 2006 08:51:27 +0000 Subject: [PATCH] Introduced new API function burn_drive_obtain_scsi_adr() --- trunk/libburn/drive.c | 13 +++++++++++++ trunk/libburn/libburn.h | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/trunk/libburn/drive.c b/trunk/libburn/drive.c index 45573817..ac9273f1 100644 --- a/trunk/libburn/drive.c +++ b/trunk/libburn/drive.c @@ -842,3 +842,16 @@ fprintf(stderr,"libburn experimental: Nothing found for %s \n",path); return 0; } +/* ts A60923 */ +/** Try to obtain host,channel,target,lun from path. + @return 1 = success , 0 = failure , -1 = severe error +*/ +int burn_drive_obtain_scsi_adr(char *path, int *host_no, int *channel_no, + int *target_no, int *lun_no) +{ + int ret; + + ret = sg_obtain_scsi_adr(path, host_no, channel_no, target_no, lun_no); + return ret; +} + diff --git a/trunk/libburn/libburn.h b/trunk/libburn/libburn.h index 04b2167f..d80511d5 100644 --- a/trunk/libburn/libburn.h +++ b/trunk/libburn/libburn.h @@ -610,6 +610,16 @@ int burn_drive_convert_fs_adr(char *path, char adr[]); int burn_drive_convert_scsi_adr(int host_no, int channel_no, int target_no, int lun_no, char adr[]); +/* ts A60923 */ +/** Try to obtain host,channel,target,lun from path. If there is an SCSI + address at all, then this call should succeed with a persistent + drive address obtained via burn_drive_get_adr(). It is also supposed to + succeed with any device file of a (possibly emulated) SCSI device. + @return 1 = success , 0 = failure , -1 = severe error +*/ +int burn_drive_obtain_scsi_adr(char *path, int *host_no, int *channel_no, + int *target_no, int *lun_no); + /** Grab a drive. This must be done before the drive can be used (for reading, writing, etc).