# Asterisk Installation - DAHDI make error

**URL:** <https://forums.rockylinux.org/t/asterisk-installation-dahdi-make-error/9861>\
**Category:** Rocky Linux Help & Support\
**Created:** [May 11, 2023, 4:59pm UTC](https://forums.rockylinux.org/t/asterisk-installation-dahdi-make-error/9861 "2023-05-11T16:59:29Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![ewilde](https://avatars.discourse-cdn.com/v4/letter/e/c67d28/32.png) [@ewilde](https://forums.rockylinux.org/u/ewilde)\
**Post date:** [January 20, 2024, 3:14am UTC](https://forums.rockylinux.org/t/asterisk-installation-dahdi-make-error/9861/10 "2024-01-20T03:14:21Z")

</div>

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.

---

_[View the full topic](https://forums.rockylinux.org/t/asterisk-installation-dahdi-make-error/9861)._
