[Home]

Summary:DAHLIN-00394: DAHDI with CONFIG_DAHDI_NET fails to compile with kernels >= 5.15
Reporter:Martin Hauke (mnhauke)Labels:
Date Opened:2021-11-28 06:32:22.000-0600Date Closed:
Priority:MajorRegression?
Status:Triage/NewComponents:General
Versions:3.1.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:openSUSE Tumbleweed, kernel 5.15.3, gcc 11.2.1Attachments:
Description:Since the "split out ndo_siowandev ioctl" changset in the upstream kernel  from July DAHDI with CONFIG_DAHDI_NET fails to compile:
https://www.spinics.net/lists/netdev/msg755198.html

{code}
make -C /lib/modules/5.15.3-1-default/build M=/home/mhauke/tmp/DAHDI/linux/drivers/dahdi DAHDI_INCLUDE=/home/mhauke/tmp/DAHDI/linux/include DAHDI_MODULES_EXTRA=" " HOTPLUG_FIRMWARE=yes modules DAHDI_BUILD_ALL=m
make[1]: Verzeichnis „/usr/src/linux-5.15.3-1-obj/x86_64/default“ wird betreten
 CC [M]  /home/mhauke/tmp/DAHDI/linux/drivers/dahdi/dahdi-base.o
>>>> This is the error Harald's patch fixed
>>>> /home/mhauke/tmp/DAHDI/linux/drivers/dahdi/dahdi-base.c: In function ‘dahdi_xmit’:
>>>> /home/mhauke/tmp/DAHDI/linux/drivers/dahdi/dahdi-base.c:2139:20: error: ‘struct net_device’ has no member named >>>> ‘trans_start’
>>>>  2139 |                 dev->trans_start = jiffies;
>>>>      |                    ^~
/home/mhauke/tmp/DAHDI/linux/drivers/dahdi/dahdi-base.c: In function ‘dahdi_net_ioctl’:
/home/mhauke/tmp/DAHDI/linux/drivers/dahdi/dahdi-base.c:2153:32: error: passing argument 2 of ‘hdlc_ioctl’ from incompatible pointer type [-Werror=incompatible-pointer-types]
2153 |         return hdlc_ioctl(dev, ifr, cmd);
     |                                ^~~
     |                                |
     |                                struct ifreq *
In file included from /home/mhauke/tmp/DAHDI/linux/include/dahdi/kernel.h:48,
                from /home/mhauke/tmp/DAHDI/linux/drivers/dahdi/dahdi-base.c:64:
/usr/src/linux-5.15.3-1/include/linux/hdlc.h:57:60: note: expected ‘struct if_settings *’ but argument is of type ‘struct ifreq *’
  57 | int hdlc_ioctl(struct net_device *dev, struct if_settings *ifs);
     |                                        ~~~~~~~~~~~~~~~~~~~~^~~
/home/mhauke/tmp/DAHDI/linux/drivers/dahdi/dahdi-base.c:2153:16: error: too many arguments to function ‘hdlc_ioctl’
2153 |         return hdlc_ioctl(dev, ifr, cmd);
     |                ^~~~~~~~~~
In file included from /home/mhauke/tmp/DAHDI/linux/include/dahdi/kernel.h:48,
                from /home/mhauke/tmp/DAHDI/linux/drivers/dahdi/dahdi-base.c:64:
/usr/src/linux-5.15.3-1/include/linux/hdlc.h:57:5: note: declared here
  57 | int hdlc_ioctl(struct net_device *dev, struct if_settings *ifs);
     |     ^~~~~~~~~~
{code}
Comments:By: Harald Welte (laforge) 2021-11-28 07:47:49.655-0600

Pleaes note this has been fixed already more than a year ago in a PR that I submitted back then: https://github.com/asterisk/dahdi-linux/pull/6

It is a pity that DAHDI seems to be in lack of maintenance for quite some time.  Other pull requests like https://github.com/asterisk/dahdi-linux/pull/5 have equally been ignored quitely for a long time, see also https://issues.asterisk.org/jira/browse/DAHLIN-382

By: Martin Hauke (mnhauke) 2021-11-28 14:24:58.732-0600

The first error (netdev->trans_start related) is gone when I apply your patch (Thanks Harald!) and should definitely included in upstream DAHDI. On the other side should this error message should not even be part of this bug report, sorry for that.

The actual issue is the fallout from https://www.spinics.net/lists/netdev/msg755198.html .



By: Harald Welte (laforge) 2021-11-29 03:07:39.313-0600

Martin, you  can use https://github.com/osmocom/dahdi-linux/commit/b2371828bed2240d1dde3e761539e10772a631d1 (or rather, the kernel-5.15 branch) of osmocom/dahdi-linux to find a related fix.

I've raised this in https://github.com/asterisk/dahdi-linux/pull/8 which is basically a superset of the https://github.com/asterisk/dahdi-linux/pull/6 for kernel 5.7.

By: Martin Hauke (mnhauke) 2021-11-29 14:34:52.438-0600

Harald, your patch is working fine.

Thanks a lot for your fast response and the fix.