aboutsummaryrefslogtreecommitdiff
path: root/sys/cam
diff options
context:
space:
mode:
authorKenneth D. Merry <ken@FreeBSD.org>1999-02-10 00:04:13 +0000
committerKenneth D. Merry <ken@FreeBSD.org>1999-02-10 00:04:13 +0000
commit2a888f938e5f02e6579c0a12283121a626a90fe1 (patch)
treee59cff1653e99e08396d9972b06e486a471f513e /sys/cam
parent9b8eb634313b7fe1f121677ce8908ed34d138569 (diff)
downloadsrc-2a888f938e5f02e6579c0a12283121a626a90fe1.tar.gz
src-2a888f938e5f02e6579c0a12283121a626a90fe1.zip
Add a prioritization field to the devstat_add_entry() call so that
peripheral drivers can determine where in the devstat(9) list they are inserted. This requires recompilation of libdevstat, systat, vmstat, rpc.rstatd, and any ports that depend on the devstat code, since the size of the devstat structure has changed. The devstat version number has been incremented as well to reflect the change. This sorts devices in the devstat list in "more interesting" to "less interesting" order. So, for instance, da devices are now more important than floppy drives, and so will appear before floppy drives in the default output from systat, iostat, vmstat, etc. The order of devices is, for now, kept in a central table in devicestat.h. If individual drivers were able to make a meaningful decision on what priority they should be at attach time, we could consider splitting the priority information out into the various drivers. For now, though, they have no way of knowing that, so it's easier to put them in an easy to find table. Also, move the checkversion() call in vmstat(8) to a more logical place. Thanks to Bruce and David O'Brien for suggestions, for reviewing this, and for putting up with the long time it has taken me to commit it. Bruce did object somewhat to the central priority table (he would rather the priorities be distributed in each driver), so his objection is duly noted here. Reviewed by: bde, obrien
Notes
Notes: svn path=/head/; revision=43819
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_cd.c7
-rw-r--r--sys/cam/scsi/scsi_ch.c7
-rw-r--r--sys/cam/scsi/scsi_da.c5
-rw-r--r--sys/cam/scsi/scsi_pass.c7
-rw-r--r--sys/cam/scsi/scsi_pt.c5
-rw-r--r--sys/cam/scsi/scsi_sa.c5
6 files changed, 21 insertions, 15 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index 0ebc68547191..209f937e3819 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997 Justin T. Gibbs.
- * Copyright (c) 1997, 1998 Kenneth D. Merry.
+ * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_cd.c,v 1.13 1999/01/11 17:45:22 eivind Exp $
+ * $Id: scsi_cd.c,v 1.14 1999/01/12 16:26:19 eivind Exp $
*/
/*
* Portions of this driver taken from the original FreeBSD cd driver.
@@ -631,7 +631,8 @@ cdregister(struct cam_periph *periph, void *arg)
devstat_add_entry(&softc->device_stats, "cd",
periph->unit_number, 0,
DEVSTAT_BS_UNAVAILABLE,
- DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_SCSI);
+ DEVSTAT_TYPE_CDROM | DEVSTAT_TYPE_IF_SCSI,
+ DEVSTAT_PRIORITY_CD);
/*
* Add an async callback so that we get
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index 17f6fb965966..384e9b409d55 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997 Justin T. Gibbs.
- * Copyright (c) 1997, 1998 Kenneth D. Merry.
+ * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_ch.c,v 1.8 1998/12/12 23:52:46 gibbs Exp $
+ * $Id: scsi_ch.c,v 1.9 1998/12/22 20:05:23 eivind Exp $
*/
/*
* Derived from the NetBSD SCSI changer driver.
@@ -414,7 +414,8 @@ chregister(struct cam_periph *periph, void *arg)
devstat_add_entry(&softc->device_stats, "ch",
periph->unit_number, 0,
DEVSTAT_NO_BLOCKSIZE | DEVSTAT_NO_ORDERED_TAGS,
- cgd->pd_type | DEVSTAT_TYPE_IF_SCSI);
+ cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
+ DEVSTAT_PRIORITY_OTHER);
/*
* Add an async callback so that we get
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 3463bbf21c28..253fce3fcd5f 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_da.c,v 1.18 1999/01/05 20:43:41 mjacob Exp $
+ * $Id: scsi_da.c,v 1.19 1999/01/07 20:19:09 mjacob Exp $
*/
#include "opt_hw_wdog.h"
@@ -1030,7 +1030,8 @@ daregister(struct cam_periph *periph, void *arg)
devstat_add_entry(&softc->device_stats, "da",
periph->unit_number, 0,
DEVSTAT_BS_UNAVAILABLE,
- cgd->pd_type | DEVSTAT_TYPE_IF_SCSI);
+ cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
+ DEVSTAT_PRIORITY_DA);
/*
* Add async callbacks for bus reset and
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 40e63762226a..927b1b84e64e 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -1,6 +1,6 @@
/*
* Copyright (c) 1997, 1998 Justin T. Gibbs.
- * Copyright (c) 1997, 1998 Kenneth D. Merry.
+ * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_pass.c,v 1.4 1998/10/22 22:16:56 ken Exp $
+ * $Id: scsi_pass.c,v 1.5 1998/11/22 23:44:47 ken Exp $
*/
#include <sys/param.h>
@@ -355,7 +355,8 @@ passregister(struct cam_periph *periph, void *arg)
0, DEVSTAT_NO_BLOCKSIZE | DEVSTAT_NO_ORDERED_TAGS,
cgd->pd_type |
DEVSTAT_TYPE_IF_SCSI |
- DEVSTAT_TYPE_PASS);
+ DEVSTAT_TYPE_PASS,
+ DEVSTAT_PRIORITY_PASS);
/*
* Add an async callback so that we get
* notified if this device goes away.
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index b937ad420221..4893284e21fa 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_pt.c,v 1.3 1998/10/22 22:16:56 ken Exp $
+ * $Id: scsi_pt.c,v 1.4 1998/11/22 23:44:47 ken Exp $
*/
#include <sys/param.h>
@@ -372,7 +372,8 @@ ptctor(struct cam_periph *periph, void *arg)
devstat_add_entry(&softc->device_stats, "pt",
periph->unit_number, 0,
DEVSTAT_NO_BLOCKSIZE,
- cgd->pd_type | DEVSTAT_TYPE_IF_SCSI);
+ cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
+ DEVSTAT_PRIORITY_OTHER);
/*
* Add async callbacks for bus reset and
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index 7b2ca1c8d05d..3772e472ca1a 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_sa.c,v 1.17 1999/02/05 07:32:52 mjacob Exp $
+ * $Id: scsi_sa.c,v 1.18 1999/02/05 08:49:34 mjacob Exp $
*/
#include <sys/param.h>
@@ -1242,7 +1242,8 @@ saregister(struct cam_periph *periph, void *arg)
devstat_add_entry(&softc->device_stats, "sa",
periph->unit_number, 0,
DEVSTAT_BS_UNAVAILABLE,
- cgd->pd_type | DEVSTAT_TYPE_IF_SCSI);
+ cgd->pd_type | DEVSTAT_TYPE_IF_SCSI,
+ DEVSTAT_PRIORITY_SA);
/*
* Add an async callback so that we get