move DEVICE_POLLING from opt_global.h to opt_polling.h

Matthew Dillon dillon at
Sat Oct 22 09:12:05 PDT 2005

:> :--
:> :Live Free or Die
:>     net/if_var.h has all sorts of conditionals on DEVICE_POLLING.  Either
:net/if_var.h was left out intentionally, since
:1) Size and layout of "struct ifnet" are not changed, no matter
:whether DEVICE_POLLING is defined or not.  So any *.c files that does
:not want DEVICE_POLLING can safely ignore opt_polling.h
:2) Any *.c file that wants DEVICE_POLLING supports will include
:opt_polling.h at its very beginning(at least before net/if.h or
:net/if_var.h).  This will bring in ifnet.if_poll, poll_cmd and various
:polling related functions' declaration.  Again, as pointed out in 1),
:size and layout of "struct ifnet" are not changed.
:3) IMHO, including opt_*.h in system header files will cause trouble
:>     net/if_var.h needs to include opt_polling.h (conditionally on _KERNEL
:>     or KLD_MODULE), or the option has to be left in opt_global.h.
:>     I think there were some recent commits that allow modules to use
:>     the primary opt_*.h files for a compile so its possible that this
:>     won't break the module build, but it would have to be tested.
:If module is not built during kernel building, the primary opt_*.h
:will not be used.  This is the main reason that I want to put
:DEVICE_POLLING in a seperate opt_x.h
:Best Regards,
:Live Free or Die

    Allright, its fine then, though I would appreciate it if you would 
    add a comment in net/if_var.h (above the first #ifdef on line 108)
    explaining the situation so future programmers do not introduce 
    incompatibilities (e.g. by adding structurally dependant changes).

					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>

More information about the Submit mailing list