Init script and sysconfig file for generic Ethernet driver.
--- a/script/init.d/ethercat.in Thu Nov 05 09:37:31 2009 +0100
+++ b/script/init.d/ethercat.in Thu Nov 05 10:22:58 2009 +0100
@@ -173,13 +173,17 @@
if ! ${MODINFO} ${ECMODULE} > /dev/null; then
continue # ec_* module not found
fi
- if lsmod | grep "^${MODULE} " > /dev/null; then
- if ! ${RMMOD} ${MODULE}; then
- exit_fail
+ if [ ${MODULE} != "generic" ]; then
+ if lsmod | grep "^${MODULE} " > /dev/null; then
+ if ! ${RMMOD} ${MODULE}; then
+ exit_fail
+ fi
fi
fi
if ! ${MODPROBE} ${MODPROBE_FLAGS} ${ECMODULE}; then
- ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE} # try to restore module
+ if [ ${MODULE} != "generic" ]; then
+ ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE} # try to restore
+ fi
exit_fail
fi
done
@@ -205,8 +209,10 @@
# reload previous modules
for MODULE in ${DEVICE_MODULES}; do
- if ! ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE}; then
- echo Warning: Failed to restore ${MODULE}.
+ if [ ${MODULE} != "generic" ]; then
+ if ! ${MODPROBE} ${MODPROBE_FLAGS} ${MODULE}; then
+ echo Warning: Failed to restore ${MODULE}.
+ fi
fi
done
--- a/script/sysconfig/ethercat Thu Nov 05 09:37:31 2009 +0100
+++ b/script/sysconfig/ethercat Thu Nov 05 10:22:58 2009 +0100
@@ -26,17 +26,21 @@
#MASTER1_DEVICE=""
#
-# Ethernet driver modules to replace with EtherCAT-capable ones.
+# Ethernet driver modules to use for EtherCAT operation.
#
-# The init script will try to unload the Ethernet driver modules in the list
-# and replace them with the EtherCAT-capable ones, respectively. If a certain
-# (EtherCAT-capable) driver is not found, a warning will appear.
+# Specify a non-empty list of Ethernet drivers, that shall be used for EtherCAT
+# operation.
#
-# Possible values: 8139too, e100, e1000, r8169.
+# Except for the generic Ethernet driver module, the init script will try to
+# unload the usual Ethernet driver modules in the list and replace them with
+# the EtherCAT-capable ones. If a certain (EtherCAT-capable) driver is not
+# found, a warning will appear.
+#
+# Possible values: 8139too, e100, e1000, r8169, generic.
# Separate multiple drivers with spaces.
#
-# Note: The e100, e1000 and r8169 drivers are not built by default. Enable them
-# with the --enable-<driver> configure switches.
+# Note: The e100, e1000, r8169 and generic drivers are not built by default.
+# Enable them with the --enable-<driver> configure switches.
#
DEVICE_MODULES=""