- /*
- * If operation is not a control operation,
- * check for boundary conditions.
- */
- if (bp != &ctmbuf[unit]) {
- if (dbtofsb(bp->b_blkno) > sc->sc_nxrec) {
- bp->b_flags |= B_ERROR;
- bp->b_error = ENXIO; /* past EOF */
- goto next;
- }
- if (dbtofsb(bp->b_blkno) == sc->sc_nxrec &&
- bp->b_flags&B_READ) {
- bp->b_resid = bp->b_bcount;
- clrbuf(bp); /* at EOF */
- goto next;
- }
- if ((bp->b_flags&B_READ) == 0)
- /* write sets EOF */
- sc->sc_nxrec = dbtofsb(bp->b_blkno) + 1;
- }
- /*
- * Set up the command, and then if this is a mt ioctl,
- * do the operation using, for TM_SFORW and TM_SREV, the specified
- * operation count.
- */
- cmd = TM_IE | TM_GO | (ui->ui_slave << 8);
- if ((minor(bp->b_dev) & T_1600BPI) == 0)
- cmd |= TM_D800;
- if (bp == &ctmbuf[unit]) {