head 1.13; access; symbols pkgsrc-2026Q1:1.13.0.100 pkgsrc-2026Q1-base:1.13 pkgsrc-2025Q4:1.13.0.98 pkgsrc-2025Q4-base:1.13 pkgsrc-2025Q3:1.13.0.96 pkgsrc-2025Q3-base:1.13 pkgsrc-2025Q2:1.13.0.94 pkgsrc-2025Q2-base:1.13 pkgsrc-2025Q1:1.13.0.92 pkgsrc-2025Q1-base:1.13 pkgsrc-2024Q4:1.13.0.90 pkgsrc-2024Q4-base:1.13 pkgsrc-2024Q3:1.13.0.88 pkgsrc-2024Q3-base:1.13 pkgsrc-2024Q2:1.13.0.86 pkgsrc-2024Q2-base:1.13 pkgsrc-2024Q1:1.13.0.84 pkgsrc-2024Q1-base:1.13 pkgsrc-2023Q4:1.13.0.82 pkgsrc-2023Q4-base:1.13 pkgsrc-2023Q3:1.13.0.80 pkgsrc-2023Q3-base:1.13 pkgsrc-2023Q2:1.13.0.78 pkgsrc-2023Q2-base:1.13 pkgsrc-2023Q1:1.13.0.76 pkgsrc-2023Q1-base:1.13 pkgsrc-2022Q4:1.13.0.74 pkgsrc-2022Q4-base:1.13 pkgsrc-2022Q3:1.13.0.72 pkgsrc-2022Q3-base:1.13 pkgsrc-2022Q2:1.13.0.70 pkgsrc-2022Q2-base:1.13 pkgsrc-2022Q1:1.13.0.68 pkgsrc-2022Q1-base:1.13 pkgsrc-2021Q4:1.13.0.66 pkgsrc-2021Q4-base:1.13 pkgsrc-2021Q3:1.13.0.64 pkgsrc-2021Q3-base:1.13 pkgsrc-2021Q2:1.13.0.62 pkgsrc-2021Q2-base:1.13 pkgsrc-2021Q1:1.13.0.60 pkgsrc-2021Q1-base:1.13 pkgsrc-2020Q4:1.13.0.58 pkgsrc-2020Q4-base:1.13 pkgsrc-2020Q3:1.13.0.56 pkgsrc-2020Q3-base:1.13 pkgsrc-2020Q2:1.13.0.52 pkgsrc-2020Q2-base:1.13 pkgsrc-2020Q1:1.13.0.32 pkgsrc-2020Q1-base:1.13 pkgsrc-2019Q4:1.13.0.54 pkgsrc-2019Q4-base:1.13 pkgsrc-2019Q3:1.13.0.50 pkgsrc-2019Q3-base:1.13 pkgsrc-2019Q2:1.13.0.48 pkgsrc-2019Q2-base:1.13 pkgsrc-2019Q1:1.13.0.46 pkgsrc-2019Q1-base:1.13 pkgsrc-2018Q4:1.13.0.44 pkgsrc-2018Q4-base:1.13 pkgsrc-2018Q3:1.13.0.42 pkgsrc-2018Q3-base:1.13 pkgsrc-2018Q2:1.13.0.40 pkgsrc-2018Q2-base:1.13 pkgsrc-2018Q1:1.13.0.38 pkgsrc-2018Q1-base:1.13 pkgsrc-2017Q4:1.13.0.36 pkgsrc-2017Q4-base:1.13 pkgsrc-2017Q3:1.13.0.34 pkgsrc-2017Q3-base:1.13 pkgsrc-2017Q2:1.13.0.30 pkgsrc-2017Q2-base:1.13 pkgsrc-2017Q1:1.13.0.28 pkgsrc-2017Q1-base:1.13 pkgsrc-2016Q4:1.13.0.26 pkgsrc-2016Q4-base:1.13 pkgsrc-2016Q3:1.13.0.24 pkgsrc-2016Q3-base:1.13 pkgsrc-2016Q2:1.13.0.22 pkgsrc-2016Q2-base:1.13 pkgsrc-2016Q1:1.13.0.20 pkgsrc-2016Q1-base:1.13 pkgsrc-2015Q4:1.13.0.18 pkgsrc-2015Q4-base:1.13 pkgsrc-2015Q3:1.13.0.16 pkgsrc-2015Q3-base:1.13 pkgsrc-2015Q2:1.13.0.14 pkgsrc-2015Q2-base:1.13 pkgsrc-2015Q1:1.13.0.12 pkgsrc-2015Q1-base:1.13 pkgsrc-2014Q4:1.13.0.10 pkgsrc-2014Q4-base:1.13 pkgsrc-2014Q3:1.13.0.8 pkgsrc-2014Q3-base:1.13 pkgsrc-2014Q2:1.13.0.6 pkgsrc-2014Q2-base:1.13 pkgsrc-2014Q1:1.13.0.4 pkgsrc-2014Q1-base:1.13 pkgsrc-2013Q4:1.13.0.2 pkgsrc-2013Q4-base:1.13 pkgsrc-2013Q3:1.12.0.34 pkgsrc-2013Q3-base:1.12 pkgsrc-2013Q2:1.12.0.32 pkgsrc-2013Q2-base:1.12 pkgsrc-2013Q1:1.12.0.30 pkgsrc-2013Q1-base:1.12 pkgsrc-2012Q4:1.12.0.28 pkgsrc-2012Q4-base:1.12 pkgsrc-2012Q3:1.12.0.26 pkgsrc-2012Q3-base:1.12 pkgsrc-2012Q2:1.12.0.24 pkgsrc-2012Q2-base:1.12 pkgsrc-2012Q1:1.12.0.22 pkgsrc-2012Q1-base:1.12 pkgsrc-2011Q4:1.12.0.20 pkgsrc-2011Q4-base:1.12 pkgsrc-2011Q3:1.12.0.18 pkgsrc-2011Q3-base:1.12 pkgsrc-2011Q2:1.12.0.16 pkgsrc-2011Q2-base:1.12 pkgsrc-2011Q1:1.12.0.14 pkgsrc-2011Q1-base:1.12 pkgsrc-2010Q4:1.12.0.12 pkgsrc-2010Q4-base:1.12 pkgsrc-2010Q3:1.12.0.10 pkgsrc-2010Q3-base:1.12 pkgsrc-2010Q2:1.12.0.8 pkgsrc-2010Q2-base:1.12 pkgsrc-2010Q1:1.12.0.6 pkgsrc-2010Q1-base:1.12 pkgsrc-2009Q4:1.12.0.4 pkgsrc-2009Q4-base:1.12 pkgsrc-2009Q3:1.12.0.2 pkgsrc-2009Q3-base:1.12 pkgsrc-2009Q2:1.10.0.2 pkgsrc-2009Q2-base:1.10 pkgsrc-2009Q1:1.8.0.18 pkgsrc-2009Q1-base:1.8 pkgsrc-2008Q4:1.8.0.16 pkgsrc-2008Q4-base:1.8 pkgsrc-2008Q3:1.8.0.14 pkgsrc-2008Q3-base:1.8 cube-native-xorg:1.8.0.12 cube-native-xorg-base:1.8 pkgsrc-2008Q2:1.8.0.10 pkgsrc-2008Q2-base:1.8 cwrapper:1.8.0.8 pkgsrc-2008Q1:1.8.0.6 pkgsrc-2008Q1-base:1.8 pkgsrc-2007Q4:1.8.0.4 pkgsrc-2007Q4-base:1.8 pkgsrc-2007Q3:1.8.0.2 pkgsrc-2007Q3-base:1.8 pkgsrc-2007Q2:1.7.0.8 pkgsrc-2007Q2-base:1.7 pkgsrc-2007Q1:1.7.0.6 pkgsrc-2007Q1-base:1.7 pkgsrc-2006Q4:1.7.0.4 pkgsrc-2006Q4-base:1.7 pkgsrc-2006Q3:1.7.0.2 pkgsrc-2006Q3-base:1.7 pkgsrc-2006Q2:1.6.0.4 pkgsrc-2006Q2-base:1.6 pkgsrc-2006Q1:1.6.0.2 pkgsrc-2006Q1-base:1.6 pkgsrc-2005Q4:1.5.0.10 pkgsrc-2005Q4-base:1.5 pkgsrc-2005Q3:1.5.0.8 pkgsrc-2005Q3-base:1.5 pkgsrc-2005Q2:1.5.0.6 pkgsrc-2005Q2-base:1.5 pkgsrc-2005Q1:1.5.0.4 pkgsrc-2005Q1-base:1.5 pkgsrc-2004Q4:1.5.0.2 pkgsrc-2004Q4-base:1.5 pkgsrc-2004Q3:1.4.0.8 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.6 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.4 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.4.0.2 pkgsrc-2003Q4-base:1.4 netbsd-1-6-1:1.3.0.6 netbsd-1-6-1-base:1.3 netbsd-1-6:1.3.0.8 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.3.0.4 pkgviews-base:1.3 buildlink2:1.3.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH001:1.2 netbsd-1-5-RELEASE:1.2 netbsd-1-4-PATCH003:1.2 netbsd-1-4-PATCH002:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.13 date 2013.12.12.16.41.32; author jperkin; state Exp; branches; next 1.12; commitid lQNU6i8bUcN6BRgx; 1.12 date 2009.08.29.04.54.52; author hasso; state Exp; branches; next 1.11; 1.11 date 2009.08.09.16.00.53; author drochner; state Exp; branches; next 1.10; 1.10 date 2009.05.19.00.36.06; author dholland; state Exp; branches; next 1.9; 1.9 date 2009.05.17.21.29.34; author dholland; state Exp; branches; next 1.8; 1.8 date 2007.10.09.21.26.11; author heinz; state Exp; branches; next 1.7; 1.7 date 2006.09.03.17.13.30; author ben; state Exp; branches; next 1.6; 1.6 date 2006.03.07.06.29.03; author joerg; state Exp; branches; next 1.5; 1.5 date 2004.10.10.10.48.39; author mycroft; state Exp; branches; next 1.4; 1.4 date 2003.10.20.12.07.23; author grant; state Exp; branches; next 1.3; 1.3 date 2002.03.04.14.45.14; author itohy; state Exp; branches; next 1.2; 1.2 date 2000.06.22.00.41.18; author wiz; state Exp; branches; next 1.1; 1.1 date 2000.01.19.08.03.00; author itohy; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2000.01.19.08.03.00; author itohy; state Exp; branches; next ; desc @@ 1.13 log @Make package build on SunOS. The end result is mostly non-functional as it is missing SCSI and CDDA support, however this does enable a number of other packages to now build, many of which do not depend on working cdparanoia for their own functionality. @ text @$NetBSD$ --- interface/scan_devices.c.orig 2008-08-26 09:55:22.000000000 +0000 +++ interface/scan_devices.c @@@@ -1,6 +1,8 @@@@ /****************************************************************** * CopyPolicy: GNU Lesser General Public License 2.1 applies * Copyright (C) 1998-2008 Monty xiphmont@@mit.edu + * FreeBSD porting (c) 2003 + * Simon 'corecode' Schubert * * Autoscan for or verify presence of a cdrom device * @@@@ -22,6 +24,8 @@@@ #include "common_interface.h" #include "utils.h" +#ifdef __linux__ + #define MAX_DEV_LEN 20 /* Safe because strings only come from below */ /* must be absolute paths! */ static char *scsi_cdrom_prefixes[]={ @@@@ -52,11 +56,33 @@@@ static char *cdrom_devices[]={ "/dev/cm206cd", "/dev/gscd", "/dev/optcd",NULL}; +#elif defined(__FreeBSD__) || defined(__DragonFly__) +static char *cdrom_devices[] = { + "/dev/cd?c", + "/dev/acd?c", + "/dev/wcd?c", + "/dev/mcd?c", NULL}; +#elif defined(__NetBSD__) +static char *cdrom_devices[] = { + "/dev/rcd?c", + "/dev/rcd?d", + "/dev/cd?c", + "/dev/cd?d", NULL}; +#elif defined(__sun) +static char *cdrom_devices[] = { + "/dev/dsk/c?t?d?s2", NULL}; +#endif /* Functions here look for a cdrom drive; full init of a drive type happens in interface.c */ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__sun) cdrom_drive *cdda_find_a_cdrom(int messagedest,char **messages){ +#if defined(__APPLE__) && defined(__MACH__) + cdrom_drive *d = calloc(1, sizeof(cdrom_drive)); + d->interface = OSX_IOKIT; + return d; +#else /* Brute force... */ int i=0; @@@@ -78,10 +104,12 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa if((d=cdda_identify(buffer,messagedest,messages))) return(d); idmessage(messagedest,messages,"",NULL); +#ifdef __linux__ buffer[pos-(cdrom_devices[i])]=j+97; if((d=cdda_identify(buffer,messagedest,messages))) return(d); idmessage(messagedest,messages,"",NULL); +#endif } }else{ /* Name. Go for it. */ @@@@ -93,11 +121,13 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa i++; } idmessage(messagedest,messages, - "\n\nNo cdrom drives accessible to %s found.\n", - cuserid(NULL)); + "\n\nNo cdrom drives found.\n", NULL); +#endif return(NULL); } +#endif /* __linux__ */ +#if !(defined(__APPLE__) && defined(__MACH__)) cdrom_drive *cdda_identify(const char *device, int messagedest,char **messages){ struct stat st; cdrom_drive *d=NULL; @@@@ -119,8 +149,14 @@@@ cdrom_drive *cdda_identify(const char *d /* an IDE device may have scsi-ide support, SG_IO support and cooked support. Prefer the SCSI variants, they give the most control */ +#if defined(__linux__) || defined(__NetBSD__) || defined(__DragonFly__) d=cdda_identify_scsi(NULL,device,messagedest,messages); if(!d)d=cdda_identify_cooked(device,messagedest,messages); +#elif defined(__FreeBSD__) + d = cdda_identify_scsi(device, NULL, messagedest, messages); + if (d == NULL) + d = cdda_identify_cooked(device, messagedest, messages); +#endif #ifdef CDDA_TEST if(!d)d=cdda_identify_test(device,messagedest,messages); @@@@ -148,6 +184,7 @@@@ char *test_resolve_symlink(const char *f cdrom_drive *cdda_identify_cooked(const char *dev, int messagedest, char **messages){ +#ifdef __linux__ cdrom_drive *d=NULL; struct stat st; int fd=-1, i; @@@@ -272,8 +309,60 @@@@ cdrom_drive *cdda_identify_cooked(const } idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description); return(d); +#elif defined(__NetBSD__) + /* no kernel support for CD-DA */ + return NULL; +#elif defined(__FreeBSD__) || defined(__DragonFly__) + cdrom_drive *d; + struct stat st; + + if (stat(dev, &st)) { + idperror(messagedest, messages, "\t\tCould not stat %s", dev); + return NULL; + } + + if (!S_ISCHR(st.st_mode)) { + idmessage(messagedest, messages, "\t\t%s is no block device", dev); + return NULL; + } + + if ((d = calloc(1, sizeof(*d))) == NULL) { + idperror(messagedest, messages, "\t\tCould not allocate memory", NULL); + return NULL; + } + d->ioctl_fd = -1; + + if ((d->ioctl_fd = open(dev, O_RDONLY)) == -1) { + idperror(messagedest, messages, "\t\tCould not open %s", dev); + goto cdda_identify_cooked_fail; + } + + if (ioctl_ping_cdrom(d->ioctl_fd)) { + idmessage(messagedest, messages, "\t\tDevice %s is not a CDROM", dev); + goto cdda_identify_cooked_fail; + } + + d->cdda_device_name = copystring(dev); + d->drive_model = copystring("Generic cooked ioctl CDROM"); + d->interface = COOKED_IOCTL; + d->bigendianp = -1; + d->nsectors = -1; + + idmessage(messagedest, messages, "\t\tCDROM sensed: %s\n", d->drive_model); + + return d; + +cdda_identify_cooked_fail: + if (d != NULL) { + if (d->ioctl_fd != -1) + close(d->ioctl_fd); + free(d); + } + return NULL; +#endif } +#if !defined(__FreeBSD__) || defined(__DragonFly__) struct sg_id { long l1; /* target | lun << 8 | channel << 16 | low_ino << 24 */ long l2; /* Unique id */ @@@@ -288,12 +377,18 @@@@ typedef struct scsiid{ /* Even *this* isn't as simple as it bloody well should be :-P */ /* SG has an easy interface, but SCSI overall does not */ static int get_scsi_id(int fd, scsiid *id){ +#ifdef __linux__ struct sg_id argid; +#endif +#ifdef __NetBSD__ + struct scsi_addr argid; +#endif int busarg; /* get the host/id/lun */ if(fd==-1)return(-1); +#ifdef __linux__ if(ioctl(fd,SCSI_IOCTL_GET_IDLUN,&argid))return(-1); id->bus=argid.l2; /* for now */ id->id=argid.l1&0xff; @@@@ -301,6 +396,13 @@@@ static int get_scsi_id(int fd, scsiid *i if(ioctl(fd,SCSI_IOCTL_GET_BUS_NUMBER,&busarg)==0) id->bus=busarg; +#endif +#ifdef __NetBSD__ + if(ioctl(fd,SCIOCIDENTIFY,&argid))return(-1); + id->bus=argid.addr.scsi.scbus; + id->id=argid.addr.scsi.target; + id->lun=argid.addr.scsi.lun; +#endif return(0); } @@@@ -400,6 +502,7 @@@@ matchfail: if(dev!=-1)close(dev); return(NULL); } +#endif void strscat(char *a,char *b,int n){ int i; @@@@ -411,6 +514,7 @@@@ void strscat(char *a,char *b,int n){ strcat(a," "); } +#ifdef __linux__ /* At this point, we're going to punt compatability before SG2, and allow only SG2 and SG3 */ static int verify_SG_version(cdrom_drive *d,int messagedest, @@@@ -488,7 +592,9 @@@@ int check_sgio(const char *device, int m close(fd); return 0; } +#endif +#if defined(__linux__) || defined(__NetBSD__) || defined(__DragonFly__) /* scanning is always done by specifying a device name in specialized_device; generic_device is only filled when the generic device force option is used, and in that case, use of SG (not SGIO) should indeed be @@@@ -527,11 +633,13 @@@@ cdrom_drive *cdda_identify_scsi(const ch return(NULL); } +#ifdef __linux__ if((int)(g_st.st_rdev>>8)!=SCSI_GENERIC_MAJOR){ idmessage(messagedest,messages,"\t\t%s is not a generic SCSI device", generic_device); return(NULL); } +#endif } if(specialized_device){ @@@@ -553,6 +661,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch if(specialized_device==NULL)goto cdda_identify_scsi_fail; } +#ifdef __linux__ /* sgio is always preferred if it's there, unless user has forced the generic scsi device name */ if(use_sgio){ if(check_sgio(specialized_device,messagedest,messages)){ @@@@ -562,18 +671,24 @@@@ cdrom_drive *cdda_identify_scsi(const ch use_sgio=0; } } +#else + use_sgio=0; +#endif if(!use_sgio){ /* was a generic device passed in as the specialized device name? */ if(specialized_device){ +#ifdef __linux__ if((int)(i_st.st_rdev>>8)==SCSI_GENERIC_MAJOR){ char *temp=(char *)generic_device; generic_device=specialized_device; specialized_device=temp; } +#endif if(!generic_device || !specialized_device){ +#ifdef __linux__ if(generic_device){ specialized_device= scsi_match(generic_device,scsi_cdrom_prefixes, @@@@ -589,6 +704,12 @@@@ cdrom_drive *cdda_identify_scsi(const ch if(!generic_device) goto cdda_identify_scsi_fail; } +#else + if(!generic_device) + generic_device = strdup(specialized_device); + else + specialized_device = strdup(generic_device); +#endif } } @@@@ -639,6 +760,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch type=(int)(i_st.st_rdev>>8); if(!use_sgio){ +#ifdef __linux__ if(type==SCSI_CDROM_MAJOR){ if (!S_ISBLK(i_st.st_mode)) { idmessage(messagedest,messages,"\t\tSCSI CDROM device %s not a " @@@@ -650,10 +772,12 @@@@ cdrom_drive *cdda_identify_scsi(const ch "major number",specialized_device); goto cdda_identify_scsi_fail; } +#endif } } if(g_fd != -1){ +#ifdef __linux__ if((int)(g_st.st_rdev>>8)==SCSI_GENERIC_MAJOR){ if (!S_ISCHR(g_st.st_mode)) { idmessage(messagedest,messages,"\t\tGeneric SCSI device %s not a " @@@@ -665,6 +789,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch "major number",generic_device); goto cdda_identify_scsi_fail; } +#endif } d=calloc(1,sizeof(cdrom_drive)); @@@@ -685,6 +810,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d->private->sg_buffer=(unsigned char *)(d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); g_fd=d->cdda_fd=dup(d->ioctl_fd); }else{ +#ifdef __linux__ version=verify_SG_version(d,messagedest,messages); switch(version){ case -1:case 0:case 1: @@@@ -694,6 +820,9 @@@@ cdrom_drive *cdda_identify_scsi(const ch d->interface=GENERIC_SCSI; break; } +#else + d->interface=GENERIC_SCSI; +#endif /* malloc our big buffer for scsi commands */ d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE); @@@@ -740,6 +869,15 @@@@ cdrom_drive *cdda_identify_scsi(const ch } /* It would seem some TOSHIBA CDROMs gets things wrong */ +#ifndef TYPE_DISK +#define TYPE_DISK 0 /* direct */ +#endif +#ifndef TYPE_WORM +#define TYPE_WORM 4 /* write once, read many */ +#endif +#ifndef TYPE_ROM +#define TYPE_ROM 5 /* CD-ROM */ +#endif if (p && !strncmp (p + 8, "TOSHIBA", 7) && !strncmp (p + 16, "CD-ROM", 6) && @@@@ -780,6 +918,88 @@@@ cdda_identify_scsi_fail: } return(NULL); } +#elif defined(__FreeBSD__) +cdrom_drive *cdda_identify_scsi(const char *device, + const char *dummy, + int messagedest, + char **messages) +{ + char *devname; + cdrom_drive *d = NULL; + + if (device == NULL) { + idperror(messagedest, messages, "\t\tNo device specified", NULL); + return NULL; + } + + if ((devname = test_resolve_symlink(device, messagedest, messages)) == NULL) + return NULL; + + if ((d = calloc(1, sizeof(*d))) == NULL) { + idperror(messagedest, messages, "\t\tCould not allocate memory", NULL); + free(devname); + return NULL; + } + + if ((d->dev = cam_open_device(devname, O_RDWR)) == NULL) { + idperror(messagedest, messages, "\t\tCould not open SCSI device: %s", cam_errbuf); + goto cdda_identify_scsi_fail; + } + + if ((d->ccb = cam_getccb(d->dev)) == NULL) { + idperror(messagedest, messages, "\t\tCould not allocate ccb", NULL); + goto cdda_identify_scsi_fail; + } + + if (strncmp(d->dev->inq_data.vendor, "TOSHIBA", 7) == 0 && + strncmp(d->dev->inq_data.product, "CD_ROM", 6) == 0 && + SID_TYPE(&d->dev->inq_data) == T_DIRECT) { + d->dev->inq_data.device = T_CDROM; + d->dev->inq_data.dev_qual2 |= 0x80; + } + + if (SID_TYPE(&d->dev->inq_data) != T_CDROM && + SID_TYPE(&d->dev->inq_data) != T_WORM) { + idmessage(messagedest, messages, + "\t\tDevice is neither a CDROM nor a WORM device\n", NULL); + goto cdda_identify_scsi_fail; + } + + d->cdda_device_name = copystring(devname); + d->ioctl_fd = -1; + d->bigendianp = -1; + d->nsectors = -1; + d->lun = d->dev->target_lun; + d->interface = GENERIC_SCSI; + + if ((d->private->sg_buffer = malloc(MAX_BIG_BUFF_SIZE)) == NULL) { + idperror(messagedest, messages, "Could not allocate buffer memory", NULL); + goto cdda_identify_scsi_fail; + } + + if ((d->drive_model = calloc(36,1)) == NULL) { + } + + strscat(d->drive_model, d->dev->inq_data.vendor, SID_VENDOR_SIZE); + strscat(d->drive_model, d->dev->inq_data.product, SID_PRODUCT_SIZE); + strscat(d->drive_model, d->dev->inq_data.revision, SID_REVISION_SIZE); + + idmessage(messagedest, messages, "\nCDROM model sensed: %s", d->drive_model); + + return d; + +cdda_identify_scsi_fail: + free(devname); + if (d) { + if (d->ccb) + cam_freeccb(d->ccb); + if (d->dev) + cam_close_device(d->dev); + free(d); + } + return NULL; +} +#endif #ifdef CDDA_TEST @@@@ -829,3 +1049,4 @@@@ cdrom_drive *cdda_identify_test(const ch } #endif +#endif /* __APPLE__ && __MACH__ */ @ 1.12 log @Make it just build on DragonFly. Doesn't work yet though. @ text @d1 1 a1 1 $NetBSD: patch-cf,v 1.11 2009/08/09 16:00:53 drochner Exp $ d3 2 a4 2 --- interface/scan_devices.c.orig 2008-08-26 12:55:22 +0300 +++ interface/scan_devices.c 2009-08-26 09:50:54 +0300 d23 1 a23 1 @@@@ -52,11 +56,30 @@@@ static char *cdrom_devices[]={ d39 3 d47 1 a47 1 +#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || (defined(__APPLE__) && defined(__MACH__)) d57 1 a57 1 @@@@ -78,10 +101,12 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d70 1 a70 1 @@@@ -93,11 +118,13 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d86 1 a86 1 @@@@ -119,8 +146,14 @@@@ cdrom_drive *cdda_identify(const char *d d101 1 a101 1 @@@@ -148,6 +181,7 @@@@ char *test_resolve_symlink(const char *f d109 1 a109 1 @@@@ -272,8 +306,60 @@@@ cdrom_drive *cdda_identify_cooked(const d170 1 a170 1 @@@@ -288,12 +374,18 @@@@ typedef struct scsiid{ d189 1 a189 1 @@@@ -301,6 +393,13 @@@@ static int get_scsi_id(int fd, scsiid *i d203 1 a203 1 @@@@ -400,6 +499,7 @@@@ matchfail: d211 1 a211 1 @@@@ -411,6 +511,7 @@@@ void strscat(char *a,char *b,int n){ d219 1 a219 1 @@@@ -488,7 +589,9 @@@@ int check_sgio(const char *device, int m d229 1 a229 1 @@@@ -527,11 +630,13 @@@@ cdrom_drive *cdda_identify_scsi(const ch d243 1 a243 1 @@@@ -553,6 +658,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d251 1 a251 1 @@@@ -562,18 +668,24 @@@@ cdrom_drive *cdda_identify_scsi(const ch d276 1 a276 1 @@@@ -589,6 +701,12 @@@@ cdrom_drive *cdda_identify_scsi(const ch d289 1 a289 1 @@@@ -639,6 +757,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d297 1 a297 1 @@@@ -650,10 +769,12 @@@@ cdrom_drive *cdda_identify_scsi(const ch d310 1 a310 1 @@@@ -665,6 +786,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d318 1 a318 1 @@@@ -685,6 +807,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d326 1 a326 1 @@@@ -694,6 +817,9 @@@@ cdrom_drive *cdda_identify_scsi(const ch d336 1 a336 1 @@@@ -740,6 +866,15 @@@@ cdrom_drive *cdda_identify_scsi(const ch d352 1 a352 1 @@@@ -780,6 +915,88 @@@@ cdda_identify_scsi_fail: d441 1 a441 1 @@@@ -829,3 +1046,4 @@@@ cdrom_drive *cdda_identify_test(const ch @ 1.11 log @update to 3.0.10.2 (which is III-10.2 upstream) This is a major update (9.8 was released 2001), most significant changes are support for new (Linux) kernel interfaces and improved drive cache model. pkgsrc note: I've tried to retain Darwin/FreeBSD/DragonFly support, except in scsi_interface.c where the structure changed significantly. Someone who can test please add it back. @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 2 --- interface/scan_devices.c.orig 2008-08-26 11:55:22.000000000 +0200 +++ interface/scan_devices.c d87 1 a87 1 +#if defined(__linux__) || defined(__NetBSD__) d90 1 a90 1 +#elif defined(__FreeBSD__) || defined(__DragonFly__) d222 1 a222 1 +#if defined(__linux__) || defined(__NetBSD__) d353 1 a353 1 +#elif defined(__FreeBSD__) || defined(__DragonFly__) d407 1 a407 1 + if ((d->sg_buffer = malloc(MAX_BIG_BUFF_SIZE)) == NULL) { @ 1.10 log @Simplify previous. We don't need to call getrawpartition() to find out whether to use /dev/rcd0c or /dev/rcd0d; we can just try both. This avoids needing libutil in libcdda_interface.so. Fixes broken build of mplayer (and others?) without needing a recursive revbump as adding libutil would have. PKGREVISION++ (now 8). @ text @d1 1 a1 1 $NetBSD: patch-cf,v 1.9 2009/05/17 21:29:34 dholland Exp $ d3 2 a4 2 --- interface/scan_devices.c.orig 2001-03-26 00:44:01.000000000 -0500 +++ interface/scan_devices.c 2009-05-18 20:11:24.000000000 -0400 d7 2 a8 2 * CopyPolicy: GNU Public License 2 applies * Copyright (C) 1998 Monty xiphmont@@mit.edu d14 1 a14 1 @@@@ -19,6 +21,8 @@@@ d23 1 a23 1 @@@@ -49,11 +53,30 @@@@ static char *cdrom_devices[]={ d54 1 a54 1 @@@@ -75,10 +98,12 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d67 2 a68 2 @@@@ -97,8 +122,11 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa temp->pw_name); d70 5 a75 1 +#endif d82 2 a83 4 cdrom_drive *d=NULL; @@@@ -117,8 +145,14 @@@@ cdrom_drive *cdda_identify(const char *d } #endif d85 2 d88 2 a89 2 d=cdda_identify_cooked(device,messagedest,messages); if(!d)d=cdda_identify_scsi(device,NULL,messagedest,messages); d95 1 a95 1 d98 1 a98 1 @@@@ -146,6 +180,7 @@@@ char *test_resolve_symlink(const char *f d105 3 a107 2 int fd=-1; @@@@ -273,8 +308,60 @@@@ cdrom_drive *cdda_identify_cooked(const a108 1 d167 1 a167 1 @@@@ -289,12 +376,18 @@@@ typedef struct scsiid{ d186 1 a186 1 @@@@ -302,6 +395,13 @@@@ static int get_scsi_id(int fd, scsiid *i d200 1 a200 1 @@@@ -390,6 +490,7 @@@@ matchfail: d208 1 a208 1 @@@@ -401,6 +502,7 @@@@ void strscat(char *a,char *b,int n){ d216 3 a218 3 @@@@ -430,7 +532,9 @@@@ static int verify_SG_version(cdrom_drive idmessage(messagedest,messages,buffer,""); return(major); d223 4 a226 5 cdrom_drive *cdda_identify_scsi(const char *generic_device, const char *ioctl_device, int messagedest, char **messages){ @@@@ -460,6 +564,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch generic_device); d229 1 d232 3 a234 5 if((int)(g_st.st_rdev>>8)!=SCSI_CDROM_MAJOR){ idmessage(messagedest,messages,"\t\t%s is not a SCSI device", @@@@ -471,6 +576,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch ioctl_device=temp; } d238 12 a249 5 if(ioctl_device){ if(stat(ioctl_device,&i_st)){ @@@@ -478,6 +584,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch ioctl_device); return(NULL); d251 9 d261 4 a264 5 if((int)(i_st.st_rdev>>8)!=SCSI_CDROM_MAJOR){ if((int)(i_st.st_rdev>>8)!=SCSI_GENERIC_MAJOR){ idmessage(messagedest,messages,"\t\t%s is not a SCSI device", @@@@ -489,6 +596,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch ioctl_device=temp; a265 1 } d267 2 a268 7 } /* we need to resolve any symlinks for the lookup code to work */ @@@@ -505,6 +613,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch } if(!generic_device || !ioctl_device){ d270 7 a276 7 if(generic_device){ ioctl_device= scsi_match(generic_device,scsi_cdrom_prefixes, @@@@ -520,6 +629,12 @@@@ cdrom_drive *cdda_identify_scsi(const ch if(!generic_device) goto cdda_identify_scsi_fail; } d279 1 a279 1 + generic_device = strdup(ioctl_device); d281 17 a297 1 + ioctl_device = strdup(generic_device); d299 1 d302 1 a302 5 idmessage(messagedest,messages,"\t\tgeneric device: %s",generic_device); @@@@ -556,6 +671,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch type=(int)(i_st.st_rdev>>8); d304 5 a308 5 if(type==SCSI_CDROM_MAJOR){ if (!S_ISBLK(i_st.st_mode)) { idmessage(messagedest,messages,"\t\tSCSI CDROM device %s not a " @@@@ -567,8 +683,10 @@@@ cdrom_drive *cdda_identify_scsi(const ch "major number",ioctl_device); a313 11 +#ifdef __linux__ if((int)(g_st.st_rdev>>8)==SCSI_GENERIC_MAJOR){ if (!S_ISCHR(g_st.st_mode)) { idmessage(messagedest,messages,"\t\tGeneric SCSI device %s not a " @@@@ -580,6 +698,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch "major number",generic_device); goto cdda_identify_scsi_fail; } +#endif d315 12 a326 12 @@@@ -590,6 +709,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d->bigendianp=-1; /* We don't know yet... */ d->nsectors=-1; +#ifdef __linux__ version=verify_SG_version(d,messagedest,messages); switch(version){ case -1:case 0:case 1: @@@@ -599,6 +719,9 @@@@ cdrom_drive *cdda_identify_scsi(const ch d->interface=GENERIC_SCSI; break; } d331 5 a335 4 /* malloc our big buffer for scsi commands */ d->sg=malloc(MAX_BIG_BUFF_SIZE); @@@@ -617,7 +740,16 @@@@ cdrom_drive *cdda_identify_scsi(const ch a336 2 - if (!strncmp (p + 8, "TOSHIBA", 7) && d346 2 a347 1 + if (p && !strncmp (p + 8, "TOSHIBA", 7) && d349 2 a350 4 p[0] == TYPE_DISK) { p[0] = TYPE_ROM; @@@@ -653,6 +785,88 @@@@ cdda_identify_scsi_fail: if(g_fd!=-1)close(g_fd); d438 1 a438 1 @@@@ -702,3 +916,4 @@@@ cdrom_drive *cdda_identify_test(const ch @ 1.9 log @Make the cdrom device probe work properly under NetBSD, instead of messily hardwiring it to /dev/rcd0[cd]; the latter apparently breaks in some circumstances. Uses as a starting point a patch from Kimura Fuyuki in PR 34008. PKGREVISION++ (to 7). @ text @d1 1 a1 1 $NetBSD: patch-cf,v 1.8 2007/10/09 21:26:11 heinz Exp $ d4 1 a4 1 +++ interface/scan_devices.c 2009-05-17 16:47:49.000000000 -0400 d14 1 a14 11 @@@@ -14,11 +16,18 @@@@ #include #include #include + +#ifdef HAVE_GETRAWPARTITION +#include +#endif + #include "cdda_interface.h" #include "low_interface.h" d23 1 a23 1 @@@@ -49,15 +58,43 @@@@ static char *cdrom_devices[]={ d36 3 a38 1 + "/dev/cd?c", NULL}; d54 1 a54 22 cdrom_drive *d; +#ifdef __NetBSD__ + int rawpartition; +#endif + +#ifdef __NetBSD__ +#ifdef HAVE_GETRAWPARTITION + rawpartition = getrawpartition(); +#else + rawpartition = 'c' - 'a'; +#endif +#endif while(cdrom_devices[i]!=NULL){ @@@@ -72,13 +109,18 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa /* number, then letter */ buffer[pos-(cdrom_devices[i])]=j+48; +#ifdef __NetBSD__ + buffer[(pos+1)-(cdrom_devices[i])]='a'+rawpartition; +#endif d67 1 a67 1 @@@@ -97,8 +139,11 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d79 1 a79 1 @@@@ -117,8 +162,14 @@@@ cdrom_drive *cdda_identify(const char *d d94 1 a94 1 @@@@ -146,6 +197,7 @@@@ char *test_resolve_symlink(const char *f d102 1 a102 1 @@@@ -273,8 +325,60 @@@@ cdrom_drive *cdda_identify_cooked(const d163 1 a163 1 @@@@ -289,12 +393,18 @@@@ typedef struct scsiid{ d182 1 a182 1 @@@@ -302,6 +412,13 @@@@ static int get_scsi_id(int fd, scsiid *i d196 1 a196 1 @@@@ -390,6 +507,7 @@@@ matchfail: d204 1 a204 1 @@@@ -401,6 +519,7 @@@@ void strscat(char *a,char *b,int n){ d212 1 a212 1 @@@@ -430,7 +549,9 @@@@ static int verify_SG_version(cdrom_drive d222 1 a222 1 @@@@ -460,6 +581,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d230 1 a230 1 @@@@ -471,6 +593,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d238 1 a238 1 @@@@ -478,6 +601,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d246 1 a246 1 @@@@ -489,6 +613,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d254 1 a254 1 @@@@ -505,6 +630,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d262 1 a262 1 @@@@ -520,6 +646,12 @@@@ cdrom_drive *cdda_identify_scsi(const ch d275 1 a275 1 @@@@ -556,6 +688,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d283 1 a283 1 @@@@ -567,8 +700,10 @@@@ cdrom_drive *cdda_identify_scsi(const ch d294 1 a294 1 @@@@ -580,6 +715,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d302 1 a302 1 @@@@ -590,6 +726,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d310 1 a310 1 @@@@ -599,6 +736,9 @@@@ cdrom_drive *cdda_identify_scsi(const ch d320 1 a320 1 @@@@ -617,7 +757,16 @@@@ cdrom_drive *cdda_identify_scsi(const ch d338 1 a338 1 @@@@ -653,6 +802,88 @@@@ cdda_identify_scsi_fail: d427 1 a427 1 @@@@ -702,3 +933,4 @@@@ cdrom_drive *cdda_identify_test(const ch @ 1.8 log @Added missing copyright notices for Simon 'corecode' Schubert. This should fix PR pkg/34017. @ text @d1 1 a1 1 $NetBSD: patch-cf,v 1.7 2006/09/03 17:13:30 ben Exp $ d3 2 a4 2 --- interface/scan_devices.c.orig 2001-03-26 07:44:01.000000000 +0200 +++ interface/scan_devices.c d14 11 a24 1 @@@@ -19,6 +21,8 @@@@ d33 1 a33 1 @@@@ -49,11 +53,24 @@@@ static char *cdrom_devices[]={ d43 4 d52 1 a52 1 +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || (defined(__APPLE__) && defined(__MACH__)) d62 22 a83 1 @@@@ -75,10 +92,12 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d96 1 a96 1 @@@@ -97,8 +116,20 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa a103 9 +#ifdef __NetBSD__ + +cdrom_drive *cdda_find_a_cdrom(int messagedest,char **messages) +{ + errx(1, "cdda_find_a_cdrom: not implemented"); + /* NOTREACHED */ +} +#endif /* __NetBSD__ */ + d108 1 a108 1 @@@@ -117,8 +148,14 @@@@ cdrom_drive *cdda_identify(const char *d d123 1 a123 1 @@@@ -146,6 +183,7 @@@@ char *test_resolve_symlink(const char *f d131 1 a131 1 @@@@ -273,8 +311,60 @@@@ cdrom_drive *cdda_identify_cooked(const d192 1 a192 1 @@@@ -289,12 +379,18 @@@@ typedef struct scsiid{ d211 1 a211 1 @@@@ -302,6 +398,13 @@@@ static int get_scsi_id(int fd, scsiid *i d225 1 a225 1 @@@@ -390,6 +493,7 @@@@ matchfail: d233 1 a233 1 @@@@ -401,6 +505,7 @@@@ void strscat(char *a,char *b,int n){ d241 1 a241 1 @@@@ -430,7 +535,9 @@@@ static int verify_SG_version(cdrom_drive d251 1 a251 1 @@@@ -460,6 +567,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d259 1 a259 1 @@@@ -471,6 +579,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d267 1 a267 1 @@@@ -478,6 +587,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d275 1 a275 1 @@@@ -489,6 +599,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d283 1 a283 1 @@@@ -505,6 +616,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d291 1 a291 1 @@@@ -520,6 +632,12 @@@@ cdrom_drive *cdda_identify_scsi(const ch d304 1 a304 1 @@@@ -556,6 +674,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d312 1 a312 1 @@@@ -567,8 +686,10 @@@@ cdrom_drive *cdda_identify_scsi(const ch d323 1 a323 1 @@@@ -580,6 +701,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d331 1 a331 1 @@@@ -590,6 +712,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d339 1 a339 1 @@@@ -599,6 +722,9 @@@@ cdrom_drive *cdda_identify_scsi(const ch d349 1 a349 1 @@@@ -617,7 +743,16 @@@@ cdrom_drive *cdda_identify_scsi(const ch d367 1 a367 1 @@@@ -653,6 +788,88 @@@@ cdda_identify_scsi_fail: d456 1 a456 1 @@@@ -702,3 +919,4 @@@@ cdrom_drive *cdda_identify_test(const ch @ 1.7 log @Fix build on Mac OS X and bump pkgrevision. This is based on the work found at: http://strangehours.livejournal.com/9698.html Tested on i386 Mac OS X 10.4.7 and i386 NetBSD 3.0. TODO: manual device selection in Mac OS X. @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- interface/scan_devices.c.orig 2001-03-25 21:44:01.000000000 -0800 d5 10 a14 1 @@@@ -19,6 +19,8 @@@@ d23 1 a23 1 @@@@ -49,11 +51,24 @@@@ static char *cdrom_devices[]={ d48 1 a48 1 @@@@ -75,10 +90,12 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d61 1 a61 1 @@@@ -97,8 +114,20 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d82 1 a82 1 @@@@ -117,8 +146,14 @@@@ cdrom_drive *cdda_identify(const char *d d97 1 a97 1 @@@@ -146,6 +181,7 @@@@ char *test_resolve_symlink(const char *f d105 1 a105 1 @@@@ -273,8 +309,60 @@@@ cdrom_drive *cdda_identify_cooked(const d166 1 a166 1 @@@@ -289,12 +377,18 @@@@ typedef struct scsiid{ d185 1 a185 1 @@@@ -302,6 +396,13 @@@@ static int get_scsi_id(int fd, scsiid *i d199 1 a199 1 @@@@ -390,6 +491,7 @@@@ matchfail: d207 1 a207 1 @@@@ -401,6 +503,7 @@@@ void strscat(char *a,char *b,int n){ d215 1 a215 1 @@@@ -430,7 +533,9 @@@@ static int verify_SG_version(cdrom_drive d225 1 a225 1 @@@@ -460,6 +565,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d233 1 a233 1 @@@@ -471,6 +577,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d241 1 a241 1 @@@@ -478,6 +585,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d249 1 a249 1 @@@@ -489,6 +597,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d257 1 a257 1 @@@@ -505,6 +614,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d265 1 a265 1 @@@@ -520,6 +630,12 @@@@ cdrom_drive *cdda_identify_scsi(const ch d278 1 a278 1 @@@@ -556,6 +672,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d286 1 a286 1 @@@@ -567,8 +684,10 @@@@ cdrom_drive *cdda_identify_scsi(const ch d297 1 a297 1 @@@@ -580,6 +699,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d305 1 a305 1 @@@@ -590,6 +710,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d313 1 a313 1 @@@@ -599,6 +720,9 @@@@ cdrom_drive *cdda_identify_scsi(const ch d323 1 a323 1 @@@@ -617,7 +741,16 @@@@ cdrom_drive *cdda_identify_scsi(const ch d341 1 a341 1 @@@@ -653,6 +786,88 @@@@ cdda_identify_scsi_fail: d430 1 a430 1 @@@@ -702,3 +917,4 @@@@ cdrom_drive *cdda_identify_test(const ch @ 1.6 log @Sync DragonFly/FreeBSD support with FreeBSD ports by adding cdda_device_name to struct cdrom_drive. This makes a number of hacks in various places superfluous and should fix the KDE multimedia issues. Bump revision. Recursive bump will follow, since the major version changed. @ text @d1 1 a1 1 $NetBSD: patch-cf,v 1.5 2004/10/10 10:48:39 mycroft Exp $ d3 1 a3 1 --- interface/scan_devices.c.orig 2001-03-26 15:44:01.000000000 +1000 d14 1 a14 1 @@@@ -49,10 +51,18 @@@@ static char *cdrom_devices[]={ d29 1 a29 1 +#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) d31 5 d38 2 a39 1 @@@@ -75,10 +85,12 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d52 2 a53 1 @@@@ -98,6 +110,16 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d56 1 d59 1 a59 1 + d68 2 a69 1 d72 2 a73 1 @@@@ -117,8 +139,14 @@@@ cdrom_drive *cdda_identify(const char *d d88 1 a88 1 @@@@ -146,6 +174,7 @@@@ char *test_resolve_symlink(const char *f d96 1 a96 1 @@@@ -273,8 +302,60 @@@@ cdrom_drive *cdda_identify_cooked(const d157 1 a157 1 @@@@ -289,12 +370,18 @@@@ typedef struct scsiid{ d176 1 a176 1 @@@@ -302,6 +389,13 @@@@ static int get_scsi_id(int fd, scsiid *i d190 1 a190 1 @@@@ -390,6 +484,7 @@@@ matchfail: d198 1 a198 1 @@@@ -401,6 +496,7 @@@@ void strscat(char *a,char *b,int n){ d206 1 a206 1 @@@@ -430,7 +526,9 @@@@ static int verify_SG_version(cdrom_drive d216 1 a216 1 @@@@ -460,6 +558,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d224 1 a224 1 @@@@ -471,6 +570,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d232 1 a232 1 @@@@ -478,6 +578,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d240 1 a240 1 @@@@ -489,6 +590,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d248 1 a248 1 @@@@ -505,6 +607,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d256 1 a256 1 @@@@ -520,6 +623,12 @@@@ cdrom_drive *cdda_identify_scsi(const ch d269 1 a269 1 @@@@ -556,6 +665,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d277 1 a277 1 @@@@ -567,8 +677,10 @@@@ cdrom_drive *cdda_identify_scsi(const ch d288 1 a288 1 @@@@ -580,6 +692,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d296 1 a296 1 @@@@ -590,6 +703,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d304 1 a304 1 @@@@ -599,6 +713,9 @@@@ cdrom_drive *cdda_identify_scsi(const ch d314 1 a314 1 @@@@ -617,7 +734,16 @@@@ cdrom_drive *cdda_identify_scsi(const ch d332 1 a332 1 @@@@ -653,6 +779,88 @@@@ cdda_identify_scsi_fail: d421 5 @ 1.5 log @Fix a problem with our hacked version of cdda_identify_scsi() that was causing kaudiocreator to fail with a mysterious "Unknown error". @ text @d1 1 a1 1 $NetBSD: patch-cf,v 1.4 2003/10/20 12:07:23 grant Exp $ d14 1 a14 1 @@@@ -49,10 +51,18 @@@@ d18 1 a18 1 +#elif defined(__FreeBSD__) d29 1 a29 1 +#if defined(__linux__) || defined(__FreeBSD__) d33 1 a33 1 @@@@ -75,10 +85,12 @@@@ d46 1 a46 1 @@@@ -98,6 +110,16 @@@@ d63 1 a63 1 @@@@ -117,8 +139,14 @@@@ d70 1 a70 1 +#elif defined(__FreeBSD__) d78 1 a78 1 @@@@ -146,6 +174,7 @@@@ d86 1 a86 1 @@@@ -273,8 +302,59 @@@@ d93 1 a93 1 +#elif defined(__FreeBSD__) d123 1 d143 1 a143 1 +#ifndef __FreeBSD__ d147 1 a147 1 @@@@ -289,12 +369,18 @@@@ d166 1 a166 1 @@@@ -302,6 +388,13 @@@@ d180 1 a180 1 @@@@ -390,6 +483,7 @@@@ d188 1 a188 1 @@@@ -401,6 +495,7 @@@@ d196 1 a196 1 @@@@ -430,7 +525,9 @@@@ d206 1 a206 1 @@@@ -460,6 +557,7 @@@@ d214 1 a214 1 @@@@ -471,6 +569,7 @@@@ d222 1 a222 1 @@@@ -478,6 +577,7 @@@@ d230 1 a230 1 @@@@ -489,6 +589,7 @@@@ d238 1 a238 1 @@@@ -505,6 +606,7 @@@@ d246 1 a246 1 @@@@ -520,6 +622,12 @@@@ d259 1 a259 1 @@@@ -556,6 +664,7 @@@@ d267 1 a267 1 @@@@ -567,8 +676,10 @@@@ d278 1 a278 1 @@@@ -580,6 +691,7 @@@@ d286 1 a286 1 @@@@ -590,6 +702,7 @@@@ d294 1 a294 1 @@@@ -599,6 +712,9 @@@@ d304 1 a304 1 @@@@ -617,7 +733,16 @@@@ d322 1 a322 1 @@@@ -653,6 +778,87 @@@@ d326 1 a326 1 +#elif defined(__FreeBSD__) d373 1 @ 1.4 log @merge some patches from FreeBSD ports. allows this to build on FreeBSD using the ATAPI/CAM subsystem. @ text @d1 1 a1 1 $NetBSD$ d14 1 a14 1 @@@@ -49,10 +51,18 @@@@ static char *cdrom_devices[]={ d33 1 a33 1 @@@@ -75,10 +85,12 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d46 1 a46 1 @@@@ -98,6 +110,16 @@@@ cdrom_drive *cdda_find_a_cdrom(int messa d63 1 a63 1 @@@@ -117,8 +139,14 @@@@ cdrom_drive *cdda_identify(const char *d d78 1 a78 1 @@@@ -146,6 +174,7 @@@@ char *test_resolve_symlink(const char *f d86 1 a86 1 @@@@ -273,8 +302,59 @@@@ cdrom_drive *cdda_identify_cooked(const d146 1 a146 1 @@@@ -289,12 +369,18 @@@@ typedef struct scsiid{ d165 1 a165 1 @@@@ -302,6 +388,13 @@@@ static int get_scsi_id(int fd, scsiid *i d179 1 a179 1 @@@@ -390,6 +483,7 @@@@ matchfail: d187 1 a187 1 @@@@ -401,6 +495,7 @@@@ void strscat(char *a,char *b,int n){ d195 1 a195 1 @@@@ -430,7 +525,9 @@@@ static int verify_SG_version(cdrom_drive d205 1 a205 1 @@@@ -460,6 +557,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d213 1 a213 1 @@@@ -471,6 +569,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d221 1 a221 1 @@@@ -478,6 +577,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d229 1 a229 1 @@@@ -489,6 +589,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d237 1 a237 1 @@@@ -505,6 +606,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d245 1 a245 1 @@@@ -520,6 +622,9 @@@@ cdrom_drive *cdda_identify_scsi(const ch d250 4 a253 1 + goto cdda_identify_scsi_fail; d258 1 a258 1 @@@@ -556,6 +661,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d266 1 a266 1 @@@@ -567,8 +673,10 @@@@ cdrom_drive *cdda_identify_scsi(const ch d277 1 a277 1 @@@@ -580,6 +688,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d285 1 a285 1 @@@@ -590,6 +699,7 @@@@ cdrom_drive *cdda_identify_scsi(const ch d293 1 a293 1 @@@@ -599,6 +709,9 @@@@ cdrom_drive *cdda_identify_scsi(const ch d303 1 a303 1 @@@@ -617,7 +730,16 @@@@ cdrom_drive *cdda_identify_scsi(const ch d321 1 a321 1 @@@@ -653,6 +775,87 @@@@ cdda_identify_scsi_fail: @ 1.3 log @Upgrade to cdparanoia III 9.8. Install headers in separate directory. Related changes: - Patch for Kenwood TruX drives (they worked before, but were very slow) - Slightly different default read command to alleviate end-of-track read problems on a number of drives - New -z command syntax; option argument to allow a skip after a user-configurable number of tries - Added more possible read commands to autoprobe - Removed autoprobe limitation, so starting a new rip will not potentially stall in autoprobe until previous rip finishes - Patch to allow sample-granulairy offset - allow NULL callbacks to be passed to library interface @ text @d1 1 a1 1 $NetBSD: patch-cf,v 1.2 2000/06/22 00:41:18 wiz Exp $ d3 2 a4 2 --- interface/scan_devices.c.orig Mon Mar 26 14:44:01 2001 +++ interface/scan_devices.c Mon Mar 4 00:23:01 2002 d14 1 a14 1 @@@@ -49,10 +51,12 @@@@ d18 6 d29 1 a29 1 +#ifdef __linux__ d33 14 a46 1 @@@@ -98,6 +102,16 @@@@ d63 16 a78 1 @@@@ -146,6 +160,7 @@@@ d86 1 a86 1 @@@@ -273,6 +288,12 @@@@ d90 1 a90 3 +#endif + +#ifdef __NetBSD__ d93 46 d142 1 d144 3 a146 1 @@@@ -289,12 +310,18 @@@@ d165 1 a165 1 @@@@ -302,6 +329,13 @@@@ d179 9 a187 1 @@@@ -401,6 +435,7 @@@@ d195 1 a195 1 @@@@ -430,6 +465,7 @@@@ d201 1 d204 2 a205 1 @@@@ -460,6 +496,7 @@@@ d213 1 a213 1 @@@@ -471,6 +508,7 @@@@ d221 1 a221 1 @@@@ -478,6 +516,7 @@@@ d229 1 a229 1 @@@@ -489,6 +528,7 @@@@ d237 1 a237 1 @@@@ -505,6 +545,7 @@@@ d245 1 a245 1 @@@@ -520,6 +561,9 @@@@ d255 1 a255 1 @@@@ -556,6 +600,7 @@@@ d263 1 a263 1 @@@@ -567,8 +612,10 @@@@ d274 1 a274 1 @@@@ -580,6 +627,7 @@@@ d282 1 a282 1 @@@@ -590,6 +638,7 @@@@ d290 1 a290 1 @@@@ -599,6 +648,9 @@@@ d300 1 a300 1 @@@@ -617,7 +669,16 @@@@ d318 88 @ 1.2 log @Don't dump core if device isn't recognized as valid CD-ROM drive. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- interface/scan_devices.c.orig Tue Dec 14 08:30:23 1999 +++ interface/scan_devices.c Thu Jun 22 02:36:44 2000 @@@@ -17,6 +17,8 @@@@ d13 5 a17 5 static char *scsi_cdrom_prefixes[3]={"/dev/scd","/dev/sr",NULL}; @@@@ -28,10 +30,12 @@@@ /* "/dev/aztcd", timeout is too long */ "/dev/cm206cd", "/dev/gscd","/dev/optcd",NULL}; d27 1 a27 1 @@@@ -78,6 +82,16 @@@@ d44 1 a44 1 @@@@ -143,6 +157,7 @@@@ d52 1 a52 1 @@@@ -270,6 +285,12 @@@@ a65 1 d67 1 d98 17 a114 1 @@@@ -410,6 +444,7 @@@@ d122 1 a122 1 @@@@ -421,6 +456,7 @@@@ d130 1 a130 1 @@@@ -428,6 +464,7 @@@@ d138 1 a138 1 @@@@ -439,6 +476,7 @@@@ d146 1 a146 1 @@@@ -455,6 +493,7 @@@@ d152 3 a154 3 ioctl_device=scsi_match(generic_device,scsi_cdrom_prefixes,O_RDWR, O_RDONLY|O_NONBLOCK, @@@@ -468,6 +507,9 @@@@ d164 1 a164 1 @@@@ -504,6 +546,7 @@@@ d172 1 a172 1 @@@@ -515,8 +558,10 @@@@ d183 1 a183 1 @@@@ -528,6 +573,7 @@@@ d189 1 d191 15 d207 3 a209 1 @@@@ -564,7 +610,16 @@@@ d211 1 a211 1 /* It would seem some TOSHIBA CDROM gets things wrong */ @ 1.1 log @Initial revision @ text @d3 2 a4 2 --- interface/scan_devices.c.orig Tue Dec 14 16:30:23 1999 +++ interface/scan_devices.c Sat Jan 15 20:09:29 2000 d175 1 a175 1 @@@@ -564,6 +610,15 @@@@ d179 1 d189 1 a189 1 if (!strncmp (p + 8, "TOSHIBA", 7) && d192 1 @ 1.1.1.1 log @An attempt to port cdparanoia-III-alpha9.7. CD-DA extraction tool with excessive data corrections, such as jitter, loss of data, etc. This will soon be obsoleted by cdparanoia IV, I hope.... Most SCSI/ATAPI CD-ROM drives should work fine. However, the ATAPI stuff is totally untested, and if it happened to work, it was a miracle. :-) Currently, - the feature to search for CD-ROM device is not implemented and the -g option is required, - the libraries are not installed. @ text @@