Date: Sun, 31 Mar 1996 18:31:58 +0200 (MET DST) From: J Wunsch <j@uriah.heep.sax.de> To: freebsd-hackers@freebsd.org (FreeBSD hackers) Cc: jleppek@suw2k.hisd.harris.com (James Leppek) Subject: Re: uk device Message-ID: <199603311631.SAA11915@uriah.heep.sax.de> In-Reply-To: <9603311514.AA28632@suw2k.hisd.harris.com> from "James Leppek" at Mar 31, 96 10:14:46 am
next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/types.h> @@ -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. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603311631.SAA11915>