In message <[EMAIL PROTECTED]>, "Mike Edenfield
" writes:
>I'm working up a patch to the ltmdm to accomodate phk's recent changes to
>cdevsw. I've gotten the module to build and load, but I have two questions
>before I go ahead and submit a pr.
>
>1) I simply removed D_KQFILTER from the list of flags. Based on phk's
>commit message I assumed the flag was simply not needed, and that removing
>it would not break anything. Is this assumption correct? Thus far the
>module is working (it loaded w/out a panic anyway) but I haven't tested it
>very much.
correct. D_KQFILTER was added so that we wouldn't dereference the
d_kqfilter pointer in case it was not there (ie: if the driver was
binary and compiled before the d_kqfilter pointer was added to
cdevsw). It's hacks like this we avoid now.
>2) The patch, which I've included below, only works for -CURRENT with
>rev1.170 of conf.h. I wasn't sure how to get the preprocessor to
>differentiate between -CURRENT before and after this specific revision of a
>specific file. What is the correct way to do this? Or, alternatively,
>should the patch simply assume FreeBSD 5 is the latest -CURRENT and not
>worry about the imcompatibility w/ 5.0-RELEASE?
I have bumped __FreeBSD_version so you can test for this.
But your patch is wrong. Please format the initialization like
you see in all the other device drivers:
static struct cdevsw sio_cdevsw = {
.d_maj = MAJOR_AUTO,
.d_flags = D_TTY,
.d_open = sioopen
etc
etc
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message