From 12df7a1f4a88871d0409adb0d067addd03fdb5e7 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Thu, 26 Jun 2025 16:08:36 +0200 Subject: [PATCH] Initialize watchdog jiffies in e100. --- devices/e100-3.0-ethercat.c | 5 ++++- devices/e100-3.10-ethercat.c | 5 ++++- devices/e100-3.12-ethercat.c | 5 ++++- devices/e100-3.14-ethercat.c | 5 ++++- devices/e100-3.16-ethercat.c | 5 ++++- devices/e100-3.4-ethercat.c | 5 ++++- devices/e100-3.6-ethercat.c | 5 ++++- devices/e100-3.8-ethercat.c | 5 ++++- devices/e100-4.4-ethercat.c | 5 ++++- devices/e100-5.10-ethercat.c | 5 ++++- devices/e100-5.14-ethercat.c | 5 ++++- devices/e100-5.15-ethercat.c | 5 ++++- devices/e100-5.4-ethercat.c | 5 ++++- devices/e100-6.1-ethercat.c | 5 ++++- devices/e100-6.12-ethercat.c | 7 +++++-- devices/e100-6.4-ethercat.c | 5 ++++- 16 files changed, 65 insertions(+), 17 deletions(-) diff --git a/devices/e100-3.0-ethercat.c b/devices/e100-3.0-ethercat.c index a4830b65..3f2ced12 100644 --- a/devices/e100-3.0-ethercat.c +++ b/devices/e100-3.0-ethercat.c @@ -3001,7 +3001,10 @@ static int __devinit e100_probe(struct pci_dev *pdev, // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-3.10-ethercat.c b/devices/e100-3.10-ethercat.c index 9d5c1c5f..d5273deb 100644 --- a/devices/e100-3.10-ethercat.c +++ b/devices/e100-3.10-ethercat.c @@ -3104,7 +3104,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-3.12-ethercat.c b/devices/e100-3.12-ethercat.c index a1ab7409..20b2fef6 100644 --- a/devices/e100-3.12-ethercat.c +++ b/devices/e100-3.12-ethercat.c @@ -3101,7 +3101,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-3.14-ethercat.c b/devices/e100-3.14-ethercat.c index eafba8c6..937fcfaf 100644 --- a/devices/e100-3.14-ethercat.c +++ b/devices/e100-3.14-ethercat.c @@ -3101,7 +3101,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-3.16-ethercat.c b/devices/e100-3.16-ethercat.c index b059b2d9..d2a78f7a 100644 --- a/devices/e100-3.16-ethercat.c +++ b/devices/e100-3.16-ethercat.c @@ -3101,7 +3101,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-3.4-ethercat.c b/devices/e100-3.4-ethercat.c index 4603c362..1aa5af93 100644 --- a/devices/e100-3.4-ethercat.c +++ b/devices/e100-3.4-ethercat.c @@ -3068,7 +3068,10 @@ static int __devinit e100_probe(struct pci_dev *pdev, // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-3.6-ethercat.c b/devices/e100-3.6-ethercat.c index 9c4f399c..f543010c 100644 --- a/devices/e100-3.6-ethercat.c +++ b/devices/e100-3.6-ethercat.c @@ -3092,7 +3092,10 @@ static int __devinit e100_probe(struct pci_dev *pdev, // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-3.8-ethercat.c b/devices/e100-3.8-ethercat.c index 85540783..e5dbb5e4 100644 --- a/devices/e100-3.8-ethercat.c +++ b/devices/e100-3.8-ethercat.c @@ -3091,7 +3091,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-4.4-ethercat.c b/devices/e100-4.4-ethercat.c index a1b42622..53821d4d 100644 --- a/devices/e100-4.4-ethercat.c +++ b/devices/e100-4.4-ethercat.c @@ -3104,7 +3104,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-5.10-ethercat.c b/devices/e100-5.10-ethercat.c index 12f192ea..83924b78 100644 --- a/devices/e100-5.10-ethercat.c +++ b/devices/e100-5.10-ethercat.c @@ -3086,7 +3086,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-5.14-ethercat.c b/devices/e100-5.14-ethercat.c index 15b53aa7..e10701ee 100644 --- a/devices/e100-5.14-ethercat.c +++ b/devices/e100-5.14-ethercat.c @@ -3124,7 +3124,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-5.15-ethercat.c b/devices/e100-5.15-ethercat.c index a3a67295..79c889b9 100644 --- a/devices/e100-5.15-ethercat.c +++ b/devices/e100-5.15-ethercat.c @@ -3092,7 +3092,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-5.4-ethercat.c b/devices/e100-5.4-ethercat.c index 7675e06c..9941e126 100644 --- a/devices/e100-5.4-ethercat.c +++ b/devices/e100-5.4-ethercat.c @@ -3090,7 +3090,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); - if (!nic->ecdev) { + if (nic->ecdev) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-6.1-ethercat.c b/devices/e100-6.1-ethercat.c index a8c88dd1..6e967a0f 100644 --- a/devices/e100-6.1-ethercat.c +++ b/devices/e100-6.1-ethercat.c @@ -3101,7 +3101,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) nic->ecdev_ = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); nic->ecdev_initialized = true; - if (!get_ecdev(nic)) { + if (get_ecdev(nic)) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-6.12-ethercat.c b/devices/e100-6.12-ethercat.c index b2729887..c62f5c8a 100644 --- a/devices/e100-6.12-ethercat.c +++ b/devices/e100-6.12-ethercat.c @@ -1,6 +1,6 @@ /***************************************************************************** * - * Copyright (C) 2007-2012 Florian Pose, Ingenieurgemeinschaft IgH + * Copyright (C) 2007-2025 Florian Pose, Ingenieurgemeinschaft IgH * * This file is part of the IgH EtherCAT Master. * @@ -3100,7 +3100,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) nic->ecdev_ = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); nic->ecdev_initialized = true; - if (!get_ecdev(nic)) { + if (get_ecdev(nic)) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev, diff --git a/devices/e100-6.4-ethercat.c b/devices/e100-6.4-ethercat.c index a8c88dd1..6e967a0f 100644 --- a/devices/e100-6.4-ethercat.c +++ b/devices/e100-6.4-ethercat.c @@ -3101,7 +3101,10 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) nic->ecdev_ = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); nic->ecdev_initialized = true; - if (!get_ecdev(nic)) { + if (get_ecdev(nic)) { + nic->ec_watchdog_jiffies = jiffies; + } + else { strcpy(netdev->name, "eth%d"); if ((err = register_netdev(netdev))) { netif_err(nic, probe, nic->netdev,