diff options
Diffstat (limited to 'audio/cdparanoia/patches/patch-cg')
-rw-r--r-- | audio/cdparanoia/patches/patch-cg | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/audio/cdparanoia/patches/patch-cg b/audio/cdparanoia/patches/patch-cg index 5d05e619c73..3fcca5d311e 100644 --- a/audio/cdparanoia/patches/patch-cg +++ b/audio/cdparanoia/patches/patch-cg @@ -1,7 +1,7 @@ -$NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ +$NetBSD: patch-cg,v 1.11 2009/08/29 04:54:52 hasso Exp $ ---- interface/scsi_interface.c.orig 2008-09-11 22:33:30.000000000 +0200 -+++ interface/scsi_interface.c +--- interface/scsi_interface.c.orig 2008-09-11 23:33:30 +0300 ++++ interface/scsi_interface.c 2009-08-28 12:14:21 +0300 @@ -12,6 +12,11 @@ #include "common_interface.h" #include "utils.h" @@ -37,7 +37,7 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ cdmessage(d,buffer); } -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) static void clear_garbage(cdrom_drive *d){ fd_set fdset; struct timeval tv; @@ -53,11 +53,23 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ return 0; } -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) /* process a complete scsi command. */ static int sg2_handle_scsi_cmd(cdrom_drive *d, unsigned char *cmd, -@@ -417,6 +430,71 @@ static int sgio_handle_scsi_cmd(cdrom_dr +@@ -356,7 +369,11 @@ static int sgio_handle_scsi_cmd(cdrom_dr + hdr.timeout = 50000; + hdr.interface_id = 'S'; + hdr.dxferp = d->private->sg_buffer; ++#if defined(__DragonFly__) ++ hdr.flags = 0; ++#else + hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */ ++#endif + + /* scary buffer fill hack */ + if(bytecheck && out_size>in_size) +@@ -417,6 +434,71 @@ static int sgio_handle_scsi_cmd(cdrom_dr errno = 0; return 0; } @@ -129,11 +141,11 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ static int handle_scsi_cmd(cdrom_drive *d, unsigned char *cmd, -@@ -427,9 +505,14 @@ static int handle_scsi_cmd(cdrom_drive * +@@ -427,9 +509,14 @@ static int handle_scsi_cmd(cdrom_drive * int bytecheck, unsigned char *sense){ -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) if(d->interface == SGIO_SCSI || d->interface == SGIO_SCSI_BUGGY1) return sgio_handle_scsi_cmd(d,cmd,cmd_len,in_size,out_size,bytefill,bytecheck,sense); return sg2_handle_scsi_cmd(d,cmd,cmd_len,in_size,out_size,bytefill,bytecheck,sense); @@ -144,15 +156,15 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ } -@@ -453,6 +536,7 @@ static int test_unit_ready(cdrom_drive * +@@ -453,6 +540,7 @@ static int test_unit_ready(cdrom_drive * return 1; } -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) static void reset_scsi(cdrom_drive *d){ int arg,tries=0; d->enable_cdda(d,0); -@@ -471,6 +555,22 @@ static void reset_scsi(cdrom_drive *d){ +@@ -471,6 +559,22 @@ static void reset_scsi(cdrom_drive *d){ d->enable_cdda(d,1); } @@ -175,15 +187,15 @@ $NetBSD: patch-cg,v 1.10 2009/08/09 16:00:53 drochner Exp $ static int mode_sense_atapi(cdrom_drive *d,int size,int page){ unsigned char sense[SG_MAX_SENSE]; -@@ -1587,6 +1687,7 @@ static void check_cache(cdrom_drive *d){ +@@ -1587,6 +1691,7 @@ static void check_cache(cdrom_drive *d){ } } -+#ifdef __linux__ ++#if defined(__linux__) || defined(__DragonFly__) static int check_atapi(cdrom_drive *d){ int atapiret=-1; int fd = d->cdda_fd; /* check the device we'll actually be using to read */ -@@ -1616,7 +1717,32 @@ static int check_atapi(cdrom_drive *d){ +@@ -1616,7 +1721,32 @@ static int check_atapi(cdrom_drive *d){ return(d->is_atapi); } |