aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/lantiq/ltq-ptm
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2017-11-13 22:18:00 +0100
committerMathias Kresin <dev@kresin.me>2018-02-20 19:25:17 +0100
commit73ba5e11f7582967f5151f5a3cb27932b47f44fa (patch)
tree0241af7a006b080d82645c31d23115c1ad3b98b4 /package/kernel/lantiq/ltq-ptm
parentf8a6987cd1aae8698062c8ac3907193a5c66004a (diff)
downloadupstream-73ba5e11f7582967f5151f5a3cb27932b47f44fa.tar.gz
upstream-73ba5e11f7582967f5151f5a3cb27932b47f44fa.tar.bz2
upstream-73ba5e11f7582967f5151f5a3cb27932b47f44fa.zip
lantiq: fix lantiq applications kernel 4.14 compatiblity
This is fixing multiple compile problems with kernel 4.14 and updates the code to take care of changes introduced between kernel 4.9 and 4.14. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'package/kernel/lantiq/ltq-ptm')
-rw-r--r--package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c13
-rw-r--r--package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c12
2 files changed, 24 insertions, 1 deletions
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
index f764eba1fc..43e171a2b4 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
@@ -128,7 +128,9 @@ static int ptm_stop(struct net_device *);
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 *);
@@ -247,7 +249,9 @@ static struct net_device_ops g_ptm_netdev_ops = {
.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,
};
@@ -285,6 +289,10 @@ static void ptm_setup(struct net_device *dev, int ndev)
/* 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;
@@ -459,7 +467,7 @@ PTM_HARD_START_XMIT_FAIL:
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 */
@@ -468,6 +476,7 @@ static int ptm_change_mtu(struct net_device *dev, int mtu)
dev->mtu = mtu;
return 0;
}
+#endif
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
@@ -654,7 +663,9 @@ static INLINE int mailbox_rx_irq_handler(unsigned int ch) // return: < 0 - de
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);
diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c
index 4e10d72fe1..9cfeefd80e 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c
@@ -74,7 +74,9 @@ static int ptm_stop(struct net_device *);
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 *);
@@ -115,7 +117,9 @@ static struct net_device_ops g_ptm_netdev_ops = {
.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,
};
@@ -141,6 +145,10 @@ static void ptm_setup(struct net_device *dev, int ndev)
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;
@@ -218,7 +226,9 @@ static unsigned int ptm_poll(int ndev, unsigned int work_to_do)
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);
@@ -367,6 +377,7 @@ PTM_HARD_START_XMIT_FAIL:
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 */
@@ -375,6 +386,7 @@ static int ptm_change_mtu(struct net_device *dev, int mtu)
dev->mtu = mtu;
return 0;
}
+#endif
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{