
sharing global variables between kernel modules
I'm trying to map certain device registers to a user process, as well
as have a streams driver for the device so the normal TCP/IP stacks
can run over it. Since streams drivers don't support mmap, (no user
context) I wrote a skeletal char. driver to mmap the card registers. I
would like the char. driver to have pointers to the structures in the
streams driver, at least to get where the card is mapped in.
However, it seems like the streams driver and char. driver can't share
global variables, although this works between the kernel proper and
the drivers. I first loaded the streams driver, which declared the
global variables. The loader fails to install the char. driver
however, claiming it can't resolve the shared variables.
The current hack I did was to pass kernel pointers via ioctl's up to a
user process from the streams driver and then back down into the
character driver.
Can the loader resolve when two dynamically loaded modules share global
variables? If not, am I stuck passing them though a user process?
-Rich