SCCS-vsn: sys/vax/uba/np.c 7.3
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)np.c 7.2 (Berkeley) %G%
+ * @(#)np.c 7.3 (Berkeley) %G%
*
* From:
* np.c version 1.5
*
* From:
* np.c version 1.5
register struct CQE *ep;
register struct npreq *rp;
register int base;
register struct CQE *ep;
register struct npreq *rp;
register int base;
if(NpDebug & DEBENTRY)
printf("NpProcQueue\n");
cqp = &mp->shmemp->hostcq; /* Command Queue pointer */
if(NpDebug & DEBENTRY)
printf("NpProcQueue\n");
cqp = &mp->shmemp->hostcq; /* Command Queue pointer */
+ s = spl5();
+ if(mp->flags & SCANNING) {
+ splx(s);
+ }
+ mp->flags |= SCANNING;
+ splx(s);
- else cqp->scanflag | = ON;
base = (int)mp->shmemp; /* Shared memory base address */
base = (int)mp->shmemp; /* Shared memory base address */
- while(cqp->scanflag & ON) {
+ cqp->scanflag |= ON;
+ cqp->chngflag &= ~ON;
while(ep = NpRemCQE(cqp,base)) {
rp = ep->cqe_reqid;
while(ep = NpRemCQE(cqp,base)) {
rp = ep->cqe_reqid;
if(!(cqp->chngflag & ON))
if(!(cqp->chngflag & ON))
+ mp->flags &= ~SCANNING;
if(NpDebug & DEBENTRY)
printf("NpProcQueue...\n");
}
if(NpDebug & DEBENTRY)
printf("NpProcQueue...\n");
}
}
else *temp = cqe_offset; /* Enter this request's offset */
}
else *temp = cqe_offset; /* Enter this request's offset */
- cqp->chngflag |= ON; /* Set change flag unconditionally */
-
/* Update cqe_add where next request is to be added */
cqp->cq_add += sizeof(unsign16);
/* Update cqe_add where next request is to be added */
cqp->cq_add += sizeof(unsign16);
if(cqp->cq_add == cqp->cq_wrap) /* Wrap if necessary */
cqp->cq_add = (unsign16)((int)cqp->cq_cqe - base);
if(cqp->cq_add == cqp->cq_wrap) /* Wrap if necessary */
cqp->cq_add = (unsign16)((int)cqp->cq_cqe - base);
+ cqp->chngflag |= ON; /* Set change flag unconditionally */
+
/* Interrupt the Board if his scan flag isn't on */
if(!(cqp->scanflag & ON))
/* Interrupt the Board if his scan flag isn't on */
if(!(cqp->scanflag & ON))
mp->reqtab->reqcnt = 0; /* Init request count */
mp->reqtab->reqcnt = 0; /* Init request count */
- s = spl4(); /* Disable interrupts */
+ s = spl5(); /* Disable interrupts */
/* Mark each active request as having an error and wake him up */
/* Mark each active request as having an error and wake him up */
NpAddReq(mp->reqtab,rp); /* Queue onto active list */
NpAddReq(mp->reqtab,rp); /* Queue onto active list */
- pri = spl4(); /* Mask our interrupts */
+ pri = spl5(); /* Mask our interrupts */
NpAddCQE(ep,&mp->shmemp->devcq,mp); /* Add CQE to device's queue */
NpAddCQE(ep,&mp->shmemp->devcq,mp); /* Add CQE to device's queue */