From owner-p4-projects@FreeBSD.ORG Wed May 17 16:13:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B2D7516A912; Wed, 17 May 2006 16:13:35 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 837E616A801 for ; Wed, 17 May 2006 16:13:35 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3330443D45 for ; Wed, 17 May 2006 16:13:35 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k4HGDEYN025499 for ; Wed, 17 May 2006 16:13:14 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4HGDEGo025493 for perforce@freebsd.org; Wed, 17 May 2006 16:13:14 GMT (envelope-from scottl@freebsd.org) Date: Wed, 17 May 2006 16:13:14 GMT Message-Id: <200605171613.k4HGDEGo025493@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 97345 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 May 2006 16:13:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=97345 Change 97345 by scottl@scottl-x64 on 2006/05/17 16:12:33 Move the highpower variables into the xsoftc. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#29 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#29 (text+ko) ==== @@ -82,7 +82,6 @@ SLIST_HEAD(async_list, async_node); SLIST_HEAD(periph_list, cam_periph); -static STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq; /* * This is the maximum number of high powered commands (e.g. start unit) @@ -92,9 +91,6 @@ #define CAM_MAX_HIGHPOWER 4 #endif -/* number of high powered commands that can go through right now */ -static int num_highpower = CAM_MAX_HIGHPOWER; - /* * Structure for queueing a device in a run queue. * There is one run queue for allocating new ccbs, @@ -243,6 +239,11 @@ struct xpt_softc { xpt_flags flags; u_int32_t generation; + + /* number of high powered commands that can go through right now */ + int num_highpower; + STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq; + }; static const char quantum[] = "QUANTUM"; @@ -1369,7 +1370,8 @@ TAILQ_INIT(&xpt_busses); TAILQ_INIT(&cam_bioq); - STAILQ_INIT(&highpowerq); + STAILQ_INIT(&xsoftc.highpowerq); + xsoftc.num_highpower = CAM_MAX_HIGHPOWER; mtx_init(&cam_bioq_lock, "CAM BIOQ lock", NULL, MTX_DEF); @@ -3892,7 +3894,7 @@ if ((work_ccb->ccb_h.flags & CAM_HIGH_POWER) != 0) { - if (num_highpower <= 0) { + if (xsoftc.num_highpower <= 0) { /* * We got a high power command, but we * don't have any available slots. Freeze @@ -3900,7 +3902,7 @@ * available. */ device->qfrozen_cnt++; - STAILQ_INSERT_TAIL(&highpowerq, + STAILQ_INSERT_TAIL(&xsoftc.highpowerq, &work_ccb->ccb_h, xpt_links.stqe); @@ -3911,7 +3913,7 @@ * Consume a high power slot while * this ccb runs. */ - num_highpower--; + xsoftc.num_highpower--; } } devq->active_dev = device; @@ -7122,14 +7124,14 @@ struct highpowerlist *hphead; union ccb *send_ccb; - hphead = &highpowerq; + hphead = &xsoftc.highpowerq; send_ccb = (union ccb *)STAILQ_FIRST(hphead); /* * Increment the count since this command is done. */ - num_highpower++; + xsoftc.num_highpower++; /* * Any high powered commands queued up?