1*23221Smckusick /* 2*23221Smckusick * Copyright (c) 1982 Regents of the University of California. 3*23221Smckusick * All rights reserved. The Berkeley software License Agreement 4*23221Smckusick * specifies the terms and conditions for redistribution. 5*23221Smckusick * 6*23221Smckusick * @(#)conf.c 6.2 (Berkeley) 06/08/85 7*23221Smckusick */ 8318Sbill 99803Ssam #include "../machine/pte.h" 109803Ssam 11318Sbill #include "../h/param.h" 12318Sbill #include "../h/inode.h" 137444Sroot #include "../h/fs.h" 149186Ssam 159186Ssam #include "../vaxmba/mbareg.h" 169186Ssam 17318Sbill #include "saio.h" 18318Sbill 19318Sbill devread(io) 203261Swnj register struct iob *io; 21318Sbill { 2211082Ssam int cc; 23318Sbill 2410022Ssam io->i_flgs |= F_RDDATA; 2511082Ssam io->i_error = 0; 2611082Ssam cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ); 2710022Ssam io->i_flgs &= ~F_TYPEMASK; 2811082Ssam return (cc); 29318Sbill } 30318Sbill 31318Sbill devwrite(io) 323261Swnj register struct iob *io; 33318Sbill { 3411082Ssam int cc; 353261Swnj 3610022Ssam io->i_flgs |= F_WRDATA; 3711082Ssam io->i_error = 0; 3811082Ssam cc = (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE); 3910022Ssam io->i_flgs &= ~F_TYPEMASK; 4011082Ssam return (cc); 41318Sbill } 42318Sbill 43318Sbill devopen(io) 443261Swnj register struct iob *io; 45318Sbill { 463261Swnj 47318Sbill (*devsw[io->i_ino.i_dev].dv_open)(io); 48318Sbill } 49318Sbill 50318Sbill devclose(io) 513261Swnj register struct iob *io; 52318Sbill { 533261Swnj 54318Sbill (*devsw[io->i_ino.i_dev].dv_close)(io); 55318Sbill } 56318Sbill 5710022Ssam devioctl(io, cmd, arg) 5810022Ssam register struct iob *io; 5910022Ssam int cmd; 6010022Ssam caddr_t arg; 613261Swnj { 62318Sbill 6310022Ssam return ((*devsw[io->i_ino.i_dev].dv_ioctl)(io, cmd, arg)); 6410022Ssam } 6510022Ssam 6610022Ssam /*ARGSUSED*/ 6710022Ssam nullsys(io) 6810022Ssam struct iob *io; 6910022Ssam { 7010022Ssam 713261Swnj ; 723261Swnj } 733261Swnj 7410022Ssam /*ARGSUSED*/ 7510022Ssam nullioctl(io, cmd, arg) 7610022Ssam struct iob *io; 7710022Ssam int cmd; 7810022Ssam caddr_t arg; 7910022Ssam { 8010022Ssam 8110022Ssam return (ECMD); 8210022Ssam } 8310022Ssam 8410022Ssam int nullsys(), nullioctl(); 856970Ssam #if defined(VAX780) || defined(VAX750) 8610022Ssam int hpstrategy(), hpopen(), hpioctl(); 876970Ssam #endif 8813812Ssam #if defined(VAX780) || defined(VAX750) 8910022Ssam int upstrategy(), upopen(), upioctl(); 9013812Ssam #endif 9110022Ssam int rkstrategy(), rkopen(), rkioctl(); 9211111Ssam int rastrategy(), raopen(), raioctl(); 9313812Ssam #if defined(VAX730) 9410022Ssam int idcstrategy(), idcopen(), idcioctl(); 9513812Ssam #endif 9611111Ssam int rlstrategy(), rlopen(), rlioctl(); 977277Swnj #ifndef BOOT 981812Sbill int tmstrategy(), tmopen(), tmclose(); 993261Swnj int tsstrategy(), tsopen(), tsclose(); 1006970Ssam #if defined(VAX780) || defined(VAX750) 1017277Swnj int htstrategy(), htopen(), htclose(); 1024868Sroot int mtstrategy(), mtopen(), mtclose(); 1036970Ssam #endif 1045156Ssam int utstrategy(), utopen(), utclose(); 1057277Swnj #endif 106318Sbill 107318Sbill struct devsw devsw[] = { 1086970Ssam #if defined(VAX780) || defined(VAX750) 10910022Ssam { "hp", hpstrategy, hpopen, nullsys, hpioctl }, 1106970Ssam #endif 11113812Ssam #if defined(VAX780) || defined(VAX750) 11210022Ssam { "up", upstrategy, upopen, nullsys, upioctl }, 11313812Ssam #endif 11410022Ssam { "hk", rkstrategy, rkopen, nullsys, rkioctl }, 11511111Ssam { "ra", rastrategy, raopen, nullsys, raioctl }, 11610022Ssam #if defined(VAX730) 11710022Ssam { "rb", idcstrategy, idcopen, nullsys, idcioctl }, 11810022Ssam #endif 11911111Ssam { "rl", rlstrategy, rlopen, nullsys, rlioctl }, 1207277Swnj #ifndef BOOT 12110022Ssam { "ts", tsstrategy, tsopen, tsclose, nullioctl }, 1226970Ssam #if defined(VAX780) || defined(VAX750) 12310022Ssam { "ht", htstrategy, htopen, htclose, nullioctl }, 12410022Ssam { "mt", mtstrategy, mtopen, mtclose, nullioctl }, 1256970Ssam #endif 12610022Ssam { "tm", tmstrategy, tmopen, tmclose, nullioctl }, 12710022Ssam { "ut", utstrategy, utopen, utclose, nullioctl }, 1287277Swnj #endif 12910022Ssam { 0, 0, 0, 0, 0 }, 130318Sbill }; 131