Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hp300/dev Convert to new device buffer queue interf...



details:   https://anonhg.NetBSD.org/src/rev/80d123b0deac
branches:  trunk
changeset: 534451:80d123b0deac
user:      hannken <hannken%NetBSD.org@localhost>
date:      Fri Jul 26 13:19:52 2002 +0000

description:
Convert to new device buffer queue interface.

Approved by: Jason R. Thorpe <thorpej%netbsd.org@localhost>

diffstat:

 sys/arch/hp300/dev/ct.c    |  22 +++++++++++-----------
 sys/arch/hp300/dev/mt.c    |  24 ++++++++++++------------
 sys/arch/hp300/dev/rd.c    |  22 +++++++++++-----------
 sys/arch/hp300/dev/rdvar.h |   4 ++--
 sys/arch/hp300/dev/sd.c    |  18 +++++++++---------
 sys/arch/hp300/dev/sdvar.h |   4 ++--
 sys/arch/hp300/dev/st.c    |  16 ++++++++--------
 sys/arch/hp300/dev/stvar.h |   4 ++--
 8 files changed, 57 insertions(+), 57 deletions(-)

diffs (truncated from 485 to 300 lines):

diff -r abebf73ee40a -r 80d123b0deac sys/arch/hp300/dev/ct.c
--- a/sys/arch/hp300/dev/ct.c   Fri Jul 26 13:12:47 2002 +0000
+++ b/sys/arch/hp300/dev/ct.c   Fri Jul 26 13:19:52 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ct.c,v 1.28 2002/03/15 05:55:35 gmcgarry Exp $ */
+/*     $NetBSD: ct.c,v 1.29 2002/07/26 13:19:52 hannken Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.28 2002/03/15 05:55:35 gmcgarry Exp $");                                                  
+__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.29 2002/07/26 13:19:52 hannken Exp $");                                                  
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -118,7 +118,7 @@
        struct  ct_ulcmd sc_ul;
        struct  ct_wfmcmd sc_wfm;
        struct  ct_clearcmd sc_clear;
-       struct  buf_queue sc_tab;
+       struct  bufq_state sc_tab;
        int     sc_active;
        struct  buf *sc_bp;
        struct  buf sc_bufstore;        /* XXX */
@@ -227,7 +227,7 @@
        sc->sc_slave = ha->ha_slave;
        sc->sc_punit = ha->ha_punit;
 
-       BUFQ_INIT(&sc->sc_tab);
+       bufq_alloc(&sc->sc_tab, BUFQ_FCFS);
 
        /* Initialize hpib job queue entry. */
        sc->sc_hq.hq_softc = sc;
@@ -506,7 +506,7 @@
        sc = ct_cd.cd_devs[unit];
 
        s = splbio();
