Subject: kern/32336: driver(9) out of sync WRT
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <hubert@feyrer.de>
List: netbsd-bugs
Date: 12/19/2005 07:40:00
>Number:         32336
>Category:       kern
>Synopsis:       driver(9) out of sync WRT <sys/conf.h>
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 19 07:40:00 +0000 2005
>Originator:     hubert@feyrer.de
>Release:        NetBSD 2.1
>Organization:
Hubert Feyrer <hubertf@gmx.de>
>Environment:
	
	
System: NetBSD vulab.fh-regensburg.de 2.0 NetBSD 2.0 (GENERIC) #14: Wed Jan 5 20:02:56 CET 2005 feyrer@vulab.fh-regensburg.de:/disk4/cvs/src-2.0/sys/arch/i386/compile/obj.i386/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	The driver(9) manpage describes an interface that is not
	provided by /usr/include/sys/conf.h.

	driver(9):
	     const struct cdevsw foo_cdevsw {
		     int (*d_open)(dev_t, int, int, struct proc *);
		     int (*d_close)(dev_t, int, int, struct proc *);
		     int (*d_read)(dev_t, struct uio *, int);
		     int (*d_write)(dev_t, struct uio *, int);
		     int (*d_ioctl)(dev_t, u_long, caddr_t, int, struct proc *);
		     struct tty *(*d_tty)(dev_t);
		     int (*d_poll)(dev_t, int, struct proc *);
		     paddr_t (*d_mmap)(dev_t, off_t, int);
		     int d_type;
	     };

	/usr/include/sys/conf.h:
		struct cdevsw {
			int             (*d_open)(dev_t, int, int, struct proc *);
			int             (*d_close)(dev_t, int, int, struct proc *);
			int             (*d_read)(dev_t, struct uio *, int);
			int             (*d_write)(dev_t, struct uio *, int);
			int             (*d_ioctl)(dev_t, u_long, caddr_t, int, struct proc *);
	===>		void            (*d_stop)(struct tty *, int);
			struct tty *    (*d_tty)(dev_t);
			int             (*d_poll)(dev_t, int, struct proc *);
			paddr_t         (*d_mmap)(dev_t, off_t, int);
	===>		int             (*d_kqfilter)(dev_t dev, struct knote *kn);
			int             d_type;
		};


>How-To-Repeat:
	Try to figure out how things fit together:
	UTSL, RTFM, and start wondering

>Fix:
	Someone please read through driver.9 and ajust whatever is needed.
	It's probably more than just the two calls above.

	In ther future, keep documentation in sync wwith the code!

>Unformatted: