[source] ltq-ptm: use netif_trans_update() only for kernel >= 4.7

LEDE Commits lede-commits at lists.infradead.org
Sat Feb 11 16:26:58 PST 2017


hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/2eed1179beb717e4fe17609764f1a1bb30aed88e

commit 2eed1179beb717e4fe17609764f1a1bb30aed88e
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Feb 12 01:03:18 2017 +0100

    ltq-ptm: use netif_trans_update() only for kernel >= 4.7
    
    This fixes a bug introduced in commit c7ce9908bd58af60153716aa64a7251
    "ltq-ptm: fix build with kernel 4.9"
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c | 4 ++--
 package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 4 ++--
 2 files changed, 4 insertions(+), 4 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 2691527..00a967b 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
@@ -405,7 +405,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
     /*  allocate descriptor */
     desc_base = get_tx_desc(ndev, &f_full);
     if ( f_full ) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
         netif_trans_update(dev);
 #else
         dev->trans_start = jiffies;
@@ -443,7 +443,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
     g_ptm_priv_data.itf[ndev].stats.tx_packets++;
     g_ptm_priv_data.itf[ndev].stats.tx_bytes += reg_desc.datalen;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
     netif_trans_update(dev);
 #else
     dev->trans_start = jiffies;
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 f5a3f8b..0a357f1 100644
--- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c
+++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c
@@ -289,7 +289,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
     /*  allocate descriptor */
     desc_base = get_tx_desc(0, &f_full);
     if ( f_full ) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
         netif_trans_update(dev);
 #else
         dev->trans_start = jiffies;
@@ -352,7 +352,7 @@ static int ptm_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
     wmb();
     *(volatile unsigned int *)desc = *(unsigned int *)&reg_desc;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
     netif_trans_update(dev);
 #else
     dev->trans_start = jiffies;



More information about the lede-commits mailing list