head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.36 pkgsrc-2013Q2-base:1.5 pkgsrc-2012Q4:1.5.0.34 pkgsrc-2012Q4-base:1.5 pkgsrc-2011Q4:1.5.0.32 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.5.0.30 pkgsrc-2011Q2-base:1.5 pkgsrc-2009Q4:1.5.0.28 pkgsrc-2009Q4-base:1.5 pkgsrc-2008Q4:1.5.0.26 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.24 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.22 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.20 pkgsrc-2008Q2-base:1.5 pkgsrc-2008Q1:1.5.0.18 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.16 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.14 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.12 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.5.0.10 pkgsrc-2007Q1-base:1.5 pkgsrc-2006Q4:1.5.0.8 pkgsrc-2006Q4-base:1.5 pkgsrc-2006Q3:1.5.0.6 pkgsrc-2006Q3-base:1.5 pkgsrc-2006Q2:1.5.0.4 pkgsrc-2006Q2-base:1.5 pkgsrc-2006Q1:1.5.0.2 pkgsrc-2006Q1-base:1.5 pkgsrc-2005Q4:1.4.0.8 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.6 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.4 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.2 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.3.0.12 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.10 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.8 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.6 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.3.0.4 pkgsrc-2003Q4-base:1.3 netbsd-1-6-1:1.3.0.2 netbsd-1-6-1-base:1.3 netbsd-1-6:1.2.0.8 netbsd-1-6-RELEASE-base:1.2 pkgviews:1.2.0.4 pkgviews-base:1.2 buildlink2:1.2.0.2 buildlink2-base:1.2 netbsd-1-5-PATCH003:1.2 netbsd-1-5-PATCH001:1.1; locks; strict; comment @# @; 1.5 date 2006.01.05.23.30.03; author wiz; state dead; branches; next 1.4; 1.4 date 2005.01.10.15.48.07; author hamajima; state Exp; branches; next 1.3; 1.3 date 2003.01.03.16.27.10; author lukem; state Exp; branches; next 1.2; 1.2 date 2001.08.07.11.23.57; author drochner; state Exp; branches; next 1.1; 1.1 date 2001.02.10.23.15.32; author frueauf; state Exp; branches; next ; desc @@ 1.5 log @Remove cdrecord, replaced by cdrtools. @ text @$NetBSD: patch-ai,v 1.4 2005/01/10 15:48:07 hamajima Exp $ --- libscg/scsi-bsd.c.orig Mon Oct 21 15:57:07 2002 +++ libscg/scsi-bsd.c Sat Nov 30 18:20:19 2002 @@@@ -48,7 +48,7 @@@@ * Choose your name instead of "schily" and make clear that the version * string is related to a modified source. */ -LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.41"; /* The version for this transport*/ +LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.41nb1"; /* The version for this transport*/ #define MAX_SCG 16 /* Max # of SCSI controllers */ #define MAX_TGT 16 @@@@ -108,7 +108,7 @@@@ * return "schily" for the SCG_AUTHOR request. */ case SCG_AUTHOR: - return (_scg_auth_schily); + return ("frueauf"); case SCG_SCCS_ID: return (__sccsid); } @@@@ -140,6 +140,15 @@@@ register int l; register int nopen = 0; char devname[64]; +#if defined(__NetBSD__) + struct scsi_addr mysaddr; +#if defined(__i386__) || defined(__amd64__) + char slicename[] = "d"; /* i386 is special */ +#else + char slicename[] = "c"; /* this is what the rest uses */ +#endif + char *myslicename = slicename; +#endif if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) { errno = EINVAL; @@@@ -166,6 +175,60 @@@@ if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2)) goto openbydev; + +/* + * I know of no method in NetBSD to probe the scsibus and get the mapping + * busnumber,target,lun --> devicename. + * + * Because of this implement a true bruteforce hack to find + * out what cdroms there are. + * + * Note that this method only finds cd0-cd7. Anything higher + * than this needs additional tweaks. + * + * Feel free to implement this cleanly if you have better knowledge. + * Until then this helps to get -scanbus und thus xcdroast working :-) + * + */ +#if defined(__NetBSD__) + if (busno >= 0 && tgt >= 0 && tlun >= 0) { + for (l=0; l < MAX_LUN ; l++) { + sprintf(devname, "/dev/rcd%d%s", l, myslicename); + f = open(devname, O_RDWR); + if (f >= 0) { + if (ioctl(f, SCIOCIDENTIFY, &mysaddr) < 0) { + close(f); + errno = EINVAL; + return (0); + } + if (busno == SADDR_BUS(mysaddr) && tgt == SADDR_TARGET(mysaddr) && tlun == SADDR_LUN(mysaddr)) { + scglocal(scgp)->scgfiles[busno][tgt][tlun] = f; + return(1); + } + } else goto openbydev; + } + } else for (l=0; l < MAX_LUN ; l++) { + sprintf(devname, "/dev/rcd%d%s", l, myslicename); + f = open(devname, O_RDWR); + if (f >= 0) { + if (ioctl(f, SCIOCIDENTIFY, &mysaddr) < 0) { + close(f); + errno = EINVAL; + return (0); + } + scg_scsibus(scgp) = busno = SADDR_BUS(mysaddr); + scg_target(scgp) = tgt = SADDR_TARGET(mysaddr); + if ((tlun >= 0) && (tlun != SADDR_LUN(mysaddr))) { + close(f); + errno = EINVAL; + return (0); + } + scg_lun(scgp) = tlun = SADDR_LUN(mysaddr); + if (scg_setup(scgp, f, busno, tgt, tlun)) + nopen++; + } + } +#else /* not __NetBSD__ */ if (busno >= 0 && tgt >= 0 && tlun >= 0) { js_snprintf(devname, sizeof(devname), @@@@ -202,6 +265,7 @@@@ } } } +#endif /* end of not __NetBSD__ */ /* * Could not open /dev/su-* or got dev=devname:b,l,l / dev=devname:@@,l * We do the apropriate tests and try our best. @ 1.4 log @amd64 uses d partition, same as i386. @ text @d1 1 a1 1 $NetBSD: patch-ai,v 1.3 2003/01/03 16:27:10 lukem Exp $ @ 1.3 log @Update to cdrecord 2.0. Too many changes to list them all here; see following for full details: ftp://ftp.berlios.de/pub/cdrecord/AN-2.0 cdrecord: -overburn option Driveropts "burnproof" renamed to "burnfree" CD-Text support. cdda2wav: Added -L to query freedb.freedb.org for CDDB information. mkisofs: Fix -graft-points. Various fixes to HFS support. libedc: Performance enhancements. libscg: Various improvements to SCSI & ATAPI transports. @ text @d1 1 a1 1 $NetBSD: patch-ai,v 1.1.1.1 2002/12/02 18:41:20 drochner Exp $ d29 1 a29 1 +#if defined(__i386__) @ 1.2 log @update to 1.10 There are MANY bugfixes and cleanups. The changelog file is 22k in size. @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 8 I know this patch is an ugly hack. But at least it makes "cdrecord -scanbus" more usefull, which in turn makes xcdroast work. Feel free to implement this cleanly however... Thorsten Frueauf , 2001.02.10 --- libscg/scsi-bsd.c.orig Sun Mar 18 15:10:21 2001 +++ libscg/scsi-bsd.c Mon Aug 6 14:55:09 2001 d9 2 a10 2 -LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.40"; /* The version for this transport*/ +LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.40nb1"; /* The version for this transport*/ d23 1 a23 1 @@@@ -130,6 +130,15 @@@@ d39 1 a39 1 @@@@ -156,6 +165,60 @@@@ d100 1 a100 1 @@@@ -192,6 +255,7 @@@@ @ 1.1 log @Add patch which makes 'cdrecord -scanbus' more usefull. I admitt its an ugly hack, but this allows xcdroast to work on most common configurations. Anyone with more scsi knowledge should feel free to enhance this code :-) Also bump version to 1.9nb1. @ text @d9 2 a10 2 --- libscg/scsi-bsd.c.orig Sat Jul 1 12:22:50 2000 +++ libscg/scsi-bsd.c Sat Feb 10 20:43:09 2001 d15 2 a16 2 -LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.31"; /* The version for this transport*/ +LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.31nb1"; /* The version for this transport*/ d90 2 a91 2 + scgp->scsibus = busno = SADDR_BUS(mysaddr); + scgp->target = tgt = SADDR_TARGET(mysaddr); d97 2 a98 2 + scgp->lun = tlun = SADDR_LUN(mysaddr); + if (scsi_setup(scgp, f, busno, tgt, tlun)) d105 2 a106 2 sprintf(devname, "/dev/su%d-%d-%d", busno, tgt, tlun); @@@@ -190,6 +253,7 @@@@ @