ugly_hack_sleep_on_timeout(wait_queue_head_t *q, long timeout)
{
unsigned long flags;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
+ wait_queue_entry_t wait;
+#else
wait_queue_t wait;
+#endif
init_waitqueue_entry(&wait, current);
return NULL;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
+ refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
+#else
atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
+#endif
return skb;
}
#include <asm/byteorder.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
+#include <linux/version.h>
// must match the size of memory block allocated for g_dma_block and g_dma_block2
#define DEU_MAX_PACKET_SIZE (PAGE_SIZE >> 1)
int recv_count;
int packet_size;
int packet_num;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
+ wait_queue_entry_t wait;
+#else
wait_queue_t wait;
+#endif
} _ifx_deu_device;
extern _ifx_deu_device ifx_deu[1];
--- /dev/null
+--- a/src/linux/ifxos_linux_copy_user_space_drv.c
++++ b/src/linux/ifxos_linux_copy_user_space_drv.c
+@@ -29,7 +29,7 @@
+ #ifdef MODULE
+ #include <linux/module.h>
+ #endif
+-#include <asm/uaccess.h>
++#include <linux/uaccess.h>
+
+ #include "ifx_types.h"
+ #include "ifxos_rt_if_check.h"
+--- a/src/linux/ifxos_linux_socket_drv.c
++++ b/src/linux/ifxos_linux_socket_drv.c
+@@ -25,7 +25,7 @@
+ #endif
+ #include <linux/in.h>
+ #include <linux/net.h>
+-#include <asm/uaccess.h>
++#include <linux/uaccess.h>
+
+ #include "ifx_types.h"
+ #include "ifxos_rt_if_check.h"
static unsigned int ptm_poll(int, unsigned int);
static int ptm_napi_poll(struct napi_struct *, int);
static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
static int ptm_change_mtu(struct net_device *, int);
+#endif
static int ptm_ioctl(struct net_device *, struct ifreq *, int);
static void ptm_tx_timeout(struct net_device *);
.ndo_start_xmit = ptm_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
.ndo_change_mtu = ptm_change_mtu,
+#endif
.ndo_do_ioctl = ptm_ioctl,
.ndo_tx_timeout = ptm_tx_timeout,
};
/* hook network operations */
dev->netdev_ops = &g_ptm_netdev_ops;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+ /* Allow up to 1508 bytes, for RFC4638 */
+ dev->max_mtu = ETH_DATA_LEN + 8;
+#endif
netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 25);
dev->watchdog_timeo = ETH_WATCHDOG_TIMEOUT;
g_ptm_priv_data.itf[ndev].stats.tx_dropped++;
return NETDEV_TX_OK;
}
-
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
static int ptm_change_mtu(struct net_device *dev, int mtu)
{
/* Allow up to 1508 bytes, for RFC4638 */
dev->mtu = mtu;
return 0;
}
+#endif
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
skb->dev = g_net_dev[ndev];
skb->protocol = eth_type_trans(skb, skb->dev);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0))
g_net_dev[ndev]->last_rx = jiffies;
+#endif
netif_rx_ret = netif_receive_skb(skb);
static unsigned int ptm_poll(int, unsigned int);
static int ptm_napi_poll(struct napi_struct *, int);
static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
static int ptm_change_mtu(struct net_device *, int);
+#endif
static int ptm_ioctl(struct net_device *, struct ifreq *, int);
static void ptm_tx_timeout(struct net_device *);
.ndo_start_xmit = ptm_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
.ndo_change_mtu = ptm_change_mtu,
+#endif
.ndo_do_ioctl = ptm_ioctl,
.ndo_tx_timeout = ptm_tx_timeout,
};
netif_carrier_off(dev);
dev->netdev_ops = &g_ptm_netdev_ops;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+ /* Allow up to 1508 bytes, for RFC4638 */
+ dev->max_mtu = ETH_DATA_LEN + 8;
+#endif
netif_napi_add(dev, &g_ptm_priv_data.itf[ndev].napi, ptm_napi_poll, 16);
dev->watchdog_timeo = ETH_WATCHDOG_TIMEOUT;
skb->dev = g_net_dev[0];
skb->protocol = eth_type_trans(skb, skb->dev);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0))
g_net_dev[0]->last_rx = jiffies;
+#endif
netif_receive_skb(skb);
return 0;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0))
static int ptm_change_mtu(struct net_device *dev, int mtu)
{
/* Allow up to 1508 bytes, for RFC4638 */
dev->mtu = mtu;
return 0;
}
+#endif
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
--- /dev/null
+--- a/src/drv_tapi_linux.c
++++ b/src/drv_tapi_linux.c
+@@ -54,6 +54,10 @@
+ #include <linux/workqueue.h> /* LINUX 2.6 We need work_struct */
+ #include <linux/device.h>
+ #include <linux/sched.h>
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
++ #include <linux/sched/signal.h>
++ #include <linux/sched/types.h>
++#endif
+ #undef CONFIG_DEVFS_FS
+ #ifndef UTS_RELEASE
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
+@@ -184,7 +188,7 @@ MODULE_PARM_DESC(block_egress_tasklet, "
+ MODULE_PARM_DESC(block_ingress_tasklet, "block the execution of the ingress tasklet, i.e. force to use the RT kernel thread");
+
+ /** The driver callbacks which will be registered with the kernel*/
+-static struct file_operations tapi_fops = {0};
++static struct file_operations tapi_fops;
+
+ /* ============================= */
+ /* Global function definition */
--- a/src/drv_tapi_linux.c
+++ b/src/drv_tapi_linux.c
-@@ -552,7 +552,7 @@ static ssize_t ifx_tapi_write (struct fi
+@@ -556,7 +556,7 @@ static ssize_t ifx_tapi_write (struct fi
IFX_uint8_t *pData;
IFX_size_t buf_size;
#endif /* TAPI_PACKET */
#include <asm/io.h>
#ifdef LINUX_2_6
-@@ -65,7 +67,9 @@
+@@ -69,7 +71,9 @@
#else
#include <linux/tqueue.h>
#include <linux/sched.h>
#endif /* LINUX_2_6 */
#include "drv_tapi.h"
-@@ -133,8 +137,13 @@
+@@ -137,8 +141,13 @@ static ssize_t ifx_tapi_write(struct fil
size_t count, loff_t * ppos);
static ssize_t ifx_tapi_read(struct file * filp, char *buf,
size_t length, loff_t * ppos);
static unsigned int ifx_tapi_poll (struct file *filp, poll_table *table);
#ifdef CONFIG_PROC_FS
-@@ -218,7 +227,11 @@
+@@ -222,7 +231,11 @@ IFX_return_t TAPI_OS_RegisterLLDrv (IFX_
IFX_char_t *pRegDrvName = IFX_NULL;
IFX_int32_t ret = 0;
{
#ifdef MODULE
tapi_fops.owner = THIS_MODULE;
-@@ -226,7 +239,11 @@
+@@ -230,7 +243,11 @@ IFX_return_t TAPI_OS_RegisterLLDrv (IFX_
tapi_fops.read = ifx_tapi_read;
tapi_fops.write = ifx_tapi_write;
tapi_fops.poll = ifx_tapi_poll;
tapi_fops.open = ifx_tapi_open;
tapi_fops.release = ifx_tapi_release;
}
-@@ -881,8 +898,13 @@
+@@ -885,8 +902,13 @@ static IFX_uint32_t ifx_tapi_poll (struc
- 0 and positive values - success
- negative value - ioctl failed
*/
{
TAPI_FD_PRIV_DATA_t *pTapiPriv;
IFX_TAPI_ioctlCtx_t ctx;
-@@ -3721,7 +3743,9 @@
+@@ -3725,7 +3747,9 @@ IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre
kernel lock (lock_kernel()). The lock must be
grabbed before changing the terminate
flag and released after the down() call. */
mb();
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
kill_proc(pThrCntrl->tid, SIGKILL, 1);
-@@ -3729,8 +3753,10 @@
+@@ -3733,8 +3757,10 @@ IFX_void_t TAPI_OS_ThreadKill(IFXOS_Thre
kill_pid(find_vpid(pThrCntrl->tid), SIGKILL, 1);
#endif
/* release the big kernel lock */
-Index: drv_tapi-3.13.0/src/drv_tapi_linux.c
-===================================================================
---- drv_tapi-3.13.0.orig/src/drv_tapi_linux.c 2013-09-05 22:28:16.868419283 +0200
-+++ drv_tapi-3.13.0/src/drv_tapi_linux.c 2013-09-05 22:32:37.396425814 +0200
-@@ -93,6 +93,8 @@
+--- a/src/drv_tapi_linux.c
++++ b/src/drv_tapi_linux.c
+@@ -97,6 +97,8 @@
#include "drv_tapi_announcements.h"
#endif /* TAPI_ANNOUNCEMENTS */
--- /dev/null
+--- a/src/drv_mei_cpe_linux.h
++++ b/src/drv_mei_cpe_linux.h
+@@ -31,6 +31,9 @@
+ #include <linux/module.h>
+
+ #include <linux/sched.h>
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
++#include <linux/sched/signal.h>
++#endif
+ #include <linux/interrupt.h>
+ #include <linux/version.h>
+ #include <linux/crc32.h>
+@@ -121,7 +124,11 @@ typedef int (*MEI_RequestIrq_WrapLinux_t
+ /**
+ Function typedef for the Linux free_irq()
+ */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
++typedef const void *(*MEI_FreeIrq_WrapLinux_t)( unsigned int usedIrq,
++#else
+ typedef void (*MEI_FreeIrq_WrapLinux_t)( unsigned int usedIrq,
++#endif
+ void *usedDevId );
+
+
--- a/src/drv_mei_cpe_linux.h
+++ b/src/drv_mei_cpe_linux.h
-@@ -57,12 +57,6 @@
+@@ -60,12 +60,6 @@
#include <linux/poll.h>
#include <linux/types.h>
--- /dev/null
+--- a/src/include/drv_dsl_cpe_os_linux.h
++++ b/src/include/drv_dsl_cpe_os_linux.h
+@@ -33,6 +33,9 @@
+ #endif
+
+ #include <linux/sched.h>
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
++#include <linux/sched/signal.h>
++#endif
+
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
+ #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17))