[9314] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: TYPE_COMM not being used in the kernel source

daemon@ATHENA.MIT.EDU (Kees Cook)
Mon Aug 7 10:36:51 2000

Date:	Mon, 7 Aug 2000 09:27:39 -0500
From:	Kees Cook <cook@cpoint.net>
To:	Kurt Garloff <garloff@suse.de>,
	Linux SCSI list <linux-scsi@vger.rutgers.edu>
Message-ID: <20000807092739.A14082@cpoint.net>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="sm4nu43k4a2Rpi4c"
Content-Disposition: inline
In-Reply-To: <20000807151811.N27907@garloff.etpnet.phys.tue.nl>; from garloff@suse.de on Mon, Aug 07, 2000 at 03:18:11PM +0200


--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, Aug 07, 2000 at 03:18:11PM +0200, Kurt Garloff wrote:
> On Sat, Aug 05, 2000 at 06:11:35PM -0500, Kees Cook wrote:
> >   Type:   Communications                     ANSI SCSI revision: 02
> > ncr53c875-0-<0,0>: tagged command queue depth set to 8
> > resize_dma_pool: unknown device type 9
> 
> > >From looking through the linux kernel code, I notice that in
> > include/scsi/scsi.h, "TYPE_COMM" is not specified.  However, in
> > drivers/scsi/tmscsim.h and advansys.c, it is.  No device appears to
> > actually USE these defines, and in scsi.c, the 9th type in
> > "scsi_device_types" IS written in as "Communications".
> > 
> > Therefore, I'd conclude that the missing definition in include/scsi/scsi.h
> > is simply just the case that no one has or uses these devices, especially
> > since the "scsi_devices_types" array is populated with the information,
> > I'd argue that "TYPE_COMM" *should* be included in scsi.h.
> 
> It should. As should TYPE_PRINTER.
> Please add them both to include/scsi/scsi.h
> (even if you don't use the TYPE_PRINTER for anything).

Okay, I've moved them both into include/scsi/scsi.h

I've included a patch against 2.4.0-test5 for these changes.

--  
Cornelius "Kees" Cook                           cook@cpoint.net
Sr. Systems Engineer              Counterpoint Networking, Inc.

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="scsi_types.patch"

diff -uNr linux-2.4.0-test5/drivers/scsi/scsi_dma.c linux-2.4.0-test5-kees/drivers/scsi/scsi_dma.c
--- linux-2.4.0-test5/drivers/scsi/scsi_dma.c	Fri Mar 10 17:24:02 2000
+++ linux-2.4.0-test5-kees/drivers/scsi/scsi_dma.c	Mon Aug  7 09:21:31 2000
@@ -260,6 +260,7 @@
 					new_dma_sectors += (2048 >> 9) * SDpnt->queue_depth;
 			} else if (SDpnt->type == TYPE_SCANNER ||
 				   SDpnt->type == TYPE_PROCESSOR ||
+				   SDpnt->type == TYPE_COMM ||
 				   SDpnt->type == TYPE_MEDIUM_CHANGER ||
 				   SDpnt->type == TYPE_ENCLOSURE) {
 				new_dma_sectors += (4096 >> 9) * SDpnt->queue_depth;
diff -uNr linux-2.4.0-test5/drivers/scsi/scsi_scan.c linux-2.4.0-test5-kees/drivers/scsi/scsi_scan.c
--- linux-2.4.0-test5/drivers/scsi/scsi_scan.c	Wed Jul 19 00:26:13 2000
+++ linux-2.4.0-test5-kees/drivers/scsi/scsi_scan.c	Mon Aug  7 09:21:31 2000
@@ -578,6 +578,7 @@
 	case TYPE_SCANNER:
 	case TYPE_MEDIUM_CHANGER:
 	case TYPE_ENCLOSURE:
+	case TYPE_COMM:
 		SDpnt->writeable = 1;
 		break;
 	case TYPE_WORM:
diff -uNr linux-2.4.0-test5/drivers/scsi/tmscsim.h linux-2.4.0-test5-kees/drivers/scsi/tmscsim.h
--- linux-2.4.0-test5/drivers/scsi/tmscsim.h	Fri Apr 21 18:08:45 2000
+++ linux-2.4.0-test5-kees/drivers/scsi/tmscsim.h	Mon Aug  7 09:22:02 2000
@@ -438,12 +438,6 @@
 #define SCSI_REMOVABLE_MEDIA  0x80    /* Removable Media bit (1=removable)  */
 
 
-/*  Peripheral Device Type definitions */
-/*  see include/scsi/scsi.h for the rest */
-
-#define TYPE_PRINTER		 0x02	   /* Printer device		   */
-#define TYPE_COMM		 0x09	   /* Communications device	   */
-
 /*
 ** Inquiry flag definitions (Inq data byte 7)
 */
diff -uNr linux-2.4.0-test5/include/scsi/scsi.h linux-2.4.0-test5-kees/include/scsi/scsi.h
--- linux-2.4.0-test5/include/scsi/scsi.h	Mon Dec 13 00:55:54 1999
+++ linux-2.4.0-test5-kees/include/scsi/scsi.h	Mon Aug  7 09:22:40 2000
@@ -130,6 +130,7 @@
 
 #define TYPE_DISK           0x00
 #define TYPE_TAPE           0x01
+#define TYPE_PRINTER        0x02    /* Printer device */
 #define TYPE_PROCESSOR      0x03    /* HP scanners use this */
 #define TYPE_WORM           0x04    /* Treated as ROM by our system */
 #define TYPE_ROM            0x05
@@ -137,6 +138,7 @@
 #define TYPE_MOD            0x07    /* Magneto-optical disk - 
 				     * - treated as TYPE_DISK */
 #define TYPE_MEDIUM_CHANGER 0x08
+#define TYPE_COMM           0x09    /* Communications device */
 #define TYPE_ENCLOSURE      0x0d    /* Enclosure Services Device */
 #define TYPE_NO_LUN         0x7f
 
diff -uNr linux-2.4.0-test5/CREDITS linux-2.4.0-test5-kees/CREDITS
--- linux-2.4.0-test5/CREDITS	Wed Jul 26 12:38:23 2000
+++ linux-2.4.0-test5-kees/CREDITS	Mon Aug  7 09:21:31 2000
@@ -507,6 +507,14 @@
 D: Assorted sched/mm titbits
 S: Oxfordshire, UK.
 
+N: Kees Cook
+E: cook@cpoint.net
+W: http://outflux.net/
+P: 1024D/17063E6D 9FA3 C49C 23C9 D1BC 2E30  1975 1FFF 4BA9 1706 3E6D
+D: Minor updates to SCSI code for the Communications type
+S: (ask for current address)
+S: USA
+
 N: Alan Cox
 W: http://roadrunner.swansea.linux.org.uk/alan.shtml
 E: alan@lxorguk.ukuu.org.uk

--sm4nu43k4a2Rpi4c--

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post