summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_periph.c
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1999-05-23 18:57:29 +0000
committergibbs <gibbs@FreeBSD.org>1999-05-23 18:57:29 +0000
commit95e29ded40c1e5da157f4bc983a442810b674bec (patch)
treee4cff7168ef451efb7d01d7c99884da4a0fe3b08 /sys/cam/cam_periph.c
parent9b2b6e4e609892474c1f1ff68c0f7707970bfd71 (diff)
downloadFreeBSD-src-95e29ded40c1e5da157f4bc983a442810b674bec.zip
FreeBSD-src-95e29ded40c1e5da157f4bc983a442810b674bec.tar.gz
Rely on the statistics in XPT_GDEV_STATS instead of the versions still
retained in XPT_GDEV_TYPE for binary compatibility. Mark the legacy structure values for removal when we bump the major CAM revision.
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r--sys/cam/cam_periph.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index f88373b..240e063 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cam_periph.c,v 1.13 1999/05/09 01:25:04 ken Exp $
+ * $Id: cam_periph.c,v 1.14 1999/05/22 21:58:45 gibbs Exp $
*/
#include <sys/param.h>
@@ -1463,23 +1463,25 @@ cam_periph_error(union ccb *ccb, cam_flags camflags,
case SCSI_STATUS_QUEUE_FULL:
{
/* no decrement */
- struct ccb_getdev cgd;
+ struct ccb_getdevstats cgds;
/*
* First off, find out what the current
* transaction counts are.
*/
- xpt_setup_ccb(&cgd.ccb_h,
+ xpt_setup_ccb(&cgds.ccb_h,
ccb->ccb_h.path,
/*priority*/1);
- cgd.ccb_h.func_code = XPT_GDEV_TYPE;
- xpt_action((union ccb *)&cgd);
+ cgds.ccb_h.func_code = XPT_GDEV_STATS;
+ xpt_action((union ccb *)&cgds);
/*
* If we were the only transaction active, treat
* the QUEUE FULL as if it were a BUSY condition.
*/
- if (cgd.dev_active != 0) {
+ if (cgds.dev_active != 0) {
+ int total_openings;
+
/*
* Reduce the number of openings to
* be 1 less than the amount it took
@@ -1487,10 +1489,12 @@ cam_periph_error(union ccb *ccb, cam_flags camflags,
* minimum allowed tag count for this
* device.
*/
- openings = cgd.dev_active;
- if (openings < cgd.mintags)
- openings = cgd.mintags;
- if (openings < cgd.dev_active+cgd.dev_openings)
+ total_openings =
+ cgds.dev_active+cgds.dev_openings;
+ openings = cgds.dev_active;
+ if (openings < cgds.mintags)
+ openings = cgds.mintags;
+ if (openings < total_openings)
relsim_flags = RELSIM_ADJUST_OPENINGS;
else {
/*
OpenPOWER on IntegriCloud