asterisk / dahdi-linux

This is the official dahdi-linux repository. All issues and PR should be raised here.
GNU General Public License v2.0
47 stars 69 forks source link

wctc4xxp/base.c:661:54: error: macro "netif_napi_add" passed 4 arguments, but takes just 3 #49

Open Omid-Mohajerani opened 5 months ago

Omid-Mohajerani commented 5 months ago

Hi everyone,

I'm encountering an error while attempting to install Dahdi 3.3.0 on both RHEL 8 and Rocky Linux, using both manual installation and the provided installation script from https://github.com/InterLinked1/phreakscript.Any guidance or assistance to resolve this issue would be greatly appreciated.

  CC [M]  /usr/src/dahdi-linux-3.3.0/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o
/usr/src/dahdi-linux-3.3.0/drivers/dahdi/wctc4xxp/base.c: In function 'wctc4xxp_net_register':
/usr/src/dahdi-linux-3.3.0/drivers/dahdi/wctc4xxp/base.c:661:54: error: macro "netif_napi_add" passed 4 arguments, but takes just 3
  netif_napi_add(netdev, &wc->napi, &wctc4xxp_poll, 64);
                                                      ^
/usr/src/dahdi-linux-3.3.0/drivers/dahdi/wctc4xxp/base.c:661:2: error: 'netif_napi_add' undeclared (first use in this function); did you mean 'netif_napi_del'?
  netif_napi_add(netdev, &wc->napi, &wctc4xxp_poll, 64);
  ^~~~~~~~~~~~~~
  netif_napi_del
/usr/src/dahdi-linux-3.3.0/drivers/dahdi/wctc4xxp/base.c:661:2: note: each undeclared identifier is reported only once for each function it appears in
  LD [M]  /usr/src/dahdi-linux-3.3.0/drivers/dahdi/wct4xxp/wct4xxp.o
At top level:
/usr/src/dahdi-linux-3.3.0/drivers/dahdi/wctc4xxp/base.c:552:1: warning: 'wctc4xxp_poll' defined but not used [-Wunused-function]
 wctc4xxp_poll(struct napi_struct *napi, int budget)
 ^~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:318: /usr/src/dahdi-linux-3.3.0/drivers/dahdi/wctc4xxp/base.o] Error 1
make[2]: *** [scripts/Makefile.build:558: /usr/src/dahdi-linux-3.3.0/drivers/dahdi/wctc4xxp] Error 2
make[2]: *** Waiting for unfinished jobs....
  CC [M]  /usr/src/dahdi-linux-3.3.0/drivers/dahdi/oct612x/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o
  CC [M]  /usr/src/dahdi-linux-3.3.0/drivers/dahdi/wctdm24xxp/base.

Im testing on

Red Hat Enterprise Linux 8.9
4.18.0-513.18.1.el8_9.x86_64
InterLinked1 commented 5 months ago

What version of Rocky Linux were you testing on, 8 or 9? I thought I tested that a few months ago when somebody else was having the issue and resolved that, but if not, I can look into it. I think the patch is already around for that problem but just isn't been detected it needs to be applied.

I have not done any testing of RHEL myself.

Omid-Mohajerani commented 5 months ago

I used Rocky Linux 8 but currently testing RHEL 8.9 - kernel version 4.18.0-513.18.1.el8_9.x86_64

I applied the fix that was mentioned here: https://github.com/asterisk/dahdi-linux/issues/38

and it's working

  CC [M]  /usr/local/src/dahdi-linux/drivers/dahdi/wctc4xxp/base.o
In file included from /usr/local/src/dahdi-linux/drivers/dahdi/wctc4xxp/base.c:41:
/usr/local/src/dahdi-linux/include/dahdi/kernel.h:77: warning: "netif_napi_add" redefined
 #define netif_napi_add netif_napi_add_weight

In file included from ./include/net/inet_sock.h:23,
                 from ./include/linux/udp.h:20,
                 from /usr/local/src/dahdi-linux/drivers/dahdi/wctc4xxp/base.c:38:
./include/linux/netdevice.h:2511: note: this is the location of the previous definition
 #define netif_napi_add(dev, napi, poll) netif_napi_add_weight((dev), (napi), (poll), NAPI_POLL_WEIGHT)

  LD [M]  /usr/local/src/dahdi-linux/drivers/dahdi/wctc4xxp/wctc4xxp.o

But it stops on xbus-core.c:24

CC [M]  /usr/local/src/dahdi-linux/drivers/dahdi/xpp/xbus-core.o
In file included from ./include/linux/module.h:18,
                 from /usr/local/src/dahdi-linux/drivers/dahdi/xpp/xbus-core.c:24:
./include/linux/moduleparam.h:149:27: error: expected ')' before '&' token
  param_check_##type(name, &(value));       \
                           ^
./include/linux/moduleparam.h:129:2: note: in expansion of macro 'module_param_named'
  module_param_named(name, name, type, perm)
  ^~~~~~~~~~~~~~~~~~
/usr/local/src/dahdi-linux/drivers/dahdi/xpp/xpd.h:56:2: note: in expansion of macro 'module_param'
  module_param(name, bool, perm); \
  ^~~~~~~~~~~~
/usr/local/src/dahdi-linux/drivers/dahdi/xpp/xbus-core.c:70:8: note: in expansion of macro 'DEF_PARM_BOOL'
 static DEF_PARM_BOOL(rx_tasklet, 0, 0644, "Use receive tasklets");
        ^~~~~~~~~~~~~
./include/linux/moduleparam.h:150:25: error: 'param_ops__Bool' undeclared here (not in a function); did you mean 'param_ops_bool'?
  module_param_cb(name, &param_ops_##type, &value, perm);     \
                         ^~~~~~~~~~
./include/linux/moduleparam.h:227:39: note: in definition of macro '__module_param_call'
  = { __param_str_##name, THIS_MODULE, ops,   \
                                       ^~~
./include/linux/moduleparam.h:150:2: note: in expansion of macro 'module_param_cb'
  module_param_cb(name, &param_ops_##type, &value, perm);     \
  ^~~~~~~~~~~~~~~
./include/linux/moduleparam.h:129:2: note: in expansion of macro 'module_param_named'
  module_param_named(name, name, type, perm)
  ^~~~~~~~~~~~~~~~~~
/usr/local/src/dahdi-linux/drivers/dahdi/xpp/xpd.h:56:2: note: in expansion of macro 'module_param'
  module_param(name, bool, perm); \
  ^~~~~~~~~~~~
/usr/local/src/dahdi-linux/drivers/dahdi/xpp/xbus-core.c:70:8: note: in expansion of macro 'DEF_PARM_BOOL'
 static DEF_PARM_BOOL(rx_tasklet, 0, 0644, "Use receive tasklets");
        ^~~~~~~~~~~~~
./include/linux/moduleparam.h:149:27: error: expected ')' before '&' token
  param_check_##type(name, &(value));       \
                           ^
./include/linux/moduleparam.h:129:2: note: in expansion of macro 'module_param_named'
  module_param_named(name, name, type, perm)
  ^~~~~~~~~~~~~~~~~~
/usr/local/src/dahdi-linux/drivers/dahdi/xpp/xpd.h:56:2: note: in expansion of macro 'module_param'
  module_param(name, bool, perm); \
  ^~~~~~~~~~~~
/usr/local/src/dahdi-linux/drivers/dahdi/xpp/xbus-core.c:71:8: note: in expansion of macro 'DEF_PARM_BOOL'
 static DEF_PARM_BOOL(dahdi_autoreg, 0, 0444,
        ^~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:318: /usr/local/src/dahdi-linux/drivers/dahdi/xpp/xbus-core.o] Error 1
make[2]: *** [scripts/Makefile.build:558: /usr/local/src/dahdi-linux/drivers/dahdi/xpp] Error 2
make[1]: *** [Makefile:1619: _module_/usr/local/src/dahdi-linux/drivers/dahdi] Error 2
make[1]: Leaving directory '/usr/src/kernels/4.18.0-513.18.1.el8_9.x86_64'
make: *** [Makefile:74: modules] Error 2