Skip to content

Commit

Permalink
fixing rocky linux compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
push143smart committed Apr 3, 2024
1 parent 2781746 commit 210c040
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 11 deletions.
12 changes: 12 additions & 0 deletions drivers/dahdi/dahdi-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@

#include "hpec/hpec_user.h"

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#if defined(EMPULSE) && defined(EMFLASH)
#error "You cannot define both EMPULSE and EMFLASH"
#endif
Expand Down
12 changes: 12 additions & 0 deletions drivers/dahdi/voicebus/vpmoct.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
#include <linux/timer.h>
#include "dahdi/kernel.h"

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#define VPMOCT_FIRM_HEADER_LEN 32
#define VPMOCT_BOOT_RAM_LEN 128
#define VPMOCT_FLASH_BUF_SECTIONS 4
Expand Down
12 changes: 12 additions & 0 deletions drivers/dahdi/wcaxx-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
#include <linux/firmware.h>
#include <linux/crc32.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
/* Define this if you would like to load the modules in parallel. While this
* can speed up loads when multiple cards handled by this driver are installed,
Expand Down
12 changes: 12 additions & 0 deletions drivers/dahdi/wct4xxp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
#include <linux/crc32.h>
#include <linux/slab.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#include <dahdi/kernel.h>

#include "wct4xxp.h"
Expand Down
12 changes: 12 additions & 0 deletions drivers/dahdi/wct4xxp/vpm450m.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@

#include <dahdi/kernel.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#include "vpm450m.h"
#include <oct612x.h>

Expand Down
12 changes: 12 additions & 0 deletions drivers/dahdi/wctc4xxp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
#include <linux/timer.h>
#include <dahdi/kernel.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/sched/signal.h>
#endif /* 4.11.0 */
Expand Down
12 changes: 12 additions & 0 deletions drivers/dahdi/wctdm24xxp/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ Tx Gain - W/Pre-Emphasis: -23.99 to 0.00 db
#include <linux/crc32.h>
#include <linux/slab.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
/* Define this if you would like to load the modules in parallel. While this
* can speed up loads when multiple cards handled by this driver are installed,
Expand Down
12 changes: 12 additions & 0 deletions drivers/dahdi/wcte13xp-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@
#include <linux/crc32.h>
#include <dahdi/kernel.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#include "wct4xxp/wct4xxp.h" /* For certain definitions */
#include "wcxb.h"
#include "wcxb_spi.h"
Expand Down
12 changes: 12 additions & 0 deletions drivers/dahdi/wcte43x-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@
#include <linux/firmware.h>
#include <oct612x.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#include <dahdi/kernel.h>

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
Expand Down
12 changes: 12 additions & 0 deletions drivers/dahdi/wcxb.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@

#include <dahdi/kernel.h>

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif

#include "wcxb.h"
#include "wcxb_spi.h"
#include "wcxb_flash.h"
Expand Down
4 changes: 3 additions & 1 deletion drivers/dahdi/wcxb_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
#elif defined RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#endif
#else
#include <stdbool.h>
#endif
Expand Down
12 changes: 2 additions & 10 deletions include/dahdi/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@
#define netif_napi_add netif_napi_add_weight
#endif

/* Linux kernel 5.16 and greater has removed user-space headers from the kernel include path */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0)
#include <asm/types.h>
#elif defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#include <asm/types.h>
#else
#include <stdbool.h>
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
#include <linux/pci.h>
#include <linux/dma-mapping.h>
Expand Down Expand Up @@ -1562,11 +1552,13 @@ static inline void *PDE_DATA(const struct inode *inode)
#endif
#endif

#ifdef RHEL_RELEASE_VERSION
#if defined(RHEL_RELEASE_CODE) && LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0) && \
RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(9,1)
#define netif_napi_add netif_napi_add_weight
#define PDE_DATA(i) pde_data(i)
#endif
#endif

#ifndef TIMER_DATA_TYPE
#define TIMER_DATA_TYPE struct timer_list *
Expand Down

0 comments on commit 210c040

Please sign in to comment.