X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/1de703daf67320d643c7695d9bf7ec54c33d5512..493a57ec6180f904693c365e094a29a6ff6b9a99:/sys/dev/disk/ata/atapi-tape.c diff --git a/sys/dev/disk/ata/atapi-tape.c b/sys/dev/disk/ata/atapi-tape.c index e6eb455d94..ce0efbf853 100644 --- a/sys/dev/disk/ata/atapi-tape.c +++ b/sys/dev/disk/ata/atapi-tape.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.36.2.12 2002/07/31 11:19:26 sos Exp $ - * $DragonFly: src/sys/dev/disk/ata/atapi-tape.c,v 1.2 2003/06/17 04:28:22 dillon Exp $ + * $DragonFly: src/sys/dev/disk/ata/atapi-tape.c,v 1.9 2004/02/18 01:35:59 dillon Exp $ */ #include "opt_ata.h" @@ -41,16 +41,26 @@ #include #include #include -#include -#include -#include +#include +#include +#include +#include "ata-all.h" +#include "atapi-all.h" +#include "atapi-tape.h" /* device structures */ static d_open_t astopen; static d_close_t astclose; static d_ioctl_t astioctl; static d_strategy_t aststrategy; + static struct cdevsw ast_cdevsw = { + /* name */ "ast", + /* maj */ 119, + /* flags */ D_TAPE | D_TRACKCLOSE, + /* port */ NULL, + /* autoq */ 0, + /* open */ astopen, /* close */ astclose, /* read */ physread, @@ -59,11 +69,8 @@ static struct cdevsw ast_cdevsw = { /* poll */ nopoll, /* mmap */ nommap, /* strategy */ aststrategy, - /* name */ "ast", - /* maj */ 119, /* dump */ nodump, - /* psize */ nopsize, - /* flags */ D_TAPE | D_TRACKCLOSE, + /* psize */ nopsize }; /* prototypes */ @@ -93,7 +100,7 @@ astattach(struct ata_device *atadev) struct ast_readposition position; dev_t dev; - stp = malloc(sizeof(struct ast_softc), M_AST, M_NOWAIT | M_ZERO); + stp = malloc(sizeof(struct ast_softc), M_AST, M_WAITOK | M_ZERO); if (!stp) { ata_prtdev(atadev, "out of memory\n"); return 0; @@ -246,7 +253,7 @@ ast_describe(struct ast_softc *stp) } static int -astopen(dev_t dev, int flags, int fmt, struct proc *p) +astopen(dev_t dev, int flags, int fmt, struct thread *td) { struct ast_softc *stp = dev->si_drv1; @@ -271,7 +278,7 @@ astopen(dev_t dev, int flags, int fmt, struct proc *p) } static int -astclose(dev_t dev, int flags, int fmt, struct proc *p) +astclose(dev_t dev, int flags, int fmt, struct thread *td) { struct ast_softc *stp = dev->si_drv1; @@ -299,7 +306,7 @@ astclose(dev_t dev, int flags, int fmt, struct proc *p) } static int -astioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) +astioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { struct ast_softc *stp = dev->si_drv1; int error = 0; @@ -627,7 +634,7 @@ ast_load_unload(struct ast_softc *stp, u_int8_t function) error = atapi_queue_cmd(stp->device, ccb, NULL, 0, 0, 10, NULL, NULL); if (error) return error; - tsleep((caddr_t)&error, PRIBIO, "astlu", 1 * hz); + tsleep((caddr_t)&error, 0, "astlu", 1 * hz); if (function == SS_EJECT) return 0; return atapi_wait_dsc(stp->device, 60*60);