Just built DAHDI under Rocky 9.3, kernel 5.14.0. I experienced both
of the problems mentioned here but in more files than those noted.
Also, I experienced the problem (noted elsewhere) with PDE_DATA.
To summarize, here are all of the fixes that I made to the DAHDI
source to get the build to work:
The kernel build files are missing “stdbool.h” so all of the DAHDI
sources that include it must be changed to include “linux/types.h”
instead. Begin by finding them all. Then hack them with your
favorite text editor:
find . -type f -exec grep stdbool.h -H {} ;
linux/drivers/dahdi/wcaxx-base.c:#include <stdbool.h>
linux/drivers/dahdi/wctdm24xxp/base.c:#include <stdbool.h>
linux/drivers/dahdi/wctc4xxp/base.c:#include <stdbool.h>
linux/drivers/dahdi/wcte13xp-base.c:#include <stdbool.h>
linux/drivers/dahdi/wcxb.c:#include <stdbool.h>
linux/drivers/dahdi/dahdi-base.c:#include <stdbool.h>
linux/drivers/dahdi/wcxb_spi.h:#include <stdbool.h>
linux/drivers/dahdi/wcte43x-base.c:#include <stdbool.h>
linux/drivers/dahdi/voicebus/vpmoct.h:#include <stdbool.h>
linux/drivers/dahdi/wct4xxp/base.c:#include <stdbool.h>
linux/drivers/dahdi/wct4xxp/vpm450m.c:#include <stdbool.h>
The patch is to include “linux/types.h” for kernel versions between
5.14.0 and 5.15.x:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
+ #include <linux/types.h>
#else
#include <stdbool.h>
#endif
The prototype for “netif_napi_add” has changed to use only three
arguments instead of four so all of the DAHDI sources that call this
function must be changed. Begin by finding them all. Then hack
them with your favorite text editor:
find . -type f -exec grep netif_napi_add -H {} ;
linux/drivers/dahdi/wctc4xxp/base.c:#netif_napi_add(netdev, …
The patch is to remove the fourth parameter in the function call:
netdev->promiscuity = 0;
netdev->flags |= IFF_NOARP;
- netif_napi_add(netdev, &wc->napi, &wctc4xxp_poll, 64);
+ netif_napi_add(netdev, &wc->napi, &wctc4xxp_poll);
res = register_netdev(netdev);
if (res) {
The “PDE_DATA()” function has been renamed “pde_data()” so,
everywhere that it is called, you could rename it. But, there is an
easier solution. This function was formerly inlined in the local header
file linux/include/dahdi/kernel.h for earlier kernel versions. Then, at
some point it seems to have been subsumed by another component.
Following that, someone seems to have decided that it should be
arbitrarily renamed from all caps to all lowercase. When this
stopped DAHDI from compiling, someone added a fix (an inline
function to remap the call to the lower case function) for kernel
versions 5.17.0 and up. My guess is that they did not check lower
kernel versions, so 5.14.0 was missed. The fix is to change the
criteria for the “#if”:
linux/include/dahdi/kernel.h
#endif /* 4.15.0 */
#endif /* 5.6 */
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
#ifdef CONFIG_PROC_FS
#define PDE_DATA(i) pde_data(i)
#endif
#endif
For me, these changes were sufficient to make and install DAHDI.