summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
68347e6)
SCCS-vsn: sys/vax/uba/tm.c 4.22
#include "te.h"
#if NTM > 0
#include "te.h"
#if NTM > 0
/*
* TM11/TE10 tape driver
*
/*
* TM11/TE10 tape driver
*
- * THIS DRIVER HAS NOT BEEN TESTED WITH MORE THAN ONE TRANSPORT.
+ * Todo:
+ * Test driver with more than one slave
+ * Test reset code
+ * Do rewinds without hanging in driver
*/
#define DELAY(N) { register int d = N; while (--d > 0); }
#include "../h/param.h"
*/
#define DELAY(N) { register int d = N; while (--d > 0); }
#include "../h/param.h"
u_short sc_erreg; /* copy of last erreg */
u_short sc_dsreg; /* copy of last dsreg */
short sc_resid; /* copy of last bc */
u_short sc_erreg; /* copy of last erreg */
u_short sc_dsreg; /* copy of last dsreg */
short sc_resid; /* copy of last bc */
short sc_lastcmd; /* last command to handle direction changes */
short sc_lastcmd; /* last command to handle direction changes */
return;
}
tmcommand(dev, TM_SENSE, 1);
return;
}
tmcommand(dev, TM_SENSE, 1);
- if ((sc->sc_erreg&(TM_SELR|TM_TUR)) != (TM_SELR|TM_TUR)) {
- uprintf("tape not online\n");
- u.u_error = EIO;
- return;
- }
- if ((flag&(FREAD|FWRITE)) == FWRITE && sc->sc_erreg&TM_WRL) {
- uprintf("tape write protected\n");
+ if ((sc->sc_erreg&(TM_SELR|TM_TUR)) != (TM_SELR|TM_TUR) ||
+ (flag&(FREAD|FWRITE)) == FWRITE && sc->sc_erreg&TM_WRL) {
u.u_error = EIO;
return;
}
u.u_error = EIO;
return;
}
sc->sc_blkno = (daddr_t)0;
sc->sc_nxrec = INF;
sc->sc_lastiow = 0;
sc->sc_blkno = (daddr_t)0;
sc->sc_nxrec = INF;
sc->sc_lastiow = 0;
- sc->sc_openf = 1;
- return;
cmd |= TM_RCOM;
um->um_tab.b_active = SIO;
um->um_cmd = cmd;
cmd |= TM_RCOM;
um->um_tab.b_active = SIO;
um->um_cmd = cmd;
if (tmreverseop(sc->sc_lastcmd))
while (addr->tmer & TM_SDWN)
tmgapsdcnt++;
if (tmreverseop(sc->sc_lastcmd))
while (addr->tmer & TM_SDWN)
tmgapsdcnt++;
sc->sc_lastcmd = TM_RCOM; /* will serve */
sc->sc_lastcmd = TM_RCOM; /* will serve */
addr->tmbc = dbtofsb(bp->b_blkno) - blkno;
}
dobpcmd:
addr->tmbc = dbtofsb(bp->b_blkno) - blkno;
}
dobpcmd:
if (tmreverseop(sc->sc_lastcmd) != tmreverseop(bp->b_command))
while (addr->tmer & TM_SDWN)
tmgapsdcnt++;
if (tmreverseop(sc->sc_lastcmd) != tmreverseop(bp->b_command))
while (addr->tmer & TM_SDWN)
tmgapsdcnt++;
sc->sc_lastcmd = bp->b_command;
sc->sc_lastcmd = bp->b_command;
addr->tmcs = (cmd | bp->b_command);
return;
addr->tmcs = (cmd | bp->b_command);
return;
*/
if ((addr->tmer&TM_HARD)==0 && state==SIO) {
if (++um->um_tab.b_errcnt < 7) {
*/
if ((addr->tmer&TM_HARD)==0 && state==SIO) {
if (++um->um_tab.b_errcnt < 7) {
-/* SHOULD CHECK THAT RECOVERY WORKS IN THIS CASE */
-/* AND THEN ONLY PRINT IF errcnt==7 */
- if((addr->tmer&TM_SOFT) == TM_NXM)
- printf("TM UBA late error\n");
sc->sc_blkno++;
ubadone(um);
goto opcont;
sc->sc_blkno++;
ubadone(um);
goto opcont;
/*
* Couldn't recover error
*/
/*
* Couldn't recover error
*/
- harderr(bp);
- printf("tm%d er=%b\n", dkunit(bp),
- sc->sc_erreg, TMEREG_BITS);
+ printf("te%d: hard error bn%d er=%b\n", minor(bp->b_dev)&03,
+ bp->b_blkno, sc->sc_erreg, TMEREG_BITS);
bp->b_flags |= B_ERROR;
goto opdone;
}
bp->b_flags |= B_ERROR;
goto opdone;
}
tmreset(uban)
int uban;
{
tmreset(uban)
int uban;
{
register struct uba_minfo *um;
register tm11, unit;
register struct uba_dinfo *ui;
register struct uba_minfo *um;
register tm11, unit;
register struct uba_dinfo *ui;
if ((um = tmminfo[tm11]) == 0 || um->um_alive == 0 ||
um->um_ubanum != uban)
continue;
if ((um = tmminfo[tm11]) == 0 || um->um_alive == 0 ||
um->um_ubanum != uban)
continue;
- if (printed == 0) {
- printf(" tm");
- DELAY(2000000); /* time to self test */
- printed = 1;
- }
um->um_tab.b_active = 0;
um->um_tab.b_actf = um->um_tab.b_actl = 0;
if (um->um_ubinfo) {
um->um_tab.b_active = 0;
um->um_tab.b_actf = um->um_tab.b_actl = 0;
if (um->um_ubinfo) {