From owner-freebsd-hackers Sun Mar 31 09:22:21 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA05499 for hackers-outgoing; Sun, 31 Mar 1996 09:22:21 -0800 (PST) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id JAA05488 for ; Sun, 31 Mar 1996 09:22:12 -0800 (PST) Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id TAA13170; Sun, 31 Mar 1996 19:21:29 +0200 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id TAA24755; Sun, 31 Mar 1996 19:21:28 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.7.4/8.6.9) id SAA11915; Sun, 31 Mar 1996 18:31:58 +0200 (MET DST) From: J Wunsch Message-Id: <199603311631.SAA11915@uriah.heep.sax.de> Subject: Re: uk device To: freebsd-hackers@freebsd.org (FreeBSD hackers) Date: Sun, 31 Mar 1996 18:31:58 +0200 (MET DST) Cc: jleppek@suw2k.hisd.harris.com (James Leppek) Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <9603311514.AA28632@suw2k.hisd.harris.com> from "James Leppek" at Mar 31, 96 10:14:46 am X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL24 ME8a] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As James Leppek wrote: > > How do you get a uk device to become configured. I would > like to use this device to issue scsi commands but any use > of it just return "device unconfigured". This is on a freebsd 2.1 > release notebook using the latest pccard patches. A bug has been sneaking in there... here's the fix. I hope it would apply to the 2.1R source tree, but you should get the picture. Index: scsi/scsi_driver.c =================================================================== RCS file: /home/cvs/src/sys/scsi/scsi_driver.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -u -r1.12 -r1.13 --- scsi_driver.c 1995/12/05 07:14:23 1.12 +++ scsi_driver.c 1996/01/20 15:05:50 1.13 @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scsi_driver.c,v 1.12 1995/12/05 07:14:23 julian Exp $ + * $Id: scsi_driver.c,v 1.13 1996/01/20 15:05:50 joerg Exp $ * */ #include @@ -120,7 +120,7 @@ /* * Check the unit is legal */ - if (sc_link == 0 || sc_link->sd == 0) + if (sc_link == 0 || (sc_link->sd == 0 && !(sc_link->flags & SDEV_UK))) return ENXIO; /* If it is a "once only" device that is already open return EBUSY. Index: scsi/scsiconf.h =================================================================== RCS file: /home/cvs/src/sys/scsi/scsiconf.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -u -r1.37 -r1.38 --- scsiconf.h 1996/01/07 19:27:06 1.37 +++ scsiconf.h 1996/01/20 15:05:53 1.38 @@ -14,7 +14,7 @@ * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 * - * $Id: scsiconf.h,v 1.37 1996/01/07 19:27:06 gibbs Exp $ + * $Id: scsiconf.h,v 1.38 1996/01/20 15:05:53 joerg Exp $ */ #ifndef SCSI_SCSICONF_H #define SCSI_SCSICONF_H 1 @@ -316,6 +316,8 @@ * open and to make unit attentions errors be logged on the console. * These should be split up; I'm adding SDEV_IS_OPEN to enforce one * open only. + * + * XXX SDEV_UK is used to mark the "uk" device. */ #define SDEV_MEDIA_LOADED 0x0001 /* device figures are still valid */ @@ -328,6 +330,7 @@ #define SDEV_RESIDS_WORK 0x0400 /* XXX-HA: Residuals work */ #define SDEV_TARGET_OPS 0x0800 /* XXX-HA: Supports target ops */ #define SDEV_IS_OPEN 0x1000 /* at least 1 open session */ +#define SDEV_UK 0x2000 /* this is the "uk" device */ /* * One of these is allocated and filled in for each scsi bus. Index: scsi/uk.c =================================================================== RCS file: /home/cvs/src/sys/scsi/uk.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -u -r1.13 -r1.14 --- uk.c 1995/12/08 23:22:30 1.13 +++ uk.c 1996/01/20 15:05:55 1.14 @@ -2,7 +2,7 @@ * Driver for a device we can't identify. * by Julian Elischer (julian@tfs.com) * - * $Id: uk.c,v 1.13 1995/12/08 23:22:30 phk Exp $ + * $Id: uk.c,v 1.14 1996/01/20 15:05:55 joerg Exp $ * * If you find that you are adding any code to this file look closely * at putting it in "scsi_driver.c" instead. @@ -40,7 +40,7 @@ "uk", 0, {0, 0}, - SDEV_ONCE_ONLY, /* Only one open allowed */ + SDEV_ONCE_ONLY|SDEV_UK, /* Only one open allowed */ 0, "Unknown", ukopen, -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)