diff options
| author | Tim J. Robbins <tjr@FreeBSD.org> | 2004-07-16 06:55:34 +0000 |
|---|---|---|
| committer | Tim J. Robbins <tjr@FreeBSD.org> | 2004-07-16 06:55:34 +0000 |
| commit | 5db700e0f50ee52ed41bd1d271c96f6709072adf (patch) | |
| tree | 28f8dcde411cc1104e312d6774c39118fbd05fad /share/examples/kld | |
| parent | 205d3300b85f7e477fa5ee10c0ec91f034d79e6f (diff) | |
Notes
Diffstat (limited to 'share/examples/kld')
| -rw-r--r-- | share/examples/kld/cdev/module/cdev.c | 13 | ||||
| -rw-r--r-- | share/examples/kld/cdev/module/cdevmod.c | 3 |
2 files changed, 9 insertions, 7 deletions
diff --git a/share/examples/kld/cdev/module/cdev.c b/share/examples/kld/cdev/module/cdev.c index 45c3736dc89c..dda63c4fa70e 100644 --- a/share/examples/kld/cdev/module/cdev.c +++ b/share/examples/kld/cdev/module/cdev.c @@ -95,10 +95,10 @@ /* Stores string recv'd by _write() */ static char buf[512+1]; -static int len; +static size_t len; int -mydev_open(dev_t dev, int flag, int otyp, struct thread *td) +mydev_open(struct cdev *dev, int flag, int otyp, struct thread *td) { struct proc *procp = td->td_proc; @@ -110,7 +110,7 @@ mydev_open(dev_t dev, int flag, int otyp, struct thread *td) } int -mydev_close(dev_t dev, int flag, int otyp, struct thread *td) +mydev_close(struct cdev *dev, int flag, int otyp, struct thread *td) { struct proc *procp = td->td_proc; @@ -120,7 +120,8 @@ mydev_close(dev_t dev, int flag, int otyp, struct thread *td) } int -mydev_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct thread *td) +mydev_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int mode, + struct thread *td) { int error = 0; struct proc *procp = td->td_proc; @@ -145,7 +146,7 @@ mydev_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct thread *td) * to buf for later accessing. */ int -mydev_write(dev_t dev, struct uio *uio, int ioflag) +mydev_write(struct cdev *dev, struct uio *uio, int ioflag) { int err = 0; @@ -165,7 +166,7 @@ mydev_write(dev_t dev, struct uio *uio, int ioflag) * accessing. */ int -mydev_read(dev_t dev, struct uio *uio, int ioflag) +mydev_read(struct cdev *dev, struct uio *uio, int ioflag) { int err = 0; diff --git a/share/examples/kld/cdev/module/cdevmod.c b/share/examples/kld/cdev/module/cdevmod.c index ceb6ce053217..0f6f3cbdbb17 100644 --- a/share/examples/kld/cdev/module/cdevmod.c +++ b/share/examples/kld/cdev/module/cdevmod.c @@ -82,6 +82,7 @@ #endif static struct cdevsw my_devsw = { + /* version */ .d_version = D_VERSION, /* open */ .d_open = mydev_open, /* close */ .d_close = mydev_close, /* read */ .d_read = mydev_read, @@ -96,7 +97,7 @@ static struct cdevsw my_devsw = { * in devfs... we must keep this variable sane until we * call kldunload. */ -static dev_t sdev; +static struct cdev *sdev; /* * This function is called each time the module is loaded or unloaded. |
