conservative fix for increasing FIN
[unix-history] / usr / src / sys / vax / stand / upmaptype.c
CommitLineData
da7c5cc6
KM
1/*
2 * Copyright (c) 1982 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
6 * @(#)upmaptype.c 6.3 (Berkeley) %G%
7 */
3663fec8
SL
8
9/*
10 * UNIBUS peripheral standalone
11 * driver: drive type mapping routine.
12 */
13
14#include "../h/param.h"
15#include "../h/inode.h"
16#include "../h/fs.h"
17#include "../h/dkbad.h"
18#include "../h/vmmac.h"
19
20#include "../vax/pte.h"
21#include "../vaxuba/upreg.h"
22#include "../vaxuba/ubareg.h"
23
24#include "saio.h"
25#include "savax.h"
26
7249a989
JB
27static short up9300_off[] = { 0, 27, 0, -1, -1, -1, 562, 82 };
28static short fj_off[] = { 0, 50, 0, -1, -1, -1, 155, -1 };
29static short upam_off[] = { 0, 32, 0, 668, 723, 778, 668, 98 };
30static short up980_off[] = { 0, 100, 0, -1, -1 , -1, 309, -1};
31static short eagle_off[8] = { 0, 17, 0, 391, 408, 728, 391, 87 };
3663fec8
SL
32
33struct st upst[] = {
34 32, 19, 32*19, 815, up9300_off, /* 9300 */
f7ca52be 35 32, 19, 32*19, 823, up9300_off, /* 9766 */
3663fec8
SL
36 32, 10, 32*10, 823, fj_off, /* Fuji 160 */
37 32, 16, 32*16, 1024, upam_off, /* Capricorn */
9ed60318 38 32, 5, 32*5, 823, up980_off, /* DM980 */
7249a989 39 48, 20, 48*20, 842, eagle_off, /* Fuji Eagle */
3663fec8
SL
40 0, 0, 0, 0, 0,
41};
42
43upmaptype(unit, upaddr)
44 int unit;
45 register struct updevice *upaddr;
46{
47 register struct st *st;
48 int type = -1;
49
50 upaddr->upcs1 = 0;
51 upaddr->upcs2 = unit % 8;
52 upaddr->uphr = UPHR_MAXTRAK;
53 for (st = upst; st->ntrak != 0; st++)
54 if (upaddr->uphr == st->ntrak - 1) {
e72af119 55 type = st - upst;
3663fec8
SL
56 break;
57 }
58 if (st->ntrak == 0)
59 printf("up%d: uphr=%x\n", unit, upaddr->uphr);
60 if (type == 0) {
61 upaddr->uphr = UPHR_MAXCYL;
62 if (upaddr->uphr == 822) /* CDC 9766 */
63 type++;
64 }
65 upaddr->upcs2 = UPCS2_CLR;
66 return (type);
67}