summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-16 09:47:26 +0000
committerphk <phk@FreeBSD.org>2004-06-16 09:47:26 +0000
commitdfd1f7fd50fffaf75541921fcf86454cd8eb3614 (patch)
tree624c885995e84df6decddd3291c60a15e50e3c85 /sys
parentcafb94bcea1cdf048e81b7eb2d24808e1a8c5280 (diff)
downloadFreeBSD-src-dfd1f7fd50fffaf75541921fcf86454cd8eb3614.zip
FreeBSD-src-dfd1f7fd50fffaf75541921fcf86454cd8eb3614.tar.gz
Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/alpha/mem.c14
-rw-r--r--sys/alpha/alpha/promcons.c4
-rw-r--r--sys/alpha/include/cpu.h2
-rw-r--r--sys/alpha/tlsb/zs_tlsb.c4
-rw-r--r--sys/amd64/amd64/mem.c12
-rw-r--r--sys/amd64/include/cpu.h2
-rw-r--r--sys/arm/arm/nexus_io.c2
-rw-r--r--sys/arm/include/bus.h4
-rw-r--r--sys/arm/sa11x0/sa11x0_io.c2
-rw-r--r--sys/boot/i386/libi386/bioscd.c4
-rw-r--r--sys/boot/i386/libi386/biosdisk.c2
-rw-r--r--sys/boot/i386/libi386/libi386.h4
-rw-r--r--sys/boot/pc98/boot2/dinode.h2
-rw-r--r--sys/boot/pc98/boot2/inode.h2
-rw-r--r--sys/boot/pc98/libpc98/biosdisk.c2
-rw-r--r--sys/cam/cam_xpt.c6
-rw-r--r--sys/cam/scsi/scsi_ch.c8
-rw-r--r--sys/cam/scsi/scsi_pass.c8
-rw-r--r--sys/cam/scsi/scsi_pt.c8
-rw-r--r--sys/cam/scsi/scsi_sa.c20
-rw-r--r--sys/cam/scsi/scsi_ses.c8
-rw-r--r--sys/cam/scsi/scsi_target.c18
-rw-r--r--sys/coda/cnode.h6
-rw-r--r--sys/coda/coda.h2
-rw-r--r--sys/coda/coda_fbsd.c4
-rw-r--r--sys/coda/coda_psdev.c12
-rw-r--r--sys/coda/coda_psdev.h12
-rw-r--r--sys/coda/coda_venus.c2
-rw-r--r--sys/coda/coda_venus.h2
-rw-r--r--sys/coda/coda_vfsops.c6
-rw-r--r--sys/coda/coda_vnops.c4
-rw-r--r--sys/coda/coda_vnops.h2
-rw-r--r--sys/compat/linux/linux_stats.c12
-rw-r--r--sys/contrib/dev/fla/fla.c2
-rw-r--r--sys/contrib/ipfilter/netinet/ip_fil.c10
-rw-r--r--sys/contrib/ipfilter/netinet/ip_fil.h8
-rw-r--r--sys/contrib/ipfilter/netinet/mlfk_ipl.c2
-rw-r--r--sys/contrib/pf/net/pf_ioctl.c18
-rw-r--r--sys/dev/aac/aac.c8
-rw-r--r--sys/dev/aac/aacvar.h2
-rw-r--r--sys/dev/acpi_support/acpi_asus.c6
-rw-r--r--sys/dev/acpica/acpi.c6
-rw-r--r--sys/dev/acpica/acpivar.h2
-rw-r--r--sys/dev/adlink/adlink.c8
-rw-r--r--sys/dev/agp/agp.c8
-rw-r--r--sys/dev/agp/agppriv.h2
-rw-r--r--sys/dev/amr/amr.c8
-rw-r--r--sys/dev/amr/amrvar.h2
-rw-r--r--sys/dev/asr/asr.c14
-rw-r--r--sys/dev/ata/ata-all.c2
-rw-r--r--sys/dev/ata/atapi-tape.c8
-rw-r--r--sys/dev/ata/atapi-tape.h2
-rw-r--r--sys/dev/atkbdc/psm.c14
-rw-r--r--sys/dev/bktr/bktr_core.c2
-rw-r--r--sys/dev/bktr/bktr_core.h2
-rw-r--r--sys/dev/bktr/bktr_os.c14
-rw-r--r--sys/dev/bktr/bktr_reg.h12
-rw-r--r--sys/dev/ciss/ciss.c6
-rw-r--r--sys/dev/ciss/cissvar.h2
-rw-r--r--sys/dev/cp/if_cp.c10
-rw-r--r--sys/dev/ctau/if_ct.c10
-rw-r--r--sys/dev/cx/if_cx.c14
-rw-r--r--sys/dev/cy/cy.c8
-rw-r--r--sys/dev/dcons/dcons.c12
-rw-r--r--sys/dev/digi/digi.c10
-rw-r--r--sys/dev/digi/digi.h4
-rw-r--r--sys/dev/drm/drmP.h2
-rw-r--r--sys/dev/drm/drm_drv.h6
-rw-r--r--sys/dev/drm/drm_fops.h6
-rw-r--r--sys/dev/drm/drm_os_freebsd.h4
-rw-r--r--sys/dev/drm/drm_vm.h4
-rw-r--r--sys/dev/fb/creatorreg.h2
-rw-r--r--sys/dev/fb/gfb.h2
-rw-r--r--sys/dev/fb/vga.c12
-rw-r--r--sys/dev/fb/vgareg.h12
-rw-r--r--sys/dev/fdc/fdc.c16
-rw-r--r--sys/dev/firewire/firewirereg.h6
-rw-r--r--sys/dev/firewire/fwdev.c22
-rw-r--r--sys/dev/firewire/fwmem.c14
-rw-r--r--sys/dev/firewire/fwohci.c2
-rw-r--r--sys/dev/gfb/gfb_pci.c12
-rw-r--r--sys/dev/ida/ida.c2
-rw-r--r--sys/dev/ida/idavar.h2
-rw-r--r--sys/dev/iicbus/iic.c12
-rw-r--r--sys/dev/iir/iir.h6
-rw-r--r--sys/dev/iir/iir_ctrl.c16
-rw-r--r--sys/dev/ips/ips.c6
-rw-r--r--sys/dev/ips/ips.h2
-rw-r--r--sys/dev/isp/isp_freebsd.c2
-rw-r--r--sys/dev/joy/joy.c8
-rw-r--r--sys/dev/joy/joyvar.h2
-rw-r--r--sys/dev/kbd/kbd.c12
-rw-r--r--sys/dev/kbd/kbdreg.h2
-rw-r--r--sys/dev/led/led.c8
-rw-r--r--sys/dev/led/led.h4
-rw-r--r--sys/dev/matcd/matcd.c18
-rw-r--r--sys/dev/matcd/matcd_data.h2
-rw-r--r--sys/dev/mcd/mcd.c10
-rw-r--r--sys/dev/mcd/mcdvar.h2
-rw-r--r--sys/dev/md/md.c6
-rw-r--r--sys/dev/mlx/mlx.c8
-rw-r--r--sys/dev/mlx/mlxvar.h2
-rw-r--r--sys/dev/mly/mly.c6
-rw-r--r--sys/dev/mly/mlyvar.h2
-rw-r--r--sys/dev/mse/mse.c18
-rw-r--r--sys/dev/nmdm/nmdm.c16
-rw-r--r--sys/dev/null/null.c10
-rw-r--r--sys/dev/ofw/ofw_console.c6
-rw-r--r--sys/dev/ofw/openfirmio.c4
-rw-r--r--sys/dev/ofw/openpromio.c8
-rw-r--r--sys/dev/pci/pci.c2
-rw-r--r--sys/dev/pci/pci_user.c6
-rw-r--r--sys/dev/ppbus/lpt.c10
-rw-r--r--sys/dev/ppbus/pcfclock.c14
-rw-r--r--sys/dev/ppbus/ppi.c10
-rw-r--r--sys/dev/ppbus/pps.c10
-rw-r--r--sys/dev/random/randomdev.c12
-rw-r--r--sys/dev/rc/rc.c12
-rw-r--r--sys/dev/rp/rp.c10
-rw-r--r--sys/dev/rp/rpreg.h2
-rw-r--r--sys/dev/sab/sab.c8
-rw-r--r--sys/dev/scd/scd.c6
-rw-r--r--sys/dev/scd/scdvar.h2
-rw-r--r--sys/dev/si/si.c12
-rw-r--r--sys/dev/sio/sio.c12
-rw-r--r--sys/dev/smbus/smb.c8
-rw-r--r--sys/dev/snp/snp.c24
-rw-r--r--sys/dev/sound/pcm/dsp.c30
-rw-r--r--sys/dev/sound/pcm/mixer.c22
-rw-r--r--sys/dev/sound/pcm/mixer.h2
-rw-r--r--sys/dev/sound/pcm/sndstat.c8
-rw-r--r--sys/dev/sound/pcm/sound.h10
-rw-r--r--sys/dev/speaker/spkr.c10
-rw-r--r--sys/dev/streams/streams.c6
-rw-r--r--sys/dev/sx/sx.c8
-rw-r--r--sys/dev/syscons/scvesactl.c2
-rw-r--r--sys/dev/syscons/syscons.c26
-rw-r--r--sys/dev/syscons/syscons.h4
-rw-r--r--sys/dev/syscons/sysmouse.c8
-rw-r--r--sys/dev/tdfx/tdfx_pci.c8
-rw-r--r--sys/dev/tdfx/tdfx_vars.h2
-rw-r--r--sys/dev/ti/if_ti.c6
-rw-r--r--sys/dev/ti/if_tireg.h2
-rw-r--r--sys/dev/twa/twa.h2
-rw-r--r--sys/dev/twa/twa_freebsd.c8
-rw-r--r--sys/dev/twe/twe_compat.h2
-rw-r--r--sys/dev/twe/twe_freebsd.c8
-rw-r--r--sys/dev/uart/uart_bus.h2
-rw-r--r--sys/dev/uart/uart_tty.c6
-rw-r--r--sys/dev/usb/ubser.c12
-rw-r--r--sys/dev/usb/ucom.c10
-rw-r--r--sys/dev/usb/ucomvar.h2
-rw-r--r--sys/dev/usb/ufm.c8
-rw-r--r--sys/dev/usb/ugen.c20
-rw-r--r--sys/dev/usb/uhid.c14
-rw-r--r--sys/dev/usb/ulpt.c12
-rw-r--r--sys/dev/usb/ums.c12
-rw-r--r--sys/dev/usb/urio.c14
-rw-r--r--sys/dev/usb/usb.c10
-rw-r--r--sys/dev/usb/uscanner.c12
-rw-r--r--sys/dev/vinum/vinum.c12
-rw-r--r--sys/dev/vinum/vinumext.h10
-rw-r--r--sys/dev/vinum/vinumioctl.c4
-rw-r--r--sys/dev/vinum/vinumobj.h8
-rw-r--r--sys/dev/vinum/vinumutil.c11
-rw-r--r--sys/dev/watchdog/watchdog.c4
-rw-r--r--sys/dev/zs/z8530var.h2
-rw-r--r--sys/dev/zs/zs.c6
-rw-r--r--sys/fs/cd9660/cd9660_node.c2
-rw-r--r--sys/fs/cd9660/cd9660_node.h2
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c8
-rw-r--r--sys/fs/cd9660/iso.h2
-rw-r--r--sys/fs/coda/cnode.h6
-rw-r--r--sys/fs/coda/coda.h2
-rw-r--r--sys/fs/coda/coda_fbsd.c4
-rw-r--r--sys/fs/coda/coda_psdev.c12
-rw-r--r--sys/fs/coda/coda_psdev.h12
-rw-r--r--sys/fs/coda/coda_venus.c2
-rw-r--r--sys/fs/coda/coda_venus.h2
-rw-r--r--sys/fs/coda/coda_vfsops.c6
-rw-r--r--sys/fs/coda/coda_vnops.c4
-rw-r--r--sys/fs/coda/coda_vnops.h2
-rw-r--r--sys/fs/devfs/devfs.h2
-rw-r--r--sys/fs/devfs/devfs_devs.c22
-rw-r--r--sys/fs/devfs/devfs_rule.c20
-rw-r--r--sys/fs/devfs/devfs_vnops.c6
-rw-r--r--sys/fs/hpfs/hpfs.h10
-rw-r--r--sys/fs/hpfs/hpfs_hash.c6
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c2
-rw-r--r--sys/fs/msdosfs/msdosfs_denode.c6
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c2
-rw-r--r--sys/fs/msdosfs/msdosfsmount.h2
-rw-r--r--sys/fs/ntfs/ntfs.h2
-rw-r--r--sys/fs/ntfs/ntfs_ihash.c2
-rw-r--r--sys/fs/ntfs/ntfs_ihash.h4
-rw-r--r--sys/fs/ntfs/ntfs_inode.h2
-rw-r--r--sys/fs/ntfs/ntfs_vfsops.c2
-rw-r--r--sys/fs/specfs/spec_vnops.c26
-rw-r--r--sys/fs/udf/udf.h4
-rw-r--r--sys/geom/gate/g_gate.c4
-rw-r--r--sys/geom/geom.h3
-rw-r--r--sys/geom/geom_ctl.c4
-rw-r--r--sys/geom/geom_dev.c20
-rw-r--r--sys/gnu/ext2fs/ext2_extern.h4
-rw-r--r--sys/gnu/ext2fs/ext2_ihash.c4
-rw-r--r--sys/gnu/ext2fs/ext2_mount.h2
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c8
-rw-r--r--sys/gnu/ext2fs/inode.h4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_extern.h4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_mount.h2
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c8
-rw-r--r--sys/gnu/fs/ext2fs/inode.h4
-rw-r--r--sys/i386/acpica/acpi_asus.c6
-rw-r--r--sys/i386/acpica/acpi_machdep.c10
-rw-r--r--sys/i386/bios/apm.c10
-rw-r--r--sys/i386/bios/smapi.c4
-rw-r--r--sys/i386/i386/elan-mmcr.c6
-rw-r--r--sys/i386/i386/geode.c2
-rw-r--r--sys/i386/i386/machdep.c4
-rw-r--r--sys/i386/i386/mem.c12
-rw-r--r--sys/i386/i386/perfmon.c6
-rw-r--r--sys/i386/include/cpu.h2
-rw-r--r--sys/i386/isa/mse.c18
-rw-r--r--sys/i386/isa/pcvt/pcvt_drv.c8
-rw-r--r--sys/i386/isa/pcvt/pcvt_ext.c2
-rw-r--r--sys/i386/isa/pcvt/pcvt_hdr.h6
-rw-r--r--sys/i386/isa/pcvt/pcvt_kbd.c2
-rw-r--r--sys/i386/isa/pcvt/pcvt_sup.c18
-rw-r--r--sys/i386/isa/spic.c10
-rw-r--r--sys/i386/isa/spkr.c10
-rw-r--r--sys/i4b/driver/i4b_ctl.c8
-rw-r--r--sys/i4b/driver/i4b_rbch.c12
-rw-r--r--sys/i4b/driver/i4b_tel.c12
-rw-r--r--sys/i4b/driver/i4b_trace.c10
-rw-r--r--sys/i4b/layer4/i4b_i4bdrv.c10
-rw-r--r--sys/ia64/ia64/mem.c14
-rw-r--r--sys/ia64/ia64/ssc.c4
-rw-r--r--sys/ia64/ia64/sscdisk.c2
-rw-r--r--sys/ia64/include/cpu.h2
-rw-r--r--sys/isa/psm.c14
-rw-r--r--sys/isa/vga_isa.c12
-rw-r--r--sys/isofs/cd9660/cd9660_node.c2
-rw-r--r--sys/isofs/cd9660/cd9660_node.h2
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c8
-rw-r--r--sys/isofs/cd9660/iso.h2
-rw-r--r--sys/kern/kern_conf.c76
-rw-r--r--sys/kern/kern_descrip.c4
-rw-r--r--sys/kern/kern_physio.c2
-rw-r--r--sys/kern/subr_bus.c12
-rw-r--r--sys/kern/subr_devstat.c2
-rw-r--r--sys/kern/subr_log.c10
-rw-r--r--sys/kern/tty.c22
-rw-r--r--sys/kern/tty_conf.c2
-rw-r--r--sys/kern/tty_cons.c18
-rw-r--r--sys/kern/tty_pty.c32
-rw-r--r--sys/kern/tty_tty.c6
-rw-r--r--sys/kern/vfs_bio.c2
-rw-r--r--sys/kern/vfs_mount.c16
-rw-r--r--sys/kern/vfs_subr.c24
-rw-r--r--sys/net/bpf.c18
-rw-r--r--sys/net/if.c8
-rw-r--r--sys/net/if_sl.c4
-rw-r--r--sys/net/if_tap.c20
-rw-r--r--sys/net/if_tapvar.h2
-rw-r--r--sys/net/if_tun.c26
-rw-r--r--sys/net/if_var.h2
-rw-r--r--sys/net/ppp_tty.c4
-rw-r--r--sys/netgraph/bluetooth/drivers/h4/ng_h4.c4
-rw-r--r--sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c12
-rw-r--r--sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h6
-rw-r--r--sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c18
-rw-r--r--sys/netgraph/ng_device.c14
-rw-r--r--sys/netgraph/ng_tty.c4
-rw-r--r--sys/netncp/ncp_mod.c4
-rw-r--r--sys/netsmb/smb_dev.c10
-rw-r--r--sys/nfs4client/nfs4_dev.c10
-rw-r--r--sys/opencrypto/cryptodev.c10
-rw-r--r--sys/pc98/cbus/fdc.c16
-rw-r--r--sys/pc98/cbus/gdc.c12
-rw-r--r--sys/pc98/cbus/olpt.c8
-rw-r--r--sys/pc98/cbus/sio.c24
-rw-r--r--sys/pc98/i386/machdep.c4
-rw-r--r--sys/pc98/pc98/fd.c16
-rw-r--r--sys/pc98/pc98/machdep.c4
-rw-r--r--sys/pc98/pc98/mse.c18
-rw-r--r--sys/pc98/pc98/olpt.c8
-rw-r--r--sys/pc98/pc98/pc98gdc.c12
-rw-r--r--sys/pc98/pc98/sio.c24
-rw-r--r--sys/pc98/pc98/wd_cd.c8
-rw-r--r--sys/pccard/pccard.c12
-rw-r--r--sys/pccard/slot.h2
-rw-r--r--sys/pci/agp.c8
-rw-r--r--sys/pci/agppriv.h2
-rw-r--r--sys/pci/if_ti.c6
-rw-r--r--sys/pci/if_tireg.h2
-rw-r--r--sys/pci/xrpu.c8
-rw-r--r--sys/powerpc/ofw/ofw_syscons.h2
-rw-r--r--sys/security/mac/mac_framework.h3
-rw-r--r--sys/security/mac/mac_policy.h2
-rw-r--r--sys/security/mac/mac_vfs.c2
-rw-r--r--sys/security/mac_biba/mac_biba.c2
-rw-r--r--sys/security/mac_lomac/mac_lomac.c2
-rw-r--r--sys/security/mac_mls/mac_mls.c2
-rw-r--r--sys/security/mac_stub/mac_stub.c2
-rw-r--r--sys/security/mac_test/mac_test.c2
-rw-r--r--sys/sparc64/creator/creator.h2
-rw-r--r--sys/sparc64/creator/creator_upa.c8
-rw-r--r--sys/sparc64/include/cpu.h2
-rw-r--r--sys/sparc64/sparc64/mem.c8
-rw-r--r--sys/sys/_types.h7
-rw-r--r--sys/sys/bio.h4
-rw-r--r--sys/sys/conf.h56
-rw-r--r--sys/sys/linedisc.h4
-rw-r--r--sys/sys/mac.h3
-rw-r--r--sys/sys/mac_policy.h2
-rw-r--r--sys/sys/mount.h2
-rw-r--r--sys/sys/param.h2
-rw-r--r--sys/sys/stat.h2
-rw-r--r--sys/sys/sysctl.h2
-rw-r--r--sys/sys/systm.h14
-rw-r--r--sys/sys/tty.h4
-rw-r--r--sys/sys/types.h2
-rw-r--r--sys/sys/vnode.h6
-rw-r--r--sys/ufs/ffs/ffs_alloc.c4
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c4
-rw-r--r--sys/ufs/ufs/dinode.h2
-rw-r--r--sys/ufs/ufs/ufs_extern.h4
-rw-r--r--sys/ufs/ufs/ufs_ihash.c4
-rw-r--r--sys/ufs/ufs/ufsmount.h2
-rw-r--r--sys/vm/device_pager.c4
-rw-r--r--sys/vm/swap_pager.c2
331 files changed, 1290 insertions, 1279 deletions
diff --git a/sys/alpha/alpha/mem.c b/sys/alpha/alpha/mem.c
index 4cd0bdb..a64ea2a 100644
--- a/sys/alpha/alpha/mem.c
+++ b/sys/alpha/alpha/mem.c
@@ -67,9 +67,9 @@ __FBSDID("$FreeBSD$");
#include <vm/pmap.h>
#include <vm/vm_extern.h>
-static dev_t memdev, kmemdev;
+static struct cdev *memdev, *kmemdev;
#ifdef PERFMON
-static dev_t perfdev;
+static struct cdev *perfdev;
#endif /* PERFMON */
static d_open_t mmopen;
@@ -95,7 +95,7 @@ static struct cdevsw mem_cdevsw = {
struct mem_range_softc mem_range_softc;
static int
-mmclose(dev_t dev, int flags, int fmt, struct thread *td)
+mmclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
switch (minor(dev)) {
#ifdef PERFMON
@@ -109,7 +109,7 @@ mmclose(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-mmopen(dev_t dev, int flags, int fmt, struct thread *td)
+mmopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int error;
@@ -136,7 +136,7 @@ mmopen(dev_t dev, int flags, int fmt, struct thread *td)
/*ARGSUSED*/
static int
-mmrw(dev_t dev, struct uio *uio, int flags)
+mmrw(struct cdev *dev, struct uio *uio, int flags)
{
vm_offset_t o, v;
int c = 0;
@@ -219,7 +219,7 @@ kmemphys:
* instead of going through read/write *
\*******************************************************/
static int
-memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
/*
* /dev/mem is the only one that makes sense through this
@@ -240,7 +240,7 @@ memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
}
static int
-mmioctl(dev_t dev, u_long cmd, caddr_t cmdarg, int flags, struct thread *td)
+mmioctl(struct cdev *dev, u_long cmd, caddr_t cmdarg, int flags, struct thread *td)
{
switch(minor(dev)) {
#ifdef PERFMON
diff --git a/sys/alpha/alpha/promcons.c b/sys/alpha/alpha/promcons.c
index 3a127ea..6ced298 100644
--- a/sys/alpha/alpha/promcons.c
+++ b/sys/alpha/alpha/promcons.c
@@ -86,7 +86,7 @@ void promcons_delayed_makedev(void);
int
promopen(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag, mode;
struct thread *td;
{
@@ -137,7 +137,7 @@ promopen(dev, flag, mode, td)
int
promclose(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag, mode;
struct thread *td;
{
diff --git a/sys/alpha/include/cpu.h b/sys/alpha/include/cpu.h
index 9db2b9a..1edf6be 100644
--- a/sys/alpha/include/cpu.h
+++ b/sys/alpha/include/cpu.h
@@ -66,7 +66,7 @@ struct clockframe {
/*
* CTL_MACHDEP definitions.
*/
-#define CPU_CONSDEV 1 /* dev_t: console terminal device */
+#define CPU_CONSDEV 1 /* struct cdev *: console terminal device */
#define CPU_ROOT_DEVICE 2 /* string: root device name */
#define CPU_UNALIGNED_PRINT 3 /* int: print unaligned accesses */
#define CPU_UNALIGNED_FIX 4 /* int: fix unaligned accesses */
diff --git a/sys/alpha/tlsb/zs_tlsb.c b/sys/alpha/tlsb/zs_tlsb.c
index 1387f97..d4504d3 100644
--- a/sys/alpha/tlsb/zs_tlsb.c
+++ b/sys/alpha/tlsb/zs_tlsb.c
@@ -258,7 +258,7 @@ zs_cnputc(struct consdev *cp, int c)
static int
-zsopen(dev_t dev, int flag, int mode, struct thread *td)
+zsopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct zs_softc *sc = ZS_SOFTC(minor(dev));
struct tty *tp;
@@ -305,7 +305,7 @@ zsopen(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-zsclose(dev_t dev, int flag, int mode, struct thread *td)
+zsclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct zs_softc *sc = ZS_SOFTC(minor(dev));
struct tty *tp;
diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c
index d4cf782..739ae6d 100644
--- a/sys/amd64/amd64/mem.c
+++ b/sys/amd64/amd64/mem.c
@@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$");
#include <vm/pmap.h>
#include <vm/vm_extern.h>
-static dev_t memdev, kmemdev, iodev;
+static struct cdev *memdev, *kmemdev, *iodev;
static d_open_t mmopen;
static d_close_t mmclose;
@@ -95,7 +95,7 @@ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
struct mem_range_softc mem_range_softc;
static int
-mmclose(dev_t dev, int flags, int fmt, struct thread *td)
+mmclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
switch (minor(dev)) {
case 14:
@@ -105,7 +105,7 @@ mmclose(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-mmopen(dev_t dev, int flags, int fmt, struct thread *td)
+mmopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int error;
@@ -133,7 +133,7 @@ mmopen(dev_t dev, int flags, int fmt, struct thread *td)
/*ARGSUSED*/
static int
-mmrw(dev_t dev, struct uio *uio, int flags)
+mmrw(struct cdev *dev, struct uio *uio, int flags)
{
int o;
u_long c = 0, v;
@@ -214,7 +214,7 @@ kmemphys:
* instead of going through read/write *
\*******************************************************/
static int
-memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
switch (minor(dev))
{
@@ -242,7 +242,7 @@ memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
* and mem_range_attr_set.
*/
static int
-mmioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+mmioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
int nd, error = 0;
struct mem_range_op *mo = (struct mem_range_op *)data;
diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h
index f8a2ee3..2aeda85 100644
--- a/sys/amd64/include/cpu.h
+++ b/sys/amd64/include/cpu.h
@@ -65,7 +65,7 @@
/*
* CTL_MACHDEP definitions.
*/
-#define CPU_CONSDEV 1 /* dev_t: console terminal device */
+#define CPU_CONSDEV 1 /* struct cdev *: console terminal device */
#define CPU_ADJKERNTZ 2 /* int: timezone offset (seconds) */
#define CPU_DISRTCSET 3 /* int: disable resettodr() call */
#define CPU_WALLCLOCK 5 /* int: indicates wall CMOS clock */
diff --git a/sys/arm/arm/nexus_io.c b/sys/arm/arm/nexus_io.c
index 0a93a75..969c30e 100644
--- a/sys/arm/arm/nexus_io.c
+++ b/sys/arm/arm/nexus_io.c
@@ -190,7 +190,7 @@ nexus_bs_subregion(t, bsh, offset, size, nbshp)
}
int
-nexus_bs_mmap(dev_t dev, vm_offset_t off, vm_paddr_t *addr, int prot)
+nexus_bs_mmap(struct cdev *dev, vm_offset_t off, vm_paddr_t *addr, int prot)
{
*addr = off;
return (0);
diff --git a/sys/arm/include/bus.h b/sys/arm/include/bus.h
index 798f425..6066050 100644
--- a/sys/arm/include/bus.h
+++ b/sys/arm/include/bus.h
@@ -118,7 +118,7 @@ struct bus_space {
void * (*bs_vaddr) (void *, bus_space_handle_t);
/* mmap bus space for user */
- int (*bs_mmap) (dev_t, vm_offset_t, vm_paddr_t *, int);
+ int (*bs_mmap) (struct cdev *, vm_offset_t, vm_paddr_t *, int);
/* barrier */
void (*bs_barrier) (void *, bus_space_handle_t,
@@ -411,7 +411,7 @@ void __bs_c(f,_bs_free) (void *t, bus_space_handle_t bsh, \
void * __bs_c(f,_bs_vaddr) (void *t, bus_space_handle_t bsh);
#define bs_mmap_proto(f) \
-int __bs_c(f,_bs_mmap) (dev_t, vm_offset_t, vm_paddr_t *, int);
+int __bs_c(f,_bs_mmap) (struct cdev *, vm_offset_t, vm_paddr_t *, int);
#define bs_barrier_proto(f) \
void __bs_c(f,_bs_barrier) (void *t, bus_space_handle_t bsh, \
diff --git a/sys/arm/sa11x0/sa11x0_io.c b/sys/arm/sa11x0/sa11x0_io.c
index 7b91d5f..0fe0375 100644
--- a/sys/arm/sa11x0/sa11x0_io.c
+++ b/sys/arm/sa11x0/sa11x0_io.c
@@ -225,7 +225,7 @@ sa11x0_bs_subregion(t, bsh, offset, size, nbshp)
}
int
-sa11x0_bs_mmap(dev_t t, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+sa11x0_bs_mmap(struct cdev *t, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
{
*paddr = offset;
return (0);
diff --git a/sys/boot/i386/libi386/bioscd.c b/sys/boot/i386/libi386/bioscd.c
index 7259ff5..ad0d409 100644
--- a/sys/boot/i386/libi386/bioscd.c
+++ b/sys/boot/i386/libi386/bioscd.c
@@ -325,7 +325,7 @@ bc_read(int unit, daddr_t dblk, int blks, caddr_t dest)
}
/*
- * Return a suitable dev_t value for (dev).
+ * Return a suitable struct cdev *value for (dev).
*/
int
bc_getdev(struct i386_devdesc *dev)
@@ -344,7 +344,7 @@ bc_getdev(struct i386_devdesc *dev)
* XXX: Need to examine device spec here to figure out if SCSI or
* ATAPI. No idea on how to figure out device number. All we can
* really pass to the kernel is what bus and device on which bus we
- * were booted from, which dev_t isn't well suited to since those
+ * were booted from, which struct cdev *isn't well suited to since those
* number don't match to unit numbers very well. We may just need
* to engage in a hack where we pass -C to the boot args if we are
* the boot device.
diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c
index aeac2e3..42906ba 100644
--- a/sys/boot/i386/libi386/biosdisk.c
+++ b/sys/boot/i386/libi386/biosdisk.c
@@ -1165,7 +1165,7 @@ bd_getbigeom(int bunit)
}
/*
- * Return a suitable dev_t value for (dev).
+ * Return a suitable struct cdev *value for (dev).
*
* In the case where it looks like (dev) is a SCSI disk, we allow the number of
* IDE disks to be specified in $num_ide_disks. There should be a Better Way.
diff --git a/sys/boot/i386/libi386/libi386.h b/sys/boot/i386/libi386/libi386.h
index f2696e0..b3feacc 100644
--- a/sys/boot/i386/libi386/libi386.h
+++ b/sys/boot/i386/libi386/libi386.h
@@ -72,13 +72,13 @@ extern struct devsw pxedisk;
extern struct fs_ops pxe_fsops;
int bc_add(int biosdev); /* Register CD booted from. */
-int bc_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */
+int bc_getdev(struct i386_devdesc *dev); /* return struct cdev *for (dev) */
int bc_bios2unit(int biosdev); /* xlate BIOS device -> bioscd unit */
int bc_unit2bios(int unit); /* xlate bioscd unit -> BIOS device */
u_int32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */
int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */
int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */
-int bd_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */
+int bd_getdev(struct i386_devdesc *dev); /* return struct cdev *for (dev) */
ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len);
ssize_t i386_copyout(const vm_offset_t src, void *dest, const size_t len);
diff --git a/sys/boot/pc98/boot2/dinode.h b/sys/boot/pc98/boot2/dinode.h
index 2a78f34..e5fa7e6 100644
--- a/sys/boot/pc98/boot2/dinode.h
+++ b/sys/boot/pc98/boot2/dinode.h
@@ -94,7 +94,7 @@ struct dinode {
* The di_db fields may be overlaid with other information for
* file types that do not have associated disk storage. Block
* and character devices overlay the first data block with their
- * dev_t value. Short symbolic links place their path in the
+ * struct cdev *value. Short symbolic links place their path in the
* di_db area.
*/
#define di_inumber di_u.inumber
diff --git a/sys/boot/pc98/boot2/inode.h b/sys/boot/pc98/boot2/inode.h
index 9a59f99..facc122 100644
--- a/sys/boot/pc98/boot2/inode.h
+++ b/sys/boot/pc98/boot2/inode.h
@@ -69,7 +69,7 @@ struct inode {
struct vnode *i_vnode;/* Vnode associated with this inode. */
struct vnode *i_devvp;/* Vnode for block I/O. */
u_int32_t i_flag; /* flags, see below */
- dev_t i_dev; /* Device associated with the inode. */
+ struct cdev *i_dev; /* Device associated with the inode. */
ino_t i_number; /* The identity of the inode. */
int i_effnlink; /* i_nlink when I/O completes */
diff --git a/sys/boot/pc98/libpc98/biosdisk.c b/sys/boot/pc98/libpc98/biosdisk.c
index 9b2a535..ec0dffa 100644
--- a/sys/boot/pc98/libpc98/biosdisk.c
+++ b/sys/boot/pc98/libpc98/biosdisk.c
@@ -1481,7 +1481,7 @@ bd_getbigeom(int bunit)
}
/*
- * Return a suitable dev_t value for (dev).
+ * Return a suitable struct cdev *value for (dev).
*
* In the case where it looks like (dev) is a SCSI disk, we allow the number of
* IDE disks to be specified in $num_ide_disks. There should be a Better Way.
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 3cd6a8b..592809f 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -936,7 +936,7 @@ xptdone(struct cam_periph *periph, union ccb *done_ccb)
}
static int
-xptopen(dev_t dev, int flags, int fmt, struct thread *td)
+xptopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int unit;
@@ -973,7 +973,7 @@ xptopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-xptclose(dev_t dev, int flag, int fmt, struct thread *td)
+xptclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit;
@@ -996,7 +996,7 @@ xptclose(dev_t dev, int flag, int fmt, struct thread *td)
}
static int
-xptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+xptioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
int unit, error;
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index 7caaf0a..1cf3b1f 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -145,7 +145,7 @@ struct ch_softc {
ch_quirks quirks;
union ccb saved_ccb;
struct devstat *device_stats;
- dev_t dev;
+ struct cdev *dev;
int sc_picker; /* current picker */
@@ -405,7 +405,7 @@ chregister(struct cam_periph *periph, void *arg)
}
static int
-chopen(dev_t dev, int flags, int fmt, struct thread *td)
+chopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct ch_softc *softc;
@@ -453,7 +453,7 @@ chopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-chclose(dev_t dev, int flag, int fmt, struct thread *td)
+chclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct ch_softc *softc;
@@ -702,7 +702,7 @@ cherror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
}
static int
-chioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+chioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct cam_periph *periph;
struct ch_softc *softc;
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 67c73d9..ec98f42 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -74,7 +74,7 @@ struct pass_softc {
u_int8_t pd_type;
union ccb saved_ccb;
struct devstat *device_stats;
- dev_t dev;
+ struct cdev *dev;
};
@@ -317,7 +317,7 @@ passregister(struct cam_periph *periph, void *arg)
}
static int
-passopen(dev_t dev, int flags, int fmt, struct thread *td)
+passopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct pass_softc *softc;
@@ -384,7 +384,7 @@ passopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-passclose(dev_t dev, int flag, int fmt, struct thread *td)
+passclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct pass_softc *softc;
@@ -446,7 +446,7 @@ passdone(struct cam_periph *periph, union ccb *done_ccb)
}
static int
-passioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+passioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct cam_periph *periph;
struct pass_softc *softc;
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index 9e053f8..94653b5 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -83,7 +83,7 @@ struct pt_softc {
pt_flags flags;
union ccb saved_ccb;
int io_timeout;
- dev_t dev;
+ struct cdev *dev;
};
static d_open_t ptopen;
@@ -134,7 +134,7 @@ static struct cdevsw pt_cdevsw = {
#endif
static int
-ptopen(dev_t dev, int flags, int fmt, struct thread *td)
+ptopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct pt_softc *softc;
@@ -178,7 +178,7 @@ ptopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-ptclose(dev_t dev, int flag, int fmt, struct thread *td)
+ptclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct pt_softc *softc;
@@ -645,7 +645,7 @@ pterror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
}
static int
-ptioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+ptioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct cam_periph *periph;
struct pt_softc *softc;
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index b1fbd22..4836b8a 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -192,11 +192,11 @@ typedef enum {
#define SA_NUM_MODES 4
struct sa_devs {
- dev_t ctl_dev;
+ struct cdev *ctl_dev;
struct sa_mode_devs {
- dev_t r_dev;
- dev_t nr_dev;
- dev_t er_dev;
+ struct cdev *r_dev;
+ struct cdev *nr_dev;
+ struct cdev *er_dev;
} mode_devs[SA_NUM_MODES];
};
@@ -398,7 +398,7 @@ static void saprevent(struct cam_periph *periph, int action);
static int sarewind(struct cam_periph *periph);
static int saspace(struct cam_periph *periph, int count,
scsi_space_code code);
-static int samount(struct cam_periph *, int, dev_t);
+static int samount(struct cam_periph *, int, struct cdev *);
static int saretension(struct cam_periph *periph);
static int sareservereleaseunit(struct cam_periph *periph,
int reserve);
@@ -437,7 +437,7 @@ static struct cdevsw sa_cdevsw = {
};
static int
-saopen(dev_t dev, int flags, int fmt, struct thread *td)
+saopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct sa_softc *softc;
@@ -497,7 +497,7 @@ saopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-saclose(dev_t dev, int flag, int fmt, struct thread *td)
+saclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct sa_softc *softc;
@@ -756,7 +756,7 @@ sastrategy(struct bio *bp)
}
static int
-saioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
+saioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
struct cam_periph *periph;
struct sa_softc *softc;
@@ -1473,7 +1473,7 @@ saregister(struct cam_periph *periph, void *arg)
* Make the (well known) aliases for the first mode.
*/
if (i == 0) {
- dev_t alias;
+ struct cdev *alias;
alias = make_dev_alias(softc->devs.mode_devs[i].r_dev,
"%s%d", periph->periph_name, periph->unit_number);
@@ -1777,7 +1777,7 @@ sadone(struct cam_periph *periph, union ccb *done_ccb)
* Mount the tape (make sure it's ready for I/O).
*/
static int
-samount(struct cam_periph *periph, int oflags, dev_t dev)
+samount(struct cam_periph *periph, int oflags, struct cdev *dev)
{
struct sa_softc *softc;
union ccb *ccb;
diff --git a/sys/cam/scsi/scsi_ses.c b/sys/cam/scsi/scsi_ses.c
index a0a2f14..25b9489 100644
--- a/sys/cam/scsi/scsi_ses.c
+++ b/sys/cam/scsi/scsi_ses.c
@@ -145,7 +145,7 @@ struct ses_softc {
ses_encstat ses_encstat; /* overall status */
u_int8_t ses_flags;
union ccb ses_saved_ccb;
- dev_t ses_dev;
+ struct cdev *ses_dev;
struct cam_periph *periph;
};
#define SES_FLAG_INVALID 0x01
@@ -405,7 +405,7 @@ sesregister(struct cam_periph *periph, void *arg)
}
static int
-sesopen(dev_t dev, int flags, int fmt, struct thread *td)
+sesopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct ses_softc *softc;
@@ -461,7 +461,7 @@ out:
}
static int
-sesclose(dev_t dev, int flag, int fmt, struct thread *td)
+sesclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct cam_periph *periph;
struct ses_softc *softc;
@@ -517,7 +517,7 @@ seserror(union ccb *ccb, u_int32_t cflags, u_int32_t sflags)
}
static int
-sesioctl(dev_t dev, u_long cmd, caddr_t arg_addr, int flag, struct thread *td)
+sesioctl(struct cdev *dev, u_long cmd, caddr_t arg_addr, int flag, struct thread *td)
{
struct cam_periph *periph;
ses_encstat tmp;
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index 9310efe..f3739ea 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -142,7 +142,7 @@ static struct targ_cmd_descr *
targgetdescr(struct targ_softc *softc);
static periph_init_t targinit;
static void targclone(void *arg, char *name, int namelen,
- dev_t *dev);
+ struct cdev **dev);
static void targasync(void *callback_arg, u_int32_t code,
struct cam_path *path, void *arg);
static void abort_all_pending(struct targ_softc *softc);
@@ -165,7 +165,7 @@ static MALLOC_DEFINE(M_TARG, "TARG", "TARG data");
/* Create softc and initialize it. Only one proc can open each targ device. */
static int
-targopen(dev_t dev, int flags, int fmt, struct thread *td)
+targopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct targ_softc *softc;
@@ -202,7 +202,7 @@ targopen(dev_t dev, int flags, int fmt, struct thread *td)
/* Disable LUN if enabled and teardown softc */
static int
-targclose(dev_t dev, int flag, int fmt, struct thread *td)
+targclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct targ_softc *softc;
int error;
@@ -230,7 +230,7 @@ targclose(dev_t dev, int flag, int fmt, struct thread *td)
/* Enable/disable LUNs, set debugging level */
static int
-targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+targioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct targ_softc *softc;
cam_status status;
@@ -303,7 +303,7 @@ targioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
/* Writes are always ready, reads wait for user_ccb_queue or abort_queue */
static int
-targpoll(dev_t dev, int poll_events, struct thread *td)
+targpoll(struct cdev *dev, int poll_events, struct thread *td)
{
struct targ_softc *softc;
int revents;
@@ -329,7 +329,7 @@ targpoll(dev_t dev, int poll_events, struct thread *td)
}
static int
-targkqfilter(dev_t dev, struct knote *kn)
+targkqfilter(struct cdev *dev, struct knote *kn)
{
struct targ_softc *softc;
@@ -534,7 +534,7 @@ targdtor(struct cam_periph *periph)
/* Receive CCBs from user mode proc and send them to the HBA */
static int
-targwrite(dev_t dev, struct uio *uio, int ioflag)
+targwrite(struct cdev *dev, struct uio *uio, int ioflag)
{
union ccb *user_ccb;
struct targ_softc *softc;
@@ -835,7 +835,7 @@ targdone(struct cam_periph *periph, union ccb *done_ccb)
/* Return CCBs to the user from the user queue and abort queue */
static int
-targread(dev_t dev, struct uio *uio, int ioflag)
+targread(struct cdev *dev, struct uio *uio, int ioflag)
{
struct descr_queue *abort_queue;
struct targ_cmd_descr *user_descr;
@@ -1031,7 +1031,7 @@ targinit(void)
}
static void
-targclone(void *arg, char *name, int namelen, dev_t *dev)
+targclone(void *arg, char *name, int namelen, struct cdev **dev)
{
int u;
diff --git a/sys/coda/cnode.h b/sys/coda/cnode.h
index 540831c..be7e848 100644
--- a/sys/coda/cnode.h
+++ b/sys/coda/cnode.h
@@ -109,7 +109,7 @@ struct cnode {
struct vattr c_vattr; /* attributes */
char *c_symlink; /* pointer to symbolic link */
u_short c_symlen; /* length of symbolic link */
- dev_t c_device; /* associated vnode device */
+ struct cdev *c_device; /* associated vnode device */
ino_t c_inode; /* associated vnode inode */
struct cnode *c_next; /* links if on NetBSD machine */
};
@@ -153,7 +153,7 @@ struct coda_mntinfo {
struct vnode *mi_rootvp;
struct mount *mi_vfsp;
struct vcomm mi_vcomm;
- dev_t dev;
+ struct cdev *dev;
int mi_started;
};
extern struct coda_mntinfo coda_mnttbl[]; /* indexed by minor device number */
@@ -201,7 +201,7 @@ extern struct cnode *make_coda_node(CodaFid *fid, struct mount *vfsp, short type
extern int coda_vnodeopstats_init(void);
/* coda_vfsops.h */
-extern struct mount *devtomp(dev_t dev);
+extern struct mount *devtomp(struct cdev *dev);
/* sigh */
#define CODA_RDWR ((u_long) 31)
diff --git a/sys/coda/coda.h b/sys/coda/coda.h
index e7f1e0d..90e7e2a 100644
--- a/sys/coda/coda.h
+++ b/sys/coda/coda.h
@@ -58,7 +58,7 @@ typedef unsigned long u_long;
typedef unsigned int u_int;
typedef unsigned short u_short;
typedef u_long ino_t;
-typedef u_long dev_t;
+typedef u_long struct cdev *;
typedef void * caddr_t;
#ifdef DOS
typedef unsigned __int64 u_quad_t;
diff --git a/sys/coda/coda_fbsd.c b/sys/coda/coda_fbsd.c
index 784962c..0ce6e46 100644
--- a/sys/coda/coda_fbsd.c
+++ b/sys/coda/coda_fbsd.c
@@ -174,7 +174,7 @@ printf("error = %d\n", error);
/* for DEVFS, using bpf & tun drivers as examples*/
static void coda_fbsd_drvinit(void *unused);
static void coda_fbsd_drvuninit(void *unused);
-static void coda_fbsd_clone(void *arg, char *name, int namelen, dev_t *dev);
+static void coda_fbsd_clone(void *arg, char *name, int namelen, struct cdev **dev);
static eventhandler_tag clonetag;
@@ -182,7 +182,7 @@ static void coda_fbsd_clone(arg, name, namelen, dev)
void *arg;
char *name;
int namelen;
- dev_t *dev;
+ struct cdev **dev;
{
int u;
diff --git a/sys/coda/coda_psdev.c b/sys/coda/coda_psdev.c
index 133d0fd..03e408d 100644
--- a/sys/coda/coda_psdev.c
+++ b/sys/coda/coda_psdev.c
@@ -117,7 +117,7 @@ vcodaattach(n)
int
vc_nb_open(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td; /* NetBSD only */
@@ -149,7 +149,7 @@ vc_nb_open(dev, flag, mode, td)
int
vc_nb_close (dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -233,7 +233,7 @@ vc_nb_close (dev, flag, mode, td)
int
vc_nb_read(dev, uiop, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uiop;
int flag;
{
@@ -287,7 +287,7 @@ vc_nb_read(dev, uiop, flag)
int
vc_nb_write(dev, uiop, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uiop;
int flag;
{
@@ -387,7 +387,7 @@ vc_nb_write(dev, uiop, flag)
int
vc_nb_ioctl(dev, cmd, addr, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t addr;
int flag;
@@ -441,7 +441,7 @@ vc_nb_ioctl(dev, cmd, addr, flag, td)
int
vc_nb_poll(dev, events, td)
- dev_t dev;
+ struct cdev *dev;
int events;
struct thread *td;
{
diff --git a/sys/coda/coda_psdev.h b/sys/coda/coda_psdev.h
index c6ecf7f..f135b34 100644
--- a/sys/coda/coda_psdev.h
+++ b/sys/coda/coda_psdev.h
@@ -31,9 +31,9 @@
*
*/
-int vc_nb_open(dev_t dev, int flag, int mode, struct thread *p);
-int vc_nb_close (dev_t dev, int flag, int mode, struct thread *p);
-int vc_nb_read(dev_t dev, struct uio *uiop, int flag);
-int vc_nb_write(dev_t dev, struct uio *uiop, int flag);
-int vc_nb_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *p);
-int vc_nb_poll(dev_t dev, int events, struct thread *p);
+int vc_nb_open(struct cdev *dev, int flag, int mode, struct thread *p);
+int vc_nb_close (struct cdev *dev, int flag, int mode, struct thread *p);
+int vc_nb_read(struct cdev *dev, struct uio *uiop, int flag);
+int vc_nb_write(struct cdev *dev, struct uio *uiop, int flag);
+int vc_nb_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *p);
+int vc_nb_poll(struct cdev *dev, int events, struct thread *p);
diff --git a/sys/coda/coda_venus.c b/sys/coda/coda_venus.c
index 5105c0b..f0bc3c2 100644
--- a/sys/coda/coda_venus.c
+++ b/sys/coda/coda_venus.c
@@ -198,7 +198,7 @@ venus_root(void *mdp,
int
venus_open(void *mdp, CodaFid *fid, int flag,
struct ucred *cred, struct proc *p,
-/*out*/ dev_t *dev, ino_t *inode)
+/*out*/ struct cdev **dev, ino_t *inode)
{
int cflag;
DECL(coda_open); /* sets Isize & Osize */
diff --git a/sys/coda/coda_venus.h b/sys/coda/coda_venus.h
index b506b5b..473b84d 100644
--- a/sys/coda/coda_venus.h
+++ b/sys/coda/coda_venus.h
@@ -39,7 +39,7 @@ venus_root(void *mdp,
int
venus_open(void *mdp, CodaFid *fid, int flag,
struct ucred *cred, struct proc *p,
-/*out*/ dev_t *dev, ino_t *inode);
+/*out*/ struct cdev **dev, ino_t *inode);
int
venus_close(void *mdp, CodaFid *fid, int flag,
diff --git a/sys/coda/coda_vfsops.c b/sys/coda/coda_vfsops.c
index ff64429..e7290e7 100644
--- a/sys/coda/coda_vfsops.c
+++ b/sys/coda/coda_vfsops.c
@@ -81,7 +81,7 @@ struct coda_op_stats coda_vfsopstats[CODA_VFSOPS_SIZE];
#define MRAK_INT_GEN(op) (coda_vfsopstats[op].gen_intrn++)
extern int coda_nc_initialized; /* Set if cache has been initialized */
-extern int vc_nb_open(dev_t, int, int, struct thread *);
+extern int vc_nb_open(struct cdev *, int, int, struct thread *);
int
coda_vfsopstats_init(void)
@@ -114,7 +114,7 @@ coda_mount(vfsp, path, data, ndp, td)
{
struct vnode *dvp;
struct cnode *cp;
- dev_t dev;
+ struct cdev *dev;
struct coda_mntinfo *mi;
struct vnode *rootvp;
CodaFid rootfid = INVAL_FID;
@@ -528,7 +528,7 @@ getNewVnode(vpp)
* device corresponds to a UFS. Return NULL if no device is found.
*/
struct mount *devtomp(dev)
- dev_t dev;
+ struct cdev *dev;
{
struct mount *mp;
diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c
index a1d24e9..a8666cc 100644
--- a/sys/coda/coda_vnops.c
+++ b/sys/coda/coda_vnops.c
@@ -238,7 +238,7 @@ coda_open(v)
/* locals */
int error;
struct vnode *vp;
- dev_t dev;
+ struct cdev *dev;
ino_t inode;
MARK_ENTRY(CODA_OPEN_STATS);
@@ -1806,7 +1806,7 @@ coda_islocked(v)
/* How one looks up a vnode given a device/inode pair: */
int
-coda_grab_vnode(dev_t dev, ino_t ino, struct vnode **vpp)
+coda_grab_vnode(struct cdev *dev, ino_t ino, struct vnode **vpp)
{
/* This is like VFS_VGET() or igetinode()! */
int error;
diff --git a/sys/coda/coda_vnops.h b/sys/coda/coda_vnops.h
index 8a3184b..88a398e 100644
--- a/sys/coda/coda_vnops.h
+++ b/sys/coda/coda_vnops.h
@@ -82,6 +82,6 @@ int coda_pathconf(void *);
int coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw,
int ioflag, struct ucred *cred, struct thread *td);
-int coda_grab_vnode(dev_t dev, ino_t ino, struct vnode **vpp);
+int coda_grab_vnode(struct cdev *dev, ino_t ino, struct vnode **vpp);
void print_vattr(struct vattr *attr);
void print_cred(struct ucred *cred);
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index eaf6da0..4a02042 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -55,7 +55,7 @@ newstat_copyout(struct stat *buf, void *ubuf)
{
struct l_newstat tbuf;
struct cdevsw *cdevsw;
- dev_t dev;
+ struct cdev *dev;
bzero(&tbuf, sizeof(tbuf));
tbuf.st_dev = uminor(buf->st_dev) | (umajor(buf->st_dev) << 8);
@@ -342,7 +342,7 @@ int
linux_ustat(struct thread *td, struct linux_ustat_args *args)
{
struct l_ustat lu;
- dev_t dev;
+ struct cdev *dev;
struct vnode *vp;
struct statfs *stat;
int error;
@@ -360,9 +360,9 @@ linux_ustat(struct thread *td, struct linux_ustat_args *args)
/*
* XXX - Don't return an error if we can't find a vnode for the
- * device. Our dev_t is 32-bits whereas Linux only has a 16-bits
- * dev_t. The dev_t that is used now may as well be a truncated
- * dev_t returned from previous syscalls. Just return a bzeroed
+ * device. Our struct cdev *is 32-bits whereas Linux only has a 16-bits
+ * struct cdev *. The struct cdev *that is used now may as well be a truncated
+ * struct cdev *returned from previous syscalls. Just return a bzeroed
* ustat in that case.
*/
dev = udev2dev(makeudev(args->dev >> 8, args->dev & 0xFF));
@@ -393,7 +393,7 @@ stat64_copyout(struct stat *buf, void *ubuf)
{
struct l_stat64 lbuf;
struct cdevsw *cdevsw;
- dev_t dev;
+ struct cdev *dev;
bzero(&lbuf, sizeof(lbuf));
lbuf.st_dev = uminor(buf->st_dev) | (umajor(buf->st_dev) << 8);
diff --git a/sys/contrib/dev/fla/fla.c b/sys/contrib/dev/fla/fla.c
index 845befc..afd5a0a 100644
--- a/sys/contrib/dev/fla/fla.c
+++ b/sys/contrib/dev/fla/fla.c
@@ -79,7 +79,7 @@ static struct fla_s {
struct doc2k_stat ds;
struct bio_queue_head bio_queue;
struct disk *disk;
- dev_t dev;
+ struct cdev *dev;
} softc[8];
static int
diff --git a/sys/contrib/ipfilter/netinet/ip_fil.c b/sys/contrib/ipfilter/netinet/ip_fil.c
index 8a36dc3..b6b9dd7 100644
--- a/sys/contrib/ipfilter/netinet/ip_fil.c
+++ b/sys/contrib/ipfilter/netinet/ip_fil.c
@@ -665,7 +665,11 @@ struct thread *td;
# else
)
# endif
+#ifdef _KERNEL
+struct cdev *dev;
+#else
dev_t dev;
+#endif
# if defined(__NetBSD__) || defined(__OpenBSD__) || \
(_BSDI_VERSION >= 199701) || (__FreeBSD_version >= 300000)
u_long cmd;
@@ -1135,7 +1139,7 @@ struct thread *td;
# else
)
# endif
-dev_t dev;
+struct cdev *dev;
int flags;
# endif /* __sgi */
{
@@ -1165,7 +1169,7 @@ struct thread *td;
# else
)
# endif
-dev_t dev;
+struct cdev *dev;
int flags;
# endif /* __sgi */
{
@@ -1193,7 +1197,7 @@ int ioflag;
# else
int IPL_EXTERN(read)(dev, uio)
# endif
-dev_t dev;
+struct cdev *dev;
register struct uio *uio;
# endif /* __sgi */
{
diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h
index bf407c2..75e434c 100644
--- a/sys/contrib/ipfilter/netinet/ip_fil.h
+++ b/sys/contrib/ipfilter/netinet/ip_fil.h
@@ -574,12 +574,12 @@ extern int iplidentify __P((char *));
(NetBSD >= 199511) || defined(__OpenBSD__)
# if defined(__NetBSD__) || (_BSDI_VERSION >= 199701) || \
defined(__OpenBSD__) || (__FreeBSD_version >= 300000)
-extern int iplioctl __P((dev_t, u_long, caddr_t, int, struct thread *));
+extern int iplioctl __P((struct cdev *, u_long, caddr_t, int, struct thread *));
# else
extern int iplioctl __P((dev_t, int, caddr_t, int, struct thread *));
# endif
-extern int iplopen __P((dev_t, int, int, struct thread *));
-extern int iplclose __P((dev_t, int, int, struct thread *));
+extern int iplopen __P((struct cdev *, int, int, struct thread *));
+extern int iplclose __P((struct cdev *, int, int, struct thread *));
# else
# ifndef linux
extern int iplopen __P((dev_t, int));
@@ -592,7 +592,7 @@ extern void iplclose __P((struct inode *, struct file *));
# endif /* !linux */
# endif /* (_BSDI_VERSION >= 199510) */
# if BSD >= 199306
-extern int iplread __P((dev_t, struct uio *, int));
+extern int iplread __P((struct cdev *, struct uio *, int));
# else
# ifndef linux
extern int iplread __P((dev_t, struct uio *));
diff --git a/sys/contrib/ipfilter/netinet/mlfk_ipl.c b/sys/contrib/ipfilter/netinet/mlfk_ipl.c
index df1bb75..c06b719 100644
--- a/sys/contrib/ipfilter/netinet/mlfk_ipl.c
+++ b/sys/contrib/ipfilter/netinet/mlfk_ipl.c
@@ -55,7 +55,7 @@
#include <netinet/ip_frag.h>
#include <netinet/ip_proxy.h>
-static dev_t ipf_devs[IPL_LOGMAX + 1];
+static struct cdev *ipf_devs[IPL_LOGMAX + 1];
SYSCTL_DECL(_net_inet);
SYSCTL_NODE(_net_inet, OID_AUTO, ipf, CTLFLAG_RW, 0, "IPF");
diff --git a/sys/contrib/pf/net/pf_ioctl.c b/sys/contrib/pf/net/pf_ioctl.c
index bb83ac1..3053de3 100644
--- a/sys/contrib/pf/net/pf_ioctl.c
+++ b/sys/contrib/pf/net/pf_ioctl.c
@@ -103,8 +103,8 @@ void cleanup_pf_zone(void);
int pfattach(void);
#else
void pfattach(int);
-int pfopen(dev_t, int, int, struct proc *);
-int pfclose(dev_t, int, int, struct proc *);
+int pfopen(struct cdev *, int, int, struct proc *);
+int pfclose(struct cdev *, int, int, struct proc *);
#endif
struct pf_pool *pf_get_pool(char *, char *, u_int32_t,
u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t);
@@ -113,9 +113,9 @@ void pf_init_ruleset(struct pf_ruleset *);
void pf_mv_pool(struct pf_palist *, struct pf_palist *);
void pf_empty_pool(struct pf_palist *);
#ifdef __FreeBSD__
-int pfioctl(dev_t, u_long, caddr_t, int, struct thread *);
+int pfioctl(struct cdev *, u_long, caddr_t, int, struct thread *);
#else
-int pfioctl(dev_t, u_long, caddr_t, int, struct proc *);
+int pfioctl(struct cdev *, u_long, caddr_t, int, struct proc *);
#endif
#ifdef __FreeBSD__
@@ -139,7 +139,7 @@ TAILQ_HEAD(pf_tags, pf_tagname) pf_tags = TAILQ_HEAD_INITIALIZER(pf_tags);
#ifdef __FreeBSD__
-static dev_t pf_dev;
+static struct cdev *pf_dev;
/*
* XXX - These are new and need to be checked when moveing to a new version
@@ -421,7 +421,7 @@ pfattach(int num)
}
int
-pfopen(dev_t dev, int flags, int fmt, struct proc *p)
+pfopen(struct cdev *dev, int flags, int fmt, struct proc *p)
{
if (minor(dev) >= 1)
return (ENXIO);
@@ -429,7 +429,7 @@ pfopen(dev_t dev, int flags, int fmt, struct proc *p)
}
int
-pfclose(dev_t dev, int flags, int fmt, struct proc *p)
+pfclose(struct cdev *dev, int flags, int fmt, struct proc *p)
{
if (minor(dev) >= 1)
return (ENXIO);
@@ -771,10 +771,10 @@ pf_tag_unref(u_int16_t tag)
#ifdef __FreeBSD__
int
-pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
+pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
#else
int
-pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
+pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
#endif
{
struct pf_pooladdr *pa = NULL;
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 9a09cf8..03978ab 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -2301,7 +2301,7 @@ aac_describe_code(struct aac_code_lookup *table, u_int32_t code)
*/
static int
-aac_open(dev_t dev, int flags, int fmt, d_thread_t *td)
+aac_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
{
struct aac_softc *sc;
@@ -2319,7 +2319,7 @@ aac_open(dev_t dev, int flags, int fmt, d_thread_t *td)
}
static int
-aac_close(dev_t dev, int flags, int fmt, d_thread_t *td)
+aac_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
{
struct aac_softc *sc;
@@ -2334,7 +2334,7 @@ aac_close(dev_t dev, int flags, int fmt, d_thread_t *td)
}
static int
-aac_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
+aac_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
{
union aac_statrequest *as;
struct aac_softc *sc;
@@ -2433,7 +2433,7 @@ aac_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
}
static int
-aac_poll(dev_t dev, int poll_events, d_thread_t *td)
+aac_poll(struct cdev *dev, int poll_events, d_thread_t *td)
{
struct aac_softc *sc;
int revents;
diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h
index bedc6b0..6a8b04f 100644
--- a/sys/dev/aac/aacvar.h
+++ b/sys/dev/aac/aacvar.h
@@ -344,7 +344,7 @@ struct aac_softc
struct intr_config_hook aac_ich;
/* management interface */
- dev_t aac_dev_t;
+ struct cdev *aac_dev_t;
aac_lock_t aac_aifq_lock;
struct aac_aif_command aac_aifq[AAC_AIFQ_LENGTH];
int aac_aifq_head;
diff --git a/sys/dev/acpi_support/acpi_asus.c b/sys/dev/acpi_support/acpi_asus.c
index f16121b..10d97e4 100644
--- a/sys/dev/acpi_support/acpi_asus.c
+++ b/sys/dev/acpi_support/acpi_asus.c
@@ -83,9 +83,9 @@ struct acpi_asus_softc {
struct sysctl_ctx_list sysctl_ctx;
struct sysctl_oid *sysctl_tree;
- dev_t s_mled;
- dev_t s_tled;
- dev_t s_wled;
+ struct cdev *s_mled;
+ struct cdev *s_tled;
+ struct cdev *s_wled;
int s_brn;
int s_disp;
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 0f0712b..ffc66d2 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -2455,19 +2455,19 @@ acpi_deregister_ioctl(u_long cmd, acpi_ioctl_fn fn)
}
static int
-acpiopen(dev_t dev, int flag, int fmt, d_thread_t *td)
+acpiopen(struct cdev *dev, int flag, int fmt, d_thread_t *td)
{
return (0);
}
static int
-acpiclose(dev_t dev, int flag, int fmt, d_thread_t *td)
+acpiclose(struct cdev *dev, int flag, int fmt, d_thread_t *td)
{
return (0);
}
static int
-acpiioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
+acpiioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
{
struct acpi_softc *sc;
struct acpi_ioctl_hook *hp;
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index 959681d..c0bc481 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -45,7 +45,7 @@ typedef vm_offset_t vm_paddr_t;
struct acpi_softc {
device_t acpi_dev;
- dev_t acpi_dev_t;
+ struct cdev *acpi_dev_t;
struct resource *acpi_irq;
int acpi_irq_rid;
diff --git a/sys/dev/adlink/adlink.c b/sys/dev/adlink/adlink.c
index 1d6b8611..b32ef3d 100644
--- a/sys/dev/adlink/adlink.c
+++ b/sys/dev/adlink/adlink.c
@@ -104,7 +104,7 @@ struct softc {
struct resource *r0, *r1, *ri;
bus_space_tag_t t0, t1;
bus_space_handle_t h0, h1;
- dev_t dev;
+ struct cdev *dev;
off_t mapvir;
struct proc *procp;
@@ -241,7 +241,7 @@ adlink_loran(void *arg)
}
static int
-adlink_open(dev_t dev, int oflags, int devtype, struct thread *td)
+adlink_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
static int once;
struct softc *sc;
@@ -307,7 +307,7 @@ adlink_open(dev_t dev, int oflags, int devtype, struct thread *td)
}
static int
-adlink_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
+adlink_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
{
struct softc *sc;
struct wave *wp;
@@ -341,7 +341,7 @@ adlink_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
}
static int
-adlink_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+adlink_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
{
struct softc *sc;
struct wave *wp;
diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c
index 46f10a3..239b5bf 100644
--- a/sys/dev/agp/agp.c
+++ b/sys/dev/agp/agp.c
@@ -762,7 +762,7 @@ agp_unbind_user(device_t dev, agp_unbind *unbind)
}
static int
-agp_open(dev_t kdev, int oflags, int devtype, struct thread *td)
+agp_open(struct cdev *kdev, int oflags, int devtype, struct thread *td)
{
device_t dev = KDEV2DEV(kdev);
struct agp_softc *sc = device_get_softc(dev);
@@ -776,7 +776,7 @@ agp_open(dev_t kdev, int oflags, int devtype, struct thread *td)
}
static int
-agp_close(dev_t kdev, int fflag, int devtype, struct thread *td)
+agp_close(struct cdev *kdev, int fflag, int devtype, struct thread *td)
{
device_t dev = KDEV2DEV(kdev);
struct agp_softc *sc = device_get_softc(dev);
@@ -799,7 +799,7 @@ agp_close(dev_t kdev, int fflag, int devtype, struct thread *td)
}
static int
-agp_ioctl(dev_t kdev, u_long cmd, caddr_t data, int fflag, struct thread *td)
+agp_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int fflag, struct thread *td)
{
device_t dev = KDEV2DEV(kdev);
@@ -834,7 +834,7 @@ agp_ioctl(dev_t kdev, u_long cmd, caddr_t data, int fflag, struct thread *td)
}
static int
-agp_mmap(dev_t kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+agp_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
device_t dev = KDEV2DEV(kdev);
struct agp_softc *sc = device_get_softc(dev);
diff --git a/sys/dev/agp/agppriv.h b/sys/dev/agp/agppriv.h
index 6ba4ed6..7e846d1 100644
--- a/sys/dev/agp/agppriv.h
+++ b/sys/dev/agp/agppriv.h
@@ -75,7 +75,7 @@ struct agp_softc {
struct agp_memory_list as_memory; /* list of allocated memory */
int as_nextid; /* next memory block id */
int as_isopen; /* user device is open */
- dev_t as_devnode; /* from make_dev */
+ struct cdev *as_devnode; /* from make_dev */
struct mtx as_lock; /* lock for access to GATT */
};
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c
index 0fce755..f206b02 100644
--- a/sys/dev/amr/amr.c
+++ b/sys/dev/amr/amr.c
@@ -343,7 +343,7 @@ amr_free(struct amr_softc *sc)
}
/* destroy control device */
- if( sc->amr_dev_t != (dev_t)NULL)
+ if( sc->amr_dev_t != (struct cdev *)NULL)
destroy_dev(sc->amr_dev_t);
}
@@ -365,7 +365,7 @@ amr_submit_bio(struct amr_softc *sc, struct bio *bio)
* Accept an open operation on the control device.
*/
static int
-amr_open(dev_t dev, int flags, int fmt, d_thread_t *td)
+amr_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
{
int unit = minor(dev);
struct amr_softc *sc = devclass_get_softc(devclass_find("amr"), unit);
@@ -380,7 +380,7 @@ amr_open(dev_t dev, int flags, int fmt, d_thread_t *td)
* Accept the last close on the control device.
*/
static int
-amr_close(dev_t dev, int flags, int fmt, d_thread_t *td)
+amr_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
{
int unit = minor(dev);
struct amr_softc *sc = devclass_get_softc(devclass_find("amr"), unit);
@@ -395,7 +395,7 @@ amr_close(dev_t dev, int flags, int fmt, d_thread_t *td)
* Handle controller-specific control operations.
*/
static int
-amr_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
+amr_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
{
struct amr_softc *sc = (struct amr_softc *)dev->si_drv1;
int *arg = (int *)addr;
diff --git a/sys/dev/amr/amrvar.h b/sys/dev/amr/amrvar.h
index 2378c97..fcfb397 100644
--- a/sys/dev/amr/amrvar.h
+++ b/sys/dev/amr/amrvar.h
@@ -202,7 +202,7 @@ struct amr_softc
TAILQ_HEAD(, ccb_hdr) amr_cam_ccbq;
/* control device */
- dev_t amr_dev_t;
+ struct cdev *amr_dev_t;
/* controller type-specific support */
int amr_type;
diff --git a/sys/dev/asr/asr.c b/sys/dev/asr/asr.c
index fa29dd8..8b40347 100644
--- a/sys/dev/asr/asr.c
+++ b/sys/dev/asr/asr.c
@@ -358,7 +358,7 @@ typedef struct Asr_softc {
/* Links into other parents and HBAs */
struct Asr_softc * ha_next; /* HBA list */
- dev_t ha_devt;
+ struct cdev *ha_devt;
} Asr_softc_t;
static Asr_softc_t * Asr_softc;
@@ -371,11 +371,11 @@ static Asr_softc_t * Asr_softc;
static int asr_probe(device_t tag);
static int asr_attach(device_t tag);
-static int asr_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag,
+static int asr_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag,
struct thread *td);
-static int asr_open(dev_t dev, int32_t flags, int32_t ifmt,
+static int asr_open(struct cdev *dev, int32_t flags, int32_t ifmt,
struct thread *td);
-static int asr_close(dev_t dev, int flags, int ifmt, struct thread *td);
+static int asr_close(struct cdev *dev, int flags, int ifmt, struct thread *td);
static int asr_intr(Asr_softc_t *sc);
static void asr_timeout(void *arg);
static int ASR_init(Asr_softc_t *sc);
@@ -2999,7 +2999,7 @@ typedef U32 DPT_RTN_T;
static u_int8_t ASR_ctlr_held;
static int
-asr_open(dev_t dev, int32_t flags, int32_t ifmt, struct thread *td)
+asr_open(struct cdev *dev, int32_t flags, int32_t ifmt, struct thread *td)
{
int s;
int error;
@@ -3018,7 +3018,7 @@ asr_open(dev_t dev, int32_t flags, int32_t ifmt, struct thread *td)
} /* asr_open */
static int
-asr_close(dev_t dev, int flags, int ifmt, struct thread *td)
+asr_close(struct cdev *dev, int flags, int ifmt, struct thread *td)
{
ASR_ctlr_held = 0;
@@ -3495,7 +3495,7 @@ ASR_queue_i(Asr_softc_t *sc, PI2O_MESSAGE_FRAME Packet)
/*----------------------------------------------------------------------*/
static int
-asr_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+asr_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
Asr_softc_t *sc = dev->si_drv1;
int i, error = 0;
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index 9a31973..b0d7893 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -359,7 +359,7 @@ ata_shutdown(void *arg, int howto)
* device related interfaces
*/
static int
-ata_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
+ata_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
{
struct ata_cmd *iocmd = (struct ata_cmd *)addr;
device_t device = devclass_get_device(ata_devclass, iocmd->channel);
diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c
index c6ae4b7..19e6100 100644
--- a/sys/dev/ata/atapi-tape.c
+++ b/sys/dev/ata/atapi-tape.c
@@ -94,7 +94,7 @@ ast_attach(struct ata_device *atadev)
{
struct ast_softc *stp;
struct ast_readposition position;
- dev_t dev;
+ struct cdev *dev;
stp = malloc(sizeof(struct ast_softc), M_AST, M_NOWAIT | M_ZERO);
if (!stp) {
@@ -265,7 +265,7 @@ ast_describe(struct ast_softc *stp)
}
static int
-ast_open(dev_t dev, int flags, int fmt, struct thread *td)
+ast_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct ast_softc *stp = dev->si_drv1;
@@ -290,7 +290,7 @@ ast_open(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-ast_close(dev_t dev, int flags, int fmt, struct thread *td)
+ast_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct ast_softc *stp = dev->si_drv1;
@@ -319,7 +319,7 @@ ast_close(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-ast_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+ast_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct ast_softc *stp = dev->si_drv1;
int error = 0;
diff --git a/sys/dev/ata/atapi-tape.h b/sys/dev/ata/atapi-tape.h
index 15e3cbb..f34328d 100644
--- a/sys/dev/ata/atapi-tape.h
+++ b/sys/dev/ata/atapi-tape.h
@@ -159,5 +159,5 @@ struct ast_softc {
struct atapi_params *param; /* drive parameters table */
struct ast_cappage cap; /* capabilities page info */
struct devstat *stats; /* devstat entry */
- dev_t dev1, dev2; /* device place holders */
+ struct cdev *dev1, *dev2; /* device place holders */
};
diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c
index 376c0dc..2d30d65 100644
--- a/sys/dev/atkbdc/psm.c
+++ b/sys/dev/atkbdc/psm.c
@@ -176,8 +176,8 @@ struct psm_softc { /* Driver status information */
int watchdog; /* watchdog timer flag */
struct callout_handle callout; /* watchdog timer call out */
struct callout_handle softcallout; /* buffer timer call out */
- dev_t dev;
- dev_t bdev;
+ struct cdev *dev;
+ struct cdev *bdev;
int lasterr;
int cmdcount;
};
@@ -1307,7 +1307,7 @@ psmdetach(device_t dev)
}
static int
-psmopen(dev_t dev, int flag, int fmt, struct thread *td)
+psmopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit = PSM_UNIT(dev);
struct psm_softc *sc;
@@ -1391,7 +1391,7 @@ psmopen(dev_t dev, int flag, int fmt, struct thread *td)
}
static int
-psmclose(dev_t dev, int flag, int fmt, struct thread *td)
+psmclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit = PSM_UNIT(dev);
struct psm_softc *sc = PSM_SOFTC(unit);
@@ -1533,7 +1533,7 @@ tame_mouse(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *status, unsigne
}
static int
-psmread(dev_t dev, struct uio *uio, int flag)
+psmread(struct cdev *dev, struct uio *uio, int flag)
{
register struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
unsigned char buf[PSM_SMALLBUFSIZE];
@@ -1681,7 +1681,7 @@ unblock_mouse_data(struct psm_softc *sc, int c)
}
static int
-psmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+psmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
mousemode_t mode;
@@ -2506,7 +2506,7 @@ psmsoftintr(void *arg)
}
static int
-psmpoll(dev_t dev, int events, struct thread *td)
+psmpoll(struct cdev *dev, int events, struct thread *td)
{
struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
int s;
diff --git a/sys/dev/bktr/bktr_core.c b/sys/dev/bktr/bktr_core.c
index a71d708..d8b381f 100644
--- a/sys/dev/bktr/bktr_core.c
+++ b/sys/dev/bktr/bktr_core.c
@@ -1191,7 +1191,7 @@ vbi_close( bktr_ptr_t bktr )
*
*/
int
-video_read(bktr_ptr_t bktr, int unit, dev_t dev, struct uio *uio)
+video_read(bktr_ptr_t bktr, int unit, struct cdev *dev, struct uio *uio)
{
int status;
int count;
diff --git a/sys/dev/bktr/bktr_core.h b/sys/dev/bktr/bktr_core.h
index 5948ab6..315566f 100644
--- a/sys/dev/bktr/bktr_core.h
+++ b/sys/dev/bktr/bktr_core.h
@@ -80,7 +80,7 @@ int common_bktr_intr( void *arg );
/* Prototypes for open, close, read, mmap and ioctl calls */
int video_open( bktr_ptr_t bktr );
int video_close( bktr_ptr_t bktr );
-int video_read( bktr_ptr_t bktr, int unit, dev_t dev, struct uio *uio );
+int video_read( bktr_ptr_t bktr, int unit, struct cdev *dev, struct uio *uio );
int video_ioctl( bktr_ptr_t bktr, int unit,
ioctl_cmd_t cmd, caddr_t arg, struct thread* pr );
diff --git a/sys/dev/bktr/bktr_os.c b/sys/dev/bktr/bktr_os.c
index d7bd9ba..87d4ed9 100644
--- a/sys/dev/bktr/bktr_os.c
+++ b/sys/dev/bktr/bktr_os.c
@@ -580,7 +580,7 @@ get_bktr_mem( int unit, unsigned size )
*
*/
static int
-bktr_open( dev_t dev, int flags, int fmt, struct thread *td )
+bktr_open( struct cdev *dev, int flags, int fmt, struct thread *td )
{
bktr_ptr_t bktr;
int unit;
@@ -680,7 +680,7 @@ bktr_open( dev_t dev, int flags, int fmt, struct thread *td )
*
*/
static int
-bktr_close( dev_t dev, int flags, int fmt, struct thread *td )
+bktr_close( struct cdev *dev, int flags, int fmt, struct thread *td )
{
bktr_ptr_t bktr;
int unit;
@@ -719,7 +719,7 @@ bktr_close( dev_t dev, int flags, int fmt, struct thread *td )
*
*/
static int
-bktr_read( dev_t dev, struct uio *uio, int ioflag )
+bktr_read( struct cdev *dev, struct uio *uio, int ioflag )
{
bktr_ptr_t bktr;
int unit;
@@ -747,7 +747,7 @@ bktr_read( dev_t dev, struct uio *uio, int ioflag )
*
*/
static int
-bktr_write( dev_t dev, struct uio *uio, int ioflag )
+bktr_write( struct cdev *dev, struct uio *uio, int ioflag )
{
return( EINVAL ); /* XXX or ENXIO ? */
}
@@ -757,7 +757,7 @@ bktr_write( dev_t dev, struct uio *uio, int ioflag )
*
*/
static int
-bktr_ioctl( dev_t dev, ioctl_cmd_t cmd, caddr_t arg, int flag, struct thread *td )
+bktr_ioctl( struct cdev *dev, ioctl_cmd_t cmd, caddr_t arg, int flag, struct thread *td )
{
bktr_ptr_t bktr;
int unit;
@@ -789,7 +789,7 @@ bktr_ioctl( dev_t dev, ioctl_cmd_t cmd, caddr_t arg, int flag, struct thread *td
*
*/
static int
-bktr_mmap( dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot )
+bktr_mmap( struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot )
{
int unit;
bktr_ptr_t bktr;
@@ -820,7 +820,7 @@ bktr_mmap( dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot )
}
static int
-bktr_poll( dev_t dev, int events, struct thread *td)
+bktr_poll( struct cdev *dev, int events, struct thread *td)
{
int unit;
bktr_ptr_t bktr;
diff --git a/sys/dev/bktr/bktr_reg.h b/sys/dev/bktr/bktr_reg.h
index a7c3ef5..c8fc4d4 100644
--- a/sys/dev/bktr/bktr_reg.h
+++ b/sys/dev/bktr/bktr_reg.h
@@ -535,12 +535,12 @@ struct bktr_softc {
int irq_rid; /* 4.x resource id */
struct resource *res_irq; /* 4.x resource descriptor for interrupt */
void *res_ih; /* 4.x newbus interrupt handler cookie */
- dev_t bktrdev; /* 4.x device entry for /dev/bktrN */
- dev_t tunerdev; /* 4.x device entry for /dev/tunerN */
- dev_t vbidev; /* 4.x device entry for /dev/vbiN */
- dev_t bktrdev_alias; /* alias /dev/bktr to /dev/bktr0 */
- dev_t tunerdev_alias; /* alias /dev/tuner to /dev/tuner0 */
- dev_t vbidev_alias; /* alias /dev/vbi to /dev/vbi0 */
+ struct cdev *bktrdev; /* 4.x device entry for /dev/bktrN */
+ struct cdev *tunerdev; /* 4.x device entry for /dev/tunerN */
+ struct cdev *vbidev; /* 4.x device entry for /dev/vbiN */
+ struct cdev *bktrdev_alias; /* alias /dev/bktr to /dev/bktr0 */
+ struct cdev *tunerdev_alias; /* alias /dev/tuner to /dev/tuner0 */
+ struct cdev *vbidev_alias; /* alias /dev/vbi to /dev/vbi0 */
#endif
#if (__FreeBSD_version >= 500000)
struct mtx vbimutex; /* Mutex protecting vbi buffer */
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index 6e328e6..c04136d 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -3738,7 +3738,7 @@ ciss_name_command_status(int status)
* Handle an open on the control device.
*/
static int
-ciss_open(dev_t dev, int flags, int fmt, d_thread_t *p)
+ciss_open(struct cdev *dev, int flags, int fmt, d_thread_t *p)
{
struct ciss_softc *sc;
@@ -3756,7 +3756,7 @@ ciss_open(dev_t dev, int flags, int fmt, d_thread_t *p)
* Handle the last close on the control device.
*/
static int
-ciss_close(dev_t dev, int flags, int fmt, d_thread_t *p)
+ciss_close(struct cdev *dev, int flags, int fmt, d_thread_t *p)
{
struct ciss_softc *sc;
@@ -3775,7 +3775,7 @@ ciss_close(dev_t dev, int flags, int fmt, d_thread_t *p)
* simplify the porting of Compaq's userland tools.
*/
static int
-ciss_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *p)
+ciss_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *p)
{
struct ciss_softc *sc;
int error;
diff --git a/sys/dev/ciss/cissvar.h b/sys/dev/ciss/cissvar.h
index 717351f..b1bdd42 100644
--- a/sys/dev/ciss/cissvar.h
+++ b/sys/dev/ciss/cissvar.h
@@ -173,7 +173,7 @@ struct ciss_softc
{
/* bus connections */
device_t ciss_dev; /* bus attachment */
- dev_t ciss_dev_t; /* control device */
+ struct cdev *ciss_dev_t; /* control device */
struct resource *ciss_regs_resource; /* register interface window */
int ciss_regs_rid; /* resource ID */
diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c
index 945c863..04427c3 100644
--- a/sys/dev/cp/if_cp.c
+++ b/sys/dev/cp/if_cp.c
@@ -161,7 +161,7 @@ typedef struct _drv_t {
struct sppp pp;
#endif
#if __FreeBSD_version >= 400000
- dev_t devt;
+ struct cdev *devt;
#endif
} drv_t;
@@ -967,7 +967,7 @@ static void cp_error (cp_chan_t *c, int data)
#if __FreeBSD_version < 500000
static int cp_open (dev_t dev, int oflags, int devtype, struct proc *p)
#else
-static int cp_open (dev_t dev, int oflags, int devtype, struct thread *td)
+static int cp_open (struct cdev *dev, int oflags, int devtype, struct thread *td)
#endif
{
int unit = minor (dev);
@@ -985,7 +985,7 @@ static int cp_open (dev_t dev, int oflags, int devtype, struct thread *td)
#if __FreeBSD_version < 500000
static int cp_close (dev_t dev, int fflag, int devtype, struct proc *p)
#else
-static int cp_close (dev_t dev, int fflag, int devtype, struct thread *td)
+static int cp_close (struct cdev *dev, int fflag, int devtype, struct thread *td)
#endif
{
drv_t *d = channel [minor (dev)];
@@ -1013,7 +1013,7 @@ static int cp_modem_status (cp_chan_t *c)
#if __FreeBSD_version < 500000
static int cp_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
#else
-static int cp_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+static int cp_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
#endif
{
drv_t *d = channel [minor (dev)];
@@ -2652,7 +2652,7 @@ static int cp_modevent (module_t mod, int type, void *unused)
#else /* __FreeBSD_version >= 400000 */
static int cp_modevent (module_t mod, int type, void *unused)
{
- dev_t dev;
+ struct cdev *dev;
static int load_count = 0;
struct cdevsw *cdsw;
diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c
index cc5887a..a7462ab 100644
--- a/sys/dev/ctau/if_ct.c
+++ b/sys/dev/ctau/if_ct.c
@@ -172,7 +172,7 @@ typedef struct _drv_t {
struct sppp pp;
#endif
#if __FreeBSD_version >= 400000
- dev_t devt;
+ struct cdev *devt;
#endif
} drv_t;
@@ -1261,7 +1261,7 @@ static void ct_error (ct_chan_t *c, int data)
#if __FreeBSD_version < 500000
static int ct_open (dev_t dev, int oflags, int devtype, struct proc *p)
#else
-static int ct_open (dev_t dev, int oflags, int devtype, struct thread *td)
+static int ct_open (struct cdev *dev, int oflags, int devtype, struct thread *td)
#endif
{
drv_t *d;
@@ -1276,7 +1276,7 @@ static int ct_open (dev_t dev, int oflags, int devtype, struct thread *td)
#if __FreeBSD_version < 500000
static int ct_close (dev_t dev, int fflag, int devtype, struct proc *p)
#else
-static int ct_close (dev_t dev, int fflag, int devtype, struct thread *td)
+static int ct_close (struct cdev *dev, int fflag, int devtype, struct thread *td)
#endif
{
drv_t *d = channel [minor(dev)];
@@ -1313,7 +1313,7 @@ static int ct_modem_status (ct_chan_t *c)
#if __FreeBSD_version < 500000
static int ct_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
#else
-static int ct_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+static int ct_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
#endif
{
drv_t *d = channel [minor (dev)];
@@ -2624,7 +2624,7 @@ static int ct_modevent (module_t mod, int type, void *unused)
#else /* __FreeBSD_version >= 400000 */
static int ct_modevent (module_t mod, int type, void *unused)
{
- dev_t dev;
+ struct cdev *dev;
static int load_count = 0;
struct cdevsw *cdsw;
diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c
index 726de52..45c7f9e 100644
--- a/sys/dev/cx/if_cx.c
+++ b/sys/dev/cx/if_cx.c
@@ -212,7 +212,7 @@ typedef struct _drv_t {
struct sppp pp;
#endif
#if __FreeBSD_version >= 400000
- dev_t devt[3];
+ struct cdev *devt[3];
#endif
async_q aqueue;
#define CX_READ 1
@@ -1570,7 +1570,7 @@ static void cx_error (cx_chan_t *c, int data)
#if __FreeBSD_version < 500000
static int cx_open (dev_t dev, int flag, int mode, struct proc *p)
#else
-static int cx_open (dev_t dev, int flag, int mode, struct thread *td)
+static int cx_open (struct cdev *dev, int flag, int mode, struct thread *td)
#endif
{
int unit = UNIT (dev);
@@ -1710,7 +1710,7 @@ failed: if (! (d->tty->t_state & TS_ISOPEN)) {
#if __FreeBSD_version < 500000
static int cx_close (dev_t dev, int flag, int mode, struct proc *p)
#else
-static int cx_close (dev_t dev, int flag, int mode, struct thread *td)
+static int cx_close (struct cdev *dev, int flag, int mode, struct thread *td)
#endif
{
drv_t *d = channel [UNIT (dev)];
@@ -1756,7 +1756,7 @@ static int cx_close (dev_t dev, int flag, int mode, struct thread *td)
return 0;
}
-static int cx_read (dev_t dev, struct uio *uio, int flag)
+static int cx_read (struct cdev *dev, struct uio *uio, int flag)
{
drv_t *d = channel [UNIT (dev)];
@@ -1767,7 +1767,7 @@ static int cx_read (dev_t dev, struct uio *uio, int flag)
return ttyld_read (d->tty, uio, flag);
}
-static int cx_write (dev_t dev, struct uio *uio, int flag)
+static int cx_write (struct cdev *dev, struct uio *uio, int flag)
{
drv_t *d = channel [UNIT (dev)];
@@ -1798,7 +1798,7 @@ static int cx_modem_status (drv_t *d)
#if __FreeBSD_version < 500000
static int cx_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
#else
-static int cx_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+static int cx_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
#endif
{
drv_t *d = channel [UNIT (dev)];
@@ -3172,7 +3172,7 @@ static int cx_modevent (module_t mod, int type, void *unused)
#else /* __FreeBSD_version >= 400000 */
static int cx_modevent (module_t mod, int type, void *unused)
{
- dev_t dev;
+ struct cdev *dev;
static int load_count = 0;
struct cdevsw *cdsw;
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 7065327..7808ecb 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -592,7 +592,7 @@ cyattach_common(cy_iobase, cy_align)
static int
sioopen(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -776,7 +776,7 @@ out:
static int
sioclose(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -891,7 +891,7 @@ comhardclose(com)
static int
siowrite(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -1528,7 +1528,7 @@ terminate_tx_service:
static int
sioioctl(dev, cmd, data, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t data;
int flag;
diff --git a/sys/dev/dcons/dcons.c b/sys/dev/dcons/dcons.c
index 3a5e302..5bdbbfb 100644
--- a/sys/dev/dcons/dcons.c
+++ b/sys/dev/dcons/dcons.c
@@ -129,7 +129,7 @@ struct dcons_buf *dcons_buf; /* for local dconschat */
/* per device data */
static struct dcons_softc {
- dev_t dev;
+ struct cdev *dev;
struct dcons_ch o, i;
int brk_state;
#define DC_GDB 1
@@ -159,7 +159,7 @@ CONS_DRIVER(dcons, dcons_cnprobe, dcons_cninit, NULL, dcons_cngetc,
#endif
static int
-dcons_open(dev_t dev, int flag, int mode, struct THREAD *td)
+dcons_open(struct cdev *dev, int flag, int mode, struct THREAD *td)
{
struct tty *tp;
int unit, error, s;
@@ -198,7 +198,7 @@ dcons_open(dev_t dev, int flag, int mode, struct THREAD *td)
}
static int
-dcons_close(dev_t dev, int flag, int mode, struct THREAD *td)
+dcons_close(struct cdev *dev, int flag, int mode, struct THREAD *td)
{
int unit;
struct tty *tp;
@@ -312,17 +312,17 @@ dcons_cnputc(struct consdev *cp, int c)
}
#else
static int
-dcons_cngetc(dev_t dev)
+dcons_cngetc(struct cdev *dev)
{
return(dcons_getc((struct dcons_softc *)dev->si_drv1));
}
static int
-dcons_cncheckc(dev_t dev)
+dcons_cncheckc(struct cdev *dev)
{
return(dcons_checkc((struct dcons_softc *)dev->si_drv1));
}
static void
-dcons_cnputc(dev_t dev, int c)
+dcons_cnputc(struct cdev *dev, int c)
{
dcons_putc((struct dcons_softc *)dev->si_drv1, c);
}
diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c
index c6b6b2c..c330290 100644
--- a/sys/dev/digi/digi.c
+++ b/sys/dev/digi/digi.c
@@ -694,7 +694,7 @@ digimctl(struct digi_p *port, int bits, int how)
}
static int
-digiopen(dev_t dev, int flag, int mode, struct thread *td)
+digiopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct digi_softc *sc;
struct tty *tp;
@@ -859,7 +859,7 @@ out:
}
static int
-digiclose(dev_t dev, int flag, int mode, struct thread *td)
+digiclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
int mynor;
struct tty *tp;
@@ -938,7 +938,7 @@ digihardclose(struct digi_p *port)
}
static int
-digiread(dev_t dev, struct uio *uio, int flag)
+digiread(struct cdev *dev, struct uio *uio, int flag)
{
int mynor;
struct tty *tp;
@@ -964,7 +964,7 @@ digiread(dev_t dev, struct uio *uio, int flag)
}
static int
-digiwrite(dev_t dev, struct uio *uio, int flag)
+digiwrite(struct cdev *dev, struct uio *uio, int flag)
{
int mynor;
struct tty *tp;
@@ -1066,7 +1066,7 @@ digi_loadmoduledata(struct digi_softc *sc)
}
static int
-digiioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+digiioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int unit, pnum, mynor, error, s;
struct digi_softc *sc;
diff --git a/sys/dev/digi/digi.h b/sys/dev/digi/digi.h
index f0c9f0e..8459d60 100644
--- a/sys/dev/digi/digi.h
+++ b/sys/dev/digi/digi.h
@@ -72,7 +72,7 @@ struct digi_p {
volatile struct board_chan *bc;
struct tty *tp;
- dev_t dev[6];
+ struct cdev *dev[6];
u_char *txbuf;
u_char *rxbuf;
@@ -164,7 +164,7 @@ struct digi_softc {
int iorid;
void *irqHandler;
int unit;
- dev_t ctldev;
+ struct cdev *ctldev;
} res;
u_char *vmem; /* virtual memory address */
diff --git a/sys/dev/drm/drmP.h b/sys/dev/drm/drmP.h
index 7753b19..e45bad4 100644
--- a/sys/dev/drm/drmP.h
+++ b/sys/dev/drm/drmP.h
@@ -313,7 +313,7 @@ struct drm_device {
#ifdef __FreeBSD__
device_t device; /* Device instance from newbus */
#endif
- dev_t devnode; /* Device number for mknod */
+ struct cdev *devnode; /* Device number for mknod */
int if_version; /* Highest interface version set */
int flags; /* Flags to open(2) */
diff --git a/sys/dev/drm/drm_drv.h b/sys/dev/drm/drm_drv.h
index d005ec4..642cc74 100644
--- a/sys/dev/drm/drm_drv.h
+++ b/sys/dev/drm/drm_drv.h
@@ -808,7 +808,7 @@ int DRM(version)( DRM_IOCTL_ARGS )
return 0;
}
-int DRM(open)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p)
+int DRM(open)(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p)
{
drm_device_t *dev = NULL;
int retcode = 0;
@@ -833,7 +833,7 @@ int DRM(open)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p)
return retcode;
}
-int DRM(close)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p)
+int DRM(close)(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p)
{
drm_file_t *priv;
DRM_DEVICE;
@@ -951,7 +951,7 @@ int DRM(close)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p)
/* DRM(ioctl) is called whenever a process performs an ioctl on /dev/drm.
*/
-int DRM(ioctl)(dev_t kdev, u_long cmd, caddr_t data, int flags,
+int DRM(ioctl)(struct cdev *kdev, u_long cmd, caddr_t data, int flags,
DRM_STRUCTPROC *p)
{
DRM_DEVICE;
diff --git a/sys/dev/drm/drm_fops.h b/sys/dev/drm/drm_fops.h
index 190b708..4c79fe1 100644
--- a/sys/dev/drm/drm_fops.h
+++ b/sys/dev/drm/drm_fops.h
@@ -54,7 +54,7 @@ drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, DRM_STRUCTPROC *p)
}
/* DRM(open_helper) is called whenever a process opens /dev/drm. */
-int DRM(open_helper)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p,
+int DRM(open_helper)(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p,
drm_device_t *dev)
{
int m = minor(kdev);
@@ -106,12 +106,12 @@ int DRM(open_helper)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p,
/* The DRM(read) and DRM(poll) are stubs to prevent spurious errors
* on older X Servers (4.3.0 and earlier) */
-int DRM(read)(dev_t kdev, struct uio *uio, int ioflag)
+int DRM(read)(struct cdev *kdev, struct uio *uio, int ioflag)
{
return 0;
}
-int DRM(poll)(dev_t kdev, int events, DRM_STRUCTPROC *p)
+int DRM(poll)(struct cdev *kdev, int events, DRM_STRUCTPROC *p)
{
return 0;
}
diff --git a/sys/dev/drm/drm_os_freebsd.h b/sys/dev/drm/drm_os_freebsd.h
index 24dcd10..750e6ec 100644
--- a/sys/dev/drm/drm_os_freebsd.h
+++ b/sys/dev/drm/drm_os_freebsd.h
@@ -151,7 +151,7 @@
* of the current process. It should be a per-open unique pointer, but
* code for that is not yet written */
#define DRMFILE void *
-#define DRM_IOCTL_ARGS dev_t kdev, u_long cmd, caddr_t data, int flags, DRM_STRUCTPROC *p, DRMFILE filp
+#define DRM_IOCTL_ARGS struct cdev *kdev, u_long cmd, caddr_t data, int flags, DRM_STRUCTPROC *p, DRMFILE filp
#define DRM_SUSER(p) suser(p)
#define DRM_TASKQUEUE_ARGS void *arg, int pending
#define DRM_IRQ_ARGS void *arg
@@ -473,7 +473,7 @@ extern d_close_t DRM(close);
extern d_read_t DRM(read);
extern d_poll_t DRM(poll);
extern d_mmap_t DRM(mmap);
-extern int DRM(open_helper)(dev_t kdev, int flags, int fmt,
+extern int DRM(open_helper)(struct cdev *kdev, int flags, int fmt,
DRM_STRUCTPROC *p, drm_device_t *dev);
extern drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev,
DRM_STRUCTPROC *p);
diff --git a/sys/dev/drm/drm_vm.h b/sys/dev/drm/drm_vm.h
index ab79d03..2637a83 100644
--- a/sys/dev/drm/drm_vm.h
+++ b/sys/dev/drm/drm_vm.h
@@ -26,7 +26,7 @@
*/
#if defined(__FreeBSD__) && __FreeBSD_version >= 500102
-static int DRM(dma_mmap)(dev_t kdev, vm_offset_t offset, vm_paddr_t *paddr,
+static int DRM(dma_mmap)(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr,
int prot)
#elif defined(__FreeBSD__)
static int DRM(dma_mmap)(dev_t kdev, vm_offset_t offset, int prot)
@@ -55,7 +55,7 @@ static paddr_t DRM(dma_mmap)(dev_t kdev, vm_offset_t offset, int prot)
}
#if defined(__FreeBSD__) && __FreeBSD_version >= 500102
-int DRM(mmap)(dev_t kdev, vm_offset_t offset, vm_paddr_t *paddr,
+int DRM(mmap)(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr,
int prot)
#elif defined(__FreeBSD__)
int DRM(mmap)(dev_t kdev, vm_offset_t offset, int prot)
diff --git a/sys/dev/fb/creatorreg.h b/sys/dev/fb/creatorreg.h
index 6fa42f7..b3be9e2 100644
--- a/sys/dev/fb/creatorreg.h
+++ b/sys/dev/fb/creatorreg.h
@@ -142,7 +142,7 @@
struct creator_softc {
video_adapter_t sc_va; /* XXX must be first */
- dev_t sc_si;
+ struct cdev *sc_si;
struct resource *sc_reg[FFB_NREG];
bus_space_tag_t sc_bt[FFB_NREG];
diff --git a/sys/dev/fb/gfb.h b/sys/dev/fb/gfb.h
index 07ee5c9..470dfc2 100644
--- a/sys/dev/fb/gfb.h
+++ b/sys/dev/fb/gfb.h
@@ -166,7 +166,7 @@ typedef struct gfb_softc {
int type;
int model;
struct cdevsw *cdevsw;
- dev_t devt;
+ struct cdev *devt;
} *gfb_softc_t;
#endif /* _FB_GFB_H_ */
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c
index 9f12813..3af5fda 100644
--- a/sys/dev/fb/vga.c
+++ b/sys/dev/fb/vga.c
@@ -109,7 +109,7 @@ vga_attach_unit(int unit, vga_softc_t *sc, int flags)
#ifdef FB_INSTALL_CDEV
int
-vga_open(dev_t dev, vga_softc_t *sc, int flag, int mode, struct thread *td)
+vga_open(struct cdev *dev, vga_softc_t *sc, int flag, int mode, struct thread *td)
{
if (sc == NULL)
return ENXIO;
@@ -120,32 +120,32 @@ vga_open(dev_t dev, vga_softc_t *sc, int flag, int mode, struct thread *td)
}
int
-vga_close(dev_t dev, vga_softc_t *sc, int flag, int mode, struct thread *td)
+vga_close(struct cdev *dev, vga_softc_t *sc, int flag, int mode, struct thread *td)
{
return genfbclose(&sc->gensc, sc->adp, flag, mode, td);
}
int
-vga_read(dev_t dev, vga_softc_t *sc, struct uio *uio, int flag)
+vga_read(struct cdev *dev, vga_softc_t *sc, struct uio *uio, int flag)
{
return genfbread(&sc->gensc, sc->adp, uio, flag);
}
int
-vga_write(dev_t dev, vga_softc_t *sc, struct uio *uio, int flag)
+vga_write(struct cdev *dev, vga_softc_t *sc, struct uio *uio, int flag)
{
return genfbread(&sc->gensc, sc->adp, uio, flag);
}
int
-vga_ioctl(dev_t dev, vga_softc_t *sc, u_long cmd, caddr_t arg, int flag,
+vga_ioctl(struct cdev *dev, vga_softc_t *sc, u_long cmd, caddr_t arg, int flag,
struct thread *td)
{
return genfbioctl(&sc->gensc, sc->adp, cmd, arg, flag, td);
}
int
-vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset, vm_offset_t *paddr,
+vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_offset_t offset, vm_offset_t *paddr,
int prot)
{
return genfbmmap(&sc->gensc, sc->adp, offset, paddr, prot);
diff --git a/sys/dev/fb/vgareg.h b/sys/dev/fb/vgareg.h
index f390318..e26c214 100644
--- a/sys/dev/fb/vgareg.h
+++ b/sys/dev/fb/vgareg.h
@@ -78,15 +78,15 @@ int vga_probe_unit(int unit, struct video_adapter *adp, int flags);
int vga_attach_unit(int unit, vga_softc_t *sc, int flags);
#ifdef FB_INSTALL_CDEV
-int vga_open(dev_t dev, vga_softc_t *sc, int flag, int mode,
+int vga_open(struct cdev *dev, vga_softc_t *sc, int flag, int mode,
struct thread *td);
-int vga_close(dev_t dev, vga_softc_t *sc, int flag, int mode,
+int vga_close(struct cdev *dev, vga_softc_t *sc, int flag, int mode,
struct thread *td);
-int vga_read(dev_t dev, vga_softc_t *sc, struct uio *uio, int flag);
-int vga_write(dev_t dev, vga_softc_t *sc, struct uio *uio, int flag);
-int vga_ioctl(dev_t dev, vga_softc_t *sc, u_long cmd, caddr_t arg,
+int vga_read(struct cdev *dev, vga_softc_t *sc, struct uio *uio, int flag);
+int vga_write(struct cdev *dev, vga_softc_t *sc, struct uio *uio, int flag);
+int vga_ioctl(struct cdev *dev, vga_softc_t *sc, u_long cmd, caddr_t arg,
int flag, struct thread *td);
-int vga_mmap(dev_t dev, vga_softc_t *sc, vm_offset_t offset,
+int vga_mmap(struct cdev *dev, vga_softc_t *sc, vm_offset_t offset,
vm_offset_t *paddr, int prot);
#endif
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 916df70..f61b11fb 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -301,7 +301,7 @@ struct fd_data {
struct callout_handle toffhandle;
struct callout_handle tohandle;
struct devstat *device_stats;
- dev_t masterdev;
+ struct cdev *masterdev;
device_t dev;
fdu_t fdu;
};
@@ -393,11 +393,11 @@ static timeout_t fd_iotimeout;
static timeout_t fd_pseudointr;
static driver_intr_t fdc_intr;
static int fdcpio(fdc_p, long, caddr_t, u_int);
-static int fdautoselect(dev_t);
+static int fdautoselect(struct cdev *);
static int fdstate(struct fdc_data *);
static int retrier(struct fdc_data *);
static void fdbiodone(struct bio *);
-static int fdmisccmd(dev_t, u_int, void *);
+static int fdmisccmd(struct cdev *, u_int, void *);
static d_ioctl_t fdioctl;
static int fifo_threshold = 8; /* XXX: should be accessible via sysctl */
@@ -1496,7 +1496,7 @@ out_fdc(struct fdc_data *fdc, int x)
* auxiliary functions).
*/
static int
-fdopen(dev_t dev, int flags, int mode, struct thread *td)
+fdopen(struct cdev *dev, int flags, int mode, struct thread *td)
{
fd_p fd;
fdc_p fdc;
@@ -1591,7 +1591,7 @@ fdopen(dev_t dev, int flags, int mode, struct thread *td)
}
static int
-fdclose(dev_t dev, int flags, int mode, struct thread *td)
+fdclose(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct fd_data *fd;
@@ -1795,7 +1795,7 @@ fdcpio(fdc_p fdc, long flags, caddr_t addr, u_int count)
* Try figuring out the density of the media present in our device.
*/
static int
-fdautoselect(dev_t dev)
+fdautoselect(struct cdev *dev)
{
fd_p fd;
struct fd_type *fdtp;
@@ -2492,7 +2492,7 @@ fdbiodone(struct bio *bp)
}
static int
-fdmisccmd(dev_t dev, u_int cmd, void *data)
+fdmisccmd(struct cdev *dev, u_int cmd, void *data)
{
fdu_t fdu;
fd_p fd;
@@ -2543,7 +2543,7 @@ fdmisccmd(dev_t dev, u_int cmd, void *data)
}
static int
-fdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+fdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
fdu_t fdu;
fd_p fd;
diff --git a/sys/dev/firewire/firewirereg.h b/sys/dev/firewire/firewirereg.h
index 5b43387..3c44a55 100644
--- a/sys/dev/firewire/firewirereg.h
+++ b/sys/dev/firewire/firewirereg.h
@@ -72,7 +72,7 @@ struct fw_device{
struct firewire_softc {
#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
- dev_t dev;
+ struct cdev *dev;
#endif
struct firewire_comm *fc;
};
@@ -156,7 +156,7 @@ struct firewire_comm{
uint32_t (*cyctimer) (struct firewire_comm *);
void (*ibr) (struct firewire_comm *);
uint32_t (*set_bmr) (struct firewire_comm *, uint32_t);
- int (*ioctl) (dev_t, u_long, caddr_t, int, fw_proc *);
+ int (*ioctl) (struct cdev *, u_long, caddr_t, int, fw_proc *);
int (*irx_enable) (struct firewire_comm *, int);
int (*irx_disable) (struct firewire_comm *, int);
int (*itx_enable) (struct firewire_comm *, int);
@@ -303,7 +303,7 @@ struct fw_bind *fw_bindlookup (struct firewire_comm *, uint16_t, uint32_t);
void fw_drain_txq (struct firewire_comm *);
int fwdev_makedev (struct firewire_softc *);
int fwdev_destroydev (struct firewire_softc *);
-void fwdev_clone (void *, char *, int, dev_t *);
+void fwdev_clone (void *, char *, int, struct cdev **);
extern int firewire_debug;
extern devclass_t firewire_devclass;
diff --git a/sys/dev/firewire/fwdev.c b/sys/dev/firewire/fwdev.c
index 7cf7dc9..5d10415 100644
--- a/sys/dev/firewire/fwdev.c
+++ b/sys/dev/firewire/fwdev.c
@@ -178,7 +178,7 @@ fwdev_freebuf(struct fw_xferq *q)
static int
-fw_open (dev_t dev, int flags, int fmt, fw_proc *td)
+fw_open (struct cdev *dev, int flags, int fmt, fw_proc *td)
{
int err = 0;
@@ -205,7 +205,7 @@ fw_open (dev_t dev, int flags, int fmt, fw_proc *td)
}
static int
-fw_close (dev_t dev, int flags, int fmt, fw_proc *td)
+fw_close (struct cdev *dev, int flags, int fmt, fw_proc *td)
{
struct firewire_softc *sc;
struct firewire_comm *fc;
@@ -279,7 +279,7 @@ fw_close (dev_t dev, int flags, int fmt, fw_proc *td)
* read request.
*/
static int
-fw_read (dev_t dev, struct uio *uio, int ioflag)
+fw_read (struct cdev *dev, struct uio *uio, int ioflag)
{
struct firewire_softc *sc;
struct fw_xferq *ir;
@@ -365,7 +365,7 @@ readloop:
}
static int
-fw_write (dev_t dev, struct uio *uio, int ioflag)
+fw_write (struct cdev *dev, struct uio *uio, int ioflag)
{
int err = 0;
struct firewire_softc *sc;
@@ -428,7 +428,7 @@ isoloop:
* ioctl support.
*/
int
-fw_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
+fw_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
{
struct firewire_softc *sc;
struct firewire_comm *fc;
@@ -728,7 +728,7 @@ out:
return err;
}
int
-fw_poll(dev_t dev, int events, fw_proc *td)
+fw_poll(struct cdev *dev, int events, fw_proc *td)
{
struct firewire_softc *sc;
struct fw_xferq *ir;
@@ -760,9 +760,9 @@ fw_poll(dev_t dev, int events, fw_proc *td)
static int
#if defined(__DragonFly__) || __FreeBSD_version < 500102
-fw_mmap (dev_t dev, vm_offset_t offset, int nproto)
+fw_mmap (struct cdev *dev, vm_offset_t offset, int nproto)
#else
-fw_mmap (dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nproto)
+fw_mmap (struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nproto)
#endif
{
struct firewire_softc *sc;
@@ -783,7 +783,7 @@ fw_mmap (dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nproto)
static void
fw_strategy(struct bio *bp)
{
- dev_t dev;
+ struct cdev *dev;
dev = bp->bio_dev;
if (DEV_FWMEM(dev)) {
@@ -805,7 +805,7 @@ fwdev_makedev(struct firewire_softc *sc)
#if defined(__DragonFly__) || __FreeBSD_version < 500000
cdevsw_add(&firewire_cdevsw);
#else
- dev_t d;
+ struct cdev *d;
int unit;
unit = device_get_unit(sc->fc->bdev);
@@ -840,7 +840,7 @@ fwdev_destroydev(struct firewire_softc *sc)
#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
#define NDEVTYPE 2
void
-fwdev_clone(void *arg, char *name, int namelen, dev_t *dev)
+fwdev_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
struct firewire_softc *sc;
char *devnames[NDEVTYPE] = {"fw", "fwmem"};
diff --git a/sys/dev/firewire/fwmem.c b/sys/dev/firewire/fwmem.c
index c10a078..a2e81e3 100644
--- a/sys/dev/firewire/fwmem.c
+++ b/sys/dev/firewire/fwmem.c
@@ -274,7 +274,7 @@ fwmem_write_block(
int
-fwmem_open (dev_t dev, int flags, int fmt, fw_proc *td)
+fwmem_open (struct cdev *dev, int flags, int fmt, fw_proc *td)
{
struct fwmem_softc *fms;
@@ -300,7 +300,7 @@ fwmem_open (dev_t dev, int flags, int fmt, fw_proc *td)
}
int
-fwmem_close (dev_t dev, int flags, int fmt, fw_proc *td)
+fwmem_close (struct cdev *dev, int flags, int fmt, fw_proc *td)
{
struct fwmem_softc *fms;
@@ -343,7 +343,7 @@ fwmem_strategy(struct bio *bp)
struct fwmem_softc *fms;
struct fw_device *fwdev;
struct fw_xfer *xfer;
- dev_t dev;
+ struct cdev *dev;
int unit, err=0, s, iolen;
dev = bp->bio_dev;
@@ -406,7 +406,7 @@ error:
}
int
-fwmem_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
+fwmem_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
{
struct fwmem_softc *fms;
int err = 0;
@@ -425,15 +425,15 @@ fwmem_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
return(err);
}
int
-fwmem_poll (dev_t dev, int events, fw_proc *td)
+fwmem_poll (struct cdev *dev, int events, fw_proc *td)
{
return EINVAL;
}
int
#if defined(__DragonFly__) || __FreeBSD_version < 500102
-fwmem_mmap (dev_t dev, vm_offset_t offset, int nproto)
+fwmem_mmap (struct cdev *dev, vm_offset_t offset, int nproto)
#else
-fwmem_mmap (dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nproto)
+fwmem_mmap (struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nproto)
#endif
{
return EINVAL;
diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c
index c6e58c5..6c99909 100644
--- a/sys/dev/firewire/fwohci.c
+++ b/sys/dev/firewire/fwohci.c
@@ -345,7 +345,7 @@ again:
}
/* Device specific ioctl. */
int
-fwohci_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
+fwohci_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
{
struct firewire_softc *sc;
struct fwohci_softc *fc;
diff --git a/sys/dev/gfb/gfb_pci.c b/sys/dev/gfb/gfb_pci.c
index 7fb3878..3e22978 100644
--- a/sys/dev/gfb/gfb_pci.c
+++ b/sys/dev/gfb/gfb_pci.c
@@ -260,7 +260,7 @@ pcigfb_detach(device_t dev)
#ifdef FB_INSTALL_CDEV
int
-pcigfb_open(dev_t dev, int flag, int mode, struct thread *td)
+pcigfb_open(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct gfb_softc *sc;
int error;
@@ -277,7 +277,7 @@ pcigfb_open(dev_t dev, int flag, int mode, struct thread *td)
}
int
-pcigfb_close(dev_t dev, int flag, int mode, struct thread *td)
+pcigfb_close(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct gfb_softc *sc;
@@ -286,7 +286,7 @@ pcigfb_close(dev_t dev, int flag, int mode, struct thread *td)
}
int
-pcigfb_read(dev_t dev, struct uio *uio, int flag)
+pcigfb_read(struct cdev *dev, struct uio *uio, int flag)
{
struct gfb_softc *sc;
@@ -295,7 +295,7 @@ pcigfb_read(dev_t dev, struct uio *uio, int flag)
}
int
-pcigfb_write(dev_t dev, struct uio *uio, int flag)
+pcigfb_write(struct cdev *dev, struct uio *uio, int flag)
{
struct gfb_softc *sc;
@@ -304,7 +304,7 @@ pcigfb_write(dev_t dev, struct uio *uio, int flag)
}
int
-pcigfb_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
+pcigfb_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
struct gfb_softc *sc;
@@ -313,7 +313,7 @@ pcigfb_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
}
int
-pcigfb_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+pcigfb_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
struct gfb_softc *sc;
diff --git a/sys/dev/ida/ida.c b/sys/dev/ida/ida.c
index 47f27a7..c9682ef 100644
--- a/sys/dev/ida/ida.c
+++ b/sys/dev/ida/ida.c
@@ -575,7 +575,7 @@ struct cmd_info {
static struct cmd_info *ida_cmd_lookup(int);
static int
-ida_ioctl (dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
+ida_ioctl (struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
{
struct ida_softc *sc;
struct ida_user_command *uc;
diff --git a/sys/dev/ida/idavar.h b/sys/dev/ida/idavar.h
index 78993cb..118e680 100644
--- a/sys/dev/ida/idavar.h
+++ b/sys/dev/ida/idavar.h
@@ -126,7 +126,7 @@ struct ida_access {
struct ida_softc {
device_t dev;
int unit;
- dev_t ida_dev_t;
+ struct cdev *ida_dev_t;
int regs_res_type;
int regs_res_id;
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c
index 37c2b61..3a879d8 100644
--- a/sys/dev/iicbus/iic.c
+++ b/sys/dev/iicbus/iic.c
@@ -52,7 +52,7 @@ struct iic_softc {
char sc_buffer[BUFSIZE]; /* output buffer */
char sc_inbuf[BUFSIZE]; /* input buffer */
- dev_t sc_devnode;
+ struct cdev *sc_devnode;
};
#define IIC_SOFTC(unit) \
@@ -146,7 +146,7 @@ iic_detach(device_t dev)
}
static int
-iicopen (dev_t dev, int flags, int fmt, struct thread *td)
+iicopen (struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct iic_softc *sc = IIC_SOFTC(minor(dev));
@@ -162,7 +162,7 @@ iicopen (dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-iicclose(dev_t dev, int flags, int fmt, struct thread *td)
+iicclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct iic_softc *sc = IIC_SOFTC(minor(dev));
@@ -181,7 +181,7 @@ iicclose(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-iicwrite(dev_t dev, struct uio * uio, int ioflag)
+iicwrite(struct cdev *dev, struct uio * uio, int ioflag)
{
device_t iicdev = IIC_DEVICE(minor(dev));
struct iic_softc *sc = IIC_SOFTC(minor(dev));
@@ -208,7 +208,7 @@ iicwrite(dev_t dev, struct uio * uio, int ioflag)
}
static int
-iicread(dev_t dev, struct uio * uio, int ioflag)
+iicread(struct cdev *dev, struct uio * uio, int ioflag)
{
device_t iicdev = IIC_DEVICE(minor(dev));
struct iic_softc *sc = IIC_SOFTC(minor(dev));
@@ -240,7 +240,7 @@ iicread(dev_t dev, struct uio * uio, int ioflag)
}
static int
-iicioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
device_t iicdev = IIC_DEVICE(minor(dev));
struct iic_softc *sc = IIC_SOFTC(minor(dev));
diff --git a/sys/dev/iir/iir.h b/sys/dev/iir/iir.h
index 44c4cf5..688cf63 100644
--- a/sys/dev/iir/iir.h
+++ b/sys/dev/iir/iir.h
@@ -602,7 +602,7 @@ struct gdt_softc {
#define GDT_POLLING 0x01
#define GDT_SHUTDOWN 0x02
#define GDT_POLL_WAIT 0x80
- dev_t sc_dev;
+ struct cdev *sc_dev;
bus_space_tag_t sc_dpmemt;
bus_space_handle_t sc_dpmemh;
bus_addr_t sc_dpmembase;
@@ -746,8 +746,8 @@ gdt_dec32(addr)
extern TAILQ_HEAD(gdt_softc_list, gdt_softc) gdt_softcs;
extern u_int8_t gdt_polling;
-dev_t gdt_make_dev(int unit);
-void gdt_destroy_dev(dev_t dev);
+struct cdev *gdt_make_dev(int unit);
+void gdt_destroy_dev(struct cdev *dev);
void gdt_next(struct gdt_softc *gdt);
void gdt_free_ccb(struct gdt_softc *gdt, struct gdt_ccb *gccb);
diff --git a/sys/dev/iir/iir_ctrl.c b/sys/dev/iir/iir_ctrl.c
index 87275b5..4d976b3 100644
--- a/sys/dev/iir/iir_ctrl.c
+++ b/sys/dev/iir/iir_ctrl.c
@@ -95,10 +95,10 @@ extern gdt_statist_t gdt_stat;
* Given a controller number,
* make a special device and return the dev_t
*/
-dev_t
+struct cdev *
gdt_make_dev(int unit)
{
- dev_t dev;
+ struct cdev *dev;
#ifdef SDEV_PER_HBA
dev = make_dev(&iir_cdevsw, hba2minor(unit), UID_ROOT, GID_OPERATOR,
@@ -114,7 +114,7 @@ gdt_make_dev(int unit)
}
void
-gdt_destroy_dev(dev_t dev)
+gdt_destroy_dev(struct cdev *dev)
{
if (dev != NULL)
destroy_dev(dev);
@@ -144,7 +144,7 @@ gdt_minor2softc(int minor_no)
}
static int
-iir_open(dev_t dev, int flags, int fmt, d_thread_t * p)
+iir_open(struct cdev *dev, int flags, int fmt, d_thread_t * p)
{
GDT_DPRINTF(GDT_D_DEBUG, ("iir_open()\n"));
@@ -162,7 +162,7 @@ iir_open(dev_t dev, int flags, int fmt, d_thread_t * p)
}
static int
-iir_close(dev_t dev, int flags, int fmt, d_thread_t * p)
+iir_close(struct cdev *dev, int flags, int fmt, d_thread_t * p)
{
GDT_DPRINTF(GDT_D_DEBUG, ("iir_close()\n"));
@@ -180,7 +180,7 @@ iir_close(dev_t dev, int flags, int fmt, d_thread_t * p)
}
static int
-iir_write(dev_t dev, struct uio * uio, int ioflag)
+iir_write(struct cdev *dev, struct uio * uio, int ioflag)
{
GDT_DPRINTF(GDT_D_DEBUG, ("iir_write()\n"));
@@ -198,7 +198,7 @@ iir_write(dev_t dev, struct uio * uio, int ioflag)
}
static int
-iir_read(dev_t dev, struct uio * uio, int ioflag)
+iir_read(struct cdev *dev, struct uio * uio, int ioflag)
{
GDT_DPRINTF(GDT_D_DEBUG, ("iir_read()\n"));
@@ -222,7 +222,7 @@ iir_read(dev_t dev, struct uio * uio, int ioflag)
*/
static int
-iir_ioctl(dev_t dev, u_long cmd, caddr_t cmdarg, int flags, d_thread_t * p)
+iir_ioctl(struct cdev *dev, u_long cmd, caddr_t cmdarg, int flags, d_thread_t * p)
{
GDT_DPRINTF(GDT_D_DEBUG, ("iir_ioctl() cmd 0x%lx\n",cmd));
diff --git a/sys/dev/ips/ips.c b/sys/dev/ips/ips.c
index b2532e9..b1a8297 100644
--- a/sys/dev/ips/ips.c
+++ b/sys/dev/ips/ips.c
@@ -68,14 +68,14 @@ static const char* ips_adapter_name[] = {
};
-static int ips_open(dev_t dev, int flags, int fmt, struct thread *td)
+static int ips_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
ips_softc_t *sc = dev->si_drv1;
sc->state |= IPS_DEV_OPEN;
return 0;
}
-static int ips_close(dev_t dev, int flags, int fmt, struct thread *td)
+static int ips_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
ips_softc_t *sc = dev->si_drv1;
sc->state &= ~IPS_DEV_OPEN;
@@ -83,7 +83,7 @@ static int ips_close(dev_t dev, int flags, int fmt, struct thread *td)
return 0;
}
-static int ips_ioctl(dev_t dev, u_long command, caddr_t addr, int32_t flags, struct thread *td)
+static int ips_ioctl(struct cdev *dev, u_long command, caddr_t addr, int32_t flags, struct thread *td)
{
ips_softc_t *sc;
diff --git a/sys/dev/ips/ips.h b/sys/dev/ips/ips.h
index 5fd7514..9c26a7a 100644
--- a/sys/dev/ips/ips.h
+++ b/sys/dev/ips/ips.h
@@ -414,7 +414,7 @@ typedef struct ips_softc{
bus_dma_tag_t command_dmatag;
bus_dma_tag_t sg_dmatag;
device_t dev;
- dev_t device_file;
+ struct cdev *device_file;
struct callout_handle timer;
u_int16_t adapter_type;
ips_adapter_info_t adapter_info;
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c
index c7f908f..9845078 100644
--- a/sys/dev/isp/isp_freebsd.c
+++ b/sys/dev/isp/isp_freebsd.c
@@ -238,7 +238,7 @@ isp_freeze_loopdown(struct ispsoftc *isp, char *msg)
}
static int
-ispioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
+ispioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
{
struct ispsoftc *isp;
int nr, retval = ENOTTY;
diff --git a/sys/dev/joy/joy.c b/sys/dev/joy/joy.c
index 0b4efe7..0568feb 100644
--- a/sys/dev/joy/joy.c
+++ b/sys/dev/joy/joy.c
@@ -128,7 +128,7 @@ joy_detach(device_t dev)
static int
-joyopen(dev_t dev, int flags, int fmt, struct thread *td)
+joyopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int i = joypart (dev);
struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
@@ -141,7 +141,7 @@ joyopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-joyclose(dev_t dev, int flags, int fmt, struct thread *td)
+joyclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int i = joypart (dev);
struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
@@ -151,7 +151,7 @@ joyclose(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-joyread(dev_t dev, struct uio *uio, int flag)
+joyread(struct cdev *dev, struct uio *uio, int flag)
{
struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
bus_space_handle_t port = joy->port;
@@ -209,7 +209,7 @@ joyread(dev_t dev, struct uio *uio, int flag)
}
static int
-joyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+joyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct joy_softc *joy = JOY_SOFTC(UNIT(dev));
int i = joypart (dev);
diff --git a/sys/dev/joy/joyvar.h b/sys/dev/joy/joyvar.h
index 7fd1c13..966fe78 100644
--- a/sys/dev/joy/joyvar.h
+++ b/sys/dev/joy/joyvar.h
@@ -35,7 +35,7 @@ struct joy_softc {
int timeout[2];
struct resource *res;
int rid;
- dev_t d;
+ struct cdev *d;
};
int joy_probe(device_t);
diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c
index 0f1f571..b7694c5 100644
--- a/sys/dev/kbd/kbd.c
+++ b/sys/dev/kbd/kbd.c
@@ -489,7 +489,7 @@ kbd_detach(keyboard_t *kbd)
static kbd_callback_func_t genkbd_event;
static int
-genkbdopen(dev_t dev, int mode, int flag, struct thread *td)
+genkbdopen(struct cdev *dev, int mode, int flag, struct thread *td)
{
keyboard_t *kbd;
genkbd_softc_t *sc;
@@ -527,7 +527,7 @@ genkbdopen(dev_t dev, int mode, int flag, struct thread *td)
}
static int
-genkbdclose(dev_t dev, int mode, int flag, struct thread *td)
+genkbdclose(struct cdev *dev, int mode, int flag, struct thread *td)
{
keyboard_t *kbd;
genkbd_softc_t *sc;
@@ -553,7 +553,7 @@ genkbdclose(dev_t dev, int mode, int flag, struct thread *td)
}
static int
-genkbdread(dev_t dev, struct uio *uio, int flag)
+genkbdread(struct cdev *dev, struct uio *uio, int flag)
{
keyboard_t *kbd;
genkbd_softc_t *sc;
@@ -606,7 +606,7 @@ genkbdread(dev_t dev, struct uio *uio, int flag)
}
static int
-genkbdwrite(dev_t dev, struct uio *uio, int flag)
+genkbdwrite(struct cdev *dev, struct uio *uio, int flag)
{
keyboard_t *kbd;
@@ -617,7 +617,7 @@ genkbdwrite(dev_t dev, struct uio *uio, int flag)
}
static int
-genkbdioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
+genkbdioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
keyboard_t *kbd;
int error;
@@ -632,7 +632,7 @@ genkbdioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
}
static int
-genkbdpoll(dev_t dev, int events, struct thread *td)
+genkbdpoll(struct cdev *dev, int events, struct thread *td)
{
keyboard_t *kbd;
genkbd_softc_t *sc;
diff --git a/sys/dev/kbd/kbdreg.h b/sys/dev/kbd/kbdreg.h
index 05fb895..78a5af4 100644
--- a/sys/dev/kbd/kbdreg.h
+++ b/sys/dev/kbd/kbdreg.h
@@ -90,7 +90,7 @@ struct keyboard {
#define KB_DELAY2 100
unsigned long kb_count; /* # of processed key strokes */
u_char kb_lastact[NUM_KEYS/2];
- dev_t kb_dev;
+ struct cdev *kb_dev;
};
#define KBD_IS_VALID(k) ((k)->kb_flags & KB_VALID)
diff --git a/sys/dev/led/led.c b/sys/dev/led/led.c
index 5160a05..4c19e27 100644
--- a/sys/dev/led/led.c
+++ b/sys/dev/led/led.c
@@ -26,7 +26,7 @@ struct ledsc {
LIST_ENTRY(ledsc) list;
void *private;
led_t *func;
- dev_t dev;
+ struct cdev *dev;
struct sbuf *spec;
char *str;
char *ptr;
@@ -72,7 +72,7 @@ led_timeout(void *p)
}
static int
-led_write(dev_t dev, struct uio *uio, int ioflag)
+led_write(struct cdev *dev, struct uio *uio, int ioflag)
{
int error;
char *s, *s2;
@@ -221,7 +221,7 @@ static struct cdevsw led_cdevsw = {
.d_name = "LED",
};
-dev_t
+struct cdev *
led_create(led_t *func, void *priv, char const *name)
{
struct ledsc *sc;
@@ -259,7 +259,7 @@ led_create(led_t *func, void *priv, char const *name)
}
void
-led_destroy(dev_t dev)
+led_destroy(struct cdev *dev)
{
struct ledsc *sc;
diff --git a/sys/dev/led/led.h b/sys/dev/led/led.h
index 6880efd..866311b 100644
--- a/sys/dev/led/led.h
+++ b/sys/dev/led/led.h
@@ -14,7 +14,7 @@
typedef void led_t(void *, int);
-dev_t led_create(led_t *, void *, char const *);
-void led_destroy(dev_t);
+struct cdev *led_create(led_t *, void *, char const *);
+void led_destroy(struct cdev *);
#endif
diff --git a/sys/dev/matcd/matcd.c b/sys/dev/matcd/matcd.c
index 9e28d25..aead16c 100644
--- a/sys/dev/matcd/matcd.c
+++ b/sys/dev/matcd/matcd.c
@@ -624,7 +624,7 @@ struct matcd_mbx {
static struct matcd_data {
device_t dev;
- dev_t matcd_dev_t;
+ struct cdev *matcd_dev_t;
short config;
short drivemode; /*Last state drive was set to*/
short flags;
@@ -657,8 +657,8 @@ static unsigned char if_state[4]={0,0,0,0}; /*State of host I/F and bus*/
int matcd_probe(struct matcd_softc *sc);
int matcd_attach(struct matcd_softc *sc);
-static int matcdopen(dev_t dev, int flags, int fmt, struct thread *ptx);
-static int matcdclose(dev_t dev, int flags, int fmt, struct thread *ptx);
+static int matcdopen(struct cdev *dev, int flags, int fmt, struct thread *ptx);
+static int matcdclose(struct cdev *dev, int flags, int fmt, struct thread *ptx);
static void matcdstrategy(struct bio *bp);
static d_ioctl_t matcdioctl;
static timeout_t matcd_timeout;
@@ -668,7 +668,7 @@ static timeout_t matcd_timeout;
Internal function declarations
---------------------------------------------------------------------------*/
-static int matcdsize(dev_t dev);
+static int matcdsize(struct cdev *dev);
static void matcd_start(struct bio_queue_head *dp);
static void zero_cmd(char *);
static void matcd_pread(int port, int count, unsigned char * data);
@@ -772,7 +772,7 @@ int matcd_attach(struct matcd_softc *sc)
unsigned char data[12];
struct matcd_data *cd;
int port = sc->port_bsh; /*Take port ID selected in probe()*/
- dev_t d;
+ struct cdev *d;
int unit=0;
printf("matcdc%d: Host interface type %d port %x\n",
@@ -864,7 +864,7 @@ int matcd_attach(struct matcd_softc *sc)
<15> If LOCKDRIVE is enabled, additional minor number devices allow
<15> the drive to be locked while being accessed.
---------------------------------------------------------------------------*/
-static int matcdopen(dev_t dev, int flags, int fmt,
+static int matcdopen(struct cdev *dev, int flags, int fmt,
struct thread *ptx)
{
int cdrive,ldrive,partition,controller,lock;
@@ -1051,7 +1051,7 @@ static int matcdopen(dev_t dev, int flags, int fmt,
the drive. See Edit 15 in Edit History.
---------------------------------------------------------------------------*/
-static int matcdclose(dev_t dev, int flags, int fmt,struct thread *ptx)
+static int matcdclose(struct cdev *dev, int flags, int fmt,struct thread *ptx)
{
int ldrive,cdrive,port,partition,controller,lock;
struct matcd_data *cd;
@@ -1910,7 +1910,7 @@ static void matcd_start(struct bio_queue_head *dp)
things that don't fit into the block read scheme of things.
---------------------------------------------------------------------------*/
-static int matcdioctl(dev_t dev, unsigned long command,
+static int matcdioctl(struct cdev *dev, unsigned long command,
caddr_t addr, int flags,
struct thread *td)
{
@@ -2051,7 +2051,7 @@ static int matcdioctl(dev_t dev, unsigned long command,
matcdsize - Reports how many blocks exist on the disc.
---------------------------------------------------------------------------*/
-static int matcdsize(dev_t dev)
+static int matcdsize(struct cdev *dev)
{
int size,blksize;
int ldrive,part;
diff --git a/sys/dev/matcd/matcd_data.h b/sys/dev/matcd/matcd_data.h
index 381599a..1923cec 100644
--- a/sys/dev/matcd/matcd_data.h
+++ b/sys/dev/matcd/matcd_data.h
@@ -50,7 +50,7 @@ See matcd.c for Edit History
struct matcd_softc {
device_t dev;
- dev_t matcd_dev_t;
+ struct cdev *matcd_dev_t;
struct resource * port;
int port_rid;
int port_type;
diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c
index ebc233e..4f09744 100644
--- a/sys/dev/mcd/mcd.c
+++ b/sys/dev/mcd/mcd.c
@@ -153,7 +153,7 @@ static int mcd_pause(struct mcd_softc *);
static int mcd_resume(struct mcd_softc *);
static int mcd_lock_door(struct mcd_softc *, int lock);
static int mcd_close_tray(struct mcd_softc *);
-static int mcd_size(dev_t dev);
+static int mcd_size(struct cdev *dev);
static d_open_t mcdopen;
static d_close_t mcdclose;
@@ -211,7 +211,7 @@ mcd_attach(struct mcd_softc *sc)
}
static int
-mcdopen(dev_t dev, int flags, int fmt, struct thread *td)
+mcdopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct mcd_softc *sc;
int r,retry;
@@ -271,7 +271,7 @@ mcdopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-mcdclose(dev_t dev, int flags, int fmt, struct thread *td)
+mcdclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct mcd_softc *sc;
@@ -368,7 +368,7 @@ mcd_start(struct mcd_softc *sc)
}
static int
-mcdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
+mcdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
{
struct mcd_softc *sc;
int retry,r;
@@ -466,7 +466,7 @@ MCD_TRACE("ioctl called 0x%lx\n", cmd);
}
static int
-mcd_size(dev_t dev)
+mcd_size(struct cdev *dev)
{
struct mcd_softc *sc;
int size;
diff --git a/sys/dev/mcd/mcdvar.h b/sys/dev/mcd/mcdvar.h
index 9f81ced..adfd4a4 100644
--- a/sys/dev/mcd/mcdvar.h
+++ b/sys/dev/mcd/mcdvar.h
@@ -35,7 +35,7 @@ struct mcd_data {
struct mcd_softc {
device_t dev;
- dev_t mcd_dev_t;
+ struct cdev *mcd_dev_t;
int debug;
struct resource * port;
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 4b680d7..295d8d2 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -107,7 +107,7 @@ static u_char end_mfs_root[] __unused = "MFS Filesystem had better STOP here";
static g_init_t md_drvinit;
static int mdunits;
-static dev_t status_dev = 0;
+static struct cdev *status_dev = 0;
static d_ioctl_t mdctlioctl;
@@ -137,7 +137,7 @@ struct md_s {
LIST_ENTRY(md_s) list;
struct bio_queue_head bio_queue;
struct mtx queue_mtx;
- dev_t dev;
+ struct cdev *dev;
enum md_types type;
unsigned nsect;
unsigned opencount;
@@ -1078,7 +1078,7 @@ mddetach(int unit, struct thread *td)
}
static int
-mdctlioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
+mdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
{
struct md_ioctl *mdio;
struct md_s *sc;
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c
index bf7b8cd..f026175 100644
--- a/sys/dev/mlx/mlx.c
+++ b/sys/dev/mlx/mlx.c
@@ -204,7 +204,7 @@ mlx_free(struct mlx_softc *sc)
free(sc->mlx_enq2, M_DEVBUF);
/* destroy control device */
- if (sc->mlx_dev_t != (dev_t)NULL)
+ if (sc->mlx_dev_t != (struct cdev *)NULL)
destroy_dev(sc->mlx_dev_t);
}
@@ -721,7 +721,7 @@ mlx_submit_buf(struct mlx_softc *sc, mlx_bio *bp)
* Accept an open operation on the control device.
*/
int
-mlx_open(dev_t dev, int flags, int fmt, struct thread *td)
+mlx_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int unit = minor(dev);
struct mlx_softc *sc = devclass_get_softc(mlx_devclass, unit);
@@ -734,7 +734,7 @@ mlx_open(dev_t dev, int flags, int fmt, struct thread *td)
* Accept the last close on the control device.
*/
int
-mlx_close(dev_t dev, int flags, int fmt, struct thread *td)
+mlx_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int unit = minor(dev);
struct mlx_softc *sc = devclass_get_softc(mlx_devclass, unit);
@@ -747,7 +747,7 @@ mlx_close(dev_t dev, int flags, int fmt, struct thread *td)
* Handle controller-specific control operations.
*/
int
-mlx_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
+mlx_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
{
int unit = minor(dev);
struct mlx_softc *sc = devclass_get_softc(mlx_devclass, unit);
diff --git a/sys/dev/mlx/mlxvar.h b/sys/dev/mlx/mlxvar.h
index e499569..345cf99 100644
--- a/sys/dev/mlx/mlxvar.h
+++ b/sys/dev/mlx/mlxvar.h
@@ -108,7 +108,7 @@ struct mlx_softc
{
/* bus connections */
device_t mlx_dev;
- dev_t mlx_dev_t;
+ struct cdev *mlx_dev_t;
struct resource *mlx_mem; /* mailbox interface window */
int mlx_mem_rid;
int mlx_mem_type;
diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c
index eb035d0..2e36816 100644
--- a/sys/dev/mly/mly.c
+++ b/sys/dev/mly/mly.c
@@ -2826,7 +2826,7 @@ mly_print_controller(int controller)
* Accept an open operation on the control device.
*/
static int
-mly_user_open(dev_t dev, int flags, int fmt, struct thread *td)
+mly_user_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int unit = minor(dev);
struct mly_softc *sc = devclass_get_softc(devclass_find("mly"), unit);
@@ -2839,7 +2839,7 @@ mly_user_open(dev_t dev, int flags, int fmt, struct thread *td)
* Accept the last close on the control device.
*/
static int
-mly_user_close(dev_t dev, int flags, int fmt, struct thread *td)
+mly_user_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int unit = minor(dev);
struct mly_softc *sc = devclass_get_softc(devclass_find("mly"), unit);
@@ -2852,7 +2852,7 @@ mly_user_close(dev_t dev, int flags, int fmt, struct thread *td)
* Handle controller-specific control operations.
*/
static int
-mly_user_ioctl(dev_t dev, u_long cmd, caddr_t addr,
+mly_user_ioctl(struct cdev *dev, u_long cmd, caddr_t addr,
int32_t flag, struct thread *td)
{
struct mly_softc *sc = (struct mly_softc *)dev->si_drv1;
diff --git a/sys/dev/mly/mlyvar.h b/sys/dev/mly/mlyvar.h
index c994d42..e1c7a50 100644
--- a/sys/dev/mly/mlyvar.h
+++ b/sys/dev/mly/mlyvar.h
@@ -165,7 +165,7 @@ struct mly_command {
struct mly_softc {
/* bus connections */
device_t mly_dev;
- dev_t mly_dev_t;
+ struct cdev *mly_dev_t;
struct resource *mly_regs_resource; /* register interface window */
int mly_regs_rid; /* resource ID */
bus_space_handle_t mly_bhandle; /* bus space handle */
diff --git a/sys/dev/mse/mse.c b/sys/dev/mse/mse.c
index ddc0742..31c85f8 100644
--- a/sys/dev/mse/mse.c
+++ b/sys/dev/mse/mse.c
@@ -96,8 +96,8 @@ typedef struct mse_softc {
u_char sc_bytes[MOUSE_SYS_PACKETSIZE];
struct callout_handle sc_callout;
int sc_watchdog;
- dev_t sc_dev;
- dev_t sc_ndev;
+ struct cdev *sc_dev;
+ struct cdev *sc_ndev;
mousehw_t hw;
mousemode_t mode;
mousestatus_t status;
@@ -386,7 +386,7 @@ mse_detach(dev)
*/
static int
mseopen(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -426,7 +426,7 @@ mseopen(dev, flags, fmt, td)
*/
static int
mseclose(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -450,7 +450,7 @@ mseclose(dev, flags, fmt, td)
*/
static int
mseread(dev, uio, ioflag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int ioflag;
{
@@ -517,7 +517,7 @@ mseread(dev, uio, ioflag)
*/
static int
mseioctl(dev, cmd, addr, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t addr;
int flag;
@@ -634,7 +634,7 @@ mseioctl(dev, cmd, addr, flag, td)
*/
static int
msepoll(dev, events, td)
- dev_t dev;
+ struct cdev *dev;
int events;
struct thread *td;
{
@@ -667,10 +667,10 @@ static void
msetimeout(arg)
void *arg;
{
- dev_t dev;
+ struct cdev *dev;
mse_softc_t *sc;
- dev = (dev_t)arg;
+ dev = (struct cdev *)arg;
sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
if (sc->sc_watchdog) {
if (bootverbose)
diff --git a/sys/dev/nmdm/nmdm.c b/sys/dev/nmdm/nmdm.c
index cb25ecb..683d06b 100644
--- a/sys/dev/nmdm/nmdm.c
+++ b/sys/dev/nmdm/nmdm.c
@@ -57,7 +57,7 @@ MALLOC_DEFINE(M_NLMDM, "nullmodem", "nullmodem data structures");
static void nmdmstart(struct tty *tp);
static void nmdmstop(struct tty *tp, int rw);
-static void nmdminit(dev_t dev);
+static void nmdminit(struct cdev *dev);
static d_open_t nmdmopen;
static d_close_t nmdmclose;
@@ -77,7 +77,7 @@ static struct cdevsw nmdm_cdevsw = {
struct softpart {
struct tty *nm_tty;
- dev_t dev;
+ struct cdev *dev;
int dcd;
struct task pt_task;
struct softpart *other;
@@ -94,11 +94,11 @@ static struct clonedevs *nmdmclones;
static TAILQ_HEAD(,nm_softc) nmdmhead = TAILQ_HEAD_INITIALIZER(nmdmhead);
static void
-nmdm_clone(void *arg, char *name, int nameen, dev_t *dev)
+nmdm_clone(void *arg, char *name, int nameen, struct cdev **dev)
{
int i, unit;
char *p;
- dev_t d1, d2;
+ struct cdev *d1, *d2;
if (*dev != NODEV)
return;
@@ -179,9 +179,9 @@ nmdm_task_tty(void *arg, int pending __unused)
* This function creates and initializes a pair of ttys.
*/
static void
-nmdminit(dev_t dev1)
+nmdminit(struct cdev *dev1)
{
- dev_t dev2;
+ struct cdev *dev2;
struct nm_softc *pt;
dev2 = dev1->si_drv2;
@@ -225,7 +225,7 @@ nmdminit(dev_t dev1)
* Device opened from userland
*/
static int
-nmdmopen(dev_t dev, int flag, int devtype, struct thread *td)
+nmdmopen(struct cdev *dev, int flag, int devtype, struct thread *td)
{
struct tty *tp, *tp2;
int error;
@@ -260,7 +260,7 @@ nmdmopen(dev_t dev, int flag, int devtype, struct thread *td)
}
static int
-nmdmclose(dev_t dev, int flag, int mode, struct thread *td)
+nmdmclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
return (ttyclose(dev->si_tty));
diff --git a/sys/dev/null/null.c b/sys/dev/null/null.c
index 314f460..710d4b1 100644
--- a/sys/dev/null/null.c
+++ b/sys/dev/null/null.c
@@ -40,8 +40,8 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
/* For use with destroy_dev(9). */
-static dev_t null_dev;
-static dev_t zero_dev;
+static struct cdev *null_dev;
+static struct cdev *zero_dev;
static d_write_t null_write;
static d_ioctl_t null_ioctl;
@@ -73,7 +73,7 @@ static void *zbuf;
/* ARGSUSED */
static int
-null_write(dev_t dev __unused, struct uio *uio, int flags __unused)
+null_write(struct cdev *dev __unused, struct uio *uio, int flags __unused)
{
uio->uio_resid = 0;
return 0;
@@ -81,7 +81,7 @@ null_write(dev_t dev __unused, struct uio *uio, int flags __unused)
/* ARGSUSED */
static int
-null_ioctl(dev_t dev __unused, u_long cmd, caddr_t data __unused,
+null_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data __unused,
int flags __unused, struct thread *td)
{
int error;
@@ -96,7 +96,7 @@ null_ioctl(dev_t dev __unused, u_long cmd, caddr_t data __unused,
/* ARGSUSED */
static int
-zero_read(dev_t dev __unused, struct uio *uio, int flags __unused)
+zero_read(struct cdev *dev __unused, struct uio *uio, int flags __unused)
{
int c;
int error = 0;
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index a16f58d..5ee5914 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -83,7 +83,7 @@ cn_drvinit(void *unused)
{
phandle_t options;
char output[32];
- dev_t dev;
+ struct cdev *dev;
if (ofw_consdev.cn_pri != CN_DEAD &&
ofw_consdev.cn_name[0] != '\0') {
@@ -103,7 +103,7 @@ static int stdin;
static int stdout;
static int
-ofw_dev_open(dev_t dev, int flag, int mode, struct thread *td)
+ofw_dev_open(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct tty *tp;
int unit;
@@ -150,7 +150,7 @@ ofw_dev_open(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-ofw_dev_close(dev_t dev, int flag, int mode, struct thread *td)
+ofw_dev_close(struct cdev *dev, int flag, int mode, struct thread *td)
{
int unit;
struct tty *tp;
diff --git a/sys/dev/ofw/openfirmio.c b/sys/dev/ofw/openfirmio.c
index adb3929..4839428 100644
--- a/sys/dev/ofw/openfirmio.c
+++ b/sys/dev/ofw/openfirmio.c
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#include <dev/ofw/openfirmio.h>
-static dev_t openfirm_dev;
+static struct cdev *openfirm_dev;
static d_ioctl_t openfirm_ioctl;
@@ -108,7 +108,7 @@ openfirm_getstr(int len, const char *user, char **cpp)
}
int
-openfirm_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
+openfirm_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
struct thread *td)
{
struct ofiocdesc *of;
diff --git a/sys/dev/ofw/openpromio.c b/sys/dev/ofw/openpromio.c
index 5bf5e69..3182bff 100644
--- a/sys/dev/ofw/openpromio.c
+++ b/sys/dev/ofw/openpromio.c
@@ -67,11 +67,11 @@ static struct cdevsw openprom_cdevsw = {
};
static int openprom_is_open;
-static dev_t openprom_dev;
+static struct cdev *openprom_dev;
static phandle_t openprom_node;
static int
-openprom_open(dev_t dev, int oflags, int devtype, struct thread *td)
+openprom_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
if (openprom_is_open != 0)
@@ -81,7 +81,7 @@ openprom_open(dev_t dev, int oflags, int devtype, struct thread *td)
}
static int
-openprom_close(dev_t dev, int fflag, int devtype, struct thread *td)
+openprom_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
{
openprom_is_open = 0;
@@ -89,7 +89,7 @@ openprom_close(dev_t dev, int fflag, int devtype, struct thread *td)
}
static int
-openprom_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
+openprom_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
struct thread *td)
{
struct openpromio *oprom;
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index f993135..0917ac5 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1783,7 +1783,7 @@ pci_assign_interrupt_method(device_t dev, device_t child)
static int
pci_modevent(module_t mod, int what, void *arg)
{
- static dev_t pci_cdev;
+ static struct cdev *pci_cdev;
switch (what) {
case MOD_LOAD:
diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c
index 0ce8da9..b14abe1 100644
--- a/sys/dev/pci/pci_user.c
+++ b/sys/dev/pci/pci_user.c
@@ -84,7 +84,7 @@ struct cdevsw pcicdev = {
};
static int
-pci_open(dev_t dev, int oflags, int devtype, struct thread *td)
+pci_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
int error;
@@ -98,7 +98,7 @@ pci_open(dev_t dev, int oflags, int devtype, struct thread *td)
}
static int
-pci_close(dev_t dev, int flag, int devtype, struct thread *td)
+pci_close(struct cdev *dev, int flag, int devtype, struct thread *td)
{
return 0;
}
@@ -171,7 +171,7 @@ pci_conf_match(struct pci_match_conf *matches, int num_matches,
}
static int
-pci_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
device_t pci, pcib;
struct pci_io *io;
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c
index 7855e36..f3f2c1d 100644
--- a/sys/dev/ppbus/lpt.c
+++ b/sys/dev/ppbus/lpt.c
@@ -455,7 +455,7 @@ lptout(void *arg)
*/
static int
-lptopen(dev_t dev, int flags, int fmt, struct thread *td)
+lptopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int s;
int trys, err;
@@ -575,7 +575,7 @@ lptopen(dev_t dev, int flags, int fmt, struct thread *td)
*/
static int
-lptclose(dev_t dev, int flags, int fmt, struct thread *td)
+lptclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
u_int unit = LPTUNIT(minor(dev));
struct lpt_data *sc = UNITOSOFTC(unit);
@@ -684,7 +684,7 @@ lpt_pushbytes(device_t dev)
*/
static int
-lptread(dev_t dev, struct uio *uio, int ioflag)
+lptread(struct cdev *dev, struct uio *uio, int ioflag)
{
u_int unit = LPTUNIT(minor(dev));
struct lpt_data *sc = UNITOSOFTC(unit);
@@ -729,7 +729,7 @@ error:
*/
static int
-lptwrite(dev_t dev, struct uio *uio, int ioflag)
+lptwrite(struct cdev *dev, struct uio *uio, int ioflag)
{
register unsigned n;
int err;
@@ -897,7 +897,7 @@ lptintr(device_t dev)
}
static int
-lptioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+lptioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
int error = 0;
u_int unit = LPTUNIT(minor(dev));
diff --git a/sys/dev/ppbus/pcfclock.c b/sys/dev/ppbus/pcfclock.c
index 599d255..0219220 100644
--- a/sys/dev/ppbus/pcfclock.c
+++ b/sys/dev/ppbus/pcfclock.c
@@ -152,7 +152,7 @@ pcfclock_attach(device_t dev)
}
static int
-pcfclock_open(dev_t dev, int flag, int fms, struct thread *td)
+pcfclock_open(struct cdev *dev, int flag, int fms, struct thread *td)
{
u_int unit = minor(dev);
struct pcfclock_data *sc = UNITOSOFTC(unit);
@@ -173,7 +173,7 @@ pcfclock_open(dev_t dev, int flag, int fms, struct thread *td)
}
static int
-pcfclock_close(dev_t dev, int flags, int fmt, struct thread *td)
+pcfclock_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
u_int unit = minor(dev);
struct pcfclock_data *sc = UNITOSOFTC(unit);
@@ -188,7 +188,7 @@ pcfclock_close(dev_t dev, int flags, int fmt, struct thread *td)
}
static void
-pcfclock_write_cmd(dev_t dev, unsigned char command)
+pcfclock_write_cmd(struct cdev *dev, unsigned char command)
{
u_int unit = minor(dev);
device_t ppidev = UNITODEVICE(unit);
@@ -208,7 +208,7 @@ pcfclock_write_cmd(dev_t dev, unsigned char command)
}
static void
-pcfclock_display_data(dev_t dev, char buf[18])
+pcfclock_display_data(struct cdev *dev, char buf[18])
{
u_int unit = minor(dev);
#ifdef PCFCLOCK_VERBOSE
@@ -232,7 +232,7 @@ pcfclock_display_data(dev_t dev, char buf[18])
}
static int
-pcfclock_read_data(dev_t dev, char *buf, ssize_t bits)
+pcfclock_read_data(struct cdev *dev, char *buf, ssize_t bits)
{
u_int unit = minor(dev);
device_t ppidev = UNITODEVICE(unit);
@@ -271,7 +271,7 @@ pcfclock_read_data(dev_t dev, char *buf, ssize_t bits)
}
static int
-pcfclock_read_dev(dev_t dev, char *buf, int maxretries)
+pcfclock_read_dev(struct cdev *dev, char *buf, int maxretries)
{
u_int unit = minor(dev);
device_t ppidev = UNITODEVICE(unit);
@@ -301,7 +301,7 @@ pcfclock_read_dev(dev_t dev, char *buf, int maxretries)
}
static int
-pcfclock_read(dev_t dev, struct uio *uio, int ioflag)
+pcfclock_read(struct cdev *dev, struct uio *uio, int ioflag)
{
u_int unit = minor(dev);
char buf[18];
diff --git a/sys/dev/ppbus/ppi.c b/sys/dev/ppbus/ppi.c
index 113448d..b537c88 100644
--- a/sys/dev/ppbus/ppi.c
+++ b/sys/dev/ppbus/ppi.c
@@ -255,7 +255,7 @@ ppiintr(void *arg)
#endif /* PERIPH_1284 */
static int
-ppiopen(dev_t dev, int flags, int fmt, struct thread *td)
+ppiopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
u_int unit = minor(dev);
struct ppi_data *ppi = UNITOSOFTC(unit);
@@ -288,7 +288,7 @@ ppiopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-ppiclose(dev_t dev, int flags, int fmt, struct thread *td)
+ppiclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
u_int unit = minor(dev);
struct ppi_data *ppi = UNITOSOFTC(unit);
@@ -330,7 +330,7 @@ ppiclose(dev_t dev, int flags, int fmt, struct thread *td)
* If no data is available, wait for it otherwise transfer as much as possible
*/
static int
-ppiread(dev_t dev, struct uio *uio, int ioflag)
+ppiread(struct cdev *dev, struct uio *uio, int ioflag)
{
#ifdef PERIPH_1284
u_int unit = minor(dev);
@@ -414,7 +414,7 @@ error:
* Once negotiation done, transfer data
*/
static int
-ppiwrite(dev_t dev, struct uio *uio, int ioflag)
+ppiwrite(struct cdev *dev, struct uio *uio, int ioflag)
{
#ifdef PERIPH_1284
u_int unit = minor(dev);
@@ -501,7 +501,7 @@ error:
}
static int
-ppiioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+ppiioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
u_int unit = minor(dev);
device_t ppidev = UNITODEVICE(unit);
diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c
index fef6157..2b86cd7 100644
--- a/sys/dev/ppbus/pps.c
+++ b/sys/dev/ppbus/pps.c
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
struct pps_data {
struct ppb_device pps_dev;
struct pps_state pps[9];
- dev_t devs[9];
+ struct cdev *devs[9];
device_t ppsdev;
device_t ppbus;
int busy;
@@ -106,7 +106,7 @@ ppsattach(device_t dev)
{
struct pps_data *sc = DEVTOSOFTC(dev);
device_t ppbus = device_get_parent(dev);
- dev_t d;
+ struct cdev *d;
intptr_t irq;
int i, unit, zero = 0;
@@ -191,7 +191,7 @@ ppsattach(device_t dev)
}
static int
-ppsopen(dev_t dev, int flags, int fmt, struct thread *td)
+ppsopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct pps_data *sc = dev->si_drv1;
int subdev = (intptr_t)dev->si_drv2;
@@ -227,7 +227,7 @@ ppsopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-ppsclose(dev_t dev, int flags, int fmt, struct thread *td)
+ppsclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct pps_data *sc = dev->si_drv1;
int subdev = (intptr_t)dev->si_drv2;
@@ -293,7 +293,7 @@ ppsintr(void *arg)
}
static int
-ppsioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+ppsioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
struct pps_data *sc = dev->si_drv1;
int subdev = (intptr_t)dev->si_drv2;
diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c
index e6727ee..a88e4a9 100644
--- a/sys/dev/random/randomdev.c
+++ b/sys/dev/random/randomdev.c
@@ -74,7 +74,7 @@ static struct cdevsw random_cdevsw = {
struct random_systat random_systat;
/* For use with make_dev(9)/destroy_dev(9). */
-static dev_t random_dev;
+static struct cdev *random_dev;
/* Used to fake out unused random calls in random_systat */
void
@@ -84,7 +84,7 @@ random_null_func(void)
/* ARGSUSED */
static int
-random_close(dev_t dev __unused, int flags, int fmt __unused,
+random_close(struct cdev *dev __unused, int flags, int fmt __unused,
struct thread *td)
{
if ((flags & FWRITE) && (suser(td) == 0)
@@ -98,7 +98,7 @@ random_close(dev_t dev __unused, int flags, int fmt __unused,
/* ARGSUSED */
static int
-random_read(dev_t dev __unused, struct uio *uio, int flag)
+random_read(struct cdev *dev __unused, struct uio *uio, int flag)
{
int c, error = 0;
void *random_buf;
@@ -136,7 +136,7 @@ random_read(dev_t dev __unused, struct uio *uio, int flag)
/* ARGSUSED */
static int
-random_write(dev_t dev __unused, struct uio *uio, int flag __unused)
+random_write(struct cdev *dev __unused, struct uio *uio, int flag __unused)
{
int c, error = 0;
void *random_buf;
@@ -158,7 +158,7 @@ random_write(dev_t dev __unused, struct uio *uio, int flag __unused)
/* ARGSUSED */
static int
-random_ioctl(dev_t dev __unused, u_long cmd, caddr_t addr __unused,
+random_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr __unused,
int flags __unused, struct thread *td __unused)
{
int error = 0;
@@ -176,7 +176,7 @@ random_ioctl(dev_t dev __unused, u_long cmd, caddr_t addr __unused,
/* ARGSUSED */
static int
-random_poll(dev_t dev __unused, int events, struct thread *td)
+random_poll(struct cdev *dev __unused, int events, struct thread *td)
{
int revents = 0;
diff --git a/sys/dev/rc/rc.c b/sys/dev/rc/rc.c
index 1135faf..d9b8e37 100644
--- a/sys/dev/rc/rc.c
+++ b/sys/dev/rc/rc.c
@@ -84,8 +84,8 @@
/* Per-channel structure */
struct rc_chans {
struct rc_softc *rc_rcb; /* back ptr */
- dev_t rc_dev; /* non-callout device */
- dev_t rc_cdev; /* callout device */
+ struct cdev *rc_dev; /* non-callout device */
+ struct cdev *rc_cdev; /* callout device */
u_short rc_flags; /* Misc. flags */
int rc_chan; /* Channel # */
u_char rc_ier; /* intr. enable reg */
@@ -234,7 +234,7 @@ rc_attach(device_t dev)
struct rc_softc *sc;
u_int port;
int base, chan, error, i, x;
- dev_t cdev;
+ struct cdev *cdev;
sc = device_get_softc(dev);
sc->sc_dev = dev;
@@ -853,7 +853,7 @@ rc_stop(struct tty *tp, int rw)
}
static int
-rcopen(dev_t dev, int flag, int mode, d_thread_t *td)
+rcopen(struct cdev *dev, int flag, int mode, d_thread_t *td)
{
struct rc_softc *sc;
struct rc_chans *rc;
@@ -944,7 +944,7 @@ out:
}
static int
-rcclose(dev_t dev, int flag, int mode, d_thread_t *td)
+rcclose(struct cdev *dev, int flag, int mode, d_thread_t *td)
{
struct rc_softc *sc;
struct rc_chans *rc;
@@ -1198,7 +1198,7 @@ rc_reinit(struct rc_softc *sc)
}
static int
-rcioctl(dev_t dev, u_long cmd, caddr_t data, int flag, d_thread_t *td)
+rcioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, d_thread_t *td)
{
struct rc_chans *rc;
struct tty *tp;
diff --git a/sys/dev/rp/rp.c b/sys/dev/rp/rp.c
index fc5241d..3c092f5 100644
--- a/sys/dev/rp/rp.c
+++ b/sys/dev/rp/rp.c
@@ -802,7 +802,7 @@ rp_attachcommon(CONTROLLER_T *ctlp, int num_aiops, int num_ports)
int retval;
struct rp_port *rp;
struct tty *tty;
- dev_t *dev_nodes;
+ struct cdev **dev_nodes;
unit = device_get_unit(ctlp->dev);
@@ -949,7 +949,7 @@ rp_releaseresource(CONTROLLER_t *ctlp)
static int
rpopen(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag, mode;
struct thread *td;
{
@@ -1108,7 +1108,7 @@ out2:
static int
rpclose(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag, mode;
struct thread *td;
{
@@ -1182,7 +1182,7 @@ rphardclose(struct rp_port *rp)
static
int
rpwrite(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -1222,7 +1222,7 @@ rpdtrwakeup(void *chan)
static int
rpioctl(dev, cmd, data, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t data;
int flag;
diff --git a/sys/dev/rp/rpreg.h b/sys/dev/rp/rpreg.h
index a7cde1b..6852f7c 100644
--- a/sys/dev/rp/rpreg.h
+++ b/sys/dev/rp/rpreg.h
@@ -371,7 +371,7 @@ struct CONTROLLER_str
struct tty *tty; /* tty */
/* Device nodes */
- dev_t *dev_nodes;
+ struct cdev **dev_nodes;
/* Bus-specific properties */
void *bus_ctlp;
diff --git a/sys/dev/sab/sab.c b/sys/dev/sab/sab.c
index 083b85a..58a7056 100644
--- a/sys/dev/sab/sab.c
+++ b/sys/dev/sab/sab.c
@@ -83,7 +83,7 @@ struct sabtty_softc {
struct sab_softc *sc_parent;
bus_space_tag_t sc_bt;
bus_space_handle_t sc_bh;
- dev_t sc_si;
+ struct cdev *sc_si;
struct tty *sc_tty;
int sc_channel;
int sc_icnt;
@@ -639,7 +639,7 @@ sabtty_softintr(struct sabtty_softc *sc)
}
static int
-sabttyopen(dev_t dev, int flags, int mode, struct thread *td)
+sabttyopen(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct sabtty_softc *sc;
struct tty *tp;
@@ -717,7 +717,7 @@ sabttyopen(dev_t dev, int flags, int mode, struct thread *td)
}
static int
-sabttyclose(dev_t dev, int flags, int mode, struct thread *td)
+sabttyclose(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct tty *tp;
@@ -733,7 +733,7 @@ sabttyclose(dev_t dev, int flags, int mode, struct thread *td)
}
static int
-sabttyioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+sabttyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
struct sabtty_softc *sc;
struct tty *tp;
diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c
index 2a66a00..93332e2 100644
--- a/sys/dev/scd/scd.c
+++ b/sys/dev/scd/scd.c
@@ -178,7 +178,7 @@ scd_attach(struct scd_softc *sc)
}
static int
-scdopen(dev_t dev, int flags, int fmt, struct thread *td)
+scdopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct scd_softc *sc;
int rc;
@@ -225,7 +225,7 @@ scdopen(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-scdclose(dev_t dev, int flags, int fmt, struct thread *td)
+scdclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct scd_softc *sc;
@@ -327,7 +327,7 @@ scd_start(struct scd_softc *sc)
}
static int
-scdioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
+scdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
{
struct scd_softc *sc;
diff --git a/sys/dev/scd/scdvar.h b/sys/dev/scd/scdvar.h
index 9eb0199..773a78b 100644
--- a/sys/dev/scd/scdvar.h
+++ b/sys/dev/scd/scdvar.h
@@ -34,7 +34,7 @@ struct scd_data {
struct scd_softc {
device_t dev;
- dev_t scd_dev_t;
+ struct cdev *scd_dev_t;
int debug;
struct resource * port;
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index 2a3601f..9732108 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -95,7 +95,7 @@ enum si_mctl { GET, SET, BIS, BIC };
static void si_command(struct si_port *, int, int);
static int si_modem(struct si_port *, enum si_mctl, int);
static void si_write_enable(struct si_port *, int);
-static int si_Sioctl(dev_t, u_long, caddr_t, int, struct thread *);
+static int si_Sioctl(struct cdev *, u_long, caddr_t, int, struct thread *);
static void si_start(struct tty *);
static void si_stop(struct tty *, int);
static timeout_t si_lstart;
@@ -589,7 +589,7 @@ try_next2:
}
static int
-siopen(dev_t dev, int flag, int mode, struct thread *td)
+siopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
int oldspl, error;
int card, port;
@@ -758,7 +758,7 @@ out:
}
static int
-siclose(dev_t dev, int flag, int mode, struct thread *td)
+siclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct si_port *pp;
struct tty *tp;
@@ -868,7 +868,7 @@ sidtrwakeup(void *chan)
}
static int
-siwrite(dev_t dev, struct uio *uio, int flag)
+siwrite(struct cdev *dev, struct uio *uio, int flag)
{
struct si_port *pp;
struct tty *tp;
@@ -907,7 +907,7 @@ out:
static int
-siioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+siioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct si_port *pp;
struct tty *tp;
@@ -1073,7 +1073,7 @@ out:
* Handle the Specialix ioctls. All MUST be called via the CONTROL device
*/
static int
-si_Sioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+si_Sioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct si_softc *xsc;
struct si_port *xpp;
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 740cd26..3281428 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -271,7 +271,7 @@ struct com_s {
struct resource *ioportres;
int ioportrid;
void *cookie;
- dev_t devs[6];
+ struct cdev *devs[6];
/*
* Data area for output buffers. Someday we should build the output
@@ -1180,7 +1180,7 @@ determined_type: ;
static int
sioopen(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -1363,7 +1363,7 @@ out:
static int
sioclose(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -1460,7 +1460,7 @@ comhardclose(com)
static int
sioread(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -1478,7 +1478,7 @@ sioread(dev, uio, flag)
static int
siowrite(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -1961,7 +1961,7 @@ txrdy:
static int
sioioctl(dev, cmd, data, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t data;
int flag;
diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c
index c8edb93..4c1c5b1 100644
--- a/sys/dev/smbus/smb.c
+++ b/sys/dev/smbus/smb.c
@@ -46,7 +46,7 @@
struct smb_softc {
int sc_count; /* >0 if device opened */
- dev_t sc_devnode;
+ struct cdev *sc_devnode;
};
#define IIC_SOFTC(unit) \
@@ -137,7 +137,7 @@ smb_detach(device_t dev)
}
static int
-smbopen (dev_t dev, int flags, int fmt, struct thread *td)
+smbopen (struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct smb_softc *sc = IIC_SOFTC(minor(dev));
@@ -153,7 +153,7 @@ smbopen (dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-smbclose(dev_t dev, int flags, int fmt, struct thread *td)
+smbclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct smb_softc *sc = IIC_SOFTC(minor(dev));
@@ -170,7 +170,7 @@ smbclose(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-smbioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+smbioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
char buf[SMB_MAXBLOCKSIZE];
device_t parent;
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index 7288a56..752dc42 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -62,7 +62,7 @@ static struct linesw snpdisc = {
struct snoop {
LIST_ENTRY(snoop) snp_list; /* List glue. */
int snp_unit; /* Device number. */
- dev_t snp_target; /* Target tty device. */
+ struct cdev *snp_target; /* Target tty device. */
struct tty *snp_tty; /* Target tty pointer. */
u_long snp_len; /* Possible length. */
u_long snp_base; /* Data base. */
@@ -106,9 +106,9 @@ static int snooplinedisc;
static LIST_HEAD(, snoop) snp_sclist = LIST_HEAD_INITIALIZER(&snp_sclist);
static struct clonedevs *snpclones;
-static struct tty *snpdevtotty(dev_t dev);
+static struct tty *snpdevtotty(struct cdev *dev);
static void snp_clone(void *arg, char *name,
- int namelen, dev_t *dev);
+ int namelen, struct cdev **dev);
static int snp_detach(struct snoop *snp);
static int snp_down(struct snoop *snp);
static int snp_in(struct snoop *snp, char *buf, int n);
@@ -175,7 +175,7 @@ snplwrite(tp, uio, flag)
static struct tty *
snpdevtotty(dev)
- dev_t dev;
+ struct cdev *dev;
{
struct cdevsw *cdp;
@@ -192,7 +192,7 @@ snpdevtotty(dev)
static int
snpwrite(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -231,7 +231,7 @@ tty_input:
static int
snpread(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -377,7 +377,7 @@ snp_in(snp, buf, n)
static int
snpopen(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag, mode;
struct thread *td;
{
@@ -451,7 +451,7 @@ detach_notty:
static int
snpclose(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -486,7 +486,7 @@ snp_down(snp)
static int
snpioctl(dev, cmd, data, flags, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t data;
int flags;
@@ -494,7 +494,7 @@ snpioctl(dev, cmd, data, flags, td)
{
struct snoop *snp;
struct tty *tp, *tpo;
- dev_t tdev;
+ struct cdev *tdev;
int s;
snp = dev->si_drv1;
@@ -577,7 +577,7 @@ snpioctl(dev, cmd, data, flags, td)
static int
snppoll(dev, events, td)
- dev_t dev;
+ struct cdev *dev;
int events;
struct thread *td;
{
@@ -605,7 +605,7 @@ snp_clone(arg, name, namelen, dev)
void *arg;
char *name;
int namelen;
- dev_t *dev;
+ struct cdev **dev;
{
int u, i;
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 3b910c7..9200941 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -60,7 +60,7 @@ static eventhandler_tag dsp_ehtag;
#endif
static struct snddev_info *
-dsp_get_info(dev_t dev)
+dsp_get_info(struct cdev *dev)
{
struct snddev_info *d;
int unit;
@@ -74,7 +74,7 @@ dsp_get_info(dev_t dev)
}
static u_int32_t
-dsp_get_flags(dev_t dev)
+dsp_get_flags(struct cdev *dev)
{
device_t bdev;
int unit;
@@ -88,7 +88,7 @@ dsp_get_flags(dev_t dev)
}
static void
-dsp_set_flags(dev_t dev, u_int32_t flags)
+dsp_set_flags(struct cdev *dev, u_int32_t flags)
{
device_t bdev;
int unit;
@@ -108,7 +108,7 @@ dsp_set_flags(dev_t dev, u_int32_t flags)
* lock channels specified.
*/
static int
-getchns(dev_t dev, struct pcm_channel **rdch, struct pcm_channel **wrch, u_int32_t prio)
+getchns(struct cdev *dev, struct pcm_channel **rdch, struct pcm_channel **wrch, u_int32_t prio)
{
struct snddev_info *d;
u_int32_t flags;
@@ -152,7 +152,7 @@ getchns(dev_t dev, struct pcm_channel **rdch, struct pcm_channel **wrch, u_int32
/* unlock specified channels */
static void
-relchns(dev_t dev, struct pcm_channel *rdch, struct pcm_channel *wrch, u_int32_t prio)
+relchns(struct cdev *dev, struct pcm_channel *rdch, struct pcm_channel *wrch, u_int32_t prio)
{
struct snddev_info *d;
@@ -165,7 +165,7 @@ relchns(dev_t dev, struct pcm_channel *rdch, struct pcm_channel *wrch, u_int32_t
}
static int
-dsp_open(dev_t i_dev, int flags, int mode, struct thread *td)
+dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td)
{
struct pcm_channel *rdch, *wrch;
struct snddev_info *d;
@@ -319,7 +319,7 @@ dsp_open(dev_t i_dev, int flags, int mode, struct thread *td)
}
static int
-dsp_close(dev_t i_dev, int flags, int mode, struct thread *td)
+dsp_close(struct cdev *i_dev, int flags, int mode, struct thread *td)
{
struct pcm_channel *rdch, *wrch;
struct snddev_info *d;
@@ -388,7 +388,7 @@ dsp_close(dev_t i_dev, int flags, int mode, struct thread *td)
}
static int
-dsp_read(dev_t i_dev, struct uio *buf, int flag)
+dsp_read(struct cdev *i_dev, struct uio *buf, int flag)
{
struct pcm_channel *rdch, *wrch;
intrmask_t s;
@@ -415,7 +415,7 @@ dsp_read(dev_t i_dev, struct uio *buf, int flag)
}
static int
-dsp_write(dev_t i_dev, struct uio *buf, int flag)
+dsp_write(struct cdev *i_dev, struct uio *buf, int flag)
{
struct pcm_channel *rdch, *wrch;
intrmask_t s;
@@ -442,7 +442,7 @@ dsp_write(dev_t i_dev, struct uio *buf, int flag)
}
static int
-dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
+dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
{
struct pcm_channel *chn, *rdch, *wrch;
struct snddev_info *d;
@@ -567,7 +567,7 @@ dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
{
snd_capabilities *p = (snd_capabilities *)arg;
struct pcmchan_caps *pcaps = NULL, *rcaps = NULL;
- dev_t pdev;
+ struct cdev *pdev;
if (rdch) {
CHN_LOCK(rdch);
@@ -1026,7 +1026,7 @@ dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
}
static int
-dsp_poll(dev_t i_dev, int events, struct thread *td)
+dsp_poll(struct cdev *i_dev, int events, struct thread *td)
{
struct pcm_channel *wrch = NULL, *rdch = NULL;
intrmask_t s;
@@ -1053,7 +1053,7 @@ dsp_poll(dev_t i_dev, int events, struct thread *td)
}
static int
-dsp_mmap(dev_t i_dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+dsp_mmap(struct cdev *i_dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
{
struct pcm_channel *wrch = NULL, *rdch = NULL, *c;
intrmask_t s;
@@ -1114,9 +1114,9 @@ dsp_mmap(dev_t i_dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
* if xN.i isn't busy, return its dev_t
*/
static void
-dsp_clone(void *arg, char *name, int namelen, dev_t *dev)
+dsp_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
- dev_t pdev;
+ struct cdev *pdev;
struct snddev_info *pcm_dev;
struct snddev_channel *pcm_chan;
int i, unit, devtype;
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index b5a67ed..47812fe 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -86,7 +86,7 @@ static struct cdevsw mixer_cdevsw = {
static eventhandler_tag mixer_ehtag;
#endif
-static dev_t
+static struct cdev *
mixer_get_devt(device_t dev)
{
struct snddev_info *snddev;
@@ -190,7 +190,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
struct snddev_info *snddev;
struct snd_mixer *m;
u_int16_t v;
- dev_t pdev;
+ struct cdev *pdev;
int i, unit;
m = (struct snd_mixer *)kobj_create(cls, M_MIXER, M_WAITOK | M_ZERO);
@@ -231,7 +231,7 @@ mixer_uninit(device_t dev)
{
int i;
struct snd_mixer *m;
- dev_t pdev;
+ struct cdev *pdev;
pdev = mixer_get_devt(dev);
m = pdev->si_drv1;
@@ -262,7 +262,7 @@ int
mixer_reinit(device_t dev)
{
struct snd_mixer *m;
- dev_t pdev;
+ struct cdev *pdev;
int i;
pdev = mixer_get_devt(dev);
@@ -318,7 +318,7 @@ int
mixer_hwvol_init(device_t dev)
{
struct snd_mixer *m;
- dev_t pdev;
+ struct cdev *pdev;
pdev = mixer_get_devt(dev);
m = pdev->si_drv1;
@@ -339,7 +339,7 @@ void
mixer_hwvol_mute(device_t dev)
{
struct snd_mixer *m;
- dev_t pdev;
+ struct cdev *pdev;
pdev = mixer_get_devt(dev);
m = pdev->si_drv1;
@@ -360,7 +360,7 @@ mixer_hwvol_step(device_t dev, int left_step, int right_step)
{
struct snd_mixer *m;
int level, left, right;
- dev_t pdev;
+ struct cdev *pdev;
pdev = mixer_get_devt(dev);
m = pdev->si_drv1;
@@ -387,7 +387,7 @@ mixer_hwvol_step(device_t dev, int left_step, int right_step)
/* ----------------------------------------------------------------------- */
static int
-mixer_open(dev_t i_dev, int flags, int mode, struct thread *td)
+mixer_open(struct cdev *i_dev, int flags, int mode, struct thread *td)
{
struct snd_mixer *m;
intrmask_t s;
@@ -404,7 +404,7 @@ mixer_open(dev_t i_dev, int flags, int mode, struct thread *td)
}
static int
-mixer_close(dev_t i_dev, int flags, int mode, struct thread *td)
+mixer_close(struct cdev *i_dev, int flags, int mode, struct thread *td)
{
struct snd_mixer *m;
intrmask_t s;
@@ -426,7 +426,7 @@ mixer_close(dev_t i_dev, int flags, int mode, struct thread *td)
}
int
-mixer_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
+mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
{
struct snd_mixer *m;
intrmask_t s;
@@ -479,7 +479,7 @@ mixer_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
#ifdef USING_DEVFS
static void
-mixer_clone(void *arg, char *name, int namelen, dev_t *dev)
+mixer_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
struct snddev_info *sd;
diff --git a/sys/dev/sound/pcm/mixer.h b/sys/dev/sound/pcm/mixer.h
index ff4c22c..22bd22a 100644
--- a/sys/dev/sound/pcm/mixer.h
+++ b/sys/dev/sound/pcm/mixer.h
@@ -29,7 +29,7 @@
int mixer_init(device_t dev, kobj_class_t cls, void *devinfo);
int mixer_uninit(device_t dev);
int mixer_reinit(device_t dev);
-int mixer_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td);
+int mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td);
int mixer_hwvol_init(device_t dev);
void mixer_hwvol_mute(device_t dev);
diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c
index e96a802..0b391a7 100644
--- a/sys/dev/sound/pcm/sndstat.c
+++ b/sys/dev/sound/pcm/sndstat.c
@@ -62,7 +62,7 @@ struct sndstat_entry {
static struct mtx sndstat_lock;
#endif
static struct sbuf sndstat_sbuf;
-static dev_t sndstat_dev = 0;
+static struct cdev *sndstat_dev = 0;
static int sndstat_isopen = 0;
static int sndstat_bufptr;
static int sndstat_maxunit = -1;
@@ -103,7 +103,7 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, CTLTYPE_INT | CTLFLAG_RW,
0, sizeof(int), sysctl_hw_sndverbose, "I", "");
static int
-sndstat_open(dev_t i_dev, int flags, int mode, struct thread *td)
+sndstat_open(struct cdev *i_dev, int flags, int mode, struct thread *td)
{
intrmask_t s;
int error;
@@ -136,7 +136,7 @@ out:
}
static int
-sndstat_close(dev_t i_dev, int flags, int mode, struct thread *td)
+sndstat_close(struct cdev *i_dev, int flags, int mode, struct thread *td)
{
intrmask_t s;
@@ -156,7 +156,7 @@ sndstat_close(dev_t i_dev, int flags, int mode, struct thread *td)
}
static int
-sndstat_read(dev_t i_dev, struct uio *buf, int flag)
+sndstat_read(struct cdev *i_dev, struct uio *buf, int flag)
{
intrmask_t s;
int l, err;
diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h
index 7acdfc8..5eae8e3 100644
--- a/sys/dev/sound/pcm/sound.h
+++ b/sys/dev/sound/pcm/sound.h
@@ -278,10 +278,10 @@ struct snddev_channel {
SLIST_ENTRY(snddev_channel) link;
struct pcm_channel *channel;
int chan_num;
- dev_t dsp_devt;
- dev_t dspW_devt;
- dev_t audio_devt;
- dev_t dspr_devt;
+ struct cdev *dsp_devt;
+ struct cdev *dspW_devt;
+ struct cdev *audio_devt;
+ struct cdev *dspr_devt;
};
struct snddev_info {
@@ -297,7 +297,7 @@ struct snddev_info {
struct sysctl_ctx_list sysctl_tree;
struct sysctl_oid *sysctl_tree_top;
struct mtx *lock;
- dev_t mixer_dev;
+ struct cdev *mixer_dev;
};
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
index e73ab8d..2dc74e3 100644
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -472,7 +472,7 @@ static char *spkr_inbuf; /* incoming buf */
static int
spkropen(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -499,7 +499,7 @@ spkropen(dev, flags, fmt, td)
static int
spkrwrite(dev, uio, ioflag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int ioflag;
{
@@ -531,7 +531,7 @@ spkrwrite(dev, uio, ioflag)
static int
spkrclose(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -554,7 +554,7 @@ spkrclose(dev, flags, fmt, td)
static int
spkrioctl(dev, cmd, cmdarg, flags, td)
- dev_t dev;
+ struct cdev *dev;
unsigned long cmd;
caddr_t cmdarg;
int flags;
@@ -610,7 +610,7 @@ static struct isa_pnp_id speaker_ids[] = {
{ 0 }
};
-static dev_t speaker_dev;
+static struct cdev *speaker_dev;
static int
speaker_probe(device_t dev)
diff --git a/sys/dev/streams/streams.c b/sys/dev/streams/streams.c
index b67e39b..8ef790d 100644
--- a/sys/dev/streams/streams.c
+++ b/sys/dev/streams/streams.c
@@ -88,8 +88,8 @@ enum {
dev_unix_ord_stream = 40
};
-static dev_t dt_ptm, dt_arp, dt_icmp, dt_ip, dt_tcp, dt_udp, dt_rawip,
- dt_unix_dgram, dt_unix_stream, dt_unix_ord_stream;
+static struct cdev *dt_ptm, *dt_arp, *dt_icmp, *dt_ip, *dt_tcp, *dt_udp, *dt_rawip,
+ *dt_unix_dgram, *dt_unix_stream, *dt_unix_ord_stream;
static struct fileops svr4_netops = {
.fo_read = soo_read,
@@ -186,7 +186,7 @@ MODULE_VERSION(streams, 1);
* routine.
*/
static int
-streamsopen(dev_t dev, int oflags, int devtype, struct thread *td)
+streamsopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
int type, protocol;
int fd, extraref;
diff --git a/sys/dev/sx/sx.c b/sys/dev/sx/sx.c
index 5588ab7..0e0687e 100644
--- a/sys/dev/sx/sx.c
+++ b/sys/dev/sx/sx.c
@@ -332,7 +332,7 @@ sxattach(
*/
static int
sxopen(
- dev_t dev,
+ struct cdev *dev,
int flag,
int mode,
d_thread_t *p)
@@ -501,7 +501,7 @@ out:
*/
static int
sxclose(
- dev_t dev,
+ struct cdev *dev,
int flag,
int mode,
d_thread_t *p)
@@ -641,7 +641,7 @@ sxdtrwakeup(void *chan)
*/
static int
sxwrite(
- dev_t dev,
+ struct cdev *dev,
struct uio *uio,
int flag)
{
@@ -690,7 +690,7 @@ out: splx(oldspl);
*/
static int
sxioctl(
- dev_t dev,
+ struct cdev *dev,
u_long cmd,
caddr_t data,
int flag,
diff --git a/sys/dev/syscons/scvesactl.c b/sys/dev/syscons/scvesactl.c
index f2ba283..dbc0dfc 100644
--- a/sys/dev/syscons/scvesactl.c
+++ b/sys/dev/syscons/scvesactl.c
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
static d_ioctl_t *prev_user_ioctl;
static int
-vesa_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+vesa_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
scr_stat *scp;
struct tty *tp;
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 0608ce5..12f0739 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -100,7 +100,7 @@ static struct tty *sc_console_tty;
static struct consdev *sc_consptr;
static void *kernel_console_ts;
static scr_stat main_console;
-static dev_t main_devs[MAXCONS];
+static struct cdev *main_devs[MAXCONS];
static char init_done = COLD;
static char shutdown_in_progress = FALSE;
@@ -148,12 +148,12 @@ static int debugger;
static int scvidprobe(int unit, int flags, int cons);
static int sckbdprobe(int unit, int flags, int cons);
static void scmeminit(void *arg);
-static int scdevtounit(dev_t dev);
+static int scdevtounit(struct cdev *dev);
static kbd_callback_func_t sckbdevent;
static int scparam(struct tty *tp, struct termios *t);
static void scstart(struct tty *tp);
static void scinit(int unit, int flags);
-static scr_stat *sc_get_stat(dev_t devptr);
+static scr_stat *sc_get_stat(struct cdev *devptr);
#if !__alpha__
static void scterm(int unit, int flags);
#endif
@@ -303,7 +303,7 @@ sc_attach_unit(int unit, int flags)
video_info_t info;
#endif
int vc;
- dev_t dev;
+ struct cdev *dev;
flags &= ~SC_KERNEL_CONSOLE;
@@ -442,7 +442,7 @@ scmeminit(void *arg)
SYSINIT(sc_mem, SI_SUB_KMEM, SI_ORDER_ANY, scmeminit, NULL);
static int
-scdevtounit(dev_t dev)
+scdevtounit(struct cdev *dev)
{
int vty = SC_VTY(dev);
@@ -455,7 +455,7 @@ scdevtounit(dev_t dev)
}
static int
-scopen(dev_t dev, int flag, int mode, struct thread *td)
+scopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
int unit = scdevtounit(dev);
sc_softc_t *sc;
@@ -518,7 +518,7 @@ scopen(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-scclose(dev_t dev, int flag, int mode, struct thread *td)
+scclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct tty *tp = dev->si_tty;
scr_stat *scp;
@@ -568,7 +568,7 @@ scclose(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-scread(dev_t dev, struct uio *uio, int flag)
+scread(struct cdev *dev, struct uio *uio, int flag)
{
if (!sc_saver_keyb_only)
sc_touch_scrn_saver();
@@ -654,7 +654,7 @@ scparam(struct tty *tp, struct termios *t)
}
static int
-scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+scioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int error;
int i;
@@ -2596,7 +2596,7 @@ void
sc_change_cursor_shape(scr_stat *scp, int flags, int base, int height)
{
sc_softc_t *sc;
- dev_t dev;
+ struct cdev *dev;
int s;
int i;
@@ -2741,7 +2741,7 @@ scinit(int unit, int flags)
kernel_default.rev_color);
} else {
/* assert(sc_malloc) */
- sc->dev = malloc(sizeof(dev_t)*sc->vtys, M_DEVBUF, M_WAITOK|M_ZERO);
+ sc->dev = malloc(sizeof(struct cdev *)*sc->vtys, M_DEVBUF, M_WAITOK|M_ZERO);
sc->dev[0] = make_dev(&sc_cdevsw, unit * MAXCONS,
UID_ROOT, GID_WHEEL, 0600, "ttyv%r", unit * MAXCONS);
sc->dev[0]->si_tty = ttymalloc(sc->dev[0]->si_tty);
@@ -3406,7 +3406,7 @@ next_code:
}
static int
-scmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+scmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
{
scr_stat *scp;
@@ -3630,7 +3630,7 @@ blink_screen(void *arg)
*/
static scr_stat *
-sc_get_stat(dev_t devptr)
+sc_get_stat(struct cdev *devptr)
{
if (devptr == NULL)
return (&main_console);
diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h
index 217e50c..1651ad8 100644
--- a/sys/dev/syscons/syscons.h
+++ b/sys/dev/syscons/syscons.h
@@ -208,7 +208,7 @@ typedef struct sc_softc {
int first_vty;
int vtys;
- dev_t *dev;
+ struct cdev **dev;
struct scr_stat *cur_scp;
struct scr_stat *new_scp;
struct scr_stat *old_scp;
@@ -518,7 +518,7 @@ typedef struct {
(*kbdsw[(kbd)->kb_index]->poll)((kbd), (on))
/* syscons.c */
-extern int (*sc_user_ioctl)(dev_t dev, u_long cmd, caddr_t data,
+extern int (*sc_user_ioctl)(struct cdev *dev, u_long cmd, caddr_t data,
int flag, struct thread *td);
int sc_probe_unit(int unit, int flags);
diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c
index ab1cd85..db2487d 100644
--- a/sys/dev/syscons/sysmouse.c
+++ b/sys/dev/syscons/sysmouse.c
@@ -66,7 +66,7 @@ static void smstart(struct tty *tp);
static int smparam(struct tty *tp, struct termios *t);
static int
-smopen(dev_t dev, int flag, int mode, struct thread *td)
+smopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct tty *tp;
@@ -101,7 +101,7 @@ smopen(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-smclose(dev_t dev, int flag, int mode, struct thread *td)
+smclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct tty *tp;
int s;
@@ -145,7 +145,7 @@ smparam(struct tty *tp, struct termios *t)
}
static int
-smioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+smioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct tty *tp;
mousehw_t *hw;
@@ -238,7 +238,7 @@ smioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
static void
sm_attach_mouse(void *unused)
{
- dev_t dev;
+ struct cdev *dev;
dev = make_dev(&sm_cdevsw, SC_MOUSE, UID_ROOT, GID_WHEEL, 0600,
"sysmouse");
diff --git a/sys/dev/tdfx/tdfx_pci.c b/sys/dev/tdfx/tdfx_pci.c
index 1ba4ed7..351411a 100644
--- a/sys/dev/tdfx/tdfx_pci.c
+++ b/sys/dev/tdfx/tdfx_pci.c
@@ -402,7 +402,7 @@ tdfx_setmtrr(device_t dev) {
}
static int
-tdfx_open(dev_t dev, int flags, int fmt, struct thread *td)
+tdfx_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
/*
* The open cdev method handles open(2) calls to /dev/3dfx[n]
@@ -420,7 +420,7 @@ tdfx_open(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-tdfx_close(dev_t dev, int fflag, int devtype, struct thread *td)
+tdfx_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
{
/*
* The close cdev method handles close(2) calls to /dev/3dfx[n]
@@ -437,7 +437,7 @@ tdfx_close(dev_t dev, int fflag, int devtype, struct thread *td)
}
static int
-tdfx_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+tdfx_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
{
/*
* mmap(2) is called by a user process to request that an area of memory
@@ -793,7 +793,7 @@ tdfx_do_pio(u_int cmd, struct tdfx_pio_data *piod)
* can return -retval and the error should be properly handled.
*/
static int
-tdfx_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+tdfx_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int retval = 0;
struct tdfx_pio_data *piod = (struct tdfx_pio_data*)data;
diff --git a/sys/dev/tdfx/tdfx_vars.h b/sys/dev/tdfx/tdfx_vars.h
index 67ce131..95a9bbf 100644
--- a/sys/dev/tdfx/tdfx_vars.h
+++ b/sys/dev/tdfx/tdfx_vars.h
@@ -92,7 +92,7 @@ struct tdfx_softc {
unsigned char dv;
struct file *curFile;
device_t dev;
- dev_t devt;
+ struct cdev *devt;
struct mem_range_desc mrdesc;
int busy;
};
diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c
index ad5366e..b801916 100644
--- a/sys/dev/ti/if_ti.c
+++ b/sys/dev/ti/if_ti.c
@@ -3121,7 +3121,7 @@ ti_ioctl(ifp, command, data)
}
static int
-ti_open(dev_t dev, int flags, int fmt, struct thread *td)
+ti_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct ti_softc *sc;
@@ -3137,7 +3137,7 @@ ti_open(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-ti_close(dev_t dev, int flag, int fmt, struct thread *td)
+ti_close(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct ti_softc *sc;
@@ -3156,7 +3156,7 @@ ti_close(dev_t dev, int flag, int fmt, struct thread *td)
* This ioctl routine goes along with the Tigon character device.
*/
static int
-ti_ioctl2(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+ti_ioctl2(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
int error;
struct ti_softc *sc;
diff --git a/sys/dev/ti/if_tireg.h b/sys/dev/ti/if_tireg.h
index 71d9661..3552514 100644
--- a/sys/dev/ti/if_tireg.h
+++ b/sys/dev/ti/if_tireg.h
@@ -1025,7 +1025,7 @@ struct ti_softc {
int ti_txcnt;
struct mtx ti_mtx;
ti_flag_vals ti_flags;
- dev_t dev;
+ struct cdev *dev;
};
#define TI_LOCK(_sc) mtx_lock(&(_sc)->ti_mtx)
diff --git a/sys/dev/twa/twa.h b/sys/dev/twa/twa.h
index 5f49b49..812f326 100644
--- a/sys/dev/twa/twa.h
+++ b/sys/dev/twa/twa.h
@@ -174,7 +174,7 @@ struct twa_softc {
between ioctl calls */
device_t twa_bus_dev; /* bus device */
- dev_t twa_ctrl_dev; /* control device */
+ struct cdev *twa_ctrl_dev; /* control device */
struct resource *twa_io_res; /* register interface window */
bus_space_handle_t twa_bus_handle; /* bus space handle */
bus_space_tag_t twa_bus_tag; /* bus space tag */
diff --git a/sys/dev/twa/twa_freebsd.c b/sys/dev/twa/twa_freebsd.c
index 9879448..09642c1 100644
--- a/sys/dev/twa/twa_freebsd.c
+++ b/sys/dev/twa/twa_freebsd.c
@@ -75,7 +75,7 @@ static devclass_t twa_devclass;
* non-zero-- failure
*/
static int
-twa_open(dev_t dev, int flags, int fmt, d_thread_t *proc)
+twa_open(struct cdev *dev, int flags, int fmt, d_thread_t *proc)
{
int unit = minor(dev);
struct twa_softc *sc = devclass_get_softc(twa_devclass, unit);
@@ -100,7 +100,7 @@ twa_open(dev_t dev, int flags, int fmt, d_thread_t *proc)
* non-zero-- failure
*/
static int
-twa_close(dev_t dev, int flags, int fmt, d_thread_t *proc)
+twa_close(struct cdev *dev, int flags, int fmt, d_thread_t *proc)
{
int unit = minor(dev);
struct twa_softc *sc = devclass_get_softc(twa_devclass, unit);
@@ -128,7 +128,7 @@ twa_close(dev_t dev, int flags, int fmt, d_thread_t *proc)
* non-zero-- failure
*/
static int
-twa_ioctl_wrapper(dev_t dev, u_long cmd, caddr_t buf,
+twa_ioctl_wrapper(struct cdev *dev, u_long cmd, caddr_t buf,
int flags, d_thread_t *proc)
{
struct twa_softc *sc = (struct twa_softc *)(dev->si_drv1);
@@ -367,7 +367,7 @@ twa_free(struct twa_softc *sc)
TWA_IO_CONFIG_REG, sc->twa_io_res);
/* Destroy the control device. */
- if (sc->twa_ctrl_dev != (dev_t)NULL)
+ if (sc->twa_ctrl_dev != (struct cdev *)NULL)
destroy_dev(sc->twa_ctrl_dev);
sysctl_ctx_free(&sc->twa_sysctl_ctx);
diff --git a/sys/dev/twe/twe_compat.h b/sys/dev/twe/twe_compat.h
index 5cdad83..3729100 100644
--- a/sys/dev/twe/twe_compat.h
+++ b/sys/dev/twe/twe_compat.h
@@ -78,7 +78,7 @@
bus_dmamap_t twe_cmdmap; /* DMA map for command */ \
u_int32_t twe_cmdphys; /* address of command in controller space */ \
device_t twe_dev; /* bus device */ \
- dev_t twe_dev_t; /* control device */ \
+ struct cdev *twe_dev_t; /* control device */ \
struct resource *twe_io; /* register interface window */ \
bus_space_handle_t twe_bhandle; /* bus space handle */ \
bus_space_tag_t twe_btag; /* bus space tag */ \
diff --git a/sys/dev/twe/twe_freebsd.c b/sys/dev/twe/twe_freebsd.c
index 2415ca5..a29b3dd 100644
--- a/sys/dev/twe/twe_freebsd.c
+++ b/sys/dev/twe/twe_freebsd.c
@@ -79,7 +79,7 @@ static struct cdevsw twe_cdevsw = {
* Accept an open operation on the control device.
*/
static int
-twe_open(dev_t dev, int flags, int fmt, d_thread_t *td)
+twe_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
{
int unit = minor(dev);
struct twe_softc *sc = devclass_get_softc(twe_devclass, unit);
@@ -92,7 +92,7 @@ twe_open(dev_t dev, int flags, int fmt, d_thread_t *td)
* Accept the last close on the control device.
*/
static int
-twe_close(dev_t dev, int flags, int fmt, d_thread_t *td)
+twe_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
{
int unit = minor(dev);
struct twe_softc *sc = devclass_get_softc(twe_devclass, unit);
@@ -105,7 +105,7 @@ twe_close(dev_t dev, int flags, int fmt, d_thread_t *td)
* Handle controller-specific control operations.
*/
static int
-twe_ioctl_wrapper(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
+twe_ioctl_wrapper(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
{
struct twe_softc *sc = (struct twe_softc *)dev->si_drv1;
@@ -423,7 +423,7 @@ twe_free(struct twe_softc *sc)
bus_release_resource(sc->twe_dev, SYS_RES_IOPORT, TWE_IO_CONFIG_REG, sc->twe_io);
/* destroy control device */
- if (sc->twe_dev_t != (dev_t)NULL)
+ if (sc->twe_dev_t != (struct cdev *)NULL)
destroy_dev(sc->twe_dev_t);
sysctl_ctx_free(&sc->sysctl_ctx);
diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h
index 3c45199..1ea7779 100644
--- a/sys/dev/uart/uart_bus.h
+++ b/sys/dev/uart/uart_bus.h
@@ -158,7 +158,7 @@ struct uart_softc {
union {
/* TTY specific data. */
struct {
- dev_t si[2]; /* We have 2 device special files. */
+ struct cdev *si[2]; /* We have 2 device special files. */
struct tty *tp;
} u_tty;
/* Keyboard specific data. */
diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c
index f42a7dc..ec10696 100644
--- a/sys/dev/uart/uart_tty.c
+++ b/sys/dev/uart/uart_tty.c
@@ -361,7 +361,7 @@ int uart_tty_detach(struct uart_softc *sc)
}
static int
-uart_tty_open(dev_t dev, int flags, int mode, struct thread *td)
+uart_tty_open(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct uart_softc *sc;
struct tty *tp;
@@ -450,7 +450,7 @@ uart_tty_open(dev_t dev, int flags, int mode, struct thread *td)
}
static int
-uart_tty_close(dev_t dev, int flags, int mode, struct thread *td)
+uart_tty_close(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct uart_softc *sc;
struct tty *tp;
@@ -485,7 +485,7 @@ uart_tty_close(dev_t dev, int flags, int mode, struct thread *td)
}
static int
-uart_tty_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
+uart_tty_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
struct thread *td)
{
struct uart_softc *sc;
diff --git a/sys/dev/usb/ubser.c b/sys/dev/usb/ubser.c
index 62d20b1..d640494 100644
--- a/sys/dev/usb/ubser.c
+++ b/sys/dev/usb/ubser.c
@@ -158,7 +158,7 @@ struct ubser_softc {
u_int sc_opkthdrlen; /* header length of
output packet */
- dev_t dev[8];
+ struct cdev *dev[8];
};
Static d_open_t ubser_open;
@@ -853,7 +853,7 @@ ubser_cleanup(struct ubser_softc *sc)
}
static int
-ubser_open(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ubser_open(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
struct ubser_softc *sc;
struct tty *tp;
@@ -929,7 +929,7 @@ bad:
}
static int
-ubser_close(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ubser_close(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
struct ubser_softc *sc;
struct tty *tp;
@@ -952,7 +952,7 @@ quit:
}
static int
-ubser_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
+ubser_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
{
usb_device_request_t req;
struct ubser_softc *sc;
@@ -997,7 +997,7 @@ ubser_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
}
static int
-ubser_read(dev_t dev, struct uio *uio, int flag)
+ubser_read(struct cdev *dev, struct uio *uio, int flag)
{
struct ubser_softc *sc;
struct tty *tp;
@@ -1019,7 +1019,7 @@ ubser_read(dev_t dev, struct uio *uio, int flag)
}
static int
-ubser_write(dev_t dev, struct uio *uio, int flag)
+ubser_write(struct cdev *dev, struct uio *uio, int flag)
{
struct ubser_softc *sc;
struct tty *tp;
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index 82ab31b..82245b7 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -249,7 +249,7 @@ ucom_shutdown(struct ucom_softc *sc)
}
Static int
-ucomopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ucomopen(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
int unit = UCOMUNIT(dev);
struct ucom_softc *sc;
@@ -443,7 +443,7 @@ bad:
}
static int
-ucomclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ucomclose(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
struct ucom_softc *sc;
struct tty *tp;
@@ -488,7 +488,7 @@ ucomclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
}
static int
-ucomread(dev_t dev, struct uio *uio, int flag)
+ucomread(struct cdev *dev, struct uio *uio, int flag)
{
struct ucom_softc *sc;
struct tty *tp;
@@ -510,7 +510,7 @@ ucomread(dev_t dev, struct uio *uio, int flag)
}
static int
-ucomwrite(dev_t dev, struct uio *uio, int flag)
+ucomwrite(struct cdev *dev, struct uio *uio, int flag)
{
struct ucom_softc *sc;
struct tty *tp;
@@ -532,7 +532,7 @@ ucomwrite(dev_t dev, struct uio *uio, int flag)
}
static int
-ucomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
+ucomioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
{
struct ucom_softc *sc;
struct tty *tp;
diff --git a/sys/dev/usb/ucomvar.h b/sys/dev/usb/ucomvar.h
index ba00856..63146b9 100644
--- a/sys/dev/usb/ucomvar.h
+++ b/sys/dev/usb/ucomvar.h
@@ -173,7 +173,7 @@ struct ucom_softc {
int sc_refcnt;
u_char sc_dying; /* disconnecting */
- dev_t dev; /* special device node */
+ struct cdev *dev; /* special device node */
};
extern devclass_t ucom_devclass;
diff --git a/sys/dev/usb/ufm.c b/sys/dev/usb/ufm.c
index db008ea..f8d640b 100644
--- a/sys/dev/usb/ufm.c
+++ b/sys/dev/usb/ufm.c
@@ -204,7 +204,7 @@ USB_ATTACH(ufm)
sc->sc_epaddr = edesc->bEndpointAddress;
#if defined(__FreeBSD__)
- /* XXX no error trapping, no storing of dev_t */
+ /* XXX no error trapping, no storing of struct cdev **/
(void) make_dev(&ufm_cdevsw, device_get_unit(self),
UID_ROOT, GID_OPERATOR,
0644, "ufm%d", device_get_unit(self));
@@ -224,7 +224,7 @@ USB_ATTACH(ufm)
int
-ufmopen(dev_t dev, int flag, int mode, usb_proc_ptr td)
+ufmopen(struct cdev *dev, int flag, int mode, usb_proc_ptr td)
{
struct ufm_softc *sc;
@@ -245,7 +245,7 @@ ufmopen(dev_t dev, int flag, int mode, usb_proc_ptr td)
}
int
-ufmclose(dev_t dev, int flag, int mode, usb_proc_ptr td)
+ufmclose(struct cdev *dev, int flag, int mode, usb_proc_ptr td)
{
struct ufm_softc *sc;
@@ -368,7 +368,7 @@ ufm_get_stat(struct ufm_softc *sc, caddr_t addr)
}
int
-ufmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr td)
+ufmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr td)
{
struct ufm_softc *sc;
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index a907423..81ae5f2 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -100,7 +100,7 @@ SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW,
struct ugen_endpoint {
struct ugen_softc *sc;
#if defined(__FreeBSD__)
- dev_t dev;
+ struct cdev *dev;
#endif
usb_endpoint_descriptor_t *edesc;
usbd_interface_handle iface;
@@ -127,7 +127,7 @@ struct ugen_softc {
USBBASEDEVICE sc_dev; /* base device */
usbd_device_handle sc_udev;
#if defined(__FreeBSD__)
- dev_t dev;
+ struct cdev *dev;
#endif
char sc_is_open[USB_MAX_ENDPOINTS];
@@ -253,7 +253,7 @@ Static void
ugen_make_devnodes(struct ugen_softc *sc)
{
int endptno;
- dev_t dev;
+ struct cdev *dev;
for (endptno = 1; endptno < USB_MAX_ENDPOINTS; endptno++) {
if (sc->sc_endpoints[endptno][IN].sc != NULL ||
@@ -283,7 +283,7 @@ Static void
ugen_destroy_devnodes(struct ugen_softc *sc)
{
int endptno;
- dev_t dev;
+ struct cdev *dev;
/* destroy all devices for the other (existing) endpoints as well */
for (endptno = 1; endptno < USB_MAX_ENDPOINTS; endptno++) {
@@ -379,7 +379,7 @@ ugen_set_config(struct ugen_softc *sc, int configno)
}
int
-ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ugenopen(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
struct ugen_softc *sc;
int unit = UGENUNIT(dev);
@@ -519,7 +519,7 @@ ugenopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
}
int
-ugenclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ugenclose(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
int endpt = UGENENDPOINT(dev);
struct ugen_softc *sc;
@@ -725,7 +725,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
}
int
-ugenread(dev_t dev, struct uio *uio, int flag)
+ugenread(struct cdev *dev, struct uio *uio, int flag)
{
int endpt = UGENENDPOINT(dev);
struct ugen_softc *sc;
@@ -825,7 +825,7 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag)
}
int
-ugenwrite(dev_t dev, struct uio *uio, int flag)
+ugenwrite(struct cdev *dev, struct uio *uio, int flag)
{
int endpt = UGENENDPOINT(dev);
struct ugen_softc *sc;
@@ -1390,7 +1390,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd,
}
int
-ugenioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
+ugenioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
{
int endpt = UGENENDPOINT(dev);
struct ugen_softc *sc;
@@ -1406,7 +1406,7 @@ ugenioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
}
int
-ugenpoll(dev_t dev, int events, usb_proc_ptr p)
+ugenpoll(struct cdev *dev, int events, usb_proc_ptr p)
{
struct ugen_softc *sc;
struct ugen_endpoint *sce;
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 461d35c..f19424b 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -136,7 +136,7 @@ struct uhid_softc {
u_char sc_dying;
#if defined(__FreeBSD__)
- dev_t dev;
+ struct cdev *dev;
#endif
};
@@ -393,7 +393,7 @@ uhid_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status)
}
int
-uhidopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
+uhidopen(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
struct uhid_softc *sc;
usbd_status err;
@@ -440,7 +440,7 @@ uhidopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
}
int
-uhidclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
+uhidclose(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
struct uhid_softc *sc;
@@ -530,7 +530,7 @@ uhid_do_read(struct uhid_softc *sc, struct uio *uio, int flag)
}
int
-uhidread(dev_t dev, struct uio *uio, int flag)
+uhidread(struct cdev *dev, struct uio *uio, int flag)
{
struct uhid_softc *sc;
int error;
@@ -576,7 +576,7 @@ uhid_do_write(struct uhid_softc *sc, struct uio *uio, int flag)
}
int
-uhidwrite(dev_t dev, struct uio *uio, int flag)
+uhidwrite(struct cdev *dev, struct uio *uio, int flag)
{
struct uhid_softc *sc;
int error;
@@ -710,7 +710,7 @@ uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr, int flag,
}
int
-uhidioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
+uhidioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
{
struct uhid_softc *sc;
int error;
@@ -725,7 +725,7 @@ uhidioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
}
int
-uhidpoll(dev_t dev, int events, usb_proc_ptr p)
+uhidpoll(struct cdev *dev, int events, usb_proc_ptr p)
{
struct uhid_softc *sc;
int revents = 0;
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index 48aeb09..e8f38d8 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -122,8 +122,8 @@ struct ulpt_softc {
u_char sc_dying;
#if defined(__FreeBSD__)
- dev_t dev;
- dev_t dev_noprime;
+ struct cdev *dev;
+ struct cdev *dev_noprime;
#endif
};
@@ -490,7 +490,7 @@ int ulptusein = 1;
* Reset the printer, then wait until it's selected and not busy.
*/
int
-ulptopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ulptopen(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
u_char flags = ULPTFLAGS(dev);
struct ulpt_softc *sc;
@@ -625,7 +625,7 @@ ulpt_statusmsg(u_char status, struct ulpt_softc *sc)
}
int
-ulptclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ulptclose(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
struct ulpt_softc *sc;
@@ -697,7 +697,7 @@ ulpt_do_write(struct ulpt_softc *sc, struct uio *uio, int flags)
}
int
-ulptwrite(dev_t dev, struct uio *uio, int flags)
+ulptwrite(struct cdev *dev, struct uio *uio, int flags)
{
struct ulpt_softc *sc;
int error;
@@ -715,7 +715,7 @@ ulptwrite(dev_t dev, struct uio *uio, int flags)
}
int
-ulptioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
+ulptioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
{
int error = 0;
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
index 1bb82ea..708f301 100644
--- a/sys/dev/usb/ums.c
+++ b/sys/dev/usb/ums.c
@@ -130,7 +130,7 @@ struct ums_softc {
# define UMS_SELECT 0x02 /* select is waiting */
struct selinfo rsel; /* process waiting in select */
- dev_t dev; /* specfs */
+ struct cdev *dev; /* specfs */
};
#define MOUSE_FLAGS_MASK (HIO_CONST|HIO_RELATIVE)
@@ -589,7 +589,7 @@ ums_disable(priv)
}
Static int
-ums_open(dev_t dev, int flag, int fmt, usb_proc_ptr p)
+ums_open(struct cdev *dev, int flag, int fmt, usb_proc_ptr p)
{
struct ums_softc *sc;
@@ -599,7 +599,7 @@ ums_open(dev_t dev, int flag, int fmt, usb_proc_ptr p)
}
Static int
-ums_close(dev_t dev, int flag, int fmt, usb_proc_ptr p)
+ums_close(struct cdev *dev, int flag, int fmt, usb_proc_ptr p)
{
struct ums_softc *sc;
@@ -615,7 +615,7 @@ ums_close(dev_t dev, int flag, int fmt, usb_proc_ptr p)
}
Static int
-ums_read(dev_t dev, struct uio *uio, int flag)
+ums_read(struct cdev *dev, struct uio *uio, int flag)
{
struct ums_softc *sc;
int s;
@@ -685,7 +685,7 @@ ums_read(dev_t dev, struct uio *uio, int flag)
}
Static int
-ums_poll(dev_t dev, int events, usb_proc_ptr p)
+ums_poll(struct cdev *dev, int events, usb_proc_ptr p)
{
struct ums_softc *sc;
int revents = 0;
@@ -711,7 +711,7 @@ ums_poll(dev_t dev, int events, usb_proc_ptr p)
}
int
-ums_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
+ums_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
{
struct ums_softc *sc;
int error = 0;
diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c
index eaec4e5..8685f0d 100644
--- a/sys/dev/usb/urio.c
+++ b/sys/dev/usb/urio.c
@@ -148,7 +148,7 @@ struct urio_softc {
int sc_refcnt;
#if defined(__FreeBSD__)
- dev_t sc_dev_t;
+ struct cdev *sc_dev_t;
#endif /* defined(__FreeBSD__) */
#if defined(__NetBSD__) || defined(__OpenBSD__)
u_char sc_dying;
@@ -262,7 +262,7 @@ USB_ATTACH(urio)
}
#if defined(__FreeBSD__)
- /* XXX no error trapping, no storing of dev_t */
+ /* XXX no error trapping, no storing of struct cdev **/
sc->sc_dev_t = make_dev(&urio_cdevsw, device_get_unit(self),
UID_ROOT, GID_OPERATOR,
0644, "urio%d", device_get_unit(self));
@@ -282,7 +282,7 @@ USB_ATTACH(urio)
int
-urioopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
+urioopen(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
#if (USBDI >= 1)
struct urio_softc * sc;
@@ -322,7 +322,7 @@ urioopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
}
int
-urioclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
+urioclose(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
#if (USBDI >= 1)
struct urio_softc * sc;
@@ -345,7 +345,7 @@ urioclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
}
int
-urioread(dev_t dev, struct uio *uio, int flag)
+urioread(struct cdev *dev, struct uio *uio, int flag)
{
#if (USBDI >= 1)
struct urio_softc * sc;
@@ -419,7 +419,7 @@ urioread(dev_t dev, struct uio *uio, int flag)
}
int
-uriowrite(dev_t dev, struct uio *uio, int flag)
+uriowrite(struct cdev *dev, struct uio *uio, int flag)
{
#if (USBDI >= 1)
struct urio_softc * sc;
@@ -486,7 +486,7 @@ uriowrite(dev_t dev, struct uio *uio, int flag)
int
-urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
+urioioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
{
#if (USBDI >= 1)
struct urio_softc * sc;
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index d2ce30f..d934491 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -470,7 +470,7 @@ usbctlprint(void *aux, const char *pnp)
#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
int
-usbopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
+usbopen(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
int unit = USBUNIT(dev);
struct usb_softc *sc;
@@ -492,7 +492,7 @@ usbopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
}
int
-usbread(dev_t dev, struct uio *uio, int flag)
+usbread(struct cdev *dev, struct uio *uio, int flag)
{
struct usb_event ue;
int unit = USBUNIT(dev);
@@ -526,7 +526,7 @@ usbread(dev_t dev, struct uio *uio, int flag)
}
int
-usbclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
+usbclose(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
int unit = USBUNIT(dev);
@@ -539,7 +539,7 @@ usbclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
}
int
-usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
+usbioctl(struct cdev *devt, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
{
struct usb_softc *sc;
int unit = USBUNIT(devt);
@@ -659,7 +659,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
}
int
-usbpoll(dev_t dev, int events, usb_proc_ptr p)
+usbpoll(struct cdev *dev, int events, usb_proc_ptr p)
{
int revents, mask, s;
int unit = USBUNIT(dev);
diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c
index f1a3700..e085c69 100644
--- a/sys/dev/usb/uscanner.c
+++ b/sys/dev/usb/uscanner.c
@@ -232,7 +232,7 @@ struct uscanner_softc {
usbd_device_handle sc_udev;
usbd_interface_handle sc_iface;
#if defined(__FreeBSD__)
- dev_t dev;
+ struct cdev *dev;
#endif
u_int sc_dev_flags;
@@ -380,7 +380,7 @@ USB_ATTACH(uscanner)
}
int
-uscanneropen(dev_t dev, int flag, int mode, usb_proc_ptr p)
+uscanneropen(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
struct uscanner_softc *sc;
int unit = USCANNERUNIT(dev);
@@ -443,7 +443,7 @@ uscanneropen(dev_t dev, int flag, int mode, usb_proc_ptr p)
}
int
-uscannerclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
+uscannerclose(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
struct uscanner_softc *sc;
@@ -541,7 +541,7 @@ uscanner_do_read(struct uscanner_softc *sc, struct uio *uio, int flag)
}
int
-uscannerread(dev_t dev, struct uio *uio, int flag)
+uscannerread(struct cdev *dev, struct uio *uio, int flag)
{
struct uscanner_softc *sc;
int error;
@@ -591,7 +591,7 @@ uscanner_do_write(struct uscanner_softc *sc, struct uio *uio, int flag)
}
int
-uscannerwrite(dev_t dev, struct uio *uio, int flag)
+uscannerwrite(struct cdev *dev, struct uio *uio, int flag)
{
struct uscanner_softc *sc;
int error;
@@ -674,7 +674,7 @@ USB_DETACH(uscanner)
}
int
-uscannerpoll(dev_t dev, int events, usb_proc_ptr p)
+uscannerpoll(struct cdev *dev, int events, usb_proc_ptr p)
{
struct uscanner_softc *sc;
int revents = 0;
diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c
index 8e1bf36..3306c96 100644
--- a/sys/dev/vinum/vinum.c
+++ b/sys/dev/vinum/vinum.c
@@ -69,12 +69,12 @@ struct cdevsw vinum_cdevsw = {
/* Called by main() during pseudo-device attachment. */
void vinumattach(void *);
STATIC int vinum_modevent(module_t mod, modeventtype_t type, void *unused);
-STATIC void vinum_clone(void *arg, char *name, int namelen, dev_t * dev);
+STATIC void vinum_clone(void *arg, char *name, int namelen, struct cdev ** dev);
struct _vinum_conf vinum_conf; /* configuration information */
-dev_t vinum_daemon_dev;
-dev_t vinum_super_dev;
+struct cdev *vinum_daemon_dev;
+struct cdev *vinum_super_dev;
static eventhandler_tag dev_clone_tag;
@@ -334,7 +334,7 @@ DECLARE_MODULE(vinum, vinum_mod, SI_SUB_RAID, SI_ORDER_MIDDLE);
/* ARGSUSED */
/* Open a vinum object */
int
-vinumopen(dev_t dev,
+vinumopen(struct cdev *dev,
int flags,
int fmt,
struct thread *td)
@@ -437,7 +437,7 @@ vinumopen(dev_t dev,
/* ARGSUSED */
int
-vinumclose(dev_t dev,
+vinumclose(struct cdev *dev,
int flags,
int fmt,
struct thread *td)
@@ -517,7 +517,7 @@ vinumclose(dev_t dev,
}
void
-vinum_clone(void *arg, char *name, int namelen, dev_t * dev)
+vinum_clone(void *arg, char *name, int namelen, struct cdev ** dev)
{
struct volume *vol;
int i;
diff --git a/sys/dev/vinum/vinumext.h b/sys/dev/vinum/vinumext.h
index 86319f0..e60356c 100644
--- a/sys/dev/vinum/vinumext.h
+++ b/sys/dev/vinum/vinumext.h
@@ -141,13 +141,13 @@ d_close_t vinumclose;
d_strategy_t vinumstrategy;
d_ioctl_t vinumioctl;
-int vinum_super_ioctl(dev_t, u_long, caddr_t);
+int vinum_super_ioctl(struct cdev *, u_long, caddr_t);
int vinumstart(struct buf *bp, int reviveok);
int launch_requests(struct request *rq, int reviveok);
void sdio(struct buf *bp);
/* XXX Do we need this? */
-int vinumpart(dev_t);
+int vinumpart(struct cdev *);
extern jmp_buf command_fail; /* return here if config fails */
@@ -172,9 +172,9 @@ struct rqgroup *allocrqg(struct request *rq, int elements);
void deallocrqg(struct rqgroup *rqg);
/* Device number decoding */
-int Volno(dev_t x);
-int Plexno(dev_t x);
-int Sdno(dev_t x);
+int Volno(struct cdev *x);
+int Plexno(struct cdev *x);
+int Sdno(struct cdev *x);
/* State transitions */
int set_drive_state(int driveno, enum drivestate state, enum setstateflags flags);
diff --git a/sys/dev/vinum/vinumioctl.c b/sys/dev/vinum/vinumioctl.c
index f38017f..1783c92 100644
--- a/sys/dev/vinum/vinumioctl.c
+++ b/sys/dev/vinum/vinumioctl.c
@@ -65,7 +65,7 @@ jmp_buf command_fail; /* return on a failed command */
/* ioctl routine */
int
-vinumioctl(dev_t dev,
+vinumioctl(struct cdev *dev,
u_long cmd,
caddr_t data,
int flag,
@@ -178,7 +178,7 @@ vinumioctl(dev_t dev,
/* Handle ioctls for the super device */
int
-vinum_super_ioctl(dev_t dev,
+vinum_super_ioctl(struct cdev *dev,
u_long cmd,
caddr_t data)
{
diff --git a/sys/dev/vinum/vinumobj.h b/sys/dev/vinum/vinumobj.h
index 0d5b800..d6a4d87 100644
--- a/sys/dev/vinum/vinumobj.h
+++ b/sys/dev/vinum/vinumobj.h
@@ -184,7 +184,7 @@ struct _drive
#ifdef _KERNEL
u_int sectorsize;
off_t mediasize;
- dev_t dev; /* device information */
+ struct cdev *dev; /* device information */
#ifdef VINUMDEBUG
char lockfilename[16]; /* name of file from which we were locked */
int lockline; /* and the line number */
@@ -234,7 +234,7 @@ struct _sd
int init_interval; /* and time to wait between transfers */
#ifdef _KERNEL
struct request *waitlist; /* list of requests waiting on revive op */
- dev_t dev; /* associated device */
+ struct cdev *dev; /* associated device */
#endif
};
@@ -276,7 +276,7 @@ struct _plex
struct rangelock *lock; /* ranges of locked addresses */
struct mtx *lockmtx; /* lock mutex, one of plexmutex [] */
daddr_t last_addr; /* last address read from this plex */
- dev_t dev; /* associated device */
+ struct cdev *dev; /* associated device */
#endif
};
@@ -316,6 +316,6 @@ struct _volume
*/
int plex[MAXPLEX]; /* index of plexes */
#ifdef _KERNEL
- dev_t dev; /* associated device */
+ struct cdev *dev; /* associated device */
#endif
};
diff --git a/sys/dev/vinum/vinumutil.c b/sys/dev/vinum/vinumutil.c
index f597cd7..f63bbd7 100644
--- a/sys/dev/vinum/vinumutil.c
+++ b/sys/dev/vinum/vinumutil.c
@@ -243,12 +243,17 @@ sizespec(char *spec)
return -1;
}
+#ifdef _KERNEL
+#define FOOTYPE struct cdev *
+#else
+#define FOOTYPE dev_t
+#endif
/*
* Extract the volume number from a device number. Check that it's
* the correct type, and that it isn't one of the superdevs.
*/
int
-Volno(dev_t dev)
+Volno(FOOTYPE dev)
{
int volno = minor(dev);
@@ -269,7 +274,7 @@ Volno(dev_t dev)
* type. Return -1 for invalid types.
*/
int
-Plexno(dev_t dev)
+Plexno(FOOTYPE dev)
{
int plexno = minor(dev);
@@ -285,7 +290,7 @@ Plexno(dev_t dev)
* type. Return -1 for invalid types.
*/
int
-Sdno(dev_t dev)
+Sdno(FOOTYPE dev)
{
int sdno = minor(dev);
diff --git a/sys/dev/watchdog/watchdog.c b/sys/dev/watchdog/watchdog.c
index a76e3ef..7823885 100644
--- a/sys/dev/watchdog/watchdog.c
+++ b/sys/dev/watchdog/watchdog.c
@@ -39,10 +39,10 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <machine/bus.h>
-static dev_t wd_dev;
+static struct cdev *wd_dev;
static int
-wd_ioctl(dev_t dev __unused, u_long cmd, caddr_t data,
+wd_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data,
int flags __unused, struct thread *td)
{
int error;
diff --git a/sys/dev/zs/z8530var.h b/sys/dev/zs/z8530var.h
index 89a246a..1e5fef7 100644
--- a/sys/dev/zs/z8530var.h
+++ b/sys/dev/zs/z8530var.h
@@ -43,7 +43,7 @@ struct zstty_softc {
bus_space_tag_t sc_bt;
bus_space_handle_t sc_csr;
bus_space_handle_t sc_data;
- dev_t sc_si;
+ struct cdev *sc_si;
struct tty *sc_tty;
int sc_icnt;
uint8_t *sc_iput;
diff --git a/sys/dev/zs/zs.c b/sys/dev/zs/zs.c
index 4695526..bc848fb 100644
--- a/sys/dev/zs/zs.c
+++ b/sys/dev/zs/zs.c
@@ -447,7 +447,7 @@ zstty_softintr(struct zstty_softc *sc)
}
static int
-zsttyopen(dev_t dev, int flags, int mode, struct thread *td)
+zsttyopen(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct zstty_softc *sc;
struct tty *tp;
@@ -503,7 +503,7 @@ zsttyopen(dev_t dev, int flags, int mode, struct thread *td)
}
static int
-zsttyclose(dev_t dev, int flags, int mode, struct thread *td)
+zsttyclose(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct tty *tp;
@@ -519,7 +519,7 @@ zsttyclose(dev_t dev, int flags, int mode, struct thread *td)
}
static int
-zsttyioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+zsttyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
struct zstty_softc *sc;
struct tty *tp;
diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c
index b51f15d..687ec66 100644
--- a/sys/fs/cd9660/cd9660_node.c
+++ b/sys/fs/cd9660/cd9660_node.c
@@ -92,7 +92,7 @@ cd9660_uninit(vfsp)
*/
int
cd9660_ihashget(dev, inum, flags, vpp)
- dev_t dev;
+ struct cdev *dev;
ino_t inum;
int flags;
struct vnode **vpp;
diff --git a/sys/fs/cd9660/cd9660_node.h b/sys/fs/cd9660/cd9660_node.h
index 8e7d6c1..a5b228c 100644
--- a/sys/fs/cd9660/cd9660_node.h
+++ b/sys/fs/cd9660/cd9660_node.h
@@ -113,7 +113,7 @@ void cd9660_defattr(struct iso_directory_record *,
struct iso_node *, struct buf *, enum ISO_FTYPE);
void cd9660_deftstamp(struct iso_directory_record *,
struct iso_node *, struct buf *, enum ISO_FTYPE);
-int cd9660_ihashget(dev_t, ino_t, int, struct vnode **);
+int cd9660_ihashget(struct cdev *, ino_t, int, struct vnode **);
void cd9660_ihashins(struct iso_node *);
int cd9660_tstamp_conv7(u_char *, struct timespec *, enum ISO_FTYPE);
int cd9660_tstamp_conv17(u_char *, struct timespec *);
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index ceb60f9..dc0b240 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -92,7 +92,7 @@ MODULE_VERSION(cd9660, 1);
* Called by vfs_mountroot when iso is going to be mounted as root.
*/
-static int iso_get_ssector(dev_t dev, struct thread *td);
+static int iso_get_ssector(struct cdev *dev, struct thread *td);
static int iso_mountfs(struct vnode *devvp, struct mount *mp,
struct thread *td, struct iso_args *argp);
@@ -103,7 +103,7 @@ static int iso_mountfs(struct vnode *devvp, struct mount *mp,
*/
static int
iso_get_ssector(dev, td)
- dev_t dev;
+ struct cdev *dev;
struct thread *td;
{
struct ioc_toc_header h;
@@ -272,7 +272,7 @@ iso_mountfs(devvp, mp, td, argp)
register struct iso_mnt *isomp = (struct iso_mnt *)0;
struct buf *bp = NULL;
struct buf *pribp = NULL, *supbp = NULL;
- dev_t dev = devvp->v_rdev;
+ struct cdev *dev = devvp->v_rdev;
int error = EINVAL;
int needclose = 0;
int high_sierra = 0;
@@ -707,7 +707,7 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
struct iso_node *ip;
struct buf *bp;
struct vnode *vp;
- dev_t dev;
+ struct cdev *dev;
int error;
imp = VFSTOISOFS(mp);
diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h
index 4789e50..412f130 100644
--- a/sys/fs/cd9660/iso.h
+++ b/sys/fs/cd9660/iso.h
@@ -223,7 +223,7 @@ struct iso_mnt {
int im_flags;
struct mount *im_mountp;
- dev_t im_dev;
+ struct cdev *im_dev;
struct vnode *im_devvp;
int logical_block_size;
diff --git a/sys/fs/coda/cnode.h b/sys/fs/coda/cnode.h
index 540831c..be7e848 100644
--- a/sys/fs/coda/cnode.h
+++ b/sys/fs/coda/cnode.h
@@ -109,7 +109,7 @@ struct cnode {
struct vattr c_vattr; /* attributes */
char *c_symlink; /* pointer to symbolic link */
u_short c_symlen; /* length of symbolic link */
- dev_t c_device; /* associated vnode device */
+ struct cdev *c_device; /* associated vnode device */
ino_t c_inode; /* associated vnode inode */
struct cnode *c_next; /* links if on NetBSD machine */
};
@@ -153,7 +153,7 @@ struct coda_mntinfo {
struct vnode *mi_rootvp;
struct mount *mi_vfsp;
struct vcomm mi_vcomm;
- dev_t dev;
+ struct cdev *dev;
int mi_started;
};
extern struct coda_mntinfo coda_mnttbl[]; /* indexed by minor device number */
@@ -201,7 +201,7 @@ extern struct cnode *make_coda_node(CodaFid *fid, struct mount *vfsp, short type
extern int coda_vnodeopstats_init(void);
/* coda_vfsops.h */
-extern struct mount *devtomp(dev_t dev);
+extern struct mount *devtomp(struct cdev *dev);
/* sigh */
#define CODA_RDWR ((u_long) 31)
diff --git a/sys/fs/coda/coda.h b/sys/fs/coda/coda.h
index e7f1e0d..90e7e2a 100644
--- a/sys/fs/coda/coda.h
+++ b/sys/fs/coda/coda.h
@@ -58,7 +58,7 @@ typedef unsigned long u_long;
typedef unsigned int u_int;
typedef unsigned short u_short;
typedef u_long ino_t;
-typedef u_long dev_t;
+typedef u_long struct cdev *;
typedef void * caddr_t;
#ifdef DOS
typedef unsigned __int64 u_quad_t;
diff --git a/sys/fs/coda/coda_fbsd.c b/sys/fs/coda/coda_fbsd.c
index 784962c..0ce6e46 100644
--- a/sys/fs/coda/coda_fbsd.c
+++ b/sys/fs/coda/coda_fbsd.c
@@ -174,7 +174,7 @@ printf("error = %d\n", error);
/* for DEVFS, using bpf & tun drivers as examples*/
static void coda_fbsd_drvinit(void *unused);
static void coda_fbsd_drvuninit(void *unused);
-static void coda_fbsd_clone(void *arg, char *name, int namelen, dev_t *dev);
+static void coda_fbsd_clone(void *arg, char *name, int namelen, struct cdev **dev);
static eventhandler_tag clonetag;
@@ -182,7 +182,7 @@ static void coda_fbsd_clone(arg, name, namelen, dev)
void *arg;
char *name;
int namelen;
- dev_t *dev;
+ struct cdev **dev;
{
int u;
diff --git a/sys/fs/coda/coda_psdev.c b/sys/fs/coda/coda_psdev.c
index 133d0fd..03e408d 100644
--- a/sys/fs/coda/coda_psdev.c
+++ b/sys/fs/coda/coda_psdev.c
@@ -117,7 +117,7 @@ vcodaattach(n)
int
vc_nb_open(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td; /* NetBSD only */
@@ -149,7 +149,7 @@ vc_nb_open(dev, flag, mode, td)
int
vc_nb_close (dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -233,7 +233,7 @@ vc_nb_close (dev, flag, mode, td)
int
vc_nb_read(dev, uiop, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uiop;
int flag;
{
@@ -287,7 +287,7 @@ vc_nb_read(dev, uiop, flag)
int
vc_nb_write(dev, uiop, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uiop;
int flag;
{
@@ -387,7 +387,7 @@ vc_nb_write(dev, uiop, flag)
int
vc_nb_ioctl(dev, cmd, addr, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t addr;
int flag;
@@ -441,7 +441,7 @@ vc_nb_ioctl(dev, cmd, addr, flag, td)
int
vc_nb_poll(dev, events, td)
- dev_t dev;
+ struct cdev *dev;
int events;
struct thread *td;
{
diff --git a/sys/fs/coda/coda_psdev.h b/sys/fs/coda/coda_psdev.h
index c6ecf7f..f135b34 100644
--- a/sys/fs/coda/coda_psdev.h
+++ b/sys/fs/coda/coda_psdev.h
@@ -31,9 +31,9 @@
*
*/
-int vc_nb_open(dev_t dev, int flag, int mode, struct thread *p);
-int vc_nb_close (dev_t dev, int flag, int mode, struct thread *p);
-int vc_nb_read(dev_t dev, struct uio *uiop, int flag);
-int vc_nb_write(dev_t dev, struct uio *uiop, int flag);
-int vc_nb_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *p);
-int vc_nb_poll(dev_t dev, int events, struct thread *p);
+int vc_nb_open(struct cdev *dev, int flag, int mode, struct thread *p);
+int vc_nb_close (struct cdev *dev, int flag, int mode, struct thread *p);
+int vc_nb_read(struct cdev *dev, struct uio *uiop, int flag);
+int vc_nb_write(struct cdev *dev, struct uio *uiop, int flag);
+int vc_nb_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *p);
+int vc_nb_poll(struct cdev *dev, int events, struct thread *p);
diff --git a/sys/fs/coda/coda_venus.c b/sys/fs/coda/coda_venus.c
index 5105c0b..f0bc3c2 100644
--- a/sys/fs/coda/coda_venus.c
+++ b/sys/fs/coda/coda_venus.c
@@ -198,7 +198,7 @@ venus_root(void *mdp,
int
venus_open(void *mdp, CodaFid *fid, int flag,
struct ucred *cred, struct proc *p,
-/*out*/ dev_t *dev, ino_t *inode)
+/*out*/ struct cdev **dev, ino_t *inode)
{
int cflag;
DECL(coda_open); /* sets Isize & Osize */
diff --git a/sys/fs/coda/coda_venus.h b/sys/fs/coda/coda_venus.h
index b506b5b..473b84d 100644
--- a/sys/fs/coda/coda_venus.h
+++ b/sys/fs/coda/coda_venus.h
@@ -39,7 +39,7 @@ venus_root(void *mdp,
int
venus_open(void *mdp, CodaFid *fid, int flag,
struct ucred *cred, struct proc *p,
-/*out*/ dev_t *dev, ino_t *inode);
+/*out*/ struct cdev **dev, ino_t *inode);
int
venus_close(void *mdp, CodaFid *fid, int flag,
diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c
index ff64429..e7290e7 100644
--- a/sys/fs/coda/coda_vfsops.c
+++ b/sys/fs/coda/coda_vfsops.c
@@ -81,7 +81,7 @@ struct coda_op_stats coda_vfsopstats[CODA_VFSOPS_SIZE];
#define MRAK_INT_GEN(op) (coda_vfsopstats[op].gen_intrn++)
extern int coda_nc_initialized; /* Set if cache has been initialized */
-extern int vc_nb_open(dev_t, int, int, struct thread *);
+extern int vc_nb_open(struct cdev *, int, int, struct thread *);
int
coda_vfsopstats_init(void)
@@ -114,7 +114,7 @@ coda_mount(vfsp, path, data, ndp, td)
{
struct vnode *dvp;
struct cnode *cp;
- dev_t dev;
+ struct cdev *dev;
struct coda_mntinfo *mi;
struct vnode *rootvp;
CodaFid rootfid = INVAL_FID;
@@ -528,7 +528,7 @@ getNewVnode(vpp)
* device corresponds to a UFS. Return NULL if no device is found.
*/
struct mount *devtomp(dev)
- dev_t dev;
+ struct cdev *dev;
{
struct mount *mp;
diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c
index a1d24e9..a8666cc 100644
--- a/sys/fs/coda/coda_vnops.c
+++ b/sys/fs/coda/coda_vnops.c
@@ -238,7 +238,7 @@ coda_open(v)
/* locals */
int error;
struct vnode *vp;
- dev_t dev;
+ struct cdev *dev;
ino_t inode;
MARK_ENTRY(CODA_OPEN_STATS);
@@ -1806,7 +1806,7 @@ coda_islocked(v)
/* How one looks up a vnode given a device/inode pair: */
int
-coda_grab_vnode(dev_t dev, ino_t ino, struct vnode **vpp)
+coda_grab_vnode(struct cdev *dev, ino_t ino, struct vnode **vpp)
{
/* This is like VFS_VGET() or igetinode()! */
int error;
diff --git a/sys/fs/coda/coda_vnops.h b/sys/fs/coda/coda_vnops.h
index 8a3184b..88a398e 100644
--- a/sys/fs/coda/coda_vnops.h
+++ b/sys/fs/coda/coda_vnops.h
@@ -82,6 +82,6 @@ int coda_pathconf(void *);
int coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw,
int ioflag, struct ucred *cred, struct thread *td);
-int coda_grab_vnode(dev_t dev, ino_t ino, struct vnode **vpp);
+int coda_grab_vnode(struct cdev *dev, ino_t ino, struct vnode **vpp);
void print_vattr(struct vattr *attr);
void print_cred(struct ucred *cred);
diff --git a/sys/fs/devfs/devfs.h b/sys/fs/devfs/devfs.h
index c12a4d6..ba8bbf0 100644
--- a/sys/fs/devfs/devfs.h
+++ b/sys/fs/devfs/devfs.h
@@ -190,7 +190,7 @@ void devfs_rules_apply(struct devfs_mount *dm, struct devfs_dirent *de);
int devfs_rules_ioctl(struct mount *mp, u_long cmd, caddr_t data, struct thread *td);
void devfs_rules_newmount(struct devfs_mount *dm, struct thread *td);
int devfs_allocv (struct devfs_dirent *de, struct mount *mp, struct vnode **vpp, struct thread *td);
-dev_t *devfs_itod (int inode);
+struct cdev **devfs_itod (int inode);
struct devfs_dirent **devfs_itode (struct devfs_mount *dm, int inode);
int devfs_populate (struct devfs_mount *dm);
struct devfs_dirent *devfs_newdirent (char *name, int namelen);
diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c
index eb394d8..732a23d 100644
--- a/sys/fs/devfs/devfs_devs.c
+++ b/sys/fs/devfs/devfs_devs.c
@@ -47,8 +47,8 @@
#include <fs/devfs/devfs.h>
-static dev_t devfs_inot[NDEVFSINO];
-static dev_t *devfs_overflow;
+static struct cdev *devfs_inot[NDEVFSINO];
+static struct cdev **devfs_overflow;
static int devfs_ref[NDEVFSINO];
static int *devfs_refoverflow;
static int devfs_nextino = 3;
@@ -95,7 +95,7 @@ static int
devfs_getref(int inode)
{
int *ip, i, j;
- dev_t *dp;
+ struct cdev **dp;
ip = devfs_itor(inode);
dp = devfs_itod(inode);
@@ -124,7 +124,7 @@ devfs_itode (struct devfs_mount *dm, int inode)
return (NULL);
}
-dev_t *
+struct cdev **
devfs_itod (int inode)
{
@@ -140,7 +140,7 @@ devfs_itod (int inode)
static void
devfs_attemptoverflow(int insist)
{
- dev_t **ot;
+ struct cdev ***ot;
int *or;
int n, nb;
@@ -150,8 +150,8 @@ devfs_attemptoverflow(int insist)
ot = NULL;
or = NULL;
n = devfs_noverflowwant;
- nb = sizeof (dev_t *) * n;
- MALLOC(ot, dev_t **, nb, M_DEVFS, (insist ? M_WAITOK : M_NOWAIT) | M_ZERO);
+ nb = sizeof (struct cdev **) * n;
+ MALLOC(ot, struct cdev ***, nb, M_DEVFS, (insist ? M_WAITOK : M_NOWAIT) | M_ZERO);
if (ot == NULL)
goto bail;
nb = sizeof (int) * n;
@@ -282,7 +282,7 @@ int
devfs_populate(struct devfs_mount *dm)
{
int i, j;
- dev_t dev, pdev;
+ struct cdev *dev, *pdev;
struct devfs_dirent *dd;
struct devfs_dirent *de, **dep;
char *q, *s;
@@ -377,10 +377,10 @@ devfs_populate(struct devfs_mount *dm)
}
void
-devfs_create(dev_t dev)
+devfs_create(struct cdev *dev)
{
int ino, i, *ip;
- dev_t *dp;
+ struct cdev **dp;
for (;;) {
/* Grab the next inode number */
@@ -426,7 +426,7 @@ devfs_create(dev_t dev)
}
void
-devfs_destroy(dev_t dev)
+devfs_destroy(struct cdev *dev)
{
int ino, i;
diff --git a/sys/fs/devfs/devfs_rule.c b/sys/fs/devfs/devfs_rule.c
index 366fd84..b73ac77 100644
--- a/sys/fs/devfs/devfs_rule.c
+++ b/sys/fs/devfs/devfs_rule.c
@@ -108,7 +108,7 @@ static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm);
static int devfs_rule_autonumber(struct devfs_ruleset *ds, devfs_rnum *rnp);
static struct devfs_krule *devfs_rule_byid(devfs_rid rid);
static int devfs_rule_delete(struct devfs_krule **dkp);
-static dev_t devfs_rule_getdev(struct devfs_dirent *de);
+static struct cdev *devfs_rule_getdev(struct devfs_dirent *de);
static int devfs_rule_input(struct devfs_rule *dr, struct devfs_mount *dm);
static int devfs_rule_insert(struct devfs_rule *dr);
static int devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de);
@@ -480,26 +480,26 @@ devfs_rule_delete(struct devfs_krule **dkp)
}
/*
- * Get a dev_t corresponding to de so we can try to match rules based
- * on it. If this routine returns NULL, there is no dev_t associated
+ * Get a struct cdev *corresponding to de so we can try to match rules based
+ * on it. If this routine returns NULL, there is no struct cdev *associated
* with the dirent (symlinks and directories don't have dev_ts), and
* the caller should assume that any critera dependent on a dev_t
* don't match.
*/
-static dev_t
+static struct cdev *
devfs_rule_getdev(struct devfs_dirent *de)
{
- dev_t *devp, dev;
+ struct cdev **devp, *dev;
devp = devfs_itod(de->de_inode);
if (devp != NULL)
dev = *devp;
else
dev = NULL;
- /* If we think this dirent should have a dev_t, alert the user. */
+ /* If we think this dirent should have a struct cdev *, alert the user. */
if (dev == NULL && de->de_dirent->d_type != DT_LNK &&
de->de_dirent->d_type != DT_DIR)
- printf("Warning: no dev_t for %s\n", de->de_dirent->d_name);
+ printf("Warning: no struct cdev *for %s\n", de->de_dirent->d_name);
return (dev);
}
@@ -590,7 +590,7 @@ static int
devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de)
{
struct devfs_rule *dr = &dk->dk_rule;
- dev_t dev;
+ struct cdev *dev;
dev = devfs_rule_getdev(de);
/*
@@ -598,7 +598,7 @@ devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de)
* criteria that depend on it don't match. We should *not*
* just ignore them (i.e., act like they weren't specified),
* since that makes a rule that only has criteria dependent on
- * the dev_t match all symlinks and directories.
+ * the struct cdev *match all symlinks and directories.
*
* Note also that the following tests are somewhat reversed:
* They're actually testing to see whether the condition does
@@ -630,7 +630,7 @@ devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_dirent *de)
{
struct devfs_rule *dr = &dk->dk_rule;
char *pname;
- dev_t dev;
+ struct cdev *dev;
dev = devfs_rule_getdev(de);
if (dev != NULL)
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index e0f192f..cbc836a 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -123,7 +123,7 @@ devfs_allocv(struct devfs_dirent *de, struct mount *mp, struct vnode **vpp, stru
{
int error;
struct vnode *vp;
- dev_t dev;
+ struct cdev *dev;
if (td == NULL)
td = curthread; /* XXX */
@@ -213,7 +213,7 @@ devfs_getattr(ap)
struct vattr *vap = ap->a_vap;
int error = 0;
struct devfs_dirent *de;
- dev_t dev;
+ struct cdev *dev;
de = vp->v_data;
if (vp->v_type == VDIR)
@@ -304,7 +304,7 @@ devfs_lookupx(ap)
struct devfs_dirent *de, *dd;
struct devfs_dirent **dde;
struct devfs_mount *dmp;
- dev_t cdev;
+ struct cdev *cdev;
int error, flags, nameiop;
char specname[SPECNAMELEN + 1], *pname;
diff --git a/sys/fs/hpfs/hpfs.h b/sys/fs/hpfs/hpfs.h
index 9b4fd1d..c02862b 100644
--- a/sys/fs/hpfs/hpfs.h
+++ b/sys/fs/hpfs/hpfs.h
@@ -312,7 +312,7 @@ struct hpfsmount {
struct spblock hpm_sp;
struct mount * hpm_mp;
struct vnode * hpm_devvp;
- dev_t hpm_dev;
+ struct cdev *hpm_dev;
uid_t hpm_uid;
gid_t hpm_gid;
mode_t hpm_mode;
@@ -341,7 +341,7 @@ struct hpfsnode {
struct fnode h_fn;
struct vnode * h_vp;
struct vnode * h_devvp;
- dev_t h_dev;
+ struct cdev *h_dev;
lsn_t h_no;
uid_t h_uid;
gid_t h_gid;
@@ -390,9 +390,9 @@ extern vop_t ** hpfs_vnodeop_p;
/* Hash routines, too small to be separate header */
void hpfs_hphashinit(void);
void hpfs_hphashdestroy(void);
-struct hpfsnode *hpfs_hphashlookup(dev_t, lsn_t);
-struct hpfsnode *hpfs_hphashget(dev_t, lsn_t);
-int hpfs_hphashvget(dev_t, lsn_t, int, struct vnode **, struct thread *);
+struct hpfsnode *hpfs_hphashlookup(struct cdev *, lsn_t);
+struct hpfsnode *hpfs_hphashget(struct cdev *, lsn_t);
+int hpfs_hphashvget(struct cdev *, lsn_t, int, struct vnode **, struct thread *);
void hpfs_hphashins(register struct hpfsnode *);
void hpfs_hphashrem(register struct hpfsnode *);
extern struct lock hpfs_hphash_lock;
diff --git a/sys/fs/hpfs/hpfs_hash.c b/sys/fs/hpfs/hpfs_hash.c
index e76eaf7..e1cd079 100644
--- a/sys/fs/hpfs/hpfs_hash.c
+++ b/sys/fs/hpfs/hpfs_hash.c
@@ -82,7 +82,7 @@ hpfs_hphashdestroy(void)
*/
struct hpfsnode *
hpfs_hphashlookup(dev, ino)
- dev_t dev;
+ struct cdev *dev;
lsn_t ino;
{
struct hpfsnode *hp;
@@ -99,7 +99,7 @@ hpfs_hphashlookup(dev, ino)
#if 0
struct hpfsnode *
hpfs_hphashget(dev, ino)
- dev_t dev;
+ struct cdev *dev;
lsn_t ino;
{
struct hpfsnode *hp;
@@ -120,7 +120,7 @@ loop:
int
hpfs_hphashvget(dev, ino, flags, vpp, td)
- dev_t dev;
+ struct cdev *dev;
lsn_t ino;
int flags;
struct vnode **vpp;
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c
index 86e8bc6..e9059d4e 100644
--- a/sys/fs/hpfs/hpfs_vfsops.c
+++ b/sys/fs/hpfs/hpfs_vfsops.c
@@ -217,7 +217,7 @@ hpfs_mountfs(devvp, mp, argsp, td)
struct hpfsmount *hpmp;
struct buf *bp = NULL;
struct vnode *vp;
- dev_t dev = devvp->v_rdev;
+ struct cdev *dev = devvp->v_rdev;
dprintf(("hpfs_mountfs():\n"));
/*
diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c
index ebf1319..6fa69bd 100644
--- a/sys/fs/msdosfs/msdosfs_denode.c
+++ b/sys/fs/msdosfs/msdosfs_denode.c
@@ -94,7 +94,7 @@ union _qcvt {
}
static struct denode *
- msdosfs_hashget(dev_t dev, u_long dirclust, u_long diroff);
+ msdosfs_hashget(struct cdev *dev, u_long dirclust, u_long diroff);
static void msdosfs_hashins(struct denode *dep);
static void msdosfs_hashrem(struct denode *dep);
@@ -133,7 +133,7 @@ msdosfs_uninit(vfsp)
static struct denode *
msdosfs_hashget(dev, dirclust, diroff)
- dev_t dev;
+ struct cdev *dev;
u_long dirclust;
u_long diroff;
{
@@ -215,7 +215,7 @@ deget(pmp, dirclust, diroffset, depp)
struct denode **depp; /* returns the addr of the gotten denode */
{
int error;
- dev_t dev = pmp->pm_dev;
+ struct cdev *dev = pmp->pm_dev;
struct mount *mntp = pmp->pm_mountp;
struct direntry *direntptr;
struct denode *ldep;
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index dd4512a..3ac0fb6 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -301,7 +301,7 @@ mountmsdosfs(devvp, mp, td, argp)
{
struct msdosfsmount *pmp;
struct buf *bp;
- dev_t dev = devvp->v_rdev;
+ struct cdev *dev = devvp->v_rdev;
union bootsector *bsp;
struct byte_bpb33 *b33;
struct byte_bpb50 *b50;
diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h
index 2f35ecc..0ff712f 100644
--- a/sys/fs/msdosfs/msdosfsmount.h
+++ b/sys/fs/msdosfs/msdosfsmount.h
@@ -62,7 +62,7 @@ MALLOC_DECLARE(M_MSDOSFSMNT);
*/
struct msdosfsmount {
struct mount *pm_mountp;/* vfs mount struct for this fs */
- dev_t pm_dev; /* block special device mounted */
+ struct cdev *pm_dev; /* block special device mounted */
uid_t pm_uid; /* uid to set as owner of the files */
gid_t pm_gid; /* gid to set as owner of the files */
mode_t pm_mask; /* mask to and with file protection bits
diff --git a/sys/fs/ntfs/ntfs.h b/sys/fs/ntfs/ntfs.h
index 6e19029..1940ee9 100644
--- a/sys/fs/ntfs/ntfs.h
+++ b/sys/fs/ntfs/ntfs.h
@@ -241,7 +241,7 @@ struct bootfile {
struct ntfsmount {
struct mount *ntm_mountp; /* filesystem vfs structure */
struct bootfile ntm_bootfile;
- dev_t ntm_dev; /* device mounted */
+ struct cdev *ntm_dev; /* device mounted */
struct vnode *ntm_devvp; /* block device mounted vnode */
struct vnode *ntm_sysvn[NTFS_SYSNODESNUM];
u_int32_t ntm_bpmftrec;
diff --git a/sys/fs/ntfs/ntfs_ihash.c b/sys/fs/ntfs/ntfs_ihash.c
index e434eafb..dd9ec2d 100644
--- a/sys/fs/ntfs/ntfs_ihash.c
+++ b/sys/fs/ntfs/ntfs_ihash.c
@@ -83,7 +83,7 @@ ntfs_nthashdestroy(void)
*/
struct ntnode *
ntfs_nthashlookup(dev, inum)
- dev_t dev;
+ struct cdev *dev;
ino_t inum;
{
struct ntnode *ip;
diff --git a/sys/fs/ntfs/ntfs_ihash.h b/sys/fs/ntfs/ntfs_ihash.h
index eb3befd..7df7495 100644
--- a/sys/fs/ntfs/ntfs_ihash.h
+++ b/sys/fs/ntfs/ntfs_ihash.h
@@ -31,7 +31,7 @@
extern struct lock ntfs_hashlock;
void ntfs_nthashinit(void);
void ntfs_nthashdestroy(void);
-struct ntnode *ntfs_nthashlookup(dev_t, ino_t);
-struct ntnode *ntfs_nthashget(dev_t, ino_t);
+struct ntnode *ntfs_nthashlookup(struct cdev *, ino_t);
+struct ntnode *ntfs_nthashget(struct cdev *, ino_t);
void ntfs_nthashins(struct ntnode *);
void ntfs_nthashrem(register struct ntnode *);
diff --git a/sys/fs/ntfs/ntfs_inode.h b/sys/fs/ntfs/ntfs_inode.h
index 13ed443..c11cfa1 100644
--- a/sys/fs/ntfs/ntfs_inode.h
+++ b/sys/fs/ntfs/ntfs_inode.h
@@ -43,7 +43,7 @@
struct ntnode {
struct vnode *i_devvp; /* vnode of blk dev we live on */
- dev_t i_dev; /* Device associated with the inode. */
+ struct cdev *i_dev; /* Device associated with the inode. */
LIST_ENTRY(ntnode) i_hash;
struct ntnode *i_next;
diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c
index a959e8c..924f06f 100644
--- a/sys/fs/ntfs/ntfs_vfsops.c
+++ b/sys/fs/ntfs/ntfs_vfsops.c
@@ -273,7 +273,7 @@ ntfs_mountfs(devvp, mp, argsp, td)
{
struct buf *bp;
struct ntfsmount *ntmp;
- dev_t dev = devvp->v_rdev;
+ struct cdev *dev = devvp->v_rdev;
int error, ronly, ncount, i;
struct vnode *vp;
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c
index a90233e..7d12a58 100644
--- a/sys/fs/specfs/spec_vnops.c
+++ b/sys/fs/specfs/spec_vnops.c
@@ -133,7 +133,7 @@ spec_open(ap)
{
struct thread *td = ap->a_td;
struct vnode *vp = ap->a_vp;
- dev_t dev = vp->v_rdev;
+ struct cdev *dev = vp->v_rdev;
int error;
struct cdevsw *dsw;
@@ -247,7 +247,7 @@ spec_read(ap)
struct vnode *vp;
struct thread *td;
struct uio *uio;
- dev_t dev;
+ struct cdev *dev;
int error, resid;
struct cdevsw *dsw;
@@ -263,7 +263,7 @@ spec_read(ap)
dsw = devsw(dev);
VOP_UNLOCK(vp, 0, td);
KASSERT(dev->si_refcount > 0,
- ("specread() on un-referenced dev_t (%s)", devtoname(dev)));
+ ("specread() on un-referenced struct cdev *(%s)", devtoname(dev)));
cdevsw_ref(dsw);
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
@@ -294,7 +294,7 @@ spec_write(ap)
struct vnode *vp;
struct thread *td;
struct uio *uio;
- dev_t dev;
+ struct cdev *dev;
int error, resid;
struct cdevsw *dsw;
@@ -307,7 +307,7 @@ spec_write(ap)
VOP_UNLOCK(vp, 0, td);
KASSERT(dev->si_refcount > 0,
- ("spec_write() on un-referenced dev_t (%s)", devtoname(dev)));
+ ("spec_write() on un-referenced struct cdev *(%s)", devtoname(dev)));
cdevsw_ref(dsw);
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
@@ -339,14 +339,14 @@ spec_ioctl(ap)
struct thread *a_td;
} */ *ap;
{
- dev_t dev;
+ struct cdev *dev;
int error;
struct cdevsw *dsw;
dev = ap->a_vp->v_rdev;
dsw = devsw(dev);
KASSERT(dev->si_refcount > 0,
- ("spec_ioctl() on un-referenced dev_t (%s)", devtoname(dev)));
+ ("spec_ioctl() on un-referenced struct cdev *(%s)", devtoname(dev)));
cdevsw_ref(dsw);
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
@@ -372,14 +372,14 @@ spec_poll(ap)
struct thread *a_td;
} */ *ap;
{
- dev_t dev;
+ struct cdev *dev;
struct cdevsw *dsw;
int error;
dev = ap->a_vp->v_rdev;
dsw = devsw(dev);
KASSERT(dev->si_refcount > 0,
- ("spec_poll() on un-referenced dev_t (%s)", devtoname(dev)));
+ ("spec_poll() on un-referenced struct cdev *(%s)", devtoname(dev)));
cdevsw_ref(dsw);
if (!(dsw->d_flags & D_NEEDGIANT)) {
/* XXX: not yet DROP_GIANT(); */
@@ -399,14 +399,14 @@ spec_kqfilter(ap)
struct knote *a_kn;
} */ *ap;
{
- dev_t dev;
+ struct cdev *dev;
struct cdevsw *dsw;
int error;
dev = ap->a_vp->v_rdev;
dsw = devsw(dev);
KASSERT(dev->si_refcount > 0,
- ("spec_kqfilter() on un-referenced dev_t (%s)", devtoname(dev)));
+ ("spec_kqfilter() on un-referenced struct cdev *(%s)", devtoname(dev)));
cdevsw_ref(dsw);
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
@@ -572,7 +572,7 @@ spec_close(ap)
{
struct vnode *vp = ap->a_vp, *oldvp;
struct thread *td = ap->a_td;
- dev_t dev = vp->v_rdev;
+ struct cdev *dev = vp->v_rdev;
struct cdevsw *dsw;
int error;
@@ -627,7 +627,7 @@ spec_close(ap)
}
VI_UNLOCK(vp);
KASSERT(dev->si_refcount > 0,
- ("spec_close() on un-referenced dev_t (%s)", devtoname(dev)));
+ ("spec_close() on un-referenced struct cdev *(%s)", devtoname(dev)));
cdevsw_ref(dsw);
if (!(dsw->d_flags & D_NEEDGIANT)) {
DROP_GIANT();
diff --git a/sys/fs/udf/udf.h b/sys/fs/udf/udf.h
index 540a3a6..449c911 100644
--- a/sys/fs/udf/udf.h
+++ b/sys/fs/udf/udf.h
@@ -33,7 +33,7 @@ struct udf_node {
struct vnode *i_vnode;
struct vnode *i_devvp;
struct udf_mnt *udfmp;
- dev_t i_dev;
+ struct cdev *i_dev;
ino_t hash_id;
long diroff;
struct file_entry *fentry;
@@ -42,7 +42,7 @@ struct udf_node {
struct udf_mnt {
int im_flags;
struct mount *im_mountp;
- dev_t im_dev;
+ struct cdev *im_dev;
struct vnode *im_devvp;
int bsize;
int bshift;
diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c
index ce084d6..aae2d0e 100644
--- a/sys/geom/gate/g_gate.c
+++ b/sys/geom/gate/g_gate.c
@@ -63,7 +63,7 @@ struct g_class g_gate_class = {
.destroy_geom = g_gate_destroy_geom
};
-static dev_t status_dev;
+static struct cdev *status_dev;
static d_ioctl_t g_gate_ioctl;
static struct cdevsw g_gate_cdevsw = {
.d_version = D_VERSION,
@@ -437,7 +437,7 @@ g_gate_create(struct g_gate_ctl_create *ggio)
return (EINVAL); \
} while (0)
static int
-g_gate_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
+g_gate_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td)
{
struct g_gate_softc *sc;
struct bio *bp;
diff --git a/sys/geom/geom.h b/sys/geom/geom.h
index 31002fe..07189bd 100644
--- a/sys/geom/geom.h
+++ b/sys/geom/geom.h
@@ -182,8 +182,9 @@ struct g_provider {
};
/* geom_dev.c */
+struct cdev;
void g_dev_print(void);
-struct g_provider *g_dev_getprovider(dev_t dev);
+struct g_provider *g_dev_getprovider(struct cdev *dev);
/* geom_dump.c */
void g_trace(int level, const char *, ...);
diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c
index 3e50eb3..ce000f3 100644
--- a/sys/geom/geom_ctl.c
+++ b/sys/geom/geom_ctl.c
@@ -444,7 +444,7 @@ g_ctl_req(void *arg, int flag __unused)
static int
-g_ctl_ioctl_ctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
+g_ctl_ioctl_ctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
{
struct gctl_req *req;
@@ -479,7 +479,7 @@ g_ctl_ioctl_ctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *t
}
static int
-g_ctl_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
+g_ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
{
int error;
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 9ad3f70..54f585e 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -99,7 +99,7 @@ g_dev_print(void)
* XXX: eliminating the need for this hack.
*/
static void
-g_dev_clone(void *arg __unused, char *name, int namelen __unused, dev_t *dev)
+g_dev_clone(void *arg __unused, char *name, int namelen __unused, struct cdev **dev)
{
struct g_geom *gp;
@@ -135,7 +135,7 @@ g_dev_register_cloner(void *foo __unused)
SYSINIT(geomdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,g_dev_register_cloner,NULL);
struct g_provider *
-g_dev_getprovider(dev_t dev)
+g_dev_getprovider(struct cdev *dev)
{
struct g_consumer *cp;
@@ -155,7 +155,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
struct g_consumer *cp;
static int unit = GEOM_MINOR_PROVIDERS;
int error;
- dev_t dev;
+ struct cdev *dev;
g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
g_topology_assert();
@@ -190,7 +190,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
}
static int
-g_dev_open(dev_t dev, int flags, int fmt, struct thread *td)
+g_dev_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct g_geom *gp;
struct g_consumer *cp;
@@ -223,7 +223,7 @@ g_dev_open(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-g_dev_close(dev_t dev, int flags, int fmt, struct thread *td)
+g_dev_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct g_geom *gp;
struct g_consumer *cp;
@@ -273,7 +273,7 @@ g_dev_close(dev_t dev, int flags, int fmt, struct thread *td)
* XXX: will break (actually: stall) the BSD disklabel hacks.
*/
static int
-g_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
+g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
{
struct g_geom *gp;
struct g_consumer *cp;
@@ -365,7 +365,7 @@ g_dev_strategy(struct bio *bp)
{
struct g_consumer *cp;
struct bio *bp2;
- dev_t dev;
+ struct cdev *dev;
KASSERT(bp->bio_cmd == BIO_READ ||
bp->bio_cmd == BIO_WRITE ||
@@ -404,7 +404,7 @@ g_dev_strategy(struct bio *bp)
*
* Called from below when the provider orphaned us.
* - Clear any dump settings.
- * - Destroy the dev_t to prevent any more request from coming in. The
+ * - Destroy the struct cdev *to prevent any more request from coming in. The
* provider is already marked with an error, so anything which comes in
* in the interrim will be returned immediately.
* - Wait for any outstanding I/O to finish.
@@ -416,7 +416,7 @@ static void
g_dev_orphan(struct g_consumer *cp)
{
struct g_geom *gp;
- dev_t dev;
+ struct cdev *dev;
g_topology_assert();
gp = cp->geom;
@@ -427,7 +427,7 @@ g_dev_orphan(struct g_consumer *cp)
if (dev->si_flags & SI_DUMPDEV)
set_dumper(NULL);
- /* Destroy the dev_t so we get no more requests */
+ /* Destroy the struct cdev *so we get no more requests */
destroy_dev(dev);
/* Wait for the cows to come home */
diff --git a/sys/gnu/ext2fs/ext2_extern.h b/sys/gnu/ext2fs/ext2_extern.h
index 12ec524..45ba6b3 100644
--- a/sys/gnu/ext2fs/ext2_extern.h
+++ b/sys/gnu/ext2fs/ext2_extern.h
@@ -59,11 +59,11 @@ void ext2_dirbad(struct inode *ip, doff_t offset, char *how);
void ext2_ei2i(struct ext2_inode *, struct inode *);
int ext2_getlbns(struct vnode *, int32_t, struct indir *, int *);
void ext2_i2ei(struct inode *, struct ext2_inode *);
-int ext2_ihashget(dev_t, ino_t, int, struct vnode **);
+int ext2_ihashget(struct cdev *, ino_t, int, struct vnode **);
void ext2_ihashinit(void);
void ext2_ihashins(struct inode *);
struct vnode *
- ext2_ihashlookup(dev_t, ino_t);
+ ext2_ihashlookup(struct cdev *, ino_t);
void ext2_ihashrem(struct inode *);
void ext2_ihashuninit(void);
void ext2_itimes(struct vnode *vp);
diff --git a/sys/gnu/ext2fs/ext2_ihash.c b/sys/gnu/ext2fs/ext2_ihash.c
index 09da056..fca9a0d 100644
--- a/sys/gnu/ext2fs/ext2_ihash.c
+++ b/sys/gnu/ext2fs/ext2_ihash.c
@@ -80,7 +80,7 @@ ext2_ihashuninit()
*/
struct vnode *
ext2_ihashlookup(dev, inum)
- dev_t dev;
+ struct cdev *dev;
ino_t inum;
{
struct inode *ip;
@@ -102,7 +102,7 @@ ext2_ihashlookup(dev, inum)
*/
int
ext2_ihashget(dev, inum, flags, vpp)
- dev_t dev;
+ struct cdev *dev;
ino_t inum;
int flags;
struct vnode **vpp;
diff --git a/sys/gnu/ext2fs/ext2_mount.h b/sys/gnu/ext2fs/ext2_mount.h
index e1ca44d..407ca8a 100644
--- a/sys/gnu/ext2fs/ext2_mount.h
+++ b/sys/gnu/ext2fs/ext2_mount.h
@@ -44,7 +44,7 @@ struct vnode;
/* This structure describes the ext2fs specific mount structure data. */
struct ext2mount {
struct mount *um_mountp; /* filesystem vfs structure */
- dev_t um_dev; /* device mounted */
+ struct cdev *um_dev; /* device mounted */
struct vnode *um_devvp; /* block device mounted vnode */
struct ext2_sb_info *um_e2fs; /* EXT2FS */
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index c91eaac..a745e6a 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -97,7 +97,7 @@ VFS_SET(ext2fs_vfsops, ext2fs, 0);
static int ext2fs_inode_hash_lock;
-static int ext2_check_sb_compat(struct ext2_super_block *es, dev_t dev,
+static int ext2_check_sb_compat(struct ext2_super_block *es, struct cdev *dev,
int ronly);
static int compute_sb_data(struct vnode * devvp,
struct ext2_super_block * es, struct ext2_sb_info * fs);
@@ -378,7 +378,7 @@ static int ext2_check_descriptors (struct ext2_sb_info * sb)
static int
ext2_check_sb_compat(es, dev, ronly)
struct ext2_super_block *es;
- dev_t dev;
+ struct cdev *dev;
int ronly;
{
@@ -635,7 +635,7 @@ ext2_mountfs(devvp, mp, td)
struct buf *bp;
struct ext2_sb_info *fs;
struct ext2_super_block * es;
- dev_t dev = devvp->v_rdev;
+ struct cdev *dev = devvp->v_rdev;
int error;
int ronly;
@@ -1000,7 +1000,7 @@ ext2_vget(mp, ino, flags, vpp)
struct ext2mount *ump;
struct buf *bp;
struct vnode *vp;
- dev_t dev;
+ struct cdev *dev;
int i, error;
int used_blocks;
diff --git a/sys/gnu/ext2fs/inode.h b/sys/gnu/ext2fs/inode.h
index b0f1625..cf5288a 100644
--- a/sys/gnu/ext2fs/inode.h
+++ b/sys/gnu/ext2fs/inode.h
@@ -65,7 +65,7 @@ struct inode {
struct vnode *i_vnode;/* Vnode associated with this inode. */
struct vnode *i_devvp;/* Vnode for block I/O. */
u_int32_t i_flag; /* flags, see below */
- dev_t i_dev; /* Device associated with the inode. */
+ struct cdev *i_dev; /* Device associated with the inode. */
ino_t i_number; /* The identity of the inode. */
struct ext2_sb_info *i_e2fs; /* EXT2FS */
@@ -110,7 +110,7 @@ struct inode {
* The di_db fields may be overlaid with other information for
* file types that do not have associated disk storage. Block
* and character devices overlay the first data block with their
- * dev_t value. Short symbolic links place their path in the
+ * struct cdev *value. Short symbolic links place their path in the
* di_db area.
*/
#define i_shortlink i_db
diff --git a/sys/gnu/fs/ext2fs/ext2_extern.h b/sys/gnu/fs/ext2fs/ext2_extern.h
index 12ec524..45ba6b3 100644
--- a/sys/gnu/fs/ext2fs/ext2_extern.h
+++ b/sys/gnu/fs/ext2fs/ext2_extern.h
@@ -59,11 +59,11 @@ void ext2_dirbad(struct inode *ip, doff_t offset, char *how);
void ext2_ei2i(struct ext2_inode *, struct inode *);
int ext2_getlbns(struct vnode *, int32_t, struct indir *, int *);
void ext2_i2ei(struct inode *, struct ext2_inode *);
-int ext2_ihashget(dev_t, ino_t, int, struct vnode **);
+int ext2_ihashget(struct cdev *, ino_t, int, struct vnode **);
void ext2_ihashinit(void);
void ext2_ihashins(struct inode *);
struct vnode *
- ext2_ihashlookup(dev_t, ino_t);
+ ext2_ihashlookup(struct cdev *, ino_t);
void ext2_ihashrem(struct inode *);
void ext2_ihashuninit(void);
void ext2_itimes(struct vnode *vp);
diff --git a/sys/gnu/fs/ext2fs/ext2_mount.h b/sys/gnu/fs/ext2fs/ext2_mount.h
index e1ca44d..407ca8a 100644
--- a/sys/gnu/fs/ext2fs/ext2_mount.h
+++ b/sys/gnu/fs/ext2fs/ext2_mount.h
@@ -44,7 +44,7 @@ struct vnode;
/* This structure describes the ext2fs specific mount structure data. */
struct ext2mount {
struct mount *um_mountp; /* filesystem vfs structure */
- dev_t um_dev; /* device mounted */
+ struct cdev *um_dev; /* device mounted */
struct vnode *um_devvp; /* block device mounted vnode */
struct ext2_sb_info *um_e2fs; /* EXT2FS */
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index c91eaac..a745e6a 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -97,7 +97,7 @@ VFS_SET(ext2fs_vfsops, ext2fs, 0);
static int ext2fs_inode_hash_lock;
-static int ext2_check_sb_compat(struct ext2_super_block *es, dev_t dev,
+static int ext2_check_sb_compat(struct ext2_super_block *es, struct cdev *dev,
int ronly);
static int compute_sb_data(struct vnode * devvp,
struct ext2_super_block * es, struct ext2_sb_info * fs);
@@ -378,7 +378,7 @@ static int ext2_check_descriptors (struct ext2_sb_info * sb)
static int
ext2_check_sb_compat(es, dev, ronly)
struct ext2_super_block *es;
- dev_t dev;
+ struct cdev *dev;
int ronly;
{
@@ -635,7 +635,7 @@ ext2_mountfs(devvp, mp, td)
struct buf *bp;
struct ext2_sb_info *fs;
struct ext2_super_block * es;
- dev_t dev = devvp->v_rdev;
+ struct cdev *dev = devvp->v_rdev;
int error;
int ronly;
@@ -1000,7 +1000,7 @@ ext2_vget(mp, ino, flags, vpp)
struct ext2mount *ump;
struct buf *bp;
struct vnode *vp;
- dev_t dev;
+ struct cdev *dev;
int i, error;
int used_blocks;
diff --git a/sys/gnu/fs/ext2fs/inode.h b/sys/gnu/fs/ext2fs/inode.h
index b0f1625..cf5288a 100644
--- a/sys/gnu/fs/ext2fs/inode.h
+++ b/sys/gnu/fs/ext2fs/inode.h
@@ -65,7 +65,7 @@ struct inode {
struct vnode *i_vnode;/* Vnode associated with this inode. */
struct vnode *i_devvp;/* Vnode for block I/O. */
u_int32_t i_flag; /* flags, see below */
- dev_t i_dev; /* Device associated with the inode. */
+ struct cdev *i_dev; /* Device associated with the inode. */
ino_t i_number; /* The identity of the inode. */
struct ext2_sb_info *i_e2fs; /* EXT2FS */
@@ -110,7 +110,7 @@ struct inode {
* The di_db fields may be overlaid with other information for
* file types that do not have associated disk storage. Block
* and character devices overlay the first data block with their
- * dev_t value. Short symbolic links place their path in the
+ * struct cdev *value. Short symbolic links place their path in the
* di_db area.
*/
#define i_shortlink i_db
diff --git a/sys/i386/acpica/acpi_asus.c b/sys/i386/acpica/acpi_asus.c
index f16121b..10d97e4 100644
--- a/sys/i386/acpica/acpi_asus.c
+++ b/sys/i386/acpica/acpi_asus.c
@@ -83,9 +83,9 @@ struct acpi_asus_softc {
struct sysctl_ctx_list sysctl_ctx;
struct sysctl_oid *sysctl_tree;
- dev_t s_mled;
- dev_t s_tled;
- dev_t s_wled;
+ struct cdev *s_mled;
+ struct cdev *s_tled;
+ struct cdev *s_wled;
int s_brn;
int s_disp;
diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c
index 79ba3cf..e0ad71e 100644
--- a/sys/i386/acpica/acpi_machdep.c
+++ b/sys/i386/acpica/acpi_machdep.c
@@ -192,19 +192,19 @@ acpi_capm_get_pwstatus(apm_pwstatus_t app)
}
static int
-apmopen(dev_t dev, int flag, int fmt, d_thread_t *td)
+apmopen(struct cdev *dev, int flag, int fmt, d_thread_t *td)
{
return (0);
}
static int
-apmclose(dev_t dev, int flag, int fmt, d_thread_t *td)
+apmclose(struct cdev *dev, int flag, int fmt, d_thread_t *td)
{
return (0);
}
static int
-apmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
+apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
{
int error = 0;
struct acpi_softc *acpi_sc;
@@ -281,13 +281,13 @@ apmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td)
}
static int
-apmwrite(dev_t dev, struct uio *uio, int ioflag)
+apmwrite(struct cdev *dev, struct uio *uio, int ioflag)
{
return (uio->uio_resid);
}
static int
-apmpoll(dev_t dev, int events, d_thread_t *td)
+apmpoll(struct cdev *dev, int events, d_thread_t *td)
{
return (0);
}
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c
index 4f3adca..768bd06 100644
--- a/sys/i386/bios/apm.c
+++ b/sys/i386/bios/apm.c
@@ -1229,7 +1229,7 @@ apm_attach(device_t dev)
}
static int
-apmopen(dev_t dev, int flag, int fmt, struct thread *td)
+apmopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct apm_softc *sc = &apm_softc;
int ctl = APMDEV(dev);
@@ -1257,7 +1257,7 @@ apmopen(dev_t dev, int flag, int fmt, struct thread *td)
}
static int
-apmclose(dev_t dev, int flag, int fmt, struct thread *td)
+apmclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct apm_softc *sc = &apm_softc;
int ctl = APMDEV(dev);
@@ -1280,7 +1280,7 @@ apmclose(dev_t dev, int flag, int fmt, struct thread *td)
}
static int
-apmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+apmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct apm_softc *sc = &apm_softc;
struct apm_bios_arg *args;
@@ -1434,7 +1434,7 @@ apmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
}
static int
-apmwrite(dev_t dev, struct uio *uio, int ioflag)
+apmwrite(struct cdev *dev, struct uio *uio, int ioflag)
{
struct apm_softc *sc = &apm_softc;
u_int event_type;
@@ -1464,7 +1464,7 @@ apmwrite(dev_t dev, struct uio *uio, int ioflag)
}
static int
-apmpoll(dev_t dev, int events, struct thread *td)
+apmpoll(struct cdev *dev, int events, struct thread *td)
{
struct apm_softc *sc = &apm_softc;
int revents = 0;
diff --git a/sys/i386/bios/smapi.c b/sys/i386/bios/smapi.c
index 883676c..9879c90 100644
--- a/sys/i386/bios/smapi.c
+++ b/sys/i386/bios/smapi.c
@@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$");
#define ADDR2HDR(addr) ((struct smapi_bios_header *)BIOS_PADDRTOVADDR(addr))
struct smapi_softc {
- dev_t cdev;
+ struct cdev *cdev;
device_t dev;
struct resource * res;
int rid;
@@ -98,7 +98,7 @@ extern int smapi32_new (u_long, u_short,
static int
smapi_ioctl (dev, cmd, data, fflag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t data;
int fflag;
diff --git a/sys/i386/i386/elan-mmcr.c b/sys/i386/i386/elan-mmcr.c
index 70670eb..2bda626 100644
--- a/sys/i386/i386/elan-mmcr.c
+++ b/sys/i386/i386/elan-mmcr.c
@@ -78,7 +78,7 @@ static u_int echo_a, echo_d;
#endif /* CPU_ELAN_PPS */
static u_int led_cookie[32];
-static dev_t led_dev[32];
+static struct cdev *led_dev[32];
static void
gpio_led(void *cookie, int state)
@@ -405,7 +405,7 @@ elan_watchdog(void *foo __unused, u_int spec, int *error)
}
static int
-elan_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+elan_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
{
if (offset >= 0x1000)
@@ -414,7 +414,7 @@ elan_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
return (0);
}
static int
-elan_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *tdr)
+elan_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *tdr)
{
int error;
diff --git a/sys/i386/i386/geode.c b/sys/i386/i386/geode.c
index 6896686..2702f21 100644
--- a/sys/i386/i386/geode.c
+++ b/sys/i386/i386/geode.c
@@ -43,7 +43,7 @@ static unsigned cba;
static unsigned gpio;
static unsigned geode_counter;
-static dev_t led1, led2, led3;
+static struct cdev *led1, *led2, *led3;
static int led1b, led2b, led3b;
static void
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 3a41bbe..d1eb5c0 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -1215,9 +1215,9 @@ SYSCTL_STRUCT(_machdep, CPU_BOOTINFO, bootinfo,
SYSCTL_INT(_machdep, CPU_WALLCLOCK, wall_cmos_clock,
CTLFLAG_RW, &wall_cmos_clock, 0, "");
-u_long bootdev; /* not a dev_t - encoding is different */
+u_long bootdev; /* not a struct cdev *- encoding is different */
SYSCTL_ULONG(_machdep, OID_AUTO, guessed_bootdev,
- CTLFLAG_RD, &bootdev, 0, "Maybe the Boot device (not in dev_t format)");
+ CTLFLAG_RD, &bootdev, 0, "Maybe the Boot device (not in struct cdev *format)");
/*
* Initialize 386 and configure to run kernel
diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c
index f296d68..379b59c 100644
--- a/sys/i386/i386/mem.c
+++ b/sys/i386/i386/mem.c
@@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$");
#include <vm/pmap.h>
#include <vm/vm_extern.h>
-static dev_t memdev, kmemdev, iodev;
+static struct cdev *memdev, *kmemdev, *iodev;
static d_open_t mmopen;
static d_close_t mmclose;
@@ -94,7 +94,7 @@ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors");
struct mem_range_softc mem_range_softc;
static int
-mmclose(dev_t dev, int flags, int fmt, struct thread *td)
+mmclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
switch (minor(dev)) {
case 14:
@@ -104,7 +104,7 @@ mmclose(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-mmopen(dev_t dev, int flags, int fmt, struct thread *td)
+mmopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int error;
@@ -132,7 +132,7 @@ mmopen(dev_t dev, int flags, int fmt, struct thread *td)
/*ARGSUSED*/
static int
-mmrw(dev_t dev, struct uio *uio, int flags)
+mmrw(struct cdev *dev, struct uio *uio, int flags)
{
int o;
u_int c = 0, v;
@@ -209,7 +209,7 @@ mmrw(dev_t dev, struct uio *uio, int flags)
* instead of going through read/write *
\*******************************************************/
static int
-memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
switch (minor(dev))
{
@@ -237,7 +237,7 @@ memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
* and mem_range_attr_set.
*/
static int
-mmioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+mmioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
int nd, error = 0;
struct mem_range_op *mo = (struct mem_range_op *)data;
diff --git a/sys/i386/i386/perfmon.c b/sys/i386/i386/perfmon.c
index eaccb5a..d085261 100644
--- a/sys/i386/i386/perfmon.c
+++ b/sys/i386/i386/perfmon.c
@@ -299,7 +299,7 @@ static int writer;
static int writerpmc;
static int
-perfmon_open(dev_t dev, int flags, int fmt, struct thread *td)
+perfmon_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
if (!perfmon_cpuok)
return ENXIO;
@@ -316,7 +316,7 @@ perfmon_open(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-perfmon_close(dev_t dev, int flags, int fmt, struct thread *td)
+perfmon_close(struct cdev *dev, int flags, int fmt, struct thread *td)
{
if (flags & FWRITE) {
int i;
@@ -331,7 +331,7 @@ perfmon_close(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-perfmon_ioctl(dev_t dev, u_long cmd, caddr_t param, int flags, struct thread *td)
+perfmon_ioctl(struct cdev *dev, u_long cmd, caddr_t param, int flags, struct thread *td)
{
struct pmc *pmc;
struct pmc_data *pmcd;
diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h
index ad5665b..0702b06 100644
--- a/sys/i386/include/cpu.h
+++ b/sys/i386/include/cpu.h
@@ -65,7 +65,7 @@
/*
* CTL_MACHDEP definitions.
*/
-#define CPU_CONSDEV 1 /* dev_t: console terminal device */
+#define CPU_CONSDEV 1 /* struct cdev *: console terminal device */
#define CPU_ADJKERNTZ 2 /* int: timezone offset (seconds) */
#define CPU_DISRTCSET 3 /* int: disable resettodr() call */
#define CPU_BOOTINFO 4 /* struct: bootinfo */
diff --git a/sys/i386/isa/mse.c b/sys/i386/isa/mse.c
index ddc0742..31c85f8 100644
--- a/sys/i386/isa/mse.c
+++ b/sys/i386/isa/mse.c
@@ -96,8 +96,8 @@ typedef struct mse_softc {
u_char sc_bytes[MOUSE_SYS_PACKETSIZE];
struct callout_handle sc_callout;
int sc_watchdog;
- dev_t sc_dev;
- dev_t sc_ndev;
+ struct cdev *sc_dev;
+ struct cdev *sc_ndev;
mousehw_t hw;
mousemode_t mode;
mousestatus_t status;
@@ -386,7 +386,7 @@ mse_detach(dev)
*/
static int
mseopen(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -426,7 +426,7 @@ mseopen(dev, flags, fmt, td)
*/
static int
mseclose(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -450,7 +450,7 @@ mseclose(dev, flags, fmt, td)
*/
static int
mseread(dev, uio, ioflag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int ioflag;
{
@@ -517,7 +517,7 @@ mseread(dev, uio, ioflag)
*/
static int
mseioctl(dev, cmd, addr, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t addr;
int flag;
@@ -634,7 +634,7 @@ mseioctl(dev, cmd, addr, flag, td)
*/
static int
msepoll(dev, events, td)
- dev_t dev;
+ struct cdev *dev;
int events;
struct thread *td;
{
@@ -667,10 +667,10 @@ static void
msetimeout(arg)
void *arg;
{
- dev_t dev;
+ struct cdev *dev;
mse_softc_t *sc;
- dev = (dev_t)arg;
+ dev = (struct cdev *)arg;
sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
if (sc->sc_watchdog) {
if (bootverbose)
diff --git a/sys/i386/isa/pcvt/pcvt_drv.c b/sys/i386/isa/pcvt/pcvt_drv.c
index 39c7b83..ac38733 100644
--- a/sys/i386/isa/pcvt/pcvt_drv.c
+++ b/sys/i386/isa/pcvt/pcvt_drv.c
@@ -271,7 +271,7 @@ pcvt_attach(device_t dev)
* driver open
*---------------------------------------------------------------------------*/
static int
-pcvt_open(dev_t dev, int flag, int mode, struct thread *td)
+pcvt_open(struct cdev *dev, int flag, int mode, struct thread *td)
{
register struct tty *tp;
register struct video_state *vsx;
@@ -339,7 +339,7 @@ pcvt_open(dev_t dev, int flag, int mode, struct thread *td)
* driver close
*---------------------------------------------------------------------------*/
static int
-pcvt_close(dev_t dev, int flag, int mode, struct thread *td)
+pcvt_close(struct cdev *dev, int flag, int mode, struct thread *td)
{
register struct tty *tp;
register struct video_state *vsx;
@@ -369,7 +369,7 @@ pcvt_close(dev_t dev, int flag, int mode, struct thread *td)
* driver ioctl
*---------------------------------------------------------------------------*/
static int
-pcvt_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+pcvt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
register int error;
register struct tty *tp;
@@ -404,7 +404,7 @@ pcvt_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
* driver mmap
*---------------------------------------------------------------------------*/
static int
-pcvt_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+pcvt_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
{
if (offset > 0x20000 - PAGE_SIZE)
return -1;
diff --git a/sys/i386/isa/pcvt/pcvt_ext.c b/sys/i386/isa/pcvt/pcvt_ext.c
index 639c50c..035c2af 100644
--- a/sys/i386/isa/pcvt/pcvt_ext.c
+++ b/sys/i386/isa/pcvt/pcvt_ext.c
@@ -2393,7 +2393,7 @@ vgapage(int new_screen)
* ioctl handling for VT_USL mode
*---------------------------------------------------------------------------*/
int
-usl_vt_ioctl(dev_t dev, int cmd, caddr_t data, int flag, struct thread *td)
+usl_vt_ioctl(struct cdev *dev, int cmd, caddr_t data, int flag, struct thread *td)
{
struct proc *p;
int i, j, error, opri;
diff --git a/sys/i386/isa/pcvt/pcvt_hdr.h b/sys/i386/isa/pcvt/pcvt_hdr.h
index 44b65a4..a100de7 100644
--- a/sys/i386/isa/pcvt/pcvt_hdr.h
+++ b/sys/i386/isa/pcvt/pcvt_hdr.h
@@ -948,7 +948,7 @@ void get_usl_keymap( keymap_t *map );
void init_sfkl ( struct video_state *svsp );
void init_ufkl ( struct video_state *svsp );
-int kbdioctl ( dev_t dev, int cmd, caddr_t data, int flag );
+int kbdioctl ( struct cdev *dev, int cmd, caddr_t data, int flag );
void kbd_code_init ( void );
void kbd_code_init1 ( void );
@@ -1001,14 +1001,14 @@ void update_hp ( struct video_state *svsp );
void update_led ( void );
#ifdef XSERVER
-int usl_vt_ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct thread *);
+int usl_vt_ioctl (struct cdev *dev, int cmd, caddr_t data, int flag, struct thread *);
#endif
void vga10_vga10 ( u_char *invga, u_char *outvga );
void vga10_vga14 ( u_char *invga, u_char *outvga );
void vga10_vga16 ( u_char *invga, u_char *outvga );
void vga10_vga8 ( u_char *invga, u_char *outvga );
-int vgaioctl ( dev_t dev, int cmd, caddr_t data, int flag );
+int vgaioctl ( struct cdev *dev, int cmd, caddr_t data, int flag );
#ifdef XSERVER
int vgapage ( int n );
diff --git a/sys/i386/isa/pcvt/pcvt_kbd.c b/sys/i386/isa/pcvt/pcvt_kbd.c
index d3f060a..343f385 100644
--- a/sys/i386/isa/pcvt/pcvt_kbd.c
+++ b/sys/i386/isa/pcvt/pcvt_kbd.c
@@ -1199,7 +1199,7 @@ setkeydef(Ovl_tbl *data)
* keyboard ioctl's entry
*---------------------------------------------------------------------------*/
int
-kbdioctl(dev_t dev, int cmd, caddr_t data, int flag)
+kbdioctl(struct cdev *dev, int cmd, caddr_t data, int flag)
{
int key;
diff --git a/sys/i386/isa/pcvt/pcvt_sup.c b/sys/i386/isa/pcvt/pcvt_sup.c
index 49fe289..16d5f60 100644
--- a/sys/i386/isa/pcvt/pcvt_sup.c
+++ b/sys/i386/isa/pcvt/pcvt_sup.c
@@ -58,13 +58,13 @@ static void vid_cursor ( struct cursorshape *data );
static void vgasetfontattr ( struct vgafontattr *data );
static void vgagetfontattr ( struct vgafontattr *data );
static void vgaloadchar ( struct vgaloadchar *data );
-static void vid_getscreen ( struct screeninfo *data, dev_t dev );
-static void vid_setscreen ( struct screeninfo *data, dev_t dev );
+static void vid_getscreen ( struct screeninfo *data, struct cdev *dev );
+static void vid_setscreen ( struct screeninfo *data, struct cdev *dev );
static void setchargen ( void );
static void setchargen3 ( void );
static void resetchargen ( void );
-static void vgareadpel ( struct vgapel *data, dev_t dev );
-static void vgawritepel ( struct vgapel *data, dev_t dev );
+static void vgareadpel ( struct vgapel *data, struct cdev *dev );
+static void vgawritepel ( struct vgapel *data, struct cdev *dev );
static void vgapcvtid ( struct pcvtid *data );
static void vgapcvtinfo ( struct pcvtinfo *data );
@@ -102,7 +102,7 @@ static u_short getrand ( void );
* execute vga ioctls
*---------------------------------------------------------------------------*/
int
-vgaioctl(dev_t dev, int cmd, caddr_t data, int flag)
+vgaioctl(struct cdev *dev, int cmd, caddr_t data, int flag)
{
if(minor(dev) >= PCVT_NSCREENS)
return -1;
@@ -553,7 +553,7 @@ vgaloadchar(struct vgaloadchar *data)
* video ioctl - get screen information
*---------------------------------------------------------------------------*/
static void
-vid_getscreen(struct screeninfo *data, dev_t dev)
+vid_getscreen(struct screeninfo *data, struct cdev *dev)
{
int device = minor(dev);
data->adaptor_type = adaptor_type; /* video adapter installed */
@@ -576,7 +576,7 @@ vid_getscreen(struct screeninfo *data, dev_t dev)
* video ioctl - set screen information
*---------------------------------------------------------------------------*/
static void
-vid_setscreen(struct screeninfo *data, dev_t dev)
+vid_setscreen(struct screeninfo *data, struct cdev *dev)
{
int screen;
@@ -770,7 +770,7 @@ reallocate_scrollbuffer(struct video_state *svsp, int pages)
* VGA ioctl - read DAC palette entry
*---------------------------------------------------------------------------*/
static void
-vgareadpel(struct vgapel *data, dev_t dev)
+vgareadpel(struct vgapel *data, struct cdev *dev)
{
register unsigned vpage = minor(dev);
register unsigned idx = data->idx;
@@ -788,7 +788,7 @@ vgareadpel(struct vgapel *data, dev_t dev)
* VGA ioctl - write DAC palette entry
*---------------------------------------------------------------------------*/
static void
-vgawritepel(struct vgapel *data, dev_t dev)
+vgawritepel(struct vgapel *data, struct cdev *dev)
{
register unsigned vpage = minor(dev);
register unsigned idx = data->idx;
diff --git a/sys/i386/isa/spic.c b/sys/i386/isa/spic.c
index 3b0a419..1ded09c 100644
--- a/sys/i386/isa/spic.c
+++ b/sys/i386/isa/spic.c
@@ -443,7 +443,7 @@ spictimeout(void *arg)
}
static int
-spicopen(dev_t dev, int flag, int fmt, struct thread *td)
+spicopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct spic_softc *sc;
@@ -461,7 +461,7 @@ spicopen(dev_t dev, int flag, int fmt, struct thread *td)
}
static int
-spicclose(dev_t dev, int flag, int fmt, struct thread *td)
+spicclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct spic_softc *sc;
@@ -474,7 +474,7 @@ spicclose(dev_t dev, int flag, int fmt, struct thread *td)
}
static int
-spicread(dev_t dev, struct uio *uio, int flag)
+spicread(struct cdev *dev, struct uio *uio, int flag)
{
struct spic_softc *sc;
int l, s, error;
@@ -508,7 +508,7 @@ spicread(dev_t dev, struct uio *uio, int flag)
}
static int
-spicioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+spicioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct spic_softc *sc;
@@ -518,7 +518,7 @@ spicioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
}
static int
-spicpoll(dev_t dev, int events, struct thread *td)
+spicpoll(struct cdev *dev, int events, struct thread *td)
{
struct spic_softc *sc;
int revents = 0, s;
diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c
index e73ab8d..2dc74e3 100644
--- a/sys/i386/isa/spkr.c
+++ b/sys/i386/isa/spkr.c
@@ -472,7 +472,7 @@ static char *spkr_inbuf; /* incoming buf */
static int
spkropen(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -499,7 +499,7 @@ spkropen(dev, flags, fmt, td)
static int
spkrwrite(dev, uio, ioflag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int ioflag;
{
@@ -531,7 +531,7 @@ spkrwrite(dev, uio, ioflag)
static int
spkrclose(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -554,7 +554,7 @@ spkrclose(dev, flags, fmt, td)
static int
spkrioctl(dev, cmd, cmdarg, flags, td)
- dev_t dev;
+ struct cdev *dev;
unsigned long cmd;
caddr_t cmdarg;
int flags;
@@ -610,7 +610,7 @@ static struct isa_pnp_id speaker_ids[] = {
{ 0 }
};
-static dev_t speaker_dev;
+static struct cdev *speaker_dev;
static int
speaker_probe(device_t dev)
diff --git a/sys/i4b/driver/i4b_ctl.c b/sys/i4b/driver/i4b_ctl.c
index 630c064..4ba3e05 100644
--- a/sys/i4b/driver/i4b_ctl.c
+++ b/sys/i4b/driver/i4b_ctl.c
@@ -84,7 +84,7 @@ i4bctlattach(void *dummy)
* i4bctlopen - device driver open routine
*---------------------------------------------------------------------------*/
static int
-i4bctlopen(dev_t dev, int flag, int fmt, struct thread *td)
+i4bctlopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
if(minor(dev))
return (ENXIO);
@@ -101,7 +101,7 @@ i4bctlopen(dev_t dev, int flag, int fmt, struct thread *td)
* i4bctlclose - device driver close routine
*---------------------------------------------------------------------------*/
static int
-i4bctlclose(dev_t dev, int flag, int fmt, struct thread *td)
+i4bctlclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
openflag = 0;
return (0);
@@ -111,7 +111,7 @@ i4bctlclose(dev_t dev, int flag, int fmt, struct thread *td)
* i4bctlioctl - device driver ioctl routine
*---------------------------------------------------------------------------*/
static int
-i4bctlioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+i4bctlioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
#if DO_I4B_DEBUG
ctl_debug_t *cdbg;
@@ -206,7 +206,7 @@ i4bctlioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
* i4bctlpoll - device driver poll routine
*---------------------------------------------------------------------------*/
static int
-i4bctlpoll (dev_t dev, int events, struct thread *td)
+i4bctlpoll (struct cdev *dev, int events, struct thread *td)
{
return (ENODEV);
}
diff --git a/sys/i4b/driver/i4b_rbch.c b/sys/i4b/driver/i4b_rbch.c
index 5738335..f44dcaf 100644
--- a/sys/i4b/driver/i4b_rbch.c
+++ b/sys/i4b/driver/i4b_rbch.c
@@ -166,7 +166,7 @@ i4brbchattach(void *dummy)
* open rbch device
*---------------------------------------------------------------------------*/
static int
-i4brbchopen(dev_t dev, int flag, int fmt, struct thread *td)
+i4brbchopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit = minor(dev);
@@ -191,7 +191,7 @@ i4brbchopen(dev_t dev, int flag, int fmt, struct thread *td)
* close rbch device
*---------------------------------------------------------------------------*/
static int
-i4brbchclose(dev_t dev, int flag, int fmt, struct thread *td)
+i4brbchclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit = minor(dev);
struct rbch_softc *sc = &rbch_softc[unit];
@@ -212,7 +212,7 @@ i4brbchclose(dev_t dev, int flag, int fmt, struct thread *td)
* read from rbch device
*---------------------------------------------------------------------------*/
static int
-i4brbchread(dev_t dev, struct uio *uio, int ioflag)
+i4brbchread(struct cdev *dev, struct uio *uio, int ioflag)
{
struct mbuf *m;
int error = 0;
@@ -314,7 +314,7 @@ i4brbchread(dev_t dev, struct uio *uio, int ioflag)
* write to rbch device
*---------------------------------------------------------------------------*/
static int
-i4brbchwrite(dev_t dev, struct uio * uio, int ioflag)
+i4brbchwrite(struct cdev *dev, struct uio * uio, int ioflag)
{
struct mbuf *m;
int error = 0;
@@ -432,7 +432,7 @@ i4brbchwrite(dev_t dev, struct uio * uio, int ioflag)
* rbch device ioctl handlibg
*---------------------------------------------------------------------------*/
static int
-i4brbchioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+i4brbchioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int error = 0;
int unit = minor(dev);
@@ -529,7 +529,7 @@ i4brbchioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
* device driver poll
*---------------------------------------------------------------------------*/
static int
-i4brbchpoll(dev_t dev, int events, struct thread *td)
+i4brbchpoll(struct cdev *dev, int events, struct thread *td)
{
int revents = 0; /* Events we found */
int s;
diff --git a/sys/i4b/driver/i4b_tel.c b/sys/i4b/driver/i4b_tel.c
index 703bfc1..c4fc0e3 100644
--- a/sys/i4b/driver/i4b_tel.c
+++ b/sys/i4b/driver/i4b_tel.c
@@ -196,7 +196,7 @@ i4btelattach(void *dummy)
* open tel device
*---------------------------------------------------------------------------*/
static int
-i4btelopen(dev_t dev, int flag, int fmt, struct thread *td)
+i4btelopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit = UNIT(dev);
int func = FUNC(dev);
@@ -225,7 +225,7 @@ i4btelopen(dev_t dev, int flag, int fmt, struct thread *td)
* close tel device
*---------------------------------------------------------------------------*/
static int
-i4btelclose(dev_t dev, int flag, int fmt, struct thread *td)
+i4btelclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit = UNIT(dev);
int func = FUNC(dev);
@@ -268,7 +268,7 @@ i4btelclose(dev_t dev, int flag, int fmt, struct thread *td)
* i4btelioctl - device driver ioctl routine
*---------------------------------------------------------------------------*/
static int
-i4btelioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+i4btelioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int unit = UNIT(dev);
int func = FUNC(dev);
@@ -390,7 +390,7 @@ i4btelioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
* read from tel device
*---------------------------------------------------------------------------*/
static int
-i4btelread(dev_t dev, struct uio *uio, int ioflag)
+i4btelread(struct cdev *dev, struct uio *uio, int ioflag)
{
int unit = UNIT(dev);
int func = FUNC(dev);
@@ -523,7 +523,7 @@ i4btelread(dev_t dev, struct uio *uio, int ioflag)
* write to tel device
*---------------------------------------------------------------------------*/
static int
-i4btelwrite(dev_t dev, struct uio * uio, int ioflag)
+i4btelwrite(struct cdev *dev, struct uio * uio, int ioflag)
{
int unit = UNIT(dev);
int func = FUNC(dev);
@@ -683,7 +683,7 @@ tel_tone(tel_sc_t *sc)
* device driver poll
*---------------------------------------------------------------------------*/
static int
-i4btelpoll(dev_t dev, int events, struct thread *td)
+i4btelpoll(struct cdev *dev, int events, struct thread *td)
{
int revents = 0; /* Events we found */
int s;
diff --git a/sys/i4b/driver/i4b_trace.c b/sys/i4b/driver/i4b_trace.c
index c5c3832..e165d96 100644
--- a/sys/i4b/driver/i4b_trace.c
+++ b/sys/i4b/driver/i4b_trace.c
@@ -223,7 +223,7 @@ get_trace_data_from_l1(i4b_trace_hdr_t *hdr, int len, char *buf)
* open trace device
*---------------------------------------------------------------------------*/
static int
-i4btrcopen(dev_t dev, int flag, int fmt, struct thread *td)
+i4btrcopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int x;
int unit = minor(dev);
@@ -250,7 +250,7 @@ i4btrcopen(dev_t dev, int flag, int fmt, struct thread *td)
* close trace device
*---------------------------------------------------------------------------*/
static int
-i4btrcclose(dev_t dev, int flag, int fmt, struct thread *td)
+i4btrcclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit = minor(dev);
int i, x;
@@ -296,7 +296,7 @@ i4btrcclose(dev_t dev, int flag, int fmt, struct thread *td)
* read from trace device
*---------------------------------------------------------------------------*/
static int
-i4btrcread(dev_t dev, struct uio * uio, int ioflag)
+i4btrcread(struct cdev *dev, struct uio * uio, int ioflag)
{
struct mbuf *m;
int x;
@@ -346,7 +346,7 @@ i4btrcread(dev_t dev, struct uio * uio, int ioflag)
* poll device
*---------------------------------------------------------------------------*/
static int
-i4btrcpoll(dev_t dev, int events, struct thread *td)
+i4btrcpoll(struct cdev *dev, int events, struct thread *td)
{
return(ENODEV);
}
@@ -355,7 +355,7 @@ i4btrcpoll(dev_t dev, int events, struct thread *td)
* device driver ioctl routine
*---------------------------------------------------------------------------*/
static int
-i4btrcioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+i4btrcioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int error = 0;
int unit = minor(dev);
diff --git a/sys/i4b/layer4/i4b_i4bdrv.c b/sys/i4b/layer4/i4b_i4bdrv.c
index 7b19aec..671cba4 100644
--- a/sys/i4b/layer4/i4b_i4bdrv.c
+++ b/sys/i4b/layer4/i4b_i4bdrv.c
@@ -111,7 +111,7 @@ i4battach(void *dummy)
* i4bopen - device driver open routine
*---------------------------------------------------------------------------*/
static int
-i4bopen(dev_t dev, int flag, int fmt, struct thread *td)
+i4bopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int x;
@@ -133,7 +133,7 @@ i4bopen(dev_t dev, int flag, int fmt, struct thread *td)
* i4bclose - device driver close routine
*---------------------------------------------------------------------------*/
static int
-i4bclose(dev_t dev, int flag, int fmt, struct thread *td)
+i4bclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int x = splimp();
openflag = 0;
@@ -147,7 +147,7 @@ i4bclose(dev_t dev, int flag, int fmt, struct thread *td)
* i4bread - device driver read routine
*---------------------------------------------------------------------------*/
static int
-i4bread(dev_t dev, struct uio *uio, int ioflag)
+i4bread(struct cdev *dev, struct uio *uio, int ioflag)
{
struct mbuf *m;
int x;
@@ -192,7 +192,7 @@ i4bread(dev_t dev, struct uio *uio, int ioflag)
* i4bioctl - device driver ioctl routine
*---------------------------------------------------------------------------*/
static int
-i4bioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+i4bioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
call_desc_t *cd;
int error = 0;
@@ -755,7 +755,7 @@ diag_done:
* i4bpoll - device driver poll routine
*---------------------------------------------------------------------------*/
static int
-i4bpoll(dev_t dev, int events, struct thread *td)
+i4bpoll(struct cdev *dev, int events, struct thread *td)
{
int x;
diff --git a/sys/ia64/ia64/mem.c b/sys/ia64/ia64/mem.c
index 3d48bfd..d03051f 100644
--- a/sys/ia64/ia64/mem.c
+++ b/sys/ia64/ia64/mem.c
@@ -66,9 +66,9 @@
#include <vm/pmap.h>
#include <vm/vm_extern.h>
-static dev_t memdev, kmemdev;
+static struct cdev *memdev, *kmemdev;
#ifdef PERFMON
-static dev_t perfdev;
+static struct cdev *perfdev;
#endif /* PERFMON */
static d_open_t mmopen;
@@ -100,7 +100,7 @@ ia64_pa_access(vm_offset_t pa)
}
static int
-mmclose(dev_t dev, int flags, int fmt, struct thread *td)
+mmclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
switch (minor(dev)) {
#ifdef PERFMON
@@ -114,7 +114,7 @@ mmclose(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-mmopen(dev_t dev, int flags, int fmt, struct thread *td)
+mmopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int error;
@@ -141,7 +141,7 @@ mmopen(dev_t dev, int flags, int fmt, struct thread *td)
/*ARGSUSED*/
static int
-mmrw(dev_t dev, struct uio *uio, int flags)
+mmrw(struct cdev *dev, struct uio *uio, int flags)
{
struct iovec *iov;
vm_offset_t addr, eaddr, o, v;
@@ -225,7 +225,7 @@ kmemphys:
* instead of going through read/write *
\*******************************************************/
static int
-memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+memmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
/*
* /dev/mem is the only one that makes sense through this
@@ -246,7 +246,7 @@ memmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
}
static int
-mmioctl(dev_t dev, u_long cmd, caddr_t cmdarg, int flags, struct thread *td)
+mmioctl(struct cdev *dev, u_long cmd, caddr_t cmdarg, int flags, struct thread *td)
{
switch(minor(dev)) {
#ifdef PERFMON
diff --git a/sys/ia64/ia64/ssc.c b/sys/ia64/ia64/ssc.c
index d87aa76..eb03592 100644
--- a/sys/ia64/ia64/ssc.c
+++ b/sys/ia64/ia64/ssc.c
@@ -133,7 +133,7 @@ ssccncheckc(struct consdev *cp)
}
static int
-sscopen(dev_t dev, int flag, int mode, struct thread *td)
+sscopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct tty *tp;
int s;
@@ -176,7 +176,7 @@ sscopen(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-sscclose(dev_t dev, int flag, int mode, struct thread *td)
+sscclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
int unit = minor(dev);
struct tty *tp = ssc_tp;
diff --git a/sys/ia64/ia64/sscdisk.c b/sys/ia64/ia64/sscdisk.c
index d831ab9..726fec4 100644
--- a/sys/ia64/ia64/sscdisk.c
+++ b/sys/ia64/ia64/sscdisk.c
@@ -85,7 +85,7 @@ struct ssc_s {
LIST_ENTRY(ssc_s) list;
struct bio_queue_head bio_queue;
struct disk *disk;
- dev_t dev;
+ struct cdev *dev;
int busy;
int fd;
};
diff --git a/sys/ia64/include/cpu.h b/sys/ia64/include/cpu.h
index f6f6b5c..b2bffe8 100644
--- a/sys/ia64/include/cpu.h
+++ b/sys/ia64/include/cpu.h
@@ -62,7 +62,7 @@ struct clockframe {
/*
* CTL_MACHDEP definitions.
*/
-#define CPU_CONSDEV 1 /* dev_t: console terminal device */
+#define CPU_CONSDEV 1 /* struct cdev *: console terminal device */
#define CPU_ADJKERNTZ 2 /* int: timezone offset (seconds) */
#define CPU_DISRTCSET 3 /* int: disable resettodr() call */
#define CPU_WALLCLOCK 4 /* int: indicates wall CMOS clock */
diff --git a/sys/isa/psm.c b/sys/isa/psm.c
index 376c0dc..2d30d65 100644
--- a/sys/isa/psm.c
+++ b/sys/isa/psm.c
@@ -176,8 +176,8 @@ struct psm_softc { /* Driver status information */
int watchdog; /* watchdog timer flag */
struct callout_handle callout; /* watchdog timer call out */
struct callout_handle softcallout; /* buffer timer call out */
- dev_t dev;
- dev_t bdev;
+ struct cdev *dev;
+ struct cdev *bdev;
int lasterr;
int cmdcount;
};
@@ -1307,7 +1307,7 @@ psmdetach(device_t dev)
}
static int
-psmopen(dev_t dev, int flag, int fmt, struct thread *td)
+psmopen(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit = PSM_UNIT(dev);
struct psm_softc *sc;
@@ -1391,7 +1391,7 @@ psmopen(dev_t dev, int flag, int fmt, struct thread *td)
}
static int
-psmclose(dev_t dev, int flag, int fmt, struct thread *td)
+psmclose(struct cdev *dev, int flag, int fmt, struct thread *td)
{
int unit = PSM_UNIT(dev);
struct psm_softc *sc = PSM_SOFTC(unit);
@@ -1533,7 +1533,7 @@ tame_mouse(struct psm_softc *sc, packetbuf_t *pb, mousestatus_t *status, unsigne
}
static int
-psmread(dev_t dev, struct uio *uio, int flag)
+psmread(struct cdev *dev, struct uio *uio, int flag)
{
register struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
unsigned char buf[PSM_SMALLBUFSIZE];
@@ -1681,7 +1681,7 @@ unblock_mouse_data(struct psm_softc *sc, int c)
}
static int
-psmioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+psmioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
mousemode_t mode;
@@ -2506,7 +2506,7 @@ psmsoftintr(void *arg)
}
static int
-psmpoll(dev_t dev, int events, struct thread *td)
+psmpoll(struct cdev *dev, int events, struct thread *td)
{
struct psm_softc *sc = PSM_SOFTC(PSM_UNIT(dev));
int s;
diff --git a/sys/isa/vga_isa.c b/sys/isa/vga_isa.c
index fb65204..e1538f8 100644
--- a/sys/isa/vga_isa.c
+++ b/sys/isa/vga_isa.c
@@ -163,37 +163,37 @@ isavga_attach(device_t dev)
#ifdef FB_INSTALL_CDEV
static int
-isavga_open(dev_t dev, int flag, int mode, struct thread *td)
+isavga_open(struct cdev *dev, int flag, int mode, struct thread *td)
{
return vga_open(dev, VGA_SOFTC(VGA_UNIT(dev)), flag, mode, td);
}
static int
-isavga_close(dev_t dev, int flag, int mode, struct thread *td)
+isavga_close(struct cdev *dev, int flag, int mode, struct thread *td)
{
return vga_close(dev, VGA_SOFTC(VGA_UNIT(dev)), flag, mode, td);
}
static int
-isavga_read(dev_t dev, struct uio *uio, int flag)
+isavga_read(struct cdev *dev, struct uio *uio, int flag)
{
return vga_read(dev, VGA_SOFTC(VGA_UNIT(dev)), uio, flag);
}
static int
-isavga_write(dev_t dev, struct uio *uio, int flag)
+isavga_write(struct cdev *dev, struct uio *uio, int flag)
{
return vga_write(dev, VGA_SOFTC(VGA_UNIT(dev)), uio, flag);
}
static int
-isavga_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
+isavga_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
return vga_ioctl(dev, VGA_SOFTC(VGA_UNIT(dev)), cmd, arg, flag, td);
}
static int
-isavga_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+isavga_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
return vga_mmap(dev, VGA_SOFTC(VGA_UNIT(dev)), offset, paddr, prot);
}
diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c
index b51f15d..687ec66 100644
--- a/sys/isofs/cd9660/cd9660_node.c
+++ b/sys/isofs/cd9660/cd9660_node.c
@@ -92,7 +92,7 @@ cd9660_uninit(vfsp)
*/
int
cd9660_ihashget(dev, inum, flags, vpp)
- dev_t dev;
+ struct cdev *dev;
ino_t inum;
int flags;
struct vnode **vpp;
diff --git a/sys/isofs/cd9660/cd9660_node.h b/sys/isofs/cd9660/cd9660_node.h
index 8e7d6c1..a5b228c 100644
--- a/sys/isofs/cd9660/cd9660_node.h
+++ b/sys/isofs/cd9660/cd9660_node.h
@@ -113,7 +113,7 @@ void cd9660_defattr(struct iso_directory_record *,
struct iso_node *, struct buf *, enum ISO_FTYPE);
void cd9660_deftstamp(struct iso_directory_record *,
struct iso_node *, struct buf *, enum ISO_FTYPE);
-int cd9660_ihashget(dev_t, ino_t, int, struct vnode **);
+int cd9660_ihashget(struct cdev *, ino_t, int, struct vnode **);
void cd9660_ihashins(struct iso_node *);
int cd9660_tstamp_conv7(u_char *, struct timespec *, enum ISO_FTYPE);
int cd9660_tstamp_conv17(u_char *, struct timespec *);
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index ceb60f9..dc0b240 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/cd9660/cd9660_vfsops.c
@@ -92,7 +92,7 @@ MODULE_VERSION(cd9660, 1);
* Called by vfs_mountroot when iso is going to be mounted as root.
*/
-static int iso_get_ssector(dev_t dev, struct thread *td);
+static int iso_get_ssector(struct cdev *dev, struct thread *td);
static int iso_mountfs(struct vnode *devvp, struct mount *mp,
struct thread *td, struct iso_args *argp);
@@ -103,7 +103,7 @@ static int iso_mountfs(struct vnode *devvp, struct mount *mp,
*/
static int
iso_get_ssector(dev, td)
- dev_t dev;
+ struct cdev *dev;
struct thread *td;
{
struct ioc_toc_header h;
@@ -272,7 +272,7 @@ iso_mountfs(devvp, mp, td, argp)
register struct iso_mnt *isomp = (struct iso_mnt *)0;
struct buf *bp = NULL;
struct buf *pribp = NULL, *supbp = NULL;
- dev_t dev = devvp->v_rdev;
+ struct cdev *dev = devvp->v_rdev;
int error = EINVAL;
int needclose = 0;
int high_sierra = 0;
@@ -707,7 +707,7 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
struct iso_node *ip;
struct buf *bp;
struct vnode *vp;
- dev_t dev;
+ struct cdev *dev;
int error;
imp = VFSTOISOFS(mp);
diff --git a/sys/isofs/cd9660/iso.h b/sys/isofs/cd9660/iso.h
index 4789e50..412f130 100644
--- a/sys/isofs/cd9660/iso.h
+++ b/sys/isofs/cd9660/iso.h
@@ -223,7 +223,7 @@ struct iso_mnt {
int im_flags;
struct mount *im_mountp;
- dev_t im_dev;
+ struct cdev *im_dev;
struct vnode *im_devvp;
int logical_block_size;
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 18ede10..216a777 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/tty.h>
#include <machine/stdarg.h>
-static MALLOC_DEFINE(M_DEVT, "dev_t", "dev_t storage");
+static MALLOC_DEFINE(M_DEVT, "struct cdev *", "struct cdev *storage");
/* Built at compile time from sys/conf/majors */
extern unsigned char reserved_majors[256];
@@ -56,7 +56,7 @@ extern unsigned char reserved_majors[256];
*/
#define DEVT_HASH 83
-/* The number of dev_t's we can create before malloc(9) kick in. */
+/* The number of struct cdev *'s we can create before malloc(9) kick in. */
#define DEVT_STASH 50
static struct cdev devt_stash[DEVT_STASH];
@@ -69,13 +69,13 @@ static int free_devt;
SYSCTL_INT(_debug, OID_AUTO, free_devt, CTLFLAG_RW, &free_devt, 0, "");
static struct mtx devmtx;
-static void freedev(dev_t dev);
+static void freedev(struct cdev *dev);
static void
devlock(void)
{
if (!mtx_initialized(&devmtx))
- mtx_init(&devmtx, "dev_t", NULL, MTX_DEF);
+ mtx_init(&devmtx, "struct cdev *", NULL, MTX_DEF);
mtx_lock(&devmtx);
}
@@ -86,7 +86,7 @@ devunlock(void)
}
void
-dev_ref(dev_t dev)
+dev_ref(struct cdev *dev)
{
devlock();
dev->si_refcount++;
@@ -94,7 +94,7 @@ dev_ref(dev_t dev)
}
void
-dev_rel(dev_t dev)
+dev_rel(struct cdev *dev)
{
devlock();
dev->si_refcount--;
@@ -125,7 +125,7 @@ cdevsw_rel(struct cdevsw *csw)
devunlock();
}
-static dev_t makedev(int x, int y);
+static struct cdev *makedev(int x, int y);
int
nullop(void)
@@ -200,7 +200,7 @@ static struct cdevsw dead_cdevsw = {
#define no_mmap (d_mmap_t *)enodev
static int
-no_kqfilter(dev_t dev __unused, struct knote *kn __unused)
+no_kqfilter(struct cdev *dev __unused, struct knote *kn __unused)
{
return (1);
@@ -214,7 +214,7 @@ no_strategy(struct bio *bp)
}
static int
-no_poll(dev_t dev __unused, int events, struct thread *td __unused)
+no_poll(struct cdev *dev __unused, int events, struct thread *td __unused)
{
/*
* Return true for read/write. If the user asked for something
@@ -233,7 +233,7 @@ no_poll(dev_t dev __unused, int events, struct thread *td __unused)
#define no_dump (dumper_t *)enodev
struct cdevsw *
-devsw(dev_t dev)
+devsw(struct cdev *dev)
{
if (dev->si_devsw != NULL)
return (dev->si_devsw);
@@ -241,11 +241,11 @@ devsw(dev_t dev)
}
/*
- * dev_t and u_dev_t primitives
+ * struct cdev *and u_dev_t primitives
*/
int
-major(dev_t x)
+major(struct cdev *x)
{
if (x == NODEV)
return NOUDEV;
@@ -253,7 +253,7 @@ major(dev_t x)
}
int
-minor(dev_t x)
+minor(struct cdev *x)
{
if (x == NODEV)
return NOUDEV;
@@ -261,7 +261,7 @@ minor(dev_t x)
}
int
-dev2unit(dev_t x)
+dev2unit(struct cdev *x)
{
int i;
@@ -279,7 +279,7 @@ unit2minor(int unit)
return ((unit & 0xff) | ((unit << 8) & ~0xffff));
}
-static dev_t
+static struct cdev *
allocdev(void)
{
static int stashed;
@@ -303,7 +303,7 @@ allocdev(void)
return (si);
}
-static dev_t
+static struct cdev *
makedev(int x, int y)
{
struct cdev *si;
@@ -325,7 +325,7 @@ makedev(int x, int y)
}
static void
-freedev(dev_t dev)
+freedev(struct cdev *dev)
{
if (dev->si_flags & SI_STASHED) {
@@ -338,14 +338,14 @@ freedev(dev_t dev)
}
udev_t
-dev2udev(dev_t x)
+dev2udev(struct cdev *x)
{
if (x == NODEV)
return (NOUDEV);
return (x->si_udev);
}
-dev_t
+struct cdev *
udev2dev(udev_t udev)
{
struct cdev *si;
@@ -467,10 +467,10 @@ prep_cdevsw(struct cdevsw *devsw)
devunlock();
}
-dev_t
+struct cdev *
make_dev(struct cdevsw *devsw, int minornr, uid_t uid, gid_t gid, int perms, const char *fmt, ...)
{
- dev_t dev;
+ struct cdev *dev;
va_list ap;
int i;
@@ -515,9 +515,9 @@ make_dev(struct cdevsw *devsw, int minornr, uid_t uid, gid_t gid, int perms, con
}
int
-dev_named(dev_t pdev, const char *name)
+dev_named(struct cdev *pdev, const char *name)
{
- dev_t cdev;
+ struct cdev *cdev;
if (strcmp(devtoname(pdev), name) == 0)
return (1);
@@ -528,7 +528,7 @@ dev_named(dev_t pdev, const char *name)
}
void
-dev_depends(dev_t pdev, dev_t cdev)
+dev_depends(struct cdev *pdev, struct cdev *cdev)
{
devlock();
@@ -538,10 +538,10 @@ dev_depends(dev_t pdev, dev_t cdev)
devunlock();
}
-dev_t
-make_dev_alias(dev_t pdev, const char *fmt, ...)
+struct cdev *
+make_dev_alias(struct cdev *pdev, const char *fmt, ...)
{
- dev_t dev;
+ struct cdev *dev;
va_list ap;
int i;
@@ -564,7 +564,7 @@ make_dev_alias(dev_t pdev, const char *fmt, ...)
}
static void
-idestroy_dev(dev_t dev)
+idestroy_dev(struct cdev *dev)
{
if (!(dev->si_flags & SI_NAMED)) {
printf( "WARNING: Driver mistake: destroy_dev on %d/%d\n",
@@ -597,7 +597,7 @@ idestroy_dev(dev_t dev)
/* Remove from cdevsw list */
LIST_REMOVE(dev, si_list);
- /* If cdevsw has no dev_t's, clean it */
+ /* If cdevsw has no struct cdev *'s, clean it */
if (LIST_EMPTY(&dev->si_devsw->d_devs))
fini_cdevsw(dev->si_devsw);
@@ -616,7 +616,7 @@ idestroy_dev(dev_t dev)
}
void
-destroy_dev(dev_t dev)
+destroy_dev(struct cdev *dev)
{
devlock();
@@ -625,7 +625,7 @@ destroy_dev(dev_t dev)
}
const char *
-devtoname(dev_t dev)
+devtoname(struct cdev *dev)
{
char *p;
int mynor;
@@ -681,7 +681,7 @@ dev_stdclone(char *name, char **namep, const char *stem, int *unit)
* we do "on-demand" devices, using rman or other "private" methods
* will be very tricky to lock down properly once we lock down this file.
*
- * Instead we give the drivers these routines which puts the dev_t's that
+ * Instead we give the drivers these routines which puts the struct cdev *'s that
* are to be managed on their own list, and gives the driver the ability
* to ask for the first free unit number or a given specified unit number.
*
@@ -703,10 +703,10 @@ clone_setup(struct clonedevs **cdp)
}
int
-clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, dev_t *dp, u_int extra)
+clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **dp, u_int extra)
{
struct clonedevs *cd;
- dev_t dev, dl, de;
+ struct cdev *dev, *dl, *de;
int unit, low, u;
KASSERT(*cdp != NULL,
@@ -766,12 +766,12 @@ clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, dev_t *dp, u_i
/*
* Kill everything still on the list. The driver should already have
- * disposed of any softc hung of the dev_t's at this time.
+ * disposed of any softc hung of the struct cdev *'s at this time.
*/
void
clone_cleanup(struct clonedevs **cdp)
{
- dev_t dev, tdev;
+ struct cdev *dev, *tdev;
struct clonedevs *cd;
cd = *cdp;
@@ -787,7 +787,7 @@ clone_cleanup(struct clonedevs **cdp)
}
/*
- * Helper sysctl for devname(3). We're given a {u}dev_t and return
+ * Helper sysctl for devname(3). We're given a {u}struct cdev *and return
* the name, if any, registered by the device driver.
*/
static int
@@ -795,7 +795,7 @@ sysctl_devname(SYSCTL_HANDLER_ARGS)
{
int error;
udev_t ud;
- dev_t dev;
+ struct cdev *dev;
error = SYSCTL_IN(req, &ud, sizeof (ud));
if (error)
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 8e955ca..c61e0ed 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -2153,7 +2153,7 @@ done2:
/* ARGSUSED */
static int
fdopen(dev, mode, type, td)
- dev_t dev;
+ struct cdev *dev;
int mode, type;
struct thread *td;
{
@@ -2393,7 +2393,7 @@ SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD,
static void
fildesc_drvinit(void *unused)
{
- dev_t dev;
+ struct cdev *dev;
dev = make_dev(&fildesc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "fd/0");
make_dev_alias(dev, "stdin");
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c
index 83b7b82..c2c9b3f 100644
--- a/sys/kern/kern_physio.c
+++ b/sys/kern/kern_physio.c
@@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_extern.h>
int
-physio(dev_t dev, struct uio *uio, int ioflag)
+physio(struct cdev *dev, struct uio *uio, int ioflag)
{
int i;
int error;
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index b0271f9..fd2e9d4 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -390,7 +390,7 @@ static struct dev_softc
struct proc *async_proc;
} devsoftc;
-static dev_t devctl_dev;
+static struct cdev *devctl_dev;
static void
devinit(void)
@@ -403,7 +403,7 @@ devinit(void)
}
static int
-devopen(dev_t dev, int oflags, int devtype, d_thread_t *td)
+devopen(struct cdev *dev, int oflags, int devtype, d_thread_t *td)
{
if (devsoftc.inuse)
return (EBUSY);
@@ -415,7 +415,7 @@ devopen(dev_t dev, int oflags, int devtype, d_thread_t *td)
}
static int
-devclose(dev_t dev, int fflag, int devtype, d_thread_t *td)
+devclose(struct cdev *dev, int fflag, int devtype, d_thread_t *td)
{
devsoftc.inuse = 0;
mtx_lock(&devsoftc.mtx);
@@ -434,7 +434,7 @@ devclose(dev_t dev, int fflag, int devtype, d_thread_t *td)
* programs are expected to cope.
*/
static int
-devread(dev_t dev, struct uio *uio, int ioflag)
+devread(struct cdev *dev, struct uio *uio, int ioflag)
{
struct dev_event_info *n1;
int rv;
@@ -464,7 +464,7 @@ devread(dev_t dev, struct uio *uio, int ioflag)
}
static int
-devioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td)
+devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td)
{
switch (cmd) {
@@ -494,7 +494,7 @@ devioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td)
}
static int
-devpoll(dev_t dev, int events, d_thread_t *td)
+devpoll(struct cdev *dev, int events, d_thread_t *td)
{
int revents = 0;
diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c
index 04abe89..f7fda10 100644
--- a/sys/kern/subr_devstat.c
+++ b/sys/kern/subr_devstat.c
@@ -453,7 +453,7 @@ static TAILQ_HEAD(, statspage) pagelist = TAILQ_HEAD_INITIALIZER(pagelist);
static MALLOC_DEFINE(M_DEVSTAT, "devstat", "Device statistics");
static int
-devstat_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+devstat_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
{
struct statspage *spp;
diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c
index a232335..bdb18fd 100644
--- a/sys/kern/subr_log.c
+++ b/sys/kern/subr_log.c
@@ -92,7 +92,7 @@ SYSCTL_INT(_kern, OID_AUTO, log_wakeups_per_second, CTLFLAG_RW,
/*ARGSUSED*/
static int
-logopen(dev_t dev, int flags, int mode, struct thread *td)
+logopen(struct cdev *dev, int flags, int mode, struct thread *td)
{
if (log_open)
return (EBUSY);
@@ -110,7 +110,7 @@ logopen(dev_t dev, int flags, int mode, struct thread *td)
/*ARGSUSED*/
static int
-logclose(dev_t dev, int flag, int mode, struct thread *td)
+logclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
log_open = 0;
@@ -122,7 +122,7 @@ logclose(dev_t dev, int flag, int mode, struct thread *td)
/*ARGSUSED*/
static int
-logread(dev_t dev, struct uio *uio, int flag)
+logread(struct cdev *dev, struct uio *uio, int flag)
{
char buf[128];
struct msgbuf *mbp = msgbufp;
@@ -157,7 +157,7 @@ logread(dev_t dev, struct uio *uio, int flag)
/*ARGSUSED*/
static int
-logpoll(dev_t dev, int events, struct thread *td)
+logpoll(struct cdev *dev, int events, struct thread *td)
{
int s;
int revents = 0;
@@ -203,7 +203,7 @@ logtimeout(void *arg)
/*ARGSUSED*/
static int
-logioctl(dev_t dev, u_long com, caddr_t data, int flag, struct thread *td)
+logioctl(struct cdev *dev, u_long com, caddr_t data, int flag, struct thread *td)
{
switch (com) {
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index aeecbb8..6c5f4d5 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -227,7 +227,7 @@ SYSCTL_INT(_kern, OID_AUTO, drainwait, CTLFLAG_RW, &drainwait,
* Initial open of tty, or (re)entry to standard tty line discipline.
*/
int
-ttyopen(dev_t device, struct tty *tp)
+ttyopen(struct cdev *device, struct tty *tp)
{
int s;
@@ -1015,7 +1015,7 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
}
case TIOCSETD: { /* set line discipline */
int t = *(int *)data;
- dev_t device = tp->t_dev;
+ struct cdev *device = tp->t_dev;
if ((u_int)t >= nlinesw)
return (ENXIO);
@@ -1140,7 +1140,7 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
}
int
-ttypoll(dev_t dev, int events, struct thread *td)
+ttypoll(struct cdev *dev, int events, struct thread *td)
{
int s;
int revents = 0;
@@ -1180,7 +1180,7 @@ static struct filterops ttywrite_filtops =
{ 1, NULL, filt_ttywdetach, filt_ttywrite };
int
-ttykqfilter(dev_t dev, struct knote *kn)
+ttykqfilter(struct cdev *dev, struct knote *kn)
{
struct tty *tp;
struct klist *klist;
@@ -1216,7 +1216,7 @@ ttykqfilter(dev_t dev, struct knote *kn)
static void
filt_ttyrdetach(struct knote *kn)
{
- struct tty *tp = ((dev_t)kn->kn_hook)->si_tty;
+ struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty;
int s = spltty();
SLIST_REMOVE(&tp->t_rsel.si_note, kn, knote, kn_selnext);
@@ -1226,7 +1226,7 @@ filt_ttyrdetach(struct knote *kn)
static int
filt_ttyread(struct knote *kn, long hint)
{
- struct tty *tp = ((dev_t)kn->kn_hook)->si_tty;
+ struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty;
kn->kn_data = ttnread(tp);
if (ISSET(tp->t_state, TS_ZOMBIE)) {
@@ -1239,7 +1239,7 @@ filt_ttyread(struct knote *kn, long hint)
static void
filt_ttywdetach(struct knote *kn)
{
- struct tty *tp = ((dev_t)kn->kn_hook)->si_tty;
+ struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty;
int s = spltty();
SLIST_REMOVE(&tp->t_wsel.si_note, kn, knote, kn_selnext);
@@ -1249,7 +1249,7 @@ filt_ttywdetach(struct knote *kn)
static int
filt_ttywrite(struct knote *kn, long hint)
{
- struct tty *tp = ((dev_t)kn->kn_hook)->si_tty;
+ struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty;
kn->kn_data = tp->t_outq.c_cc;
if (ISSET(tp->t_state, TS_ZOMBIE))
@@ -2789,7 +2789,7 @@ nottystop(struct tty *tp, int rw)
}
int
-ttyread(dev_t dev, struct uio *uio, int flag)
+ttyread(struct cdev *dev, struct uio *uio, int flag)
{
struct tty *tp;
@@ -2804,7 +2804,7 @@ ttyread(dev_t dev, struct uio *uio, int flag)
}
int
-ttywrite(dev_t dev, struct uio *uio, int flag)
+ttywrite(struct cdev *dev, struct uio *uio, int flag)
{
struct tty *tp;
@@ -2819,7 +2819,7 @@ ttywrite(dev_t dev, struct uio *uio, int flag)
}
int
-ttyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+ttyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct tty *tp;
int error;
diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c
index 827fe42..488e383 100644
--- a/sys/kern/tty_conf.c
+++ b/sys/kern/tty_conf.c
@@ -156,7 +156,7 @@ ldisc_deregister(int discipline)
*/
static int
-l_noopen(dev_t dev, struct tty *tp)
+l_noopen(struct cdev *dev, struct tty *tp)
{
return (ENODEV);
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index 2c38d56..a9bea7c 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -105,7 +105,7 @@ static STAILQ_HEAD(, cn_device) cn_devlist =
static udev_t cn_udev_t;
SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLFLAG_RD,
- &cn_udev_t, sizeof cn_udev_t, "T,dev_t", "");
+ &cn_udev_t, sizeof cn_udev_t, "T,struct cdev *", "");
int cons_avail_mask = 0; /* Bit mask. Each registered low level console
* which is currently unavailable for inpit
@@ -388,7 +388,7 @@ cn_devopen(struct cn_device *cnd, struct thread *td, int forceopen)
char path[CNDEVPATHMAX];
struct nameidata nd;
struct vnode *vp;
- dev_t dev;
+ struct cdev *dev;
int error;
if ((vp = cnd->cnd_vp) != NULL) {
@@ -414,7 +414,7 @@ cn_devopen(struct cn_device *cnd, struct thread *td, int forceopen)
}
static int
-cnopen(dev_t dev, int flag, int mode, struct thread *td)
+cnopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct cn_device *cnd;
@@ -428,7 +428,7 @@ cnopen(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-cnclose(dev_t dev, int flag, int mode, struct thread *td)
+cnclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct cn_device *cnd;
struct vnode *vp;
@@ -444,7 +444,7 @@ cnclose(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-cnread(dev_t dev, struct uio *uio, int flag)
+cnread(struct cdev *dev, struct uio *uio, int flag)
{
struct cn_device *cnd;
@@ -456,7 +456,7 @@ cnread(dev_t dev, struct uio *uio, int flag)
}
static int
-cnwrite(dev_t dev, struct uio *uio, int flag)
+cnwrite(struct cdev *dev, struct uio *uio, int flag)
{
struct cn_device *cnd;
@@ -477,7 +477,7 @@ done:
}
static int
-cnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+cnioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct cn_device *cnd;
int error;
@@ -507,7 +507,7 @@ cnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
* poll/kqfilter do not appear to be correct
*/
static int
-cnpoll(dev_t dev, int events, struct thread *td)
+cnpoll(struct cdev *dev, int events, struct thread *td)
{
struct cn_device *cnd;
@@ -521,7 +521,7 @@ cnpoll(dev_t dev, int events, struct thread *td)
}
static int
-cnkqfilter(dev_t dev, struct knote *kn)
+cnkqfilter(struct cdev *dev, struct knote *kn)
{
struct cn_device *cnd;
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 96ccbf4..b4082a3 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -61,7 +61,7 @@ static MALLOC_DEFINE(M_PTY, "ptys", "pty data structures");
static void ptsstart(struct tty *tp);
static void ptsstop(struct tty *tp, int rw);
static void ptcwakeup(struct tty *tp, int flag);
-static dev_t ptyinit(dev_t cdev);
+static struct cdev *ptyinit(struct cdev *cdev);
static d_open_t ptsopen;
static d_close_t ptsclose;
@@ -109,7 +109,7 @@ struct ptsc {
u_char pt_send;
u_char pt_ucntl;
struct tty *pt_tty;
- dev_t devs, devc;
+ struct cdev *devs, *devc;
struct prison *pt_prison;
};
@@ -133,10 +133,10 @@ static char *names = "pqrsPQRS";
* XXX: define and add mapping of upper minor bits to allow more
* than 256 ptys.
*/
-static dev_t
-ptyinit(dev_t devc)
+static struct cdev *
+ptyinit(struct cdev *devc)
{
- dev_t devs;
+ struct cdev *devs;
struct ptsc *pt;
int n;
@@ -161,7 +161,7 @@ ptyinit(dev_t devc)
/*ARGSUSED*/
static int
-ptsopen(dev_t dev, int flag, int devtype, struct thread *td)
+ptsopen(struct cdev *dev, int flag, int devtype, struct thread *td)
{
struct tty *tp;
int error;
@@ -199,7 +199,7 @@ ptsopen(dev_t dev, int flag, int devtype, struct thread *td)
}
static int
-ptsclose(dev_t dev, int flag, int mode, struct thread *td)
+ptsclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct tty *tp;
int err;
@@ -211,7 +211,7 @@ ptsclose(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-ptsread(dev_t dev, struct uio *uio, int flag)
+ptsread(struct cdev *dev, struct uio *uio, int flag)
{
struct thread *td = curthread;
struct proc *p = td->td_proc;
@@ -274,7 +274,7 @@ again:
* indirectly, when tty driver calls ptsstart.
*/
static int
-ptswrite(dev_t dev, struct uio *uio, int flag)
+ptswrite(struct cdev *dev, struct uio *uio, int flag)
{
struct tty *tp;
@@ -318,7 +318,7 @@ ptcwakeup(struct tty *tp, int flag)
}
static int
-ptcopen(dev_t dev, int flag, int devtype, struct thread *td)
+ptcopen(struct cdev *dev, int flag, int devtype, struct thread *td)
{
struct tty *tp;
struct ptsc *pt;
@@ -344,7 +344,7 @@ ptcopen(dev_t dev, int flag, int devtype, struct thread *td)
}
static int
-ptcclose(dev_t dev, int flags, int fmt, struct thread *td)
+ptcclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct tty *tp;
@@ -370,7 +370,7 @@ ptcclose(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-ptcread(dev_t dev, struct uio *uio, int flag)
+ptcread(struct cdev *dev, struct uio *uio, int flag)
{
struct tty *tp = dev->si_tty;
struct ptsc *pt = dev->si_drv1;
@@ -450,7 +450,7 @@ ptsstop(struct tty *tp, int flush)
}
static int
-ptcpoll(dev_t dev, int events, struct thread *td)
+ptcpoll(struct cdev *dev, int events, struct thread *td)
{
struct tty *tp = dev->si_tty;
struct ptsc *pt = dev->si_drv1;
@@ -498,7 +498,7 @@ ptcpoll(dev_t dev, int events, struct thread *td)
}
static int
-ptcwrite(dev_t dev, struct uio *uio, int flag)
+ptcwrite(struct cdev *dev, struct uio *uio, int flag)
{
struct tty *tp = dev->si_tty;
u_char *cp = 0;
@@ -606,7 +606,7 @@ block:
/*ARGSUSED*/
static int
-ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+ptyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct tty *tp = dev->si_tty;
struct ptsc *pt = dev->si_drv1;
@@ -773,7 +773,7 @@ ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
}
static void
-pty_clone(void *arg, char *name, int namelen, dev_t *dev)
+pty_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
int u;
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index 96fa84b..85b0eac 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -45,17 +45,17 @@ static struct cdevsw ctty_cdevsw = {
.d_flags = D_TTY | D_NEEDGIANT,
};
-static dev_t ctty;
+static struct cdev *ctty;
static int
-cttyopen(dev_t dev, int flag, int mode, struct thread *td)
+cttyopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
return (ENXIO);
}
static void
-ctty_clone(void *arg, char *name, int namelen, dev_t *dev)
+ctty_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
if (*dev != NODEV)
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 30daba7..19b6726 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -3083,7 +3083,7 @@ dev_strategy(struct buf *bp)
bp->b_io.bio_caller2 = bp;
csw = devsw(bp->b_io.bio_dev);
KASSERT(bp->b_io.bio_dev->si_refcount > 0,
- ("dev_strategy on un-referenced dev_t (%s)",
+ ("dev_strategy on un-referenced struct cdev *(%s)",
devtoname(bp->b_io.bio_dev)));
cdevsw_ref(csw);
(*devsw(bp->b_io.bio_dev)->d_strategy)(&bp->b_io);
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 229309d..8eaa6e9 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -147,7 +147,7 @@ static char *cdrom_rootdevnames[] = {
/* legacy find-root code */
char *rootdevnames[2] = {NULL, NULL};
static int setrootbyname(char *name);
-dev_t rootdev = NODEV;
+struct cdev *rootdev = NODEV;
/*
* Has to be dynamic as the value of rootdev can change; however, it can't
@@ -1445,13 +1445,13 @@ gets(char *cp)
}
/*
- * Convert a given name to the dev_t of the disk-like device
+ * Convert a given name to the struct cdev *of the disk-like device
* it refers to.
*/
-dev_t
+struct cdev *
getdiskbyname(char *name) {
char *cp;
- dev_t dev;
+ struct cdev *dev;
cp = name;
if (!bcmp(cp, "/dev/", 5))
@@ -1469,7 +1469,7 @@ getdiskbyname(char *name) {
static int
setrootbyname(char *name)
{
- dev_t diskdev;
+ struct cdev *diskdev;
diskdev = getdiskbyname(name);
if (diskdev != NODEV) {
@@ -1480,11 +1480,11 @@ setrootbyname(char *name)
return (1);
}
-/* Show the dev_t for a disk specified by name */
+/* Show the struct cdev *for a disk specified by name */
#ifdef DDB
DB_SHOW_COMMAND(disk, db_getdiskbyname)
{
- dev_t dev;
+ struct cdev *dev;
if (modif[0] == '\0') {
db_error("usage: show disk/devicename");
@@ -1492,7 +1492,7 @@ DB_SHOW_COMMAND(disk, db_getdiskbyname)
}
dev = getdiskbyname(modif);
if (dev != NODEV)
- db_printf("dev_t = %p\n", dev);
+ db_printf("struct cdev *= %p\n", dev);
else
db_printf("No disk device matched.\n");
}
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 2caad25..0346fa2 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$");
static MALLOC_DEFINE(M_NETADDR, "Export Host", "Export host address structure");
-static void addalias(struct vnode *vp, dev_t nvp_rdev);
+static void addalias(struct vnode *vp, struct cdev *nvp_rdev);
static void insmntque(struct vnode *vp, struct mount *mp);
static void vclean(struct vnode *vp, int flags, struct thread *td);
static void vlruvp(struct vnode *vp);
@@ -1737,7 +1737,7 @@ reassignbuf(bp, newvp)
*/
int
bdevvp(dev, vpp)
- dev_t dev;
+ struct cdev *dev;
struct vnode **vpp;
{
register struct vnode *vp;
@@ -1776,7 +1776,7 @@ v_incr_usecount(struct vnode *vp, int delta)
}
/*
- * Add vnode to the alias list hung off the dev_t.
+ * Add vnode to the alias list hung off the struct cdev *.
*
* The reason for this gunk is that multiple vnodes can reference
* the same physical device, so checking vp->v_usecount to see
@@ -1790,7 +1790,7 @@ addaliasu(nvp, nvp_rdev)
{
struct vnode *ovp;
vop_t **ops;
- dev_t dev;
+ struct cdev *dev;
if (nvp->v_type == VBLK)
return (nvp);
@@ -1836,11 +1836,11 @@ addaliasu(nvp, nvp_rdev)
}
/* This is a local helper function that do the same as addaliasu, but for a
- * dev_t instead of an udev_t. */
+ * struct cdev *instead of an udev_t. */
static void
addalias(nvp, dev)
struct vnode *nvp;
- dev_t dev;
+ struct cdev *dev;
{
KASSERT(nvp->v_type == VCHR, ("addalias on non-special vnode"));
@@ -2440,7 +2440,7 @@ vop_revoke(ap)
} */ *ap;
{
struct vnode *vp, *vq;
- dev_t dev;
+ struct cdev *dev;
KASSERT((ap->a_flags & REVOKEALL) != 0, ("vop_revoke"));
vp = ap->a_vp;
@@ -2622,7 +2622,7 @@ vgonel(vp, td)
*/
int
vfinddev(dev, vpp)
- dev_t dev;
+ struct cdev *dev;
struct vnode **vpp;
{
struct vnode *vp;
@@ -2653,11 +2653,11 @@ vcount(vp)
}
/*
- * Same as above, but using the dev_t as argument
+ * Same as above, but using the struct cdev *as argument
*/
int
count_dev(dev)
- dev_t dev;
+ struct cdev *dev;
{
int count;
@@ -3399,9 +3399,9 @@ sync_reclaim(ap)
}
/*
- * extract the dev_t from a VCHR
+ * extract the struct cdev *from a VCHR
*/
-dev_t
+struct cdev *
vn_todev(vp)
struct vnode *vp;
{
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 8bb0fe5..4b3cf45 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -319,7 +319,7 @@ bpf_detachd(d)
/* ARGSUSED */
static int
bpfopen(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -364,7 +364,7 @@ bpfopen(dev, flags, fmt, td)
/* ARGSUSED */
static int
bpfclose(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -408,7 +408,7 @@ bpfclose(dev, flags, fmt, td)
*/
static int
bpfread(dev, uio, ioflag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int ioflag;
{
@@ -545,7 +545,7 @@ bpf_timed_out(arg)
static int
bpfwrite(dev, uio, ioflag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int ioflag;
{
@@ -633,7 +633,7 @@ reset_d(d)
/* ARGSUSED */
static int
bpfioctl(dev, cmd, addr, flags, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t addr;
int flags;
@@ -1043,7 +1043,7 @@ bpf_setif(d, ifr)
*/
static int
bpfpoll(dev, events, td)
- dev_t dev;
+ struct cdev *dev;
int events;
struct thread *td;
{
@@ -1079,7 +1079,7 @@ bpfpoll(dev, events, td)
*/
int
bpfkqfilter(dev, kn)
- dev_t dev;
+ struct cdev *dev;
struct knote *kn;
{
struct bpf_d *d = (struct bpf_d *)dev->si_drv1;
@@ -1567,14 +1567,14 @@ bpf_setdlt(d, dlt)
static void bpf_drvinit(void *unused);
-static void bpf_clone(void *arg, char *name, int namelen, dev_t *dev);
+static void bpf_clone(void *arg, char *name, int namelen, struct cdev **dev);
static void
bpf_clone(arg, name, namelen, dev)
void *arg;
char *name;
int namelen;
- dev_t *dev;
+ struct cdev **dev;
{
int u;
diff --git a/sys/net/if.c b/sys/net/if.c
index 7942065..2b3805e 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -144,19 +144,19 @@ static struct cdevsw net_cdevsw = {
};
static int
-netopen(dev_t dev, int flag, int mode, struct thread *td)
+netopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
return (0);
}
static int
-netclose(dev_t dev, int flags, int fmt, struct thread *td)
+netclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
return (0);
}
static int
-netioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+netioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct ifnet *ifp;
int error, idx;
@@ -185,7 +185,7 @@ netioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
}
static int
-netkqfilter(dev_t dev, struct knote *kn)
+netkqfilter(struct cdev *dev, struct knote *kn)
{
struct klist *klist;
struct ifnet *ifp;
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c
index 5037742..c05ecd0 100644
--- a/sys/net/if_sl.c
+++ b/sys/net/if_sl.c
@@ -179,7 +179,7 @@ static l_close_t slclose;
static l_rint_t slinput;
static l_ioctl_t sltioctl;
static int slioctl(struct ifnet *, u_long, caddr_t);
-static int slopen(dev_t, struct tty *);
+static int slopen(struct cdev *, struct tty *);
static int sloutput(struct ifnet *,
struct mbuf *, struct sockaddr *, struct rtentry *);
static int slstart(struct tty *);
@@ -340,7 +340,7 @@ slcreate()
/* ARGSUSED */
static int
slopen(dev, tp)
- dev_t dev;
+ struct cdev *dev;
register struct tty *tp;
{
register struct sl_softc *sc;
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c
index a9ea725..7f2f856 100644
--- a/sys/net/if_tap.c
+++ b/sys/net/if_tap.c
@@ -81,8 +81,8 @@
static int tapmodevent(module_t, int, void *);
/* device */
-static void tapclone(void *, char *, int, dev_t *);
-static void tapcreate(dev_t);
+static void tapclone(void *, char *, int, struct cdev **);
+static void tapcreate(struct cdev *);
/* network interface */
static void tapifstart(struct ifnet *);
@@ -222,7 +222,7 @@ tapclone(arg, name, namelen, dev)
void *arg;
char *name;
int namelen;
- dev_t *dev;
+ struct cdev **dev;
{
u_int extra;
int i, unit;
@@ -264,7 +264,7 @@ tapclone(arg, name, namelen, dev)
*/
static void
tapcreate(dev)
- dev_t dev;
+ struct cdev *dev;
{
struct ifnet *ifp = NULL;
struct tap_softc *tp = NULL;
@@ -334,7 +334,7 @@ tapcreate(dev)
*/
static int
tapopen(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -384,7 +384,7 @@ tapopen(dev, flag, mode, td)
*/
static int
tapclose(dev, foo, bar, td)
- dev_t dev;
+ struct cdev *dev;
int foo;
int bar;
struct thread *td;
@@ -588,7 +588,7 @@ tapifstart(ifp)
*/
static int
tapioctl(dev, cmd, data, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t data;
int flag;
@@ -712,7 +712,7 @@ tapioctl(dev, cmd, data, flag, td)
*/
static int
tapread(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -786,7 +786,7 @@ tapread(dev, uio, flag)
*/
static int
tapwrite(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -858,7 +858,7 @@ tapwrite(dev, uio, flag)
*/
static int
tappoll(dev, events, td)
- dev_t dev;
+ struct cdev *dev;
int events;
struct thread *td;
{
diff --git a/sys/net/if_tapvar.h b/sys/net/if_tapvar.h
index acd4528..512a33d 100644
--- a/sys/net/if_tapvar.h
+++ b/sys/net/if_tapvar.h
@@ -63,7 +63,7 @@ struct tap_softc {
struct selinfo tap_rsel; /* read select */
SLIST_ENTRY(tap_softc) tap_next; /* next device in chain */
- dev_t tap_dev;
+ struct cdev *tap_dev;
struct mtx tap_mtx; /* per-softc mutex */
};
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 90eafeb..975b1c0 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -62,7 +62,7 @@
*/
struct tun_softc {
TAILQ_ENTRY(tun_softc) tun_list;
- dev_t tun_dev;
+ struct cdev *tun_dev;
u_short tun_flags; /* misc flags */
#define TUN_OPEN 0x0001
#define TUN_INITED 0x0002
@@ -105,8 +105,8 @@ static struct clonedevs *tunclones;
static TAILQ_HEAD(,tun_softc) tunhead = TAILQ_HEAD_INITIALIZER(tunhead);
SYSCTL_INT(_debug, OID_AUTO, if_tun_debug, CTLFLAG_RW, &tundebug, 0, "");
-static void tunclone(void *arg, char *name, int namelen, dev_t *dev);
-static void tuncreate(dev_t dev);
+static void tunclone(void *arg, char *name, int namelen, struct cdev **dev);
+static void tuncreate(struct cdev *dev);
static int tunifioctl(struct ifnet *, u_long, caddr_t);
static int tuninit(struct ifnet *);
static int tunmodevent(module_t, int, void *);
@@ -134,7 +134,7 @@ static struct cdevsw tun_cdevsw = {
};
static void
-tunclone(void *arg, char *name, int namelen, dev_t *dev)
+tunclone(void *arg, char *name, int namelen, struct cdev **dev)
{
int u, i;
@@ -151,7 +151,7 @@ tunclone(void *arg, char *name, int namelen, dev_t *dev)
/* find any existing device, or allocate new unit number */
i = clone_create(&tunclones, &tun_cdevsw, &u, dev, 0);
if (i) {
- /* No preexisting dev_t, create one */
+ /* No preexisting struct cdev *, create one */
*dev = make_dev(&tun_cdevsw, unit2minor(u),
UID_UUCP, GID_DIALER, 0600, "tun%d", u);
if (*dev != NULL)
@@ -162,7 +162,7 @@ tunclone(void *arg, char *name, int namelen, dev_t *dev)
static void
tun_destroy(struct tun_softc *tp)
{
- dev_t dev;
+ struct cdev *dev;
/* Unlocked read. */
KASSERT((tp->tun_flags & TUN_OPEN) == 0,
@@ -235,7 +235,7 @@ tunstart(struct ifnet *ifp)
}
static void
-tuncreate(dev_t dev)
+tuncreate(struct cdev *dev)
{
struct tun_softc *sc;
struct ifnet *ifp;
@@ -266,7 +266,7 @@ tuncreate(dev_t dev)
}
static int
-tunopen(dev_t dev, int flag, int mode, struct thread *td)
+tunopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct ifnet *ifp;
struct tun_softc *tp;
@@ -307,7 +307,7 @@ tunopen(dev_t dev, int flag, int mode, struct thread *td)
* routing info
*/
static int
-tunclose(dev_t dev, int foo, int bar, struct thread *td)
+tunclose(struct cdev *dev, int foo, int bar, struct thread *td)
{
struct tun_softc *tp;
struct ifnet *ifp;
@@ -535,7 +535,7 @@ tunoutput(
* the cdevsw interface is now pretty minimal.
*/
static int
-tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
int s;
int error;
@@ -658,7 +658,7 @@ tunioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
* least as much of a packet as can be read.
*/
static int
-tunread(dev_t dev, struct uio *uio, int flag)
+tunread(struct cdev *dev, struct uio *uio, int flag)
{
struct tun_softc *tp = dev->si_drv1;
struct ifnet *ifp = &tp->tun_if;
@@ -714,7 +714,7 @@ tunread(dev_t dev, struct uio *uio, int flag)
* the cdevsw write interface - an atomic write is a packet - or else!
*/
static int
-tunwrite(dev_t dev, struct uio *uio, int flag)
+tunwrite(struct cdev *dev, struct uio *uio, int flag)
{
struct tun_softc *tp = dev->si_drv1;
struct ifnet *ifp = &tp->tun_if;
@@ -829,7 +829,7 @@ tunwrite(dev_t dev, struct uio *uio, int flag)
* anyway, it either accepts the packet or drops it.
*/
static int
-tunpoll(dev_t dev, int events, struct thread *td)
+tunpoll(struct cdev *dev, int events, struct thread *td)
{
int s;
struct tun_softc *tp = dev->si_drv1;
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 68cebe6..9fd82c7 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -643,7 +643,7 @@ extern struct mtx ifnet_lock;
struct ifindex_entry {
struct ifnet *ife_ifnet;
struct ifaddr *ife_ifnet_addr;
- dev_t ife_dev;
+ struct cdev *ife_dev;
};
#define ifnet_byindex(idx) ifindex_table[(idx)].ife_ifnet
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c
index 135ddeb..0270acb 100644
--- a/sys/net/ppp_tty.c
+++ b/sys/net/ppp_tty.c
@@ -93,7 +93,7 @@
#include <net/if_ppp.h>
#include <net/if_pppvar.h>
-static int pppopen(dev_t dev, struct tty *tp);
+static int pppopen(struct cdev *dev, struct tty *tp);
static int pppclose(struct tty *tp, int flag);
static int pppread(struct tty *tp, struct uio *uio, int flag);
static int pppwrite(struct tty *tp, struct uio *uio, int flag);
@@ -173,7 +173,7 @@ pppasyncdetach()
/* ARGSUSED */
static int
pppopen(dev, tp)
- dev_t dev;
+ struct cdev *dev;
register struct tty *tp;
{
struct thread *td = curthread; /* XXX */
diff --git a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
index 3aeb21a..27b6641 100644
--- a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
+++ b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c
@@ -78,7 +78,7 @@ MALLOC_DEFINE(M_NETGRAPH_H4, "netgraph_h4", "Netgraph Bluetooth H4 node");
#endif /* NG_SEPARATE_MALLOC */
/* Line discipline methods */
-static int ng_h4_open (dev_t, struct tty *);
+static int ng_h4_open (struct cdev *, struct tty *);
static int ng_h4_close (struct tty *, int);
static int ng_h4_read (struct tty *, struct uio *, int);
static int ng_h4_write (struct tty *, struct uio *, int);
@@ -147,7 +147,7 @@ static int ng_h4_node = 0;
*/
static int
-ng_h4_open(dev_t dev, struct tty *tp)
+ng_h4_open(struct cdev *dev, struct tty *tp)
{
char name[NG_NODESIZ];
ng_h4_info_p sc = NULL;
diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
index 5c48c53..c28e772 100644
--- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
+++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
@@ -2291,7 +2291,7 @@ done:
*/
Static int
-ubt_open(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ubt_open(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
ubt_softc_p sc = NULL;
int ep = UBT_ENDPOINT(dev);
@@ -2331,7 +2331,7 @@ ubt_open(dev_t dev, int flag, int mode, usb_proc_ptr p)
*/
Static int
-ubt_close(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ubt_close(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
ubt_softc_p sc = NULL;
int ep = UBT_ENDPOINT(dev);
@@ -2368,7 +2368,7 @@ ubt_close(dev_t dev, int flag, int mode, usb_proc_ptr p)
*/
Static int
-ubt_read(dev_t dev, struct uio *uio, int flag)
+ubt_read(struct cdev *dev, struct uio *uio, int flag)
{
ubt_softc_p sc = NULL;
int error = 0, n, tn, ep = UBT_ENDPOINT(dev);
@@ -2436,7 +2436,7 @@ ubt_read(dev_t dev, struct uio *uio, int flag)
*/
Static int
-ubt_write(dev_t dev, struct uio *uio, int flag)
+ubt_write(struct cdev *dev, struct uio *uio, int flag)
{
ubt_softc_p sc = NULL;
int error = 0, n, ep = UBT_ENDPOINT(dev);
@@ -2495,7 +2495,7 @@ ubt_write(dev_t dev, struct uio *uio, int flag)
*/
Static int
-ubt_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
+ubt_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
{
ubt_softc_p sc = NULL;
int len, error = 0, ep = UBT_ENDPOINT(dev);
@@ -2613,7 +2613,7 @@ ret:
*/
Static int
-ubt_poll(dev_t dev, int events, usb_proc_ptr p)
+ubt_poll(struct cdev *dev, int events, usb_proc_ptr p)
{
ubt_softc_p sc = NULL;
int revents = 0, ep = UBT_ENDPOINT(dev);
diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h
index 3fc3322..fef8189 100644
--- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h
+++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h
@@ -139,9 +139,9 @@ struct ubt_softc {
hook_p sc_hook; /* upstream hook */
/* Device specific */
- dev_t sc_ctrl_dev; /* control device */
- dev_t sc_intr_dev; /* interrupt device */
- dev_t sc_bulk_dev; /* bulk device */
+ struct cdev *sc_ctrl_dev; /* control device */
+ struct cdev *sc_intr_dev; /* interrupt device */
+ struct cdev *sc_bulk_dev; /* bulk device */
int sc_refcnt; /* device ref. count */
int sc_dying;
diff --git a/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c b/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c
index 19e1801..f957cf5 100644
--- a/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c
+++ b/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c
@@ -61,9 +61,9 @@
struct ubtbcmfw_softc {
USBBASEDEVICE sc_dev; /* base device */
usbd_device_handle sc_udev; /* USB device handle */
- dev_t sc_ctrl_dev; /* control device */
- dev_t sc_intr_in_dev; /* interrupt device */
- dev_t sc_bulk_out_dev; /* bulk device */
+ struct cdev *sc_ctrl_dev; /* control device */
+ struct cdev *sc_intr_in_dev; /* interrupt device */
+ struct cdev *sc_bulk_out_dev; /* bulk device */
usbd_pipe_handle sc_intr_in_pipe; /* interrupt pipe */
usbd_pipe_handle sc_bulk_out_pipe; /* bulk out pipe */
int sc_flags;
@@ -264,7 +264,7 @@ USB_DETACH(ubtbcmfw)
*/
Static int
-ubtbcmfw_open(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ubtbcmfw_open(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
ubtbcmfw_softc_p sc = NULL;
int error = 0;
@@ -316,7 +316,7 @@ ubtbcmfw_open(dev_t dev, int flag, int mode, usb_proc_ptr p)
*/
Static int
-ubtbcmfw_close(dev_t dev, int flag, int mode, usb_proc_ptr p)
+ubtbcmfw_close(struct cdev *dev, int flag, int mode, usb_proc_ptr p)
{
ubtbcmfw_softc_p sc = NULL;
@@ -353,7 +353,7 @@ ubtbcmfw_close(dev_t dev, int flag, int mode, usb_proc_ptr p)
*/
Static int
-ubtbcmfw_read(dev_t dev, struct uio *uio, int flag)
+ubtbcmfw_read(struct cdev *dev, struct uio *uio, int flag)
{
ubtbcmfw_softc_p sc = NULL;
u_int8_t buf[UBTBCMFW_BSIZE];
@@ -417,7 +417,7 @@ ubtbcmfw_read(dev_t dev, struct uio *uio, int flag)
*/
Static int
-ubtbcmfw_write(dev_t dev, struct uio *uio, int flag)
+ubtbcmfw_write(struct cdev *dev, struct uio *uio, int flag)
{
ubtbcmfw_softc_p sc = NULL;
u_int8_t buf[UBTBCMFW_BSIZE];
@@ -482,7 +482,7 @@ ubtbcmfw_write(dev_t dev, struct uio *uio, int flag)
*/
Static int
-ubtbcmfw_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
+ubtbcmfw_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
{
ubtbcmfw_softc_p sc = NULL;
int error = 0;
@@ -519,7 +519,7 @@ ubtbcmfw_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
*/
Static int
-ubtbcmfw_poll(dev_t dev, int events, usb_proc_ptr p)
+ubtbcmfw_poll(struct cdev *dev, int events, usb_proc_ptr p)
{
ubtbcmfw_softc_p sc = NULL;
int revents = 0;
diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c
index c0666b9..49d86b9 100644
--- a/sys/netgraph/ng_device.c
+++ b/sys/netgraph/ng_device.c
@@ -81,7 +81,7 @@ NETGRAPH_INIT(device, &typestruct);
struct ngd_connection {
SLIST_ENTRY(ngd_connection) links;
- dev_t ngddev;
+ struct cdev *ngddev;
struct ng_hook *active_hook;
char *readq;
int loc;
@@ -412,7 +412,7 @@ ng_device_disconnect(hook_p hook)
* the device is opened
*/
static int
-ngdopen(dev_t dev, int flag, int mode, struct thread *td)
+ngdopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
#ifdef NGD_DEBUG
@@ -426,7 +426,7 @@ ngdopen(dev_t dev, int flag, int mode, struct thread *td)
* the device is closed
*/
static int
-ngdclose(dev_t dev, int flag, int mode, struct thread *td)
+ngdclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
#ifdef NGD_DEBUG
@@ -444,7 +444,7 @@ ngdclose(dev_t dev, int flag, int mode, struct thread *td)
*
*/
static int
-ngdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+ngdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct ngd_softc *sc = &ngd_softc;
struct ngd_connection * connection = NULL;
@@ -496,7 +496,7 @@ nomsg:
* uiomove.
*/
static int
-ngdread(dev_t dev, struct uio *uio, int flag)
+ngdread(struct cdev *dev, struct uio *uio, int flag)
{
int ret = 0, amnt;
char buffer[uio->uio_resid+1];
@@ -547,7 +547,7 @@ error:
*
*/
static int
-ngdwrite(dev_t dev, struct uio *uio, int flag)
+ngdwrite(struct cdev *dev, struct uio *uio, int flag)
{
int ret;
int error = 0;
@@ -597,7 +597,7 @@ error:
* check if there is data available for read
*/
static int
-ngdpoll(dev_t dev, int events, struct thread *td)
+ngdpoll(struct cdev *dev, int events, struct thread *td)
{
int revents = 0;
struct ngd_softc *sc = &ngd_softc;
diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c
index 186cad6..0ce67a5 100644
--- a/sys/netgraph/ng_tty.c
+++ b/sys/netgraph/ng_tty.c
@@ -115,7 +115,7 @@ typedef struct ngt_sc *sc_p;
#endif
/* Line discipline methods */
-static int ngt_open(dev_t dev, struct tty *tp);
+static int ngt_open(struct cdev *dev, struct tty *tp);
static int ngt_close(struct tty *tp, int flag);
static int ngt_read(struct tty *tp, struct uio *uio, int flag);
static int ngt_write(struct tty *tp, struct uio *uio, int flag);
@@ -180,7 +180,7 @@ static int ngt_ldisc;
* Called from device open routine or ttioctl() at >= splsofttty()
*/
static int
-ngt_open(dev_t dev, struct tty *tp)
+ngt_open(struct cdev *dev, struct tty *tp)
{
struct thread *const td = curthread; /* XXX */
char name[sizeof(NG_TTY_NODE_TYPE) + 8];
diff --git a/sys/netncp/ncp_mod.c b/sys/netncp/ncp_mod.c
index 497e203..83e9708 100644
--- a/sys/netncp/ncp_mod.c
+++ b/sys/netncp/ncp_mod.c
@@ -62,7 +62,7 @@ SYSCTL_INT(_net_ncp, OID_AUTO, version, CTLFLAG_RD, &ncp_version, 0, "");
MODULE_VERSION(ncp, 1);
MODULE_DEPEND(ncp, libmchain, 1, 1, 1);
-static dev_t ncp_dev;
+static struct cdev *ncp_dev;
static d_ioctl_t ncp_ioctl;
@@ -82,7 +82,7 @@ static int sncp_connect(struct thread *, struct ncpioc_connect *);
static int sncp_request(struct thread *, struct ncpioc_request *);
static int
-ncp_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+ncp_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
switch (cmd) {
diff --git a/sys/netsmb/smb_dev.c b/sys/netsmb/smb_dev.c
index 16e4819..78a6068 100644
--- a/sys/netsmb/smb_dev.c
+++ b/sys/netsmb/smb_dev.c
@@ -99,7 +99,7 @@ static struct cdevsw nsmb_cdevsw = {
static eventhandler_tag nsmb_dev_tag;
static void
-nsmb_dev_clone(void *arg, char *name, int namelen, dev_t *dev)
+nsmb_dev_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
int u;
@@ -112,7 +112,7 @@ nsmb_dev_clone(void *arg, char *name, int namelen, dev_t *dev)
}
static int
-nsmb_dev_open(dev_t dev, int oflags, int devtype, struct thread *td)
+nsmb_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
struct smb_dev *sdp;
struct ucred *cred = td->td_ucred;
@@ -146,7 +146,7 @@ nsmb_dev_open(dev_t dev, int oflags, int devtype, struct thread *td)
}
static int
-nsmb_dev_close(dev_t dev, int flag, int fmt, struct thread *td)
+nsmb_dev_close(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct smb_dev *sdp;
struct smb_vc *vcp;
@@ -180,7 +180,7 @@ nsmb_dev_close(dev_t dev, int flag, int fmt, struct thread *td)
static int
-nsmb_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+nsmb_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct smb_dev *sdp;
struct smb_vc *vcp;
@@ -385,7 +385,7 @@ smb_dev2share(int fd, int mode, struct smb_cred *scred,
struct vnode *vp;
struct smb_dev *sdp;
struct smb_share *ssp;
- dev_t dev;
+ struct cdev *dev;
int error;
fp = nsmb_getfp(scred->scr_td->td_proc->p_fd, fd, FREAD | FWRITE);
diff --git a/sys/nfs4client/nfs4_dev.c b/sys/nfs4client/nfs4_dev.c
index 645c4ea..b675e55 100644
--- a/sys/nfs4client/nfs4_dev.c
+++ b/sys/nfs4client/nfs4_dev.c
@@ -75,7 +75,7 @@ struct nfs4dev_upcall {
static int nfs4dev_nopen = 0;
static struct thread * nfs4dev_reader = NULL;
-static dev_t nfs4device = 0;
+static struct cdev *nfs4device = 0;
static struct mtx nfs4dev_daemon_mtx;
static int nfs4dev_xid = 0;
@@ -252,7 +252,7 @@ nfs4dev_uninit(void)
/* device interface functions */
static int
-nfs4dev_open(dev_t dev, int flags, int fmt, d_thread_t *td)
+nfs4dev_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
{
if (dev != nfs4device)
return ENODEV;
@@ -271,7 +271,7 @@ nfs4dev_open(dev_t dev, int flags, int fmt, d_thread_t *td)
}
static int
-nfs4dev_close(dev_t dev, int flags, int fmt, d_thread_t *td)
+nfs4dev_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
{
struct nfs4dev_upcall * u;
@@ -303,7 +303,7 @@ nfs4dev_close(dev_t dev, int flags, int fmt, d_thread_t *td)
}
static int
-nfs4dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
+nfs4dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
{
int error;
@@ -333,7 +333,7 @@ nfs4dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
}
static int
-nfs4dev_poll(dev_t dev, int events, struct thread *td)
+nfs4dev_poll(struct cdev *dev, int events, struct thread *td)
{
int revents;
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
index 9feb48b..9b0da7c 100644
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -712,25 +712,25 @@ csefree(struct csession *cse)
}
static int
-cryptoopen(dev_t dev, int oflags, int devtype, struct thread *td)
+cryptoopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
return (0);
}
static int
-cryptoread(dev_t dev, struct uio *uio, int ioflag)
+cryptoread(struct cdev *dev, struct uio *uio, int ioflag)
{
return (EIO);
}
static int
-cryptowrite(dev_t dev, struct uio *uio, int ioflag)
+cryptowrite(struct cdev *dev, struct uio *uio, int ioflag)
{
return (EIO);
}
static int
-cryptoioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
+cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
{
struct file *f;
struct fcrypt *fcr;
@@ -775,7 +775,7 @@ static struct cdevsw crypto_cdevsw = {
.d_name = "crypto",
.d_maj = CRYPTO_MAJOR,
};
-static dev_t crypto_dev;
+static struct cdev *crypto_dev;
/*
* Initialization code, both for static and dynamic loading.
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c
index dc6668a..a8ed556 100644
--- a/sys/pc98/cbus/fdc.c
+++ b/sys/pc98/cbus/fdc.c
@@ -379,7 +379,7 @@ struct fd_data {
struct callout_handle toffhandle;
struct callout_handle tohandle;
struct devstat *device_stats;
- dev_t masterdev;
+ struct cdev *masterdev;
device_t dev;
fdu_t fdu;
#ifdef PC98
@@ -532,11 +532,11 @@ static timeout_t fd_iotimeout;
static timeout_t fd_pseudointr;
static driver_intr_t fdc_intr;
static int fdcpio(fdc_p, long, caddr_t, u_int);
-static int fdautoselect(dev_t);
+static int fdautoselect(struct cdev *);
static int fdstate(struct fdc_data *);
static int retrier(struct fdc_data *);
static void fdbiodone(struct bio *);
-static int fdmisccmd(dev_t, u_int, void *);
+static int fdmisccmd(struct cdev *, u_int, void *);
static d_ioctl_t fdioctl;
static int fifo_threshold = 8; /* XXX: should be accessible via sysctl */
@@ -1881,7 +1881,7 @@ out_fdc(struct fdc_data *fdc, int x)
* auxiliary functions).
*/
static int
-fdopen(dev_t dev, int flags, int mode, struct thread *td)
+fdopen(struct cdev *dev, int flags, int mode, struct thread *td)
{
fd_p fd;
fdc_p fdc;
@@ -1985,7 +1985,7 @@ fdopen(dev_t dev, int flags, int mode, struct thread *td)
}
static int
-fdclose(dev_t dev, int flags, int mode, struct thread *td)
+fdclose(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct fd_data *fd;
@@ -2184,7 +2184,7 @@ fdcpio(fdc_p fdc, long flags, caddr_t addr, u_int count)
* Try figuring out the density of the media present in our device.
*/
static int
-fdautoselect(dev_t dev)
+fdautoselect(struct cdev *dev)
{
fd_p fd;
struct fd_type *fdtp;
@@ -2993,7 +2993,7 @@ fdbiodone(struct bio *bp)
}
static int
-fdmisccmd(dev_t dev, u_int cmd, void *data)
+fdmisccmd(struct cdev *dev, u_int cmd, void *data)
{
fdu_t fdu;
fd_p fd;
@@ -3044,7 +3044,7 @@ fdmisccmd(dev_t dev, u_int cmd, void *data)
}
static int
-fdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+fdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
fdu_t fdu;
fd_p fd;
diff --git a/sys/pc98/cbus/gdc.c b/sys/pc98/cbus/gdc.c
index eca0454..a22ad99 100644
--- a/sys/pc98/cbus/gdc.c
+++ b/sys/pc98/cbus/gdc.c
@@ -346,7 +346,7 @@ gdc_release_resource(device_t dev)
#ifdef FB_INSTALL_CDEV
static int
-gdcopen(dev_t dev, int flag, int mode, struct thread *td)
+gdcopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
gdc_softc_t *sc;
@@ -360,7 +360,7 @@ gdcopen(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-gdcclose(dev_t dev, int flag, int mode, struct thread *td)
+gdcclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
gdc_softc_t *sc;
@@ -369,7 +369,7 @@ gdcclose(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-gdcread(dev_t dev, struct uio *uio, int flag)
+gdcread(struct cdev *dev, struct uio *uio, int flag)
{
gdc_softc_t *sc;
@@ -378,7 +378,7 @@ gdcread(dev_t dev, struct uio *uio, int flag)
}
static int
-gdcwrite(dev_t dev, struct uio *uio, int flag)
+gdcwrite(struct cdev *dev, struct uio *uio, int flag)
{
gdc_softc_t *sc;
@@ -387,7 +387,7 @@ gdcwrite(dev_t dev, struct uio *uio, int flag)
}
static int
-gdcioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
+gdcioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
gdc_softc_t *sc;
@@ -396,7 +396,7 @@ gdcioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
}
static int
-gdcmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+gdcmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
gdc_softc_t *sc;
diff --git a/sys/pc98/cbus/olpt.c b/sys/pc98/cbus/olpt.c
index 49e78e0..dc523db 100644
--- a/sys/pc98/cbus/olpt.c
+++ b/sys/pc98/cbus/olpt.c
@@ -466,7 +466,7 @@ lpt_attach(device_t dev)
*/
static int
-lptopen (dev_t dev, int flags, int fmt, struct thread *td)
+lptopen (struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct lpt_softc *sc;
int s;
@@ -605,7 +605,7 @@ lptout (void *arg)
*/
static int
-lptclose(dev_t dev, int flags, int fmt, struct thread *td)
+lptclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct lpt_softc *sc;
#ifndef PC98
@@ -718,7 +718,7 @@ pushbytes(struct lpt_softc * sc)
*/
static int
-lptwrite(dev_t dev, struct uio * uio, int ioflag)
+lptwrite(struct cdev *dev, struct uio * uio, int ioflag)
{
register unsigned n;
int pl, err;
@@ -776,7 +776,7 @@ lpt_intr(void *arg)
}
static int
-lptioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+lptioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
int error = 0;
struct lpt_softc *sc;
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index 708c4a7..9a98b65 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -351,7 +351,7 @@ struct com_s {
struct resource *ioportres;
int ioportrid;
void *cookie;
- dev_t devs[6];
+ struct cdev *devs[6];
/*
* Data area for output buffers. Someday we should build the output
@@ -452,13 +452,13 @@ static int sysclock;
#define IS_8251(if_type) (!(if_type & 0x10))
#define COM1_EXT_CLOCK 0x40000
-static void commint(dev_t dev);
+static void commint(struct cdev *dev);
static void com_tiocm_set(struct com_s *com, int msr);
static void com_tiocm_bis(struct com_s *com, int msr);
static void com_tiocm_bic(struct com_s *com, int msr);
static int com_tiocm_get(struct com_s *com);
static int com_tiocm_get_delta(struct com_s *com);
-static void pc98_msrint_start(dev_t dev);
+static void pc98_msrint_start(struct cdev *dev);
static void com_cflag_and_speed_set(struct com_s *com, int cflag, int speed);
static int pc98_ttspeedtab(struct com_s *com, int speed, u_int *divisor);
static int pc98_get_modem_status(struct com_s *com);
@@ -1847,7 +1847,7 @@ determined_type: ;
static int
sioopen(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -2080,7 +2080,7 @@ out:
static int
sioclose(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -2221,7 +2221,7 @@ comhardclose(com)
static int
sioread(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -2239,7 +2239,7 @@ sioread(dev, uio, flag)
static int
siowrite(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -2934,7 +2934,7 @@ txrdy:
static int
sioioctl(dev, cmd, data, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t data;
int flag;
@@ -3861,7 +3861,7 @@ comwakeup(chan)
#ifdef PC98
/* commint is called when modem control line changes */
static void
-commint(dev_t dev)
+commint(struct cdev *dev)
{
register struct tty *tp;
int stat,delta;
@@ -4551,9 +4551,9 @@ pc98_check_msr(void* chan)
struct com_s *com;
int mynor;
int unit;
- dev_t dev;
+ struct cdev *dev;
- dev=(dev_t)chan;
+ dev=(struct cdev *)chan;
mynor = minor(dev);
unit = MINOR_TO_UNIT(mynor);
com = com_addr(unit);
@@ -4591,7 +4591,7 @@ pc98_check_msr(void* chan)
}
static void
-pc98_msrint_start(dev_t dev)
+pc98_msrint_start(struct cdev *dev)
{
struct com_s *com;
int mynor;
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index a3a0b97..315b4d3 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -1232,9 +1232,9 @@ SYSCTL_STRUCT(_machdep, CPU_BOOTINFO, bootinfo,
SYSCTL_INT(_machdep, CPU_WALLCLOCK, wall_cmos_clock,
CTLFLAG_RW, &wall_cmos_clock, 0, "");
-u_long bootdev; /* not a dev_t - encoding is different */
+u_long bootdev; /* not a struct cdev *- encoding is different */
SYSCTL_ULONG(_machdep, OID_AUTO, guessed_bootdev,
- CTLFLAG_RD, &bootdev, 0, "Maybe the Boot device (not in dev_t format)");
+ CTLFLAG_RD, &bootdev, 0, "Maybe the Boot device (not in struct cdev *format)");
/*
* Initialize 386 and configure to run kernel
diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c
index dc6668a..a8ed556 100644
--- a/sys/pc98/pc98/fd.c
+++ b/sys/pc98/pc98/fd.c
@@ -379,7 +379,7 @@ struct fd_data {
struct callout_handle toffhandle;
struct callout_handle tohandle;
struct devstat *device_stats;
- dev_t masterdev;
+ struct cdev *masterdev;
device_t dev;
fdu_t fdu;
#ifdef PC98
@@ -532,11 +532,11 @@ static timeout_t fd_iotimeout;
static timeout_t fd_pseudointr;
static driver_intr_t fdc_intr;
static int fdcpio(fdc_p, long, caddr_t, u_int);
-static int fdautoselect(dev_t);
+static int fdautoselect(struct cdev *);
static int fdstate(struct fdc_data *);
static int retrier(struct fdc_data *);
static void fdbiodone(struct bio *);
-static int fdmisccmd(dev_t, u_int, void *);
+static int fdmisccmd(struct cdev *, u_int, void *);
static d_ioctl_t fdioctl;
static int fifo_threshold = 8; /* XXX: should be accessible via sysctl */
@@ -1881,7 +1881,7 @@ out_fdc(struct fdc_data *fdc, int x)
* auxiliary functions).
*/
static int
-fdopen(dev_t dev, int flags, int mode, struct thread *td)
+fdopen(struct cdev *dev, int flags, int mode, struct thread *td)
{
fd_p fd;
fdc_p fdc;
@@ -1985,7 +1985,7 @@ fdopen(dev_t dev, int flags, int mode, struct thread *td)
}
static int
-fdclose(dev_t dev, int flags, int mode, struct thread *td)
+fdclose(struct cdev *dev, int flags, int mode, struct thread *td)
{
struct fd_data *fd;
@@ -2184,7 +2184,7 @@ fdcpio(fdc_p fdc, long flags, caddr_t addr, u_int count)
* Try figuring out the density of the media present in our device.
*/
static int
-fdautoselect(dev_t dev)
+fdautoselect(struct cdev *dev)
{
fd_p fd;
struct fd_type *fdtp;
@@ -2993,7 +2993,7 @@ fdbiodone(struct bio *bp)
}
static int
-fdmisccmd(dev_t dev, u_int cmd, void *data)
+fdmisccmd(struct cdev *dev, u_int cmd, void *data)
{
fdu_t fdu;
fd_p fd;
@@ -3044,7 +3044,7 @@ fdmisccmd(dev_t dev, u_int cmd, void *data)
}
static int
-fdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+fdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
fdu_t fdu;
fd_p fd;
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index a3a0b97..315b4d3 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -1232,9 +1232,9 @@ SYSCTL_STRUCT(_machdep, CPU_BOOTINFO, bootinfo,
SYSCTL_INT(_machdep, CPU_WALLCLOCK, wall_cmos_clock,
CTLFLAG_RW, &wall_cmos_clock, 0, "");
-u_long bootdev; /* not a dev_t - encoding is different */
+u_long bootdev; /* not a struct cdev *- encoding is different */
SYSCTL_ULONG(_machdep, OID_AUTO, guessed_bootdev,
- CTLFLAG_RD, &bootdev, 0, "Maybe the Boot device (not in dev_t format)");
+ CTLFLAG_RD, &bootdev, 0, "Maybe the Boot device (not in struct cdev *format)");
/*
* Initialize 386 and configure to run kernel
diff --git a/sys/pc98/pc98/mse.c b/sys/pc98/pc98/mse.c
index 1639314..9b8b83b 100644
--- a/sys/pc98/pc98/mse.c
+++ b/sys/pc98/pc98/mse.c
@@ -93,8 +93,8 @@ typedef struct mse_softc {
u_char sc_bytes[MOUSE_SYS_PACKETSIZE];
struct callout_handle sc_callout;
int sc_watchdog;
- dev_t sc_dev;
- dev_t sc_ndev;
+ struct cdev *sc_dev;
+ struct cdev *sc_ndev;
mousehw_t hw;
mousemode_t mode;
mousestatus_t status;
@@ -446,7 +446,7 @@ mse_detach(dev)
*/
static int
mseopen(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -486,7 +486,7 @@ mseopen(dev, flags, fmt, td)
*/
static int
mseclose(dev, flags, fmt, td)
- dev_t dev;
+ struct cdev *dev;
int flags;
int fmt;
struct thread *td;
@@ -510,7 +510,7 @@ mseclose(dev, flags, fmt, td)
*/
static int
mseread(dev, uio, ioflag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int ioflag;
{
@@ -577,7 +577,7 @@ mseread(dev, uio, ioflag)
*/
static int
mseioctl(dev, cmd, addr, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t addr;
int flag;
@@ -694,7 +694,7 @@ mseioctl(dev, cmd, addr, flag, td)
*/
static int
msepoll(dev, events, td)
- dev_t dev;
+ struct cdev *dev;
int events;
struct thread *td;
{
@@ -727,10 +727,10 @@ static void
msetimeout(arg)
void *arg;
{
- dev_t dev;
+ struct cdev *dev;
mse_softc_t *sc;
- dev = (dev_t)arg;
+ dev = (struct cdev *)arg;
sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev));
if (sc->sc_watchdog) {
if (bootverbose)
diff --git a/sys/pc98/pc98/olpt.c b/sys/pc98/pc98/olpt.c
index 49e78e0..dc523db 100644
--- a/sys/pc98/pc98/olpt.c
+++ b/sys/pc98/pc98/olpt.c
@@ -466,7 +466,7 @@ lpt_attach(device_t dev)
*/
static int
-lptopen (dev_t dev, int flags, int fmt, struct thread *td)
+lptopen (struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct lpt_softc *sc;
int s;
@@ -605,7 +605,7 @@ lptout (void *arg)
*/
static int
-lptclose(dev_t dev, int flags, int fmt, struct thread *td)
+lptclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct lpt_softc *sc;
#ifndef PC98
@@ -718,7 +718,7 @@ pushbytes(struct lpt_softc * sc)
*/
static int
-lptwrite(dev_t dev, struct uio * uio, int ioflag)
+lptwrite(struct cdev *dev, struct uio * uio, int ioflag)
{
register unsigned n;
int pl, err;
@@ -776,7 +776,7 @@ lpt_intr(void *arg)
}
static int
-lptioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
+lptioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td)
{
int error = 0;
struct lpt_softc *sc;
diff --git a/sys/pc98/pc98/pc98gdc.c b/sys/pc98/pc98/pc98gdc.c
index eca0454..a22ad99 100644
--- a/sys/pc98/pc98/pc98gdc.c
+++ b/sys/pc98/pc98/pc98gdc.c
@@ -346,7 +346,7 @@ gdc_release_resource(device_t dev)
#ifdef FB_INSTALL_CDEV
static int
-gdcopen(dev_t dev, int flag, int mode, struct thread *td)
+gdcopen(struct cdev *dev, int flag, int mode, struct thread *td)
{
gdc_softc_t *sc;
@@ -360,7 +360,7 @@ gdcopen(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-gdcclose(dev_t dev, int flag, int mode, struct thread *td)
+gdcclose(struct cdev *dev, int flag, int mode, struct thread *td)
{
gdc_softc_t *sc;
@@ -369,7 +369,7 @@ gdcclose(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-gdcread(dev_t dev, struct uio *uio, int flag)
+gdcread(struct cdev *dev, struct uio *uio, int flag)
{
gdc_softc_t *sc;
@@ -378,7 +378,7 @@ gdcread(dev_t dev, struct uio *uio, int flag)
}
static int
-gdcwrite(dev_t dev, struct uio *uio, int flag)
+gdcwrite(struct cdev *dev, struct uio *uio, int flag)
{
gdc_softc_t *sc;
@@ -387,7 +387,7 @@ gdcwrite(dev_t dev, struct uio *uio, int flag)
}
static int
-gdcioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
+gdcioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
{
gdc_softc_t *sc;
@@ -396,7 +396,7 @@ gdcioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
}
static int
-gdcmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+gdcmmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
gdc_softc_t *sc;
diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c
index 708c4a7..9a98b65 100644
--- a/sys/pc98/pc98/sio.c
+++ b/sys/pc98/pc98/sio.c
@@ -351,7 +351,7 @@ struct com_s {
struct resource *ioportres;
int ioportrid;
void *cookie;
- dev_t devs[6];
+ struct cdev *devs[6];
/*
* Data area for output buffers. Someday we should build the output
@@ -452,13 +452,13 @@ static int sysclock;
#define IS_8251(if_type) (!(if_type & 0x10))
#define COM1_EXT_CLOCK 0x40000
-static void commint(dev_t dev);
+static void commint(struct cdev *dev);
static void com_tiocm_set(struct com_s *com, int msr);
static void com_tiocm_bis(struct com_s *com, int msr);
static void com_tiocm_bic(struct com_s *com, int msr);
static int com_tiocm_get(struct com_s *com);
static int com_tiocm_get_delta(struct com_s *com);
-static void pc98_msrint_start(dev_t dev);
+static void pc98_msrint_start(struct cdev *dev);
static void com_cflag_and_speed_set(struct com_s *com, int cflag, int speed);
static int pc98_ttspeedtab(struct com_s *com, int speed, u_int *divisor);
static int pc98_get_modem_status(struct com_s *com);
@@ -1847,7 +1847,7 @@ determined_type: ;
static int
sioopen(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -2080,7 +2080,7 @@ out:
static int
sioclose(dev, flag, mode, td)
- dev_t dev;
+ struct cdev *dev;
int flag;
int mode;
struct thread *td;
@@ -2221,7 +2221,7 @@ comhardclose(com)
static int
sioread(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -2239,7 +2239,7 @@ sioread(dev, uio, flag)
static int
siowrite(dev, uio, flag)
- dev_t dev;
+ struct cdev *dev;
struct uio *uio;
int flag;
{
@@ -2934,7 +2934,7 @@ txrdy:
static int
sioioctl(dev, cmd, data, flag, td)
- dev_t dev;
+ struct cdev *dev;
u_long cmd;
caddr_t data;
int flag;
@@ -3861,7 +3861,7 @@ comwakeup(chan)
#ifdef PC98
/* commint is called when modem control line changes */
static void
-commint(dev_t dev)
+commint(struct cdev *dev)
{
register struct tty *tp;
int stat,delta;
@@ -4551,9 +4551,9 @@ pc98_check_msr(void* chan)
struct com_s *com;
int mynor;
int unit;
- dev_t dev;
+ struct cdev *dev;
- dev=(dev_t)chan;
+ dev=(struct cdev *)chan;
mynor = minor(dev);
unit = MINOR_TO_UNIT(mynor);
com = com_addr(unit);
@@ -4591,7 +4591,7 @@ pc98_check_msr(void* chan)
}
static void
-pc98_msrint_start(dev_t dev)
+pc98_msrint_start(struct cdev *dev)
{
struct com_s *com;
int mynor;
diff --git a/sys/pc98/pc98/wd_cd.c b/sys/pc98/pc98/wd_cd.c
index ef508c0..5ac001e 100644
--- a/sys/pc98/pc98/wd_cd.c
+++ b/sys/pc98/pc98/wd_cd.c
@@ -97,7 +97,7 @@ struct acd *
acd_init_lun(struct atapi *ata, int unit, struct atapi_params *ap, int lun)
{
struct acd *ptr;
- dev_t pdev;
+ struct cdev *pdev;
if (!(ptr = malloc(sizeof(struct acd), M_TEMP, M_NOWAIT | M_ZERO)))
return NULL;
@@ -360,7 +360,7 @@ acd_describe(struct acd *cdp)
}
static int
-acdopen(dev_t dev, int flags, int fmt, struct thread *td)
+acdopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct acd *cdp;
@@ -385,7 +385,7 @@ acdopen(dev_t dev, int flags, int fmt, struct thread *td)
}
int
-acdclose(dev_t dev, int flags, int fmt, struct thread *td)
+acdclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct acd *cdp = dev->si_drv1;
@@ -550,7 +550,7 @@ msf2lba(u_char m, u_char s, u_char f)
}
int
-acdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+acdioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
struct acd *cdp = dev->si_drv1;
int error = 0;
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index b4d15ff..876c241 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -349,7 +349,7 @@ pccard_event(struct slot *slt, enum card_event event)
* Device driver interface.
*/
static int
-crdopen(dev_t dev, int oflags, int devtype, d_thread_t *td)
+crdopen(struct cdev *dev, int oflags, int devtype, d_thread_t *td)
{
struct slot *slt = PCCARD_DEV2SOFTC(dev);
@@ -365,7 +365,7 @@ crdopen(dev_t dev, int oflags, int devtype, d_thread_t *td)
* slots may be assigned to drivers already.
*/
static int
-crdclose(dev_t dev, int fflag, int devtype, d_thread_t *td)
+crdclose(struct cdev *dev, int fflag, int devtype, d_thread_t *td)
{
return (0);
}
@@ -375,7 +375,7 @@ crdclose(dev_t dev, int fflag, int devtype, d_thread_t *td)
* then transfer to user space.
*/
static int
-crdread(dev_t dev, struct uio *uio, int ioflag)
+crdread(struct cdev *dev, struct uio *uio, int ioflag)
{
struct slot *slt = PCCARD_DEV2SOFTC(dev);
struct mem_desc *mp, oldmap;
@@ -421,7 +421,7 @@ crdread(dev_t dev, struct uio *uio, int ioflag)
* window is used.
*/
static int
-crdwrite(dev_t dev, struct uio *uio, int ioflag)
+crdwrite(struct cdev *dev, struct uio *uio, int ioflag)
{
struct slot *slt = PCCARD_DEV2SOFTC(dev);
struct mem_desc *mp, oldmap;
@@ -466,7 +466,7 @@ crdwrite(dev_t dev, struct uio *uio, int ioflag)
* descriptors, and assignment of drivers.
*/
static int
-crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td)
+crdioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td)
{
u_int32_t addr;
int err;
@@ -667,7 +667,7 @@ crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td)
* when a change in card status occurs.
*/
static int
-crdpoll(dev_t dev, int events, d_thread_t *td)
+crdpoll(struct cdev *dev, int events, d_thread_t *td)
{
int revents = 0;
int s;
diff --git a/sys/pccard/slot.h b/sys/pccard/slot.h
index ff248ae..a910983 100644
--- a/sys/pccard/slot.h
+++ b/sys/pccard/slot.h
@@ -125,7 +125,7 @@ struct slot {
void *cdata; /* Controller specific data */
int pwr_off_pending;/* Power status of slot */
device_t dev; /* Config system device. */
- dev_t d; /* fs device */
+ struct cdev *d; /* fs device */
};
#define PCCARD_DEVICE2SOFTC(d) ((struct slot *) device_get_softc(d))
diff --git a/sys/pci/agp.c b/sys/pci/agp.c
index 46f10a3..239b5bf 100644
--- a/sys/pci/agp.c
+++ b/sys/pci/agp.c
@@ -762,7 +762,7 @@ agp_unbind_user(device_t dev, agp_unbind *unbind)
}
static int
-agp_open(dev_t kdev, int oflags, int devtype, struct thread *td)
+agp_open(struct cdev *kdev, int oflags, int devtype, struct thread *td)
{
device_t dev = KDEV2DEV(kdev);
struct agp_softc *sc = device_get_softc(dev);
@@ -776,7 +776,7 @@ agp_open(dev_t kdev, int oflags, int devtype, struct thread *td)
}
static int
-agp_close(dev_t kdev, int fflag, int devtype, struct thread *td)
+agp_close(struct cdev *kdev, int fflag, int devtype, struct thread *td)
{
device_t dev = KDEV2DEV(kdev);
struct agp_softc *sc = device_get_softc(dev);
@@ -799,7 +799,7 @@ agp_close(dev_t kdev, int fflag, int devtype, struct thread *td)
}
static int
-agp_ioctl(dev_t kdev, u_long cmd, caddr_t data, int fflag, struct thread *td)
+agp_ioctl(struct cdev *kdev, u_long cmd, caddr_t data, int fflag, struct thread *td)
{
device_t dev = KDEV2DEV(kdev);
@@ -834,7 +834,7 @@ agp_ioctl(dev_t kdev, u_long cmd, caddr_t data, int fflag, struct thread *td)
}
static int
-agp_mmap(dev_t kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+agp_mmap(struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
device_t dev = KDEV2DEV(kdev);
struct agp_softc *sc = device_get_softc(dev);
diff --git a/sys/pci/agppriv.h b/sys/pci/agppriv.h
index 6ba4ed6..7e846d1 100644
--- a/sys/pci/agppriv.h
+++ b/sys/pci/agppriv.h
@@ -75,7 +75,7 @@ struct agp_softc {
struct agp_memory_list as_memory; /* list of allocated memory */
int as_nextid; /* next memory block id */
int as_isopen; /* user device is open */
- dev_t as_devnode; /* from make_dev */
+ struct cdev *as_devnode; /* from make_dev */
struct mtx as_lock; /* lock for access to GATT */
};
diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c
index ad5366e..b801916 100644
--- a/sys/pci/if_ti.c
+++ b/sys/pci/if_ti.c
@@ -3121,7 +3121,7 @@ ti_ioctl(ifp, command, data)
}
static int
-ti_open(dev_t dev, int flags, int fmt, struct thread *td)
+ti_open(struct cdev *dev, int flags, int fmt, struct thread *td)
{
struct ti_softc *sc;
@@ -3137,7 +3137,7 @@ ti_open(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-ti_close(dev_t dev, int flag, int fmt, struct thread *td)
+ti_close(struct cdev *dev, int flag, int fmt, struct thread *td)
{
struct ti_softc *sc;
@@ -3156,7 +3156,7 @@ ti_close(dev_t dev, int flag, int fmt, struct thread *td)
* This ioctl routine goes along with the Tigon character device.
*/
static int
-ti_ioctl2(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
+ti_ioctl2(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
{
int error;
struct ti_softc *sc;
diff --git a/sys/pci/if_tireg.h b/sys/pci/if_tireg.h
index 71d9661..3552514 100644
--- a/sys/pci/if_tireg.h
+++ b/sys/pci/if_tireg.h
@@ -1025,7 +1025,7 @@ struct ti_softc {
int ti_txcnt;
struct mtx ti_mtx;
ti_flag_vals ti_flags;
- dev_t dev;
+ struct cdev *dev;
};
#define TI_LOCK(_sc) mtx_lock(&(_sc)->ti_mtx)
diff --git a/sys/pci/xrpu.c b/sys/pci/xrpu.c
index 38014a3..7ec18a5 100644
--- a/sys/pci/xrpu.c
+++ b/sys/pci/xrpu.c
@@ -113,7 +113,7 @@ xrpu_poll_pps(struct timecounter *tc)
}
static int
-xrpu_open(dev_t dev, int flag, int mode, struct thread *td)
+xrpu_open(struct cdev *dev, int flag, int mode, struct thread *td)
{
struct softc *sc = devclass_get_softc(xrpu_devclass, dev2unit(dev));
@@ -124,13 +124,13 @@ xrpu_open(dev_t dev, int flag, int mode, struct thread *td)
}
static int
-xrpu_close(dev_t dev, int flag, int mode, struct thread *td)
+xrpu_close(struct cdev *dev, int flag, int mode, struct thread *td)
{
return (0);
}
static int
-xrpu_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
+xrpu_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
{
struct softc *sc = dev->si_drv1;
if (offset >= 0x1000000)
@@ -140,7 +140,7 @@ xrpu_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot)
}
static int
-xrpu_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *tdr)
+xrpu_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *tdr)
{
struct softc *sc = dev->si_drv1;
int i, error;
diff --git a/sys/powerpc/ofw/ofw_syscons.h b/sys/powerpc/ofw/ofw_syscons.h
index de7308e..5c7f46d 100644
--- a/sys/powerpc/ofw/ofw_syscons.h
+++ b/sys/powerpc/ofw/ofw_syscons.h
@@ -31,7 +31,7 @@
struct ofwfb_softc {
video_adapter_t sc_va;
- dev_t sc_si;
+ struct cdev *sc_si;
phandle_t sc_node;
int sc_console;
diff --git a/sys/security/mac/mac_framework.h b/sys/security/mac/mac_framework.h
index 45abe17..172c8c2 100644
--- a/sys/security/mac/mac_framework.h
+++ b/sys/security/mac/mac_framework.h
@@ -106,6 +106,7 @@ __END_DECLS
* Kernel functions to manage and evaluate labels.
*/
struct bpf_d;
+struct cdev;
struct componentname;
struct devfs_dirent;
struct ifnet;
@@ -178,7 +179,7 @@ void mac_associate_vnode_devfs(struct mount *mp, struct devfs_dirent *de,
struct vnode *vp);
int mac_associate_vnode_extattr(struct mount *mp, struct vnode *vp);
void mac_associate_vnode_singlelabel(struct mount *mp, struct vnode *vp);
-void mac_create_devfs_device(struct mount *mp, dev_t dev,
+void mac_create_devfs_device(struct mount *mp, struct cdev *dev,
struct devfs_dirent *de);
void mac_create_devfs_directory(struct mount *mp, char *dirname,
int dirnamelen, struct devfs_dirent *de);
diff --git a/sys/security/mac/mac_policy.h b/sys/security/mac/mac_policy.h
index 8bcc1be..1748a40 100644
--- a/sys/security/mac/mac_policy.h
+++ b/sys/security/mac/mac_policy.h
@@ -167,7 +167,7 @@ struct mac_policy_ops {
void (*mpo_associate_vnode_singlelabel)(struct mount *mp,
struct label *fslabel, struct vnode *vp,
struct label *vlabel);
- void (*mpo_create_devfs_device)(struct mount *mp, dev_t dev,
+ void (*mpo_create_devfs_device)(struct mount *mp, struct cdev *dev,
struct devfs_dirent *de, struct label *label);
void (*mpo_create_devfs_directory)(struct mount *mp, char *dirname,
int dirnamelen, struct devfs_dirent *de,
diff --git a/sys/security/mac/mac_vfs.c b/sys/security/mac/mac_vfs.c
index efcb710..6472607 100644
--- a/sys/security/mac/mac_vfs.c
+++ b/sys/security/mac/mac_vfs.c
@@ -938,7 +938,7 @@ mac_check_mount_stat(struct ucred *cred, struct mount *mount)
}
void
-mac_create_devfs_device(struct mount *mp, dev_t dev, struct devfs_dirent *de)
+mac_create_devfs_device(struct mount *mp, struct cdev *dev, struct devfs_dirent *de)
{
MAC_PERFORM(create_devfs_device, mp, dev, de, de->de_label);
diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c
index 545ba43..005c967 100644
--- a/sys/security/mac_biba/mac_biba.c
+++ b/sys/security/mac_biba/mac_biba.c
@@ -772,7 +772,7 @@ mac_biba_copy_label(struct label *src, struct label *dest)
* a lot like file system objects.
*/
static void
-mac_biba_create_devfs_device(struct mount *mp, dev_t dev,
+mac_biba_create_devfs_device(struct mount *mp, struct cdev *dev,
struct devfs_dirent *devfs_dirent, struct label *label)
{
struct mac_biba *mac_biba;
diff --git a/sys/security/mac_lomac/mac_lomac.c b/sys/security/mac_lomac/mac_lomac.c
index 9502c05..9d4ef7b 100644
--- a/sys/security/mac_lomac/mac_lomac.c
+++ b/sys/security/mac_lomac/mac_lomac.c
@@ -897,7 +897,7 @@ mac_lomac_copy_label(struct label *src, struct label *dest)
* a lot like file system objects.
*/
static void
-mac_lomac_create_devfs_device(struct mount *mp, dev_t dev,
+mac_lomac_create_devfs_device(struct mount *mp, struct cdev *dev,
struct devfs_dirent *devfs_dirent, struct label *label)
{
struct mac_lomac *mac_lomac;
diff --git a/sys/security/mac_mls/mac_mls.c b/sys/security/mac_mls/mac_mls.c
index 3e883ee..e683790 100644
--- a/sys/security/mac_mls/mac_mls.c
+++ b/sys/security/mac_mls/mac_mls.c
@@ -739,7 +739,7 @@ mac_mls_copy_label(struct label *src, struct label *dest)
* a lot like file system objects.
*/
static void
-mac_mls_create_devfs_device(struct mount *mp, dev_t dev,
+mac_mls_create_devfs_device(struct mount *mp, struct cdev *dev,
struct devfs_dirent *devfs_dirent, struct label *label)
{
struct mac_mls *mac_mls;
diff --git a/sys/security/mac_stub/mac_stub.c b/sys/security/mac_stub/mac_stub.c
index ea113e1..f687488 100644
--- a/sys/security/mac_stub/mac_stub.c
+++ b/sys/security/mac_stub/mac_stub.c
@@ -178,7 +178,7 @@ stub_associate_vnode_singlelabel(struct mount *mp,
}
static void
-stub_create_devfs_device(struct mount *mp, dev_t dev,
+stub_create_devfs_device(struct mount *mp, struct cdev *dev,
struct devfs_dirent *devfs_dirent, struct label *label)
{
diff --git a/sys/security/mac_test/mac_test.c b/sys/security/mac_test/mac_test.c
index 16f1a98..21be155 100644
--- a/sys/security/mac_test/mac_test.c
+++ b/sys/security/mac_test/mac_test.c
@@ -692,7 +692,7 @@ mac_test_associate_vnode_singlelabel(struct mount *mp,
}
static void
-mac_test_create_devfs_device(struct mount *mp, dev_t dev,
+mac_test_create_devfs_device(struct mount *mp, struct cdev *dev,
struct devfs_dirent *devfs_dirent, struct label *label)
{
diff --git a/sys/sparc64/creator/creator.h b/sys/sparc64/creator/creator.h
index 6fa42f7..b3be9e2 100644
--- a/sys/sparc64/creator/creator.h
+++ b/sys/sparc64/creator/creator.h
@@ -142,7 +142,7 @@
struct creator_softc {
video_adapter_t sc_va; /* XXX must be first */
- dev_t sc_si;
+ struct cdev *sc_si;
struct resource *sc_reg[FFB_NREG];
bus_space_tag_t sc_bt[FFB_NREG];
diff --git a/sys/sparc64/creator/creator_upa.c b/sys/sparc64/creator/creator_upa.c
index 255d701..864f0b8 100644
--- a/sys/sparc64/creator/creator_upa.c
+++ b/sys/sparc64/creator/creator_upa.c
@@ -212,19 +212,19 @@ creator_upa_attach(device_t dev)
}
static int
-creator_open(dev_t dev, int flags, int mode, struct thread *td)
+creator_open(struct cdev *dev, int flags, int mode, struct thread *td)
{
return (0);
}
static int
-creator_close(dev_t dev, int flags, int mode, struct thread *td)
+creator_close(struct cdev *dev, int flags, int mode, struct thread *td)
{
return (0);
}
static int
-creator_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
+creator_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags,
struct thread *td)
{
struct creator_softc *sc;
@@ -262,7 +262,7 @@ creator_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
}
static int
-creator_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
+creator_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int prot)
{
struct creator_softc *sc;
struct ffb_map *fm;
diff --git a/sys/sparc64/include/cpu.h b/sys/sparc64/include/cpu.h
index b00280d..6778d04 100644
--- a/sys/sparc64/include/cpu.h
+++ b/sys/sparc64/include/cpu.h
@@ -52,7 +52,7 @@
/*
* CTL_MACHDEP definitions.
*/
-#define CPU_CONSDEV 1 /* dev_t: console terminal device */
+#define CPU_CONSDEV 1 /* struct cdev *: console terminal device */
#define CPU_ADJKERNTZ 2 /* int: timezone offset (seconds) */
#define CPU_DISRTCSET 3 /* int: disable resettodr() call */
#define CPU_BOOTINFO 4 /* struct: bootinfo */
diff --git a/sys/sparc64/sparc64/mem.c b/sys/sparc64/sparc64/mem.c
index fca7c49..d7a1818 100644
--- a/sys/sparc64/sparc64/mem.c
+++ b/sys/sparc64/sparc64/mem.c
@@ -73,7 +73,7 @@
#include <machine/tlb.h>
#include <machine/upa.h>
-static dev_t memdev, kmemdev;
+static struct cdev *memdev, *kmemdev;
static d_open_t mmopen;
static d_close_t mmclose;
@@ -92,14 +92,14 @@ static struct cdevsw mem_cdevsw = {
};
static int
-mmclose(dev_t dev, int flags, int fmt, struct thread *td)
+mmclose(struct cdev *dev, int flags, int fmt, struct thread *td)
{
return (0);
}
static int
-mmopen(dev_t dev, int flags, int fmt, struct thread *td)
+mmopen(struct cdev *dev, int flags, int fmt, struct thread *td)
{
int error;
@@ -120,7 +120,7 @@ mmopen(dev_t dev, int flags, int fmt, struct thread *td)
/*ARGSUSED*/
static int
-mmrw(dev_t dev, struct uio *uio, int flags)
+mmrw(struct cdev *dev, struct uio *uio, int flags)
{
struct iovec *iov;
vm_offset_t eva;
diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index f233c70..478fd41 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -80,12 +80,7 @@ typedef __ct_rune_t __rune_t; /* rune_t (see above) */
typedef __ct_rune_t __wchar_t; /* wchar_t (see above) */
typedef __ct_rune_t __wint_t; /* wint_t (see above) */
-/*
- * dev_t has differing meanings in userland and the kernel.
- */
-#ifdef _KERNEL
-typedef struct cdev *__dev_t;
-#else
+#ifndef _KERNEL
typedef __udev_t __dev_t; /* device number */
#endif
diff --git a/sys/sys/bio.h b/sys/sys/bio.h
index 12a9c0e..be9b20e 100644
--- a/sys/sys/bio.h
+++ b/sys/sys/bio.h
@@ -50,7 +50,7 @@ typedef void bio_task_t(void *);
*/
struct bio {
u_int bio_cmd; /* I/O operation. */
- dev_t bio_dev; /* Device to do I/O on. */
+ struct cdev *bio_dev; /* Device to do I/O on. */
struct disk *bio_disk; /* Valid below geom_disk.c only */
off_t bio_offset; /* Offset into file. */
long bio_bcount; /* Valid bytes in buffer. */
@@ -120,7 +120,7 @@ void bioq_remove(struct bio_queue_head *head, struct bio *bp);
void bio_taskqueue(struct bio *bp, bio_task_t *fund, void *arg);
-int physio(dev_t dev, struct uio *uio, int ioflag);
+int physio(struct cdev *dev, struct uio *uio, int ioflag);
#define physread physio
#define physwrite physio
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index acbd04b..d97db93 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -55,7 +55,7 @@ struct cdev {
#define SI_ALIAS 0x0002 /* carrier of alias name */
#define SI_NAMED 0x0004 /* make_dev{_alias} has been called */
#define SI_CHEAPCLONE 0x0008 /* can be removed_dev'ed when vnode reclaims */
-#define SI_CHILD 0x0010 /* child of another dev_t */
+#define SI_CHILD 0x0010 /* child of another struct cdev **/
#define SI_DEVOPEN 0x0020 /* opened by device */
#define SI_CONSOPEN 0x0040 /* opened by console */
#define SI_DUMPDEV 0x0080 /* is kernel dumpdev */
@@ -72,7 +72,7 @@ struct cdev {
SLIST_HEAD(, vnode) si_hlist;
LIST_HEAD(, cdev) si_children;
LIST_ENTRY(cdev) si_siblings;
- dev_t si_parent;
+ struct cdev *si_parent;
u_int si_inode;
char *si_name;
void *si_drv1, *si_drv2;
@@ -145,18 +145,18 @@ struct clonedevs;
typedef struct thread d_thread_t;
-typedef int d_open_t(dev_t dev, int oflags, int devtype, struct thread *td);
-typedef int d_fdopen_t(dev_t dev, int oflags, struct thread *td, int fdidx);
-typedef int d_close_t(dev_t dev, int fflag, int devtype, struct thread *td);
+typedef int d_open_t(struct cdev *dev, int oflags, int devtype, struct thread *td);
+typedef int d_fdopen_t(struct cdev *dev, int oflags, struct thread *td, int fdidx);
+typedef int d_close_t(struct cdev *dev, int fflag, int devtype, struct thread *td);
typedef void d_strategy_t(struct bio *bp);
-typedef int d_ioctl_t(dev_t dev, u_long cmd, caddr_t data,
+typedef int d_ioctl_t(struct cdev *dev, u_long cmd, caddr_t data,
int fflag, struct thread *td);
-typedef int d_read_t(dev_t dev, struct uio *uio, int ioflag);
-typedef int d_write_t(dev_t dev, struct uio *uio, int ioflag);
-typedef int d_poll_t(dev_t dev, int events, struct thread *td);
-typedef int d_kqfilter_t(dev_t dev, struct knote *kn);
-typedef int d_mmap_t(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr,
+typedef int d_read_t(struct cdev *dev, struct uio *uio, int ioflag);
+typedef int d_write_t(struct cdev *dev, struct uio *uio, int ioflag);
+typedef int d_poll_t(struct cdev *dev, int events, struct thread *td);
+typedef int d_kqfilter_t(struct cdev *dev, struct knote *kn);
+typedef int d_mmap_t(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr,
int nprot);
typedef int dumper_t(
@@ -262,30 +262,30 @@ void clone_setup(struct clonedevs **cdp);
void clone_cleanup(struct clonedevs **);
#define CLONE_UNITMASK 0xfffff
#define CLONE_FLAG0 (CLONE_UNITMASK + 1)
-int clone_create(struct clonedevs **, struct cdevsw *, int *unit, dev_t *dev, u_int extra);
+int clone_create(struct clonedevs **, struct cdevsw *, int *unit, struct cdev **dev, u_int extra);
-int count_dev(dev_t _dev);
-void destroy_dev(dev_t _dev);
-struct cdevsw *devsw(dev_t _dev);
+int count_dev(struct cdev *_dev);
+void destroy_dev(struct cdev *_dev);
+struct cdevsw *devsw(struct cdev *_dev);
void cdevsw_ref(struct cdevsw *);
void cdevsw_rel(struct cdevsw *);
-const char *devtoname(dev_t _dev);
-int dev_named(dev_t _pdev, const char *_name);
-void dev_depends(dev_t _pdev, dev_t _cdev);
-void dev_ref(dev_t dev);
-void dev_rel(dev_t dev);
+const char *devtoname(struct cdev *_dev);
+int dev_named(struct cdev *_pdev, const char *_name);
+void dev_depends(struct cdev *_pdev, struct cdev *_cdev);
+void dev_ref(struct cdev *dev);
+void dev_rel(struct cdev *dev);
void dev_strategy(struct buf *bp);
-dev_t makebdev(int _maj, int _min);
-dev_t make_dev(struct cdevsw *_devsw, int _minor, uid_t _uid, gid_t _gid,
+struct cdev *makebdev(int _maj, int _min);
+struct cdev *make_dev(struct cdevsw *_devsw, int _minor, uid_t _uid, gid_t _gid,
int _perms, const char *_fmt, ...) __printflike(6, 7);
-dev_t make_dev_alias(dev_t _pdev, const char *_fmt, ...) __printflike(2, 3);
-int dev2unit(dev_t _dev);
+struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...) __printflike(2, 3);
+int dev2unit(struct cdev *_dev);
int unit2minor(int _unit);
void setconf(void);
-dev_t getdiskbyname(char *_name);
+struct cdev *getdiskbyname(char *_name);
-void devfs_create(dev_t dev);
-void devfs_destroy(dev_t dev);
+void devfs_create(struct cdev *dev);
+void devfs_destroy(struct cdev *dev);
#define UID_ROOT 0
#define UID_BIN 3
@@ -298,7 +298,7 @@ void devfs_destroy(dev_t dev);
#define GID_GAMES 13
#define GID_DIALER 68
-typedef void (*dev_clone_fn)(void *arg, char *name, int namelen, dev_t *result);
+typedef void (*dev_clone_fn)(void *arg, char *name, int namelen, struct cdev **result);
int dev_stdclone(char *_name, char **_namep, const char *_stem, int *_unit);
EVENTHANDLER_DECLARE(dev_clone, dev_clone_fn);
diff --git a/sys/sys/linedisc.h b/sys/sys/linedisc.h
index c24194d..5c378f7 100644
--- a/sys/sys/linedisc.h
+++ b/sys/sys/linedisc.h
@@ -44,7 +44,7 @@
struct tty;
-typedef int l_open_t(dev_t dev, struct tty *tp);
+typedef int l_open_t(struct cdev *dev, struct tty *tp);
typedef int l_close_t(struct tty *tp, int flag);
typedef int l_read_t(struct tty *tp, struct uio *uio, int flag);
typedef int l_write_t(struct tty *tp, struct uio *uio, int flag);
@@ -81,7 +81,7 @@ l_write_t l_nowrite;
l_ioctl_t l_nullioctl;
static __inline int
-ttyld_open(struct tty *tp, dev_t dev)
+ttyld_open(struct tty *tp, struct cdev *dev)
{
return ((*linesw[tp->t_line]->l_open)(dev, tp));
diff --git a/sys/sys/mac.h b/sys/sys/mac.h
index 45abe17..172c8c2 100644
--- a/sys/sys/mac.h
+++ b/sys/sys/mac.h
@@ -106,6 +106,7 @@ __END_DECLS
* Kernel functions to manage and evaluate labels.
*/
struct bpf_d;
+struct cdev;
struct componentname;
struct devfs_dirent;
struct ifnet;
@@ -178,7 +179,7 @@ void mac_associate_vnode_devfs(struct mount *mp, struct devfs_dirent *de,
struct vnode *vp);
int mac_associate_vnode_extattr(struct mount *mp, struct vnode *vp);
void mac_associate_vnode_singlelabel(struct mount *mp, struct vnode *vp);
-void mac_create_devfs_device(struct mount *mp, dev_t dev,
+void mac_create_devfs_device(struct mount *mp, struct cdev *dev,
struct devfs_dirent *de);
void mac_create_devfs_directory(struct mount *mp, char *dirname,
int dirnamelen, struct devfs_dirent *de);
diff --git a/sys/sys/mac_policy.h b/sys/sys/mac_policy.h
index 8bcc1be..1748a40 100644
--- a/sys/sys/mac_policy.h
+++ b/sys/sys/mac_policy.h
@@ -167,7 +167,7 @@ struct mac_policy_ops {
void (*mpo_associate_vnode_singlelabel)(struct mount *mp,
struct label *fslabel, struct vnode *vp,
struct label *vlabel);
- void (*mpo_create_devfs_device)(struct mount *mp, dev_t dev,
+ void (*mpo_create_devfs_device)(struct mount *mp, struct cdev *dev,
struct devfs_dirent *de, struct label *label);
void (*mpo_create_devfs_directory)(struct mount *mp, char *dirname,
int dirnamelen, struct devfs_dirent *de,
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 07d8d59..e1ab3ce 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -496,7 +496,7 @@ struct netcred *vfs_export_lookup /* lookup host in fs export list */
(struct mount *, struct sockaddr *);
int vfs_allocate_syncvnode(struct mount *);
void vfs_getnewfsid(struct mount *);
-dev_t vfs_getrootfsid(struct mount *);
+struct cdev *vfs_getrootfsid(struct mount *);
struct mount *vfs_getvfs(fsid_t *); /* return vfs given fsid */
int vfs_modevent(module_t, int, void *);
int vfs_mountedon(struct vnode *); /* is a vfs mounted on vp */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index ad72535..67a8e98 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -55,7 +55,7 @@
* scheme is: <major><two digit minor><0 if release branch, otherwise 1>xx
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 502115 /* Master, propagated to newvers */
+#define __FreeBSD_version 502116 /* Master, propagated to newvers */
#ifndef LOCORE
#include <sys/types.h>
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
index c4376da..0f7f4a3 100644
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -44,7 +44,9 @@
/* XXX missing blkcnt_t, blksize_t. */
#ifndef _DEV_T_DECLARED
+#ifndef _KERNEL
typedef __dev_t dev_t;
+#endif
#define _DEV_T_DECLARED
#endif
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 4ebbc71..2165c63 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -351,7 +351,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
#define KERN_BOOTFILE 26 /* string: name of booted kernel */
#define KERN_MAXFILESPERPROC 27 /* int: max open files per proc */
#define KERN_MAXPROCPERUID 28 /* int: max processes per uid */
-#define KERN_DUMPDEV 29 /* dev_t: device to dump on */
+#define KERN_DUMPDEV 29 /* struct cdev *: device to dump on */
#define KERN_IPC 30 /* node: anything related to IPC */
#define KERN_DUMMY 31 /* unused */
#define KERN_PS_STRINGS 32 /* int: address of PS_STRINGS */
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 44c5703..1a06d82 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -63,8 +63,8 @@ extern struct cv selwait; /* select conditional variable */
extern long physmem; /* physical memory */
-extern dev_t rootdev; /* root device */
-extern dev_t rootdevs[2]; /* possible root devices */
+extern struct cdev *rootdev; /* root device */
+extern struct cdev *rootdevs[2]; /* possible root devices */
extern char *rootdevnames[2]; /* names of possible root devices */
extern struct vnode *rootvp; /* vnode equivalent to above */
@@ -311,13 +311,13 @@ void wakeup(void *chan) __nonnull(1);
void wakeup_one(void *chan) __nonnull(1);
/*
- * Common `dev_t' stuff are declared here to avoid #include poisoning
+ * Common `struct cdev *' stuff are declared here to avoid #include poisoning
*/
-int major(dev_t x);
-int minor(dev_t x);
-udev_t dev2udev(dev_t x);
-dev_t udev2dev(udev_t x);
+int major(struct cdev *x);
+int minor(struct cdev *x);
+udev_t dev2udev(struct cdev *x);
+struct cdev *udev2dev(udev_t x);
int uminor(udev_t dev);
int umajor(udev_t dev);
udev_t makeudev(int x, int y);
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index 3dada47..1b8958b 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -81,7 +81,7 @@ struct tty {
long t_outcc; /* Output queue statistics. */
int t_line; /* Interface to device drivers. */
union {
- dev_t t_kdev; /* Device. */
+ struct cdev *t_kdev; /* Device. */
udev_t t_udev; /* Userland (sysctl) instance. */
void *t_devp; /* Keep user/kernel size in sync. */
} ttyu;
@@ -307,7 +307,7 @@ int ttylclose(struct tty *tp, int flag);
int ttyldoptim(struct tty *tp);
struct tty *ttymalloc(struct tty *tp);
int ttymodem(struct tty *tp, int flag);
-int ttyopen(dev_t device, struct tty *tp);
+int ttyopen(struct cdev *device, struct tty *tp);
int ttyref(struct tty *tp);
int ttyrel(struct tty *tp);
int ttysleep(struct tty *tp, void *chan, int pri, char *wmesg, int timo);
diff --git a/sys/sys/types.h b/sys/sys/types.h
index 1cabc3f..87d03d9 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -131,7 +131,9 @@ typedef __critical_t critical_t; /* Critical section value */
typedef __int64_t daddr_t; /* disk address */
#ifndef _DEV_T_DECLARED
+#ifndef _KERNEL
typedef __dev_t dev_t; /* device number or struct cdev */
+#endif
#define _DEV_T_DECLARED
#endif
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 9d5c2db..10df935 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -594,7 +594,7 @@ extern int (*softdep_fsync_hook)(struct vnode *);
extern int (*softdep_process_worklist_hook)(struct mount *);
struct vnode *addaliasu(struct vnode *vp, udev_t nvp_rdev);
-int bdevvp(dev_t dev, struct vnode **vpp);
+int bdevvp(struct cdev *dev, struct vnode **vpp);
/* cache_* may belong in namei.h. */
void cache_enter(struct vnode *dvp, struct vnode *vp,
struct componentname *cnp);
@@ -625,7 +625,7 @@ void vattr_null(struct vattr *vap);
int vcount(struct vnode *vp);
void vdrop(struct vnode *);
void vdropl(struct vnode *);
-int vfinddev(dev_t dev, struct vnode **vpp);
+int vfinddev(struct cdev *dev, struct vnode **vpp);
void vfs_add_vnodeops(const void *);
void vfs_rm_vnodeops(const void *);
int vflush(struct mount *mp, int rootrefs, int flags);
@@ -668,7 +668,7 @@ int vn_rdwr_inchunks(enum uio_rw rw, struct vnode *vp, caddr_t base,
int vn_stat(struct vnode *vp, struct stat *sb, struct ucred *active_cred,
struct ucred *file_cred, struct thread *td);
int vn_start_write(struct vnode *vp, struct mount **mpp, int flags);
-dev_t vn_todev(struct vnode *vp);
+struct cdev *vn_todev(struct vnode *vp);
int vn_write_suspend_wait(struct vnode *vp, struct mount *mp,
int flags);
int vn_writechk(struct vnode *vp);
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index 3974be4..a48ea78 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -1690,7 +1690,7 @@ ffs_blkfree(fs, devvp, bno, size, inum)
ufs2_daddr_t cgblkno;
int i, cg, blk, frags, bbase;
u_int8_t *blksfree;
- dev_t dev;
+ struct cdev *dev;
cg = dtog(fs, bno);
if (devvp->v_type != VCHR) {
@@ -1886,7 +1886,7 @@ ffs_freefile(fs, devvp, ino, mode)
ufs2_daddr_t cgbno;
int error, cg;
u_int8_t *inosused;
- dev_t dev;
+ struct cdev *dev;
cg = ino_to_cg(fs, ino);
if (devvp->v_type != VCHR) {
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 8f205db..f6de659 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -556,7 +556,7 @@ ffs_mountfs(devvp, mp, td)
struct ufsmount *ump;
struct buf *bp;
struct fs *fs;
- dev_t dev;
+ struct cdev *dev;
void *space;
ufs2_daddr_t sblockloc;
int error, i, blks, size, ronly;
@@ -1222,7 +1222,7 @@ ffs_vget(mp, ino, flags, vpp)
struct ufsmount *ump;
struct buf *bp;
struct vnode *vp;
- dev_t dev;
+ struct cdev *dev;
int error;
ump = VFSTOUFS(mp);
diff --git a/sys/ufs/ufs/dinode.h b/sys/ufs/ufs/dinode.h
index cedecd9..78e7e2a 100644
--- a/sys/ufs/ufs/dinode.h
+++ b/sys/ufs/ufs/dinode.h
@@ -131,7 +131,7 @@ struct ufs2_dinode {
* The di_db fields may be overlaid with other information for
* file types that do not have associated disk storage. Block
* and character devices overlay the first data block with their
- * dev_t value. Short symbolic links place their path in the
+ * struct cdev *value. Short symbolic links place their path in the
* di_db area.
*/
#define di_rdev di_db[0]
diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h
index cabad78..56b48f2 100644
--- a/sys/ufs/ufs/ufs_extern.h
+++ b/sys/ufs/ufs/ufs_extern.h
@@ -72,11 +72,11 @@ int ufs_direnter(struct vnode *, struct vnode *, struct direct *,
int ufs_dirremove(struct vnode *, struct inode *, int, int);
int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int);
int ufs_getlbns(struct vnode *, ufs2_daddr_t, struct indir *, int *);
-int ufs_ihashget(dev_t, ino_t, int, struct vnode **);
+int ufs_ihashget(struct cdev *, ino_t, int, struct vnode **);
void ufs_ihashinit(void);
int ufs_ihashins(struct inode *, int, struct vnode **);
struct vnode *
- ufs_ihashlookup(dev_t, ino_t);
+ ufs_ihashlookup(struct cdev *, ino_t);
void ufs_ihashrem(struct inode *);
void ufs_ihashuninit(void);
int ufs_inactive(struct vop_inactive_args *);
diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c
index 6e6f743..ceaae67 100644
--- a/sys/ufs/ufs/ufs_ihash.c
+++ b/sys/ufs/ufs/ufs_ihash.c
@@ -83,7 +83,7 @@ ufs_ihashuninit()
*/
struct vnode *
ufs_ihashlookup(dev, inum)
- dev_t dev;
+ struct cdev *dev;
ino_t inum;
{
struct inode *ip;
@@ -105,7 +105,7 @@ ufs_ihashlookup(dev, inum)
*/
int
ufs_ihashget(dev, inum, flags, vpp)
- dev_t dev;
+ struct cdev *dev;
ino_t inum;
int flags;
struct vnode **vpp;
diff --git a/sys/ufs/ufs/ufsmount.h b/sys/ufs/ufs/ufsmount.h
index 43c2254..6d5352c 100644
--- a/sys/ufs/ufs/ufsmount.h
+++ b/sys/ufs/ufs/ufsmount.h
@@ -59,7 +59,7 @@ struct ufs_extattr_per_mount;
/* This structure describes the UFS specific mount structure data. */
struct ufsmount {
struct mount *um_mountp; /* filesystem vfs structure */
- dev_t um_dev; /* device mounted */
+ struct cdev *um_dev; /* device mounted */
struct vnode *um_devvp; /* block device mounted vnode */
u_long um_fstype; /* type of filesystem */
struct fs *um_fs; /* pointer to superblock */
diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index 4a4c34a..e52d416 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -101,7 +101,7 @@ dev_pager_init()
static vm_object_t
dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff)
{
- dev_t dev;
+ struct cdev *dev;
d_mmap_t *mapfunc;
vm_object_t object;
vm_pindex_t pindex;
@@ -204,7 +204,7 @@ dev_pager_getpages(object, m, count, reqpage)
vm_pindex_t offset;
vm_paddr_t paddr;
vm_page_t page;
- dev_t dev;
+ struct cdev *dev;
int i, ret;
d_mmap_t *mapfunc;
int prot;
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 258ee4d..586ec82 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2441,7 +2441,7 @@ swapgeom_close(struct thread *td, struct swdevt *sw)
struct swh0h0 {
- dev_t dev;
+ struct cdev *dev;
struct vnode *vp;
int error;
};
OpenPOWER on IntegriCloud