Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jan 2002 02:01:14 -0800
From:      Michael Smith <msmith@freebsd.org>
To:        scsi@freebsd.org
Subject:   CAM sysctl tweak, scsi_low staticisation, review?
Message-ID:  <200201081001.g08A1Er00540@mass.dis.org>

next in thread | raw e-mail | index | archive | help
This is a multipart MIME message.

--==_Exmh_-10949426080
Content-Type: text/plain; charset=us-ascii


Can someone with a CAM hat on give me a review for the attached diff?

It removes the duplicate definition of the kern.cam sysctl node, and 
fixes a structure leaked from the scsi_low code.

Thanks,
Mike


--==_Exmh_-10949426080
Content-Type: text/plain ; name="cam.diff"; charset=us-ascii
Content-Description: cam.diff
Content-Disposition: attachment; filename="cam.diff"

Index: cam/cam.c
===================================================================
RCS file: /local0/cvs/src/sys/cam/cam.c,v
retrieving revision 1.4
diff -u -r1.4 cam.c
--- cam/cam.c	27 Mar 2001 05:45:09 -0000	1.4
+++ cam/cam.c	8 Jan 2002 02:19:46 -0000
@@ -30,7 +30,10 @@
 #include <sys/param.h>
 
 #ifdef _KERNEL
+#include <sys/param.h>
 #include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
 #else /* _KERNEL */
 #include <stdlib.h>
 #include <stdio.h>
@@ -94,6 +97,10 @@
 
 const int num_cam_status_entries =
     sizeof(cam_status_table)/sizeof(*cam_status_table);
+
+#ifdef _KERNEL
+SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD, 0, "CAM Subsystem");
+#endif
 
 void
 cam_strvis(u_int8_t *dst, const u_int8_t *src, int srclen, int dstlen)
Index: cam/cam.h
===================================================================
RCS file: /local0/cvs/src/sys/cam/cam.h,v
retrieving revision 1.9
diff -u -r1.9 cam.h
--- cam/cam.h	31 Mar 2001 04:34:15 -0000	1.9
+++ cam/cam.h	8 Jan 2002 02:21:39 -0000
@@ -189,6 +189,10 @@
 extern const int num_cam_status_entries;
 union ccb;
 
+#ifdef SYSCTL_DECL	/* from sysctl.h */
+SYSCTL_DECL(_kern_cam);
+#endif
+
 __BEGIN_DECLS
 typedef int (cam_quirkmatch_t)(caddr_t, caddr_t);
 
Index: cam/cam_xpt.c
===================================================================
RCS file: /local0/cvs/src/sys/cam/cam_xpt.c,v
retrieving revision 1.121
diff -u -r1.121 cam_xpt.c
--- cam/cam_xpt.c	5 Jan 2002 08:47:09 -0000	1.121
+++ cam/cam_xpt.c	8 Jan 2002 04:25:04 -0000
@@ -641,8 +641,8 @@
 #endif
 
 /* Pointers to software interrupt handlers */
-void *camnet_ih;
-void *cambio_ih;
+static void *camnet_ih;
+static void *cambio_ih;
 
 #if defined(CAM_DEBUG_FLAGS) && !defined(CAMDEBUG)
 #error "You must have options CAMDEBUG to use options CAM_DEBUG_FLAGS"
Index: cam/scsi/scsi_cd.c
===================================================================
RCS file: /local0/cvs/src/sys/cam/scsi/scsi_cd.c,v
retrieving revision 1.55
diff -u -r1.55 scsi_cd.c
--- cam/scsi/scsi_cd.c	12 Sep 2001 08:36:56 -0000	1.55
+++ cam/scsi/scsi_cd.c	8 Jan 2002 02:13:43 -0000
@@ -284,7 +284,6 @@
  * XXX KDM this CAM node should be moved if we ever get more CAM sysctl
  * variables.
  */
-SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD, 0, "CAM Subsystem");
 SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver");
 SYSCTL_NODE(_kern_cam_cd, OID_AUTO, changer, CTLFLAG_RD, 0, "CD Changer");
 SYSCTL_INT(_kern_cam_cd_changer, OID_AUTO, min_busy_seconds, CTLFLAG_RW,
Index: cam/scsi/scsi_da.c
===================================================================
RCS file: /local0/cvs/src/sys/cam/scsi/scsi_da.c,v
retrieving revision 1.93
diff -u -r1.93 scsi_da.c
--- cam/scsi/scsi_da.c	7 Jan 2002 03:32:56 -0000	1.93
+++ cam/scsi/scsi_da.c	8 Jan 2002 02:13:15 -0000
@@ -382,7 +382,6 @@
 static int da_retry_count = DA_DEFAULT_RETRY;
 static int da_default_timeout = DA_DEFAULT_TIMEOUT;
 
-SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD, 0, "CAM Subsystem");
 SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0,
             "CAM Direct Access Disk driver");
 SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW,
Index: cam/scsi/scsi_low.c
===================================================================
RCS file: /local0/cvs/src/sys/cam/scsi/scsi_low.c,v
retrieving revision 1.12
diff -u -r1.12 scsi_low.c
--- cam/scsi/scsi_low.c	10 Dec 2001 02:07:34 -0000	1.12
+++ cam/scsi/scsi_low.c	8 Jan 2002 05:11:33 -0000
@@ -192,7 +192,7 @@
 #endif	/* !SCSI_LOW_INFO_DETAIL */
 
 #ifdef	SCSI_LOW_STATICS
-struct scsi_low_statics {
+static struct scsi_low_statics {
 	int nexus_win;
 	int nexus_fail;
 	int nexus_disconnected;

--==_Exmh_-10949426080--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201081001.g08A1Er00540>