and here's the last one, the hdc stuff on vax.

can anyone compile this? test?

Index: hdc9224.c
===================================================================
RCS file: /cvs/src/sys/arch/vax/vsa/hdc9224.c,v
retrieving revision 1.41
diff -u -p -r1.41 hdc9224.c
--- hdc9224.c   14 Oct 2013 23:26:22 -0000      1.41
+++ hdc9224.c   19 Nov 2013 06:43:24 -0000
@@ -134,7 +134,7 @@ struct      hdcsoftc {
        struct evcount sc_intrcnt;
        struct vsbus_dma sc_vd;
        vaddr_t sc_regs;                /* register addresses */
-       struct buf sc_buf_queue;
+       struct bufq sc_bufq;
        struct buf *sc_active;
        struct hdc9224_UDCreg sc_creg;  /* (command) registers to be written */
        struct hdc9224_UDCreg sc_sreg;  /* (status) registers being read */
@@ -387,7 +387,7 @@ hdcintr(void *arg)
        struct buf *bp;
 
        sc->sc_status = HDC_RSTAT;
-       if (sc->sc_active == 0)
+       if (sc->sc_active == NULL)
                return; /* Complain? */
 
        if ((sc->sc_status & (DKC_ST_INTPEND | DKC_ST_DONE)) !=
@@ -395,7 +395,7 @@ hdcintr(void *arg)
                return; /* Why spurious ints sometimes??? */
 
        bp = sc->sc_active;
-       sc->sc_active = 0;
+       sc->sc_active = NULL;
        if ((sc->sc_status & DKC_ST_TERMCOD) != DKC_TC_SUCCESS) {
                int i;
                u_char *g = (u_char *)&sc->sc_sreg;
@@ -455,8 +455,9 @@ hdstrategy(struct buf *bp)
        if (bounds_check_with_label(bp, hd->sc_disk.dk_label) == -1)
                goto done;
 
+       bufq_queue(&sc->sc_bufq, bp);
+
        s = splbio();
-       disksort(&sc->sc_buf_queue, bp);
        if (inq == 0) {
                inq = 1;
                vsbus_dma_start(&sc->sc_vd);
@@ -479,8 +480,7 @@ hdc_qstart(void *arg)
        inq = 0;
 
        hdcstart(sc, NULL);
-       dp = &sc->sc_buf_queue;
-       if (dp->b_actf != NULL) {
+       if (bufq_peek(&sc->sc_bufq)) {
                vsbus_dma_start(&sc->sc_vd); /* More to go */
                inq = 1;
        }
@@ -499,15 +499,14 @@ hdcstart(struct hdcsoftc *sc, struct buf
 
        splassert(IPL_BIO);
 
-       if (sc->sc_active)
+       if (sc->sc_active != NULL)
                return; /* Already doing something */
 
        if (ob == NULL) {
-               dp = &sc->sc_buf_queue;
-               if ((bp = dp->b_actf) == NULL)
+               bp = bufq_dequeue(&sc->sc_bufq);
+               if (bp == NULL)
                        return; /* Nothing to do */
 
-               dp->b_actf = bp->b_actf;
                sc->sc_bufaddr = bp->b_data;
                sc->sc_bytecnt = bp->b_bcount;
                sc->sc_retries = 0;

Reply via email to