Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Dec 1996 17:48:27 -0600
From:      Randy Terbush <randy@zyzzyva.com>
To:        hackers@freebsd.org
Subject:   LKM and MOD_DEV changes in 2.2
Message-ID:  <199612292348.RAA23734@sierra.zyzzyva.com>

next in thread | raw e-mail | index | archive | help
I'm taking a stab at porting Darren Reed's ipfilter to 2.2 and
have run into a snag with some changed macros in the LKM stuff.

Could someone a bit more familiar with LKM explain the differences?

------------------------------------------------------------------------
>From 2.1.6.1:
/usr/include/sys/lkm.h

#define MOD_DEV(name,devtype,devslot,devp)      \
        static struct lkm_dev _module = {       \
                LM_DEV,                         \
                LKM_VERSION,                    \
                name,                           \
                devslot,                        \
                devtype,                        \
                (void *)devp                    \
        };


------------------------------------------------------------------------
>From 2.2:

#define MOD_DEV(name,devtype,devslot,devp)      \
        MOD_DECL(name);                         \
        static struct lkm_dev name ## _module = {       \
                LM_DEV,                         \
                LKM_VERSION,                    \
                #name ## "_mod",                \
                devslot,                        \
                devtype,                        \
                (void *)devp                    \
        }
 

#define MOD_DECL(name)                                                      \
        static int name ## _load __P((struct lkm_table *lkmtp, int cmd));   \
        static int name ## _unload __P((struct lkm_table *lkmtp, int cmd)); \
        int name ## _mod __P((struct lkm_table *lkmtp, int cmd, int ver))   \
                
------------------------------------------------------------------------

It's use in ipfilter:

line 122: MOD_DEV(IPL_VERSION, LM_DT_CHAR, -1, &ipldevsw);


Compiler's response:

gcc -I. -I../..  -DIPFILTER_LKM -DIPFILTER_LOG -D`uname -m` -D__`uname -m`__ -DINET -DKERNEL -D_KERNEL -I/usr/include -I/sys -I/sys/sys -I/sys/arch -DIPL_NAME=\"/dev/ipl\" -c ../../mln_ipl.c -o ml_ipl.o
../../mln_ipl.c:122: parse error before string constant
../../mln_ipl.c:122: parse error before string constant
../../mln_ipl.c:125: conflicting types for `cdevsw'
/usr/include/sys/conf.h:122: previous declaration of `cdevsw'
../../mln_ipl.c: In function `xxxinit':
../../mln_ipl.c:241: `_module' undeclared (first use this function)
../../mln_ipl.c:241: (Each undeclared identifier is reported only once
../../mln_ipl.c:241: for each function it appears in.)
*** Error code 1





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