projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
almost working versions
[unix-history]
/
usr
/
src
/
sys
/
vax
/
uba
/
tm.c
diff --git
a/usr/src/sys/vax/uba/tm.c
b/usr/src/sys/vax/uba/tm.c
index
9a3376c
..
50d6592
100644
(file)
--- a/
usr/src/sys/vax/uba/tm.c
+++ b/
usr/src/sys/vax/uba/tm.c
@@
-1,9
+1,10
@@
-/* tm.c 4.1
5
%G% */
+/* tm.c 4.1
8
%G% */
#include "tm.h"
#include "tm.h"
-#if NTM03 > 0
+#if NTM > 0
+int tmgapsdcnt; /* DEBUG */
/*
/*
- * TM tape driver
+ * TM
11/TE10
tape driver
*
* THIS DRIVER HAS NOT BEEN TESTED WITH MORE THAN ONE TRANSPORT.
*/
*
* THIS DRIVER HAS NOT BEEN TESTED WITH MORE THAN ONE TRANSPORT.
*/
@@
-25,19
+26,19
@@
#include "../h/tmreg.h"
#include "../h/tmreg.h"
-struct buf ctmbuf[NT
M11
];
-struct buf rtmbuf[NT
M11
];
+struct buf ctmbuf[NT
E
];
+struct buf rtmbuf[NT
E
];
int tmprobe(), tmslave(), tmattach(), tmdgo(), tmintr();
int tmprobe(), tmslave(), tmattach(), tmdgo(), tmintr();
-struct uba_minfo *tmminfo[NTM
03
];
-struct uba_dinfo *tmdinfo[NT
M11
];
-struct buf tmutab[NT
M11
];
+struct uba_minfo *tmminfo[NTM];
+struct uba_dinfo *tmdinfo[NT
E
];
+struct buf tmutab[NT
E
];
#ifdef notyet
#ifdef notyet
-struct uba_dinfo *tmip[NTM
03
][4];
+struct uba_dinfo *tmip[NTM][4];
#endif
u_short tmstd[] = { 0772520, 0 };
struct uba_driver tmdriver =
#endif
u_short tmstd[] = { 0772520, 0 };
struct uba_driver tmdriver =
-
{ tmprobe, tmslave, tmattach, tmdgo, tmstd, "mtm", tmdinfo, "tm", tmminfo
};
+
{ tmprobe, tmslave, tmattach, tmdgo, tmstd, "te", tmdinfo, "tm", tmminfo, 0
};
/* bits in minor device */
#define TMUNIT(dev) (minor(dev)&03)
/* bits in minor device */
#define TMUNIT(dev) (minor(dev)&03)
@@
-57,7
+58,8
@@
struct tm_softc {
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 */
-} tm_softc[NTM03];
+ short sc_lastcmd; /* last command to handle direction changes */
+} tm_softc[NTM];
/*
* States for um->um_tab.b_active, the
/*
* States for um->um_tab.b_active, the
@@
-87,7
+89,7
@@
tmprobe(reg)
#endif
((struct device *)reg)->tmcs = TM_IE;
/*
#endif
((struct device *)reg)->tmcs = TM_IE;
/*
- * If this is a tm
03
, it ought to have interrupted
+ * If this is a tm
11
, it ought to have interrupted
* by now, if it isn't (ie: it is a ts04) then we just
* hope that it didn't interrupt, so autoconf will ignore it.
* Just in case, we will reference one
* by now, if it isn't (ie: it is a ts04) then we just
* hope that it didn't interrupt, so autoconf will ignore it.
* Just in case, we will reference one
@@
-146,7
+148,7
@@
tmopen(dev, flag)
register struct tm_softc *sc;
unit = TMUNIT(dev);
register struct tm_softc *sc;
unit = TMUNIT(dev);
- if (unit>=NT
M11
|| (sc = &tm_softc[unit])->sc_openf ||
+ if (unit>=NT
E
|| (sc = &tm_softc[unit])->sc_openf ||
(ui = tmdinfo[unit]) == 0 || ui->ui_alive == 0) {
u.u_error = ENXIO;
return;
(ui = tmdinfo[unit]) == 0 || ui->ui_alive == 0) {
u.u_error = ENXIO;
return;
@@
-345,13
+347,11
@@
loop:
if (bp == &ctmbuf[unit]) {
if (bp->b_command == TM_SENSE)
goto next;
if (bp == &ctmbuf[unit]) {
if (bp->b_command == TM_SENSE)
goto next;
- cmd |= bp->b_command;
um->um_tab.b_active =
bp->b_command == TM_REW ? SREW : SCOM;
if (bp->b_command == TM_SFORW || bp->b_command == TM_SREV)
addr->tmbc = bp->b_repcnt;
um->um_tab.b_active =
bp->b_command == TM_REW ? SREW : SCOM;
if (bp->b_command == TM_SFORW || bp->b_command == TM_SREV)
addr->tmbc = bp->b_repcnt;
- addr->tmcs = cmd;
- return;
+ goto dobpcmd;
}
/*
* If the data transfer command is in the correct place,
}
/*
* If the data transfer command is in the correct place,
@@
-370,6
+370,12
@@
loop:
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++;
+*/
+ sc->sc_lastcmd = TM_RCOM; /* will serve */
ubago(ui);
return;
}
ubago(ui);
return;
}
@@
-379,13
+385,20
@@
loop:
*/
um->um_tab.b_active = SSEEK;
if (blkno < dbtofsb(bp->b_blkno)) {
*/
um->um_tab.b_active = SSEEK;
if (blkno < dbtofsb(bp->b_blkno)) {
-
cmd |
= TM_SFORW;
+
bp->b_command
= TM_SFORW;
addr->tmbc = blkno - dbtofsb(bp->b_blkno);
} else {
addr->tmbc = blkno - dbtofsb(bp->b_blkno);
} else {
-
cmd |
= TM_SREV;
+
bp->b_command
= TM_SREV;
addr->tmbc = dbtofsb(bp->b_blkno) - blkno;
}
addr->tmbc = dbtofsb(bp->b_blkno) - blkno;
}
- addr->tmcs = cmd;
+dobpcmd:
+/*
+ if (tmreverseop(sc->sc_lastcmd) != tmreverseop(bp->b_command))
+ while (addr->tmer & TM_SDWN)
+ tmgapsdcnt++;
+*/
+ sc->sc_lastcmd = bp->b_command;
+ addr->tmcs = (cmd | bp->b_command);
return;
next:
return;
next:
@@
-420,13
+433,13
@@
tmdgo(um)
* Tm interrupt routine.
*/
/*ARGSUSED*/
* Tm interrupt routine.
*/
/*ARGSUSED*/
-tmintr(tm
03
)
- int tm
03
;
+tmintr(tm
11
)
+ int tm
11
;
{
struct buf *dp;
register struct buf *bp;
{
struct buf *dp;
register struct buf *bp;
- register struct uba_minfo *um = tmminfo[tm
03
];
- register struct device *addr = (struct device *)tmdinfo[tm
03
]->ui_addr;
+ register struct uba_minfo *um = tmminfo[tm
11
];
+ register struct device *addr = (struct device *)tmdinfo[tm
11
]->ui_addr;
register struct tm_softc *sc;
int unit;
register state;
register struct tm_softc *sc;
int unit;
register state;
@@
-505,7
+518,9
@@
tmintr(tm03)
/*
* Couldn't recover error
*/
/*
* Couldn't recover error
*/
- deverror(bp, sc->sc_erreg, sc->sc_dsreg);
+ harderr(bp);
+ printf("tm%d er %b\n", dkunit(bp),
+ sc->sc_erreg, TMEREG_BITS);
bp->b_flags |= B_ERROR;
goto opdone;
}
bp->b_flags |= B_ERROR;
goto opdone;
}
@@
-642,12
+657,12
@@
tmreset(uban)
{
int printed = 0;
register struct uba_minfo *um;
{
int printed = 0;
register struct uba_minfo *um;
- register tm
03
, unit;
+ register tm
11
, unit;
register struct uba_dinfo *ui;
register struct buf *dp;
register struct uba_dinfo *ui;
register struct buf *dp;
- for (tm
03 = 0; tm03 < NTM03; tm03
++) {
- if ((um = tmminfo[tm
03
]) == 0 || um->um_alive == 0 ||
+ for (tm
11 = 0; tm11 < NTM; tm11
++) {
+ if ((um = tmminfo[tm
11
]) == 0 || um->um_alive == 0 ||
um->um_ubanum != uban)
continue;
if (printed == 0) {
um->um_ubanum != uban)
continue;
if (printed == 0) {
@@
-662,7
+677,7
@@
tmreset(uban)
ubadone(um);
}
((struct device *)(um->um_addr))->tmcs = TM_DCLR;
ubadone(um);
}
((struct device *)(um->um_addr))->tmcs = TM_DCLR;
- for (unit = 0; unit < NT
M11
; unit++) {
+ for (unit = 0; unit < NT
E
; unit++) {
if ((ui = tmdinfo[unit]) == 0)
continue;
if (ui->ui_alive == 0)
if ((ui = tmdinfo[unit]) == 0)
continue;
if (ui->ui_alive == 0)