Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2005 13:15:34 -0600 (MDT)
From:      Warner Losh <imp@bsdimp.com>
To:        scottl@samsco.org
Cc:        mat@cnd.mcgill.ca
Subject:   Re: What happened to the "d_maj" member of "struct cdevsw" in CURRENT?
Message-ID:  <20050419.131534.41663830.imp@bsdimp.com>
In-Reply-To: <42648C95.3010102@samsco.org>
References:  <20050418232455.2d530890@dolphin.local.net> <42648C95.3010102@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
From: Scott Long <scottl@samsco.org>
Subject: Re: What happened to the "d_maj" member of "struct cdevsw" in CURRENT?
Date: Mon, 18 Apr 2005 22:44:05 -0600

> Conrad J. Sabatier wrote:
> > I've been trying to help Mat Kanner with his yet-to-be-committed MIDI
> > patches, and have run into a perplexing problem on amd64 CURRENT.  It
> > seems the "d_maj" member of "struct cdevsw" no longer exists (in
> > sys/sys/conf.h).  This is causing Mat's MIDI patches to fail with:
> > 
> > 
> > 
> >>===> sound/midi (all)
> >>cc -O -pipe -march=athlon64 -Wno-error -D_KERNEL -DKLD_MODULE
> >>-nostdinc -I-   -include /usr/obj/usr/src/sys/CUSTOM/opt_global.h -I.
> >>-I@ -I@/contrib/altq -I@/../include -finline-limit=8000 -fno-common -g
> >>-fno-omit-frame-pointer -I/usr/obj/usr/src/sys/CUSTOM -mcmodel=kernel
> >>-mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow 
> >>-msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Wall
> >>-Wredundant-decls -Wnested-externs -Wstrict-prototypes 
> >>-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual 
> >>-fformat-extensions -std=c99 -c
> >>/usr/src/sys/modules/sound/midi/../../../dev/sound/midi/midi.c
> >>/usr/src/sys/modules/sound/midi/../../../dev/sound/midi/midi.c:204:
> >>error: unknown field `d_maj' specified in initializer
> > 
> > 
> > When was this member removed, and why?  And how to work around this?
> > 
> > Thanks!
> > 
> 
> Major numbers are now dynamically assigned.  The shims for allowing
> drivers to choose a static major number were removed a few months ago.
> There is no work-around for this; just don't include the field anymore
> in 6-current sources.  If there is something that thinks it needs
> explicit knowledge of major numbers, let me know and we can discuss how
> to fix it.

I have a few drivers I have to maintain on both 5.x and 6.x, and I've
been doing

#ifdef MAJOR_AUTO
	.d_maj = MyMajorHere
#endif

if I care about the major, usually because the driver also has to work
on 4.x too.

However, if you don't have such constraints, just removing it is best.

Warner




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050419.131534.41663830.imp>