diff options
| author | christos <christos@NetBSD.org> | 2014-12-31 19:52:04 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2014-12-31 19:52:04 +0000 |
| commit | 4a331aac448bc6ebd006fa2ea80af68f57c666eb (patch) | |
| tree | a61e69370e02aa55f74db2134eb4c32a0ce55868 /sys/dev/vme/xd.c | |
| parent | 7e0dbe4aff861a57f08f15f13b40808d8bd26a6f (diff) | |
make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
Diffstat (limited to 'sys/dev/vme/xd.c')
| -rw-r--r-- | sys/dev/vme/xd.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/sys/dev/vme/xd.c b/sys/dev/vme/xd.c index b2a346a151d..2cf83111ad9 100644 --- a/sys/dev/vme/xd.c +++ b/sys/dev/vme/xd.c @@ -1,4 +1,4 @@ -/* $NetBSD: xd.c,v 1.93 2014/07/25 08:10:39 dholland Exp $ */ +/* $NetBSD: xd.c,v 1.94 2014/12/31 19:52:06 christos Exp $ */ /* * Copyright (c) 1995 Charles D. Cranor @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.93 2014/07/25 08:10:39 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.94 2014/12/31 19:52:06 christos Exp $"); #undef XDC_DEBUG /* full debug */ #define XDC_DIAG /* extra sanity checks */ @@ -1034,6 +1034,10 @@ xdioctl(dev_t dev, u_long command, void *addr, int flag, struct lwp *l) if ((xd = device_lookup_private(&xd_cd, unit)) == NULL) return (ENXIO); + error = disk_ioctl(&xd->sc_dk, dev, command, addr, flag, l); + if (error != EPASSTHROUGH) + return error; + /* switch on ioctl type */ switch (command) { @@ -1045,24 +1049,6 @@ xdioctl(dev_t dev, u_long command, void *addr, int flag, struct lwp *l) splx(s); return 0; - case DIOCGDINFO: /* get disk label */ - memcpy(addr, xd->sc_dk.dk_label, sizeof(struct disklabel)); - return 0; -#ifdef __HAVE_OLD_DISKLABEL - case ODIOCGDINFO: - newlabel = *(xd->sc_dk.dk_label); - if (newlabel.d_npartitions > OLDMAXPARTITIONS) - return ENOTTY; - memcpy(addr, &newlabel, sizeof (struct olddisklabel)); - return 0; -#endif - - case DIOCGPART: /* get partition info */ - ((struct partinfo *) addr)->disklab = xd->sc_dk.dk_label; - ((struct partinfo *) addr)->part = - &xd->sc_dk.dk_label->d_partitions[DISKPART(dev)]; - return 0; - case DIOCSDINFO: /* set disk label */ #ifdef __HAVE_OLD_DISKLABEL case ODIOCSDINFO: |