-       BUFQ_INSERT_TAIL(&sc->sc_tab, bp);
+       BUFQ_PUT(&sc->sc_tab, bp);
        if (sc->sc_active == 0) {
                sc->sc_active = 1;
                ctustart(sc);
@@ -520,7 +520,7 @@
 {
        struct buf *bp;
 
-       bp = BUFQ_FIRST(&sc->sc_tab);
+       bp = BUFQ_PEEK(&sc->sc_tab);
        sc->sc_addr = bp->b_data;
        sc->sc_resid = bp->b_bcount;
        if (hpibreq(sc->sc_dev.dv_parent, &sc->sc_hq))
@@ -538,7 +538,7 @@
        ctlr = sc->sc_dev.dv_parent->dv_unit;
        slave = sc->sc_slave;
 
-       bp = BUFQ_FIRST(&sc->sc_tab);
+       bp = BUFQ_PEEK(&sc->sc_tab);
        if ((sc->sc_flags & CTF_CMD) && sc->sc_bp == bp) {
                switch(sc->sc_cmd) {
                case MTFSF:
@@ -649,7 +649,7 @@
        struct buf *bp;
        int rw;
 
-       bp = BUFQ_FIRST(&sc->sc_tab);
+       bp = BUFQ_PEEK(&sc->sc_tab);
        rw = bp->b_flags & B_READ;
        hpibgo(sc->sc_dev.dv_parent->dv_unit, sc->sc_slave, C_EXEC,
            sc->sc_addr, sc->sc_resid, rw, rw != 0);
@@ -745,7 +745,7 @@
        slave = sc->sc_slave;
        unit = sc->sc_dev.dv_unit;
 
-       bp = BUFQ_FIRST(&sc->sc_tab);
+       bp = BUFQ_PEEK(&sc->sc_tab);
        if (bp == NULL) {
                printf("%s: bp == NULL\n", sc->sc_dev.dv_xname);
                return;
@@ -882,10 +882,10 @@
        struct buf *bp;
 {
 
-       BUFQ_REMOVE(&sc->sc_tab, bp);
+       (void)BUFQ_GET(&sc->sc_tab);
        biodone(bp);
        hpibfree(sc->sc_dev.dv_parent, &sc->sc_hq);
-       if (BUFQ_FIRST(&sc->sc_tab) == NULL) {
+       if (BUFQ_PEEK(&sc->sc_tab) == NULL) {
                sc->sc_active = 0;
                return;
        }
diff -r abebf73ee40a -r 80d123b0deac sys/arch/hp300/dev/mt.c
--- a/sys/arch/hp300/dev/mt.c   Fri Jul 26 13:12:47 2002 +0000
+++ b/sys/arch/hp300/dev/mt.c   Fri Jul 26 13:19:52 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mt.c,v 1.16 2002/03/15 05:55:36 gmcgarry Exp $ */
+/*     $NetBSD: mt.c,v 1.17 2002/07/26 13:19:53 hannken Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.16 2002/03/15 05:55:36 gmcgarry Exp $");                                                  
+__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.17 2002/07/26 13:19:53 hannken Exp $");                                                  
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -116,7 +116,7 @@
        short   sc_type;        /* tape drive model (hardware IDs) */
        struct  hpibqueue sc_hq; /* HPIB device queue member */
        tpr_t   sc_ttyp;
-       struct buf_queue sc_tab;/* buf queue */
+       struct bufq_state sc_tab;/* buf queue */
        int     sc_active;
        struct buf sc_bufstore; /* XXX buffer storage */
 };
@@ -185,7 +185,7 @@
        hpibno = parent->dv_unit;
        slave = ha->ha_slave;
 
-       BUFQ_INIT(&sc->sc_tab);
+       bufq_alloc(&sc->sc_tab, BUFQ_FCFS);
        callout_init(&sc->sc_start_ch);
        callout_init(&sc->sc_intr_ch);
 
@@ -513,7 +513,7 @@
                }
        }
        s = splbio();
-       BUFQ_INSERT_TAIL(&sc->sc_tab, bp);
+       BUFQ_PUT(&sc->sc_tab, bp);
        if (sc->sc_active == 0) {
                sc->sc_active = 1;
                mtustart(sc);
@@ -564,7 +564,7 @@
 
        dlog(LOG_DEBUG, "%s start", sc->sc_dev.dv_xname);
        sc->sc_flags &= ~MTF_WRT;
-       bp = BUFQ_FIRST(&sc->sc_tab);
+       bp = BUFQ_PEEK(&sc->sc_tab);
        if ((sc->sc_flags & MTF_ALIVE) == 0 &&
            ((bp->b_flags & B_CMD) == 0 || bp->b_cmd != MTRESET))
                goto fatalerror;
@@ -745,10 +745,10 @@
        bp->b_flags |= B_ERROR;
 done:
        sc->sc_flags &= ~(MTF_HITEOF | MTF_HITBOF);
-       BUFQ_REMOVE(&sc->sc_tab, bp);
+       (void)BUFQ_GET(&sc->sc_tab);
        biodone(bp);
        hpibfree(sc->sc_dev.dv_parent, &sc->sc_hq);
-       if ((bp = BUFQ_FIRST(&sc->sc_tab)) == NULL)
+       if ((bp = BUFQ_PEEK(&sc->sc_tab)) == NULL)
                sc->sc_active = 0;
        else
                mtustart(sc);
@@ -768,7 +768,7 @@
        int rw;
 
        dlog(LOG_DEBUG, "%s go", sc->sc_dev.dv_xname);
-       bp = BUFQ_FIRST(&sc->sc_tab);
+       bp = BUFQ_PEEK(&sc->sc_tab);
        rw = bp->b_flags & B_READ;
        hpibgo(sc->sc_hpibno, sc->sc_slave, rw ? MTT_READ : MTL_WRITE,
            bp->b_data, bp->b_bcount, rw, rw != 0);
@@ -783,7 +783,7 @@
        int i;
        u_char cmdbuf[4];
 
-       bp = BUFQ_FIRST(&sc->sc_tab);
+       bp = BUFQ_PEEK(&sc->sc_tab);
        if (bp == NULL) {
                log(LOG_ERR, "%s intr: bp == NULL", sc->sc_dev.dv_xname);
                return;
@@ -930,10 +930,10 @@
        cmdbuf[0] = MTE_COMPLETE | MTE_IDLE;
        (void) hpibsend(sc->sc_hpibno, sc->sc_slave, MTL_ECMD, cmdbuf, 1);
        bp->b_flags &= ~B_CMD;
-       BUFQ_REMOVE(&sc->sc_tab, bp);
+       (void)BUFQ_GET(&sc->sc_tab);
        biodone(bp);
        hpibfree(sc->sc_dev.dv_parent, &sc->sc_hq);
-       if (BUFQ_FIRST(&sc->sc_tab) == NULL)
+       if (BUFQ_PEEK(&sc->sc_tab) == NULL)
                sc->sc_active = 0;
        else
                mtustart(sc);
diff -r abebf73ee40a -r 80d123b0deac sys/arch/hp300/dev/rd.c
--- a/sys/arch/hp300/dev/rd.c   Fri Jul 26 13:12:47 2002 +0000
+++ b/sys/arch/hp300/dev/rd.c   Fri Jul 26 13:19:52 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rd.c,v 1.49 2002/04/08 21:41:44 gmcgarry Exp $ */
+/*     $NetBSD: rd.c,v 1.50 2002/07/26 13:19:53 hannken Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.49 2002/04/08 21:41:44 gmcgarry Exp $");                                                  
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.50 2002/07/26 13:19:53 hannken Exp $");                                                  
 
 #include "opt_useleds.h"
 #include "rnd.h"
@@ -326,7 +326,7 @@
        struct rd_softc *sc = (struct rd_softc *)self;
        struct hpibbus_attach_args *ha = aux;
 
-       BUFQ_INIT(&sc->sc_tab);
+       bufq_alloc(&sc->sc_tab, BUFQ_DISKSORT|BUFQ_SORT_RAWBLOCK);
 
        if (rdident(parent, sc, ha) == 0) {
                printf("\n%s: didn't respond to describe command!\n",
@@ -714,7 +714,7 @@
        }
        bp->b_rawblkno = bn + offset;
        s = splbio();
-       disksort_blkno(&rs->sc_tab, bp);
+       BUFQ_PUT(&rs->sc_tab, bp);
        if (rs->sc_active == 0) {
                rs->sc_active = 1;
                rdustart(rs);
@@ -745,7 +745,7 @@
 {
        struct buf *bp;
 
-       bp = BUFQ_FIRST(&rs->sc_tab);
+       bp = BUFQ_PEEK(&rs->sc_tab);
        rs->sc_addr = bp->b_data;
        rs->sc_resid = bp->b_bcount;
        if (hpibreq(rs->sc_dev.dv_parent, &rs->sc_hq))
@@ -759,11 +759,11 @@
 {
 
        rs->sc_errcnt = 0;
-       BUFQ_REMOVE(&rs->sc_tab, bp);
+       (void)BUFQ_GET(&rs->sc_tab);
        bp->b_resid = 0;
        biodone(bp);
        hpibfree(rs->sc_dev.dv_parent, &rs->sc_hq);
-       if ((bp = BUFQ_FIRST(&rs->sc_tab)) != NULL)
+       if ((bp = BUFQ_PEEK(&rs->sc_tab)) != NULL)
                return (bp);
        rs->sc_active = 0;
        if (rs->sc_flags & RDF_WANTED) {
@@ -778,7 +778,7 @@
        void *arg;
 {
        struct rd_softc *rs = arg;
-       struct buf *bp = BUFQ_FIRST(&rs->sc_tab);
+       struct buf *bp = BUFQ_PEEK(&rs->sc_tab);
        int part, ctlr, slave;
 
        ctlr = rs->sc_dev.dv_parent->dv_unit;
@@ -857,7 +857,7 @@
        void *arg;
 {
        struct rd_softc *rs = arg;
-       struct buf *bp = BUFQ_FIRST(&rs->sc_tab);
+       struct buf *bp = BUFQ_PEEK(&rs->sc_tab);
        int rw, ctlr, slave;
 
        ctlr = rs->sc_dev.dv_parent->dv_unit;
@@ -881,7 +881,7 @@
 {
        struct rd_softc *rs = arg;
        int unit = rs->sc_dev.dv_unit;
-       struct buf *bp = BUFQ_FIRST(&rs->sc_tab);
+       struct buf *bp = BUFQ_PEEK(&rs->sc_tab);
        u_char stat = 13;       /* in case hpibrecv fails */
        int rv, restart, ctlr, slave;
 
@@ -1053,7 +1053,7 @@
         * Note that not all errors report a block number, in that case
         * we just use b_blkno.
         */
-       bp = BUFQ_FIRST(&rs->sc_tab);
+       bp = BUFQ_PEEK(&rs->sc_tab);
        pbn = rs->sc_dkdev.dk_label->d_partitions[rdpart(bp->b_dev)].p_offset;
        if ((sp->c_fef & FEF_CU) || (sp->c_fef & FEF_DR) ||
            (sp->c_ief & IEF_RRMASK)) {
diff -r abebf73ee40a -r 80d123b0deac sys/arch/hp300/dev/rdvar.h
--- a/sys/arch/hp300/dev/rdvar.h        Fri Jul 26 13:12:47 2002 +0000
+++ b/sys/arch/hp300/dev/rdvar.h        Fri Jul 26 13:19:52 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rdvar.h,v 1.10 2000/10/10 19:58:43 he Exp $    */
+/*     $NetBSD: rdvar.h,v 1.11 2002/07/26 13:19:53 hannken Exp $       */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -80,7 +80,7 @@
        struct  rd_ssmcmd sc_ssmc;
        struct  rd_srcmd sc_src;
        struct  rd_clearcmd sc_clear;



Home | Main Index | Thread Index | Old Index