diff --git a/master/master.c b/master/master.c index e28c485a8ad2c83f3d4b626e097f673cae855afb..ead95e4f876c740c9044eea51d6214bfa321afd8 100644 --- a/master/master.c +++ b/master/master.c @@ -100,7 +100,7 @@ static struct kobj_type ktype_ec_master = { int ec_master_init(ec_master_t *master, /**< EtherCAT master */ unsigned int index, /**< master index */ - unsigned int eoe_devices /**< number of EoE devices */ + unsigned int eoeif_count /**< number of EoE interfaces */ ) { ec_eoe_t *eoe, *next_eoe; @@ -130,7 +130,7 @@ int ec_master_init(ec_master_t *master, /**< EtherCAT master */ } // create EoE handlers - for (i = 0; i < eoe_devices; i++) { + for (i = 0; i < eoeif_count; i++) { if (!(eoe = (ec_eoe_t *) kmalloc(sizeof(ec_eoe_t), GFP_KERNEL))) { EC_ERR("Failed to allocate EoE-Object.\n"); goto out_clear_eoe; diff --git a/master/module.c b/master/module.c index 1933844dee3230c67b529672db8ab8218be42d8a..e04cc5eca9e4071d4c3d6e0087be03e622c2a1c2 100644 --- a/master/module.c +++ b/master/module.c @@ -67,7 +67,7 @@ void __exit ec_cleanup_module(void); /*****************************************************************************/ static int ec_master_count = 1; /**< parameter value, number of masters */ -static int ec_eoe_devices = 0; /**< parameter value, number of EoE interf. */ +static int ec_eoeif_count = 0; /**< parameter value, number of EoE interf. */ static struct list_head ec_masters; /**< list of masters */ /*****************************************************************************/ @@ -75,14 +75,14 @@ static struct list_head ec_masters; /**< list of masters */ /** \cond */ module_param(ec_master_count, int, S_IRUGO); -module_param(ec_eoe_devices, int, S_IRUGO); +module_param(ec_eoeif_count, int, S_IRUGO); MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>"); MODULE_DESCRIPTION("EtherCAT master driver module"); MODULE_LICENSE("GPL"); MODULE_VERSION(COMPILE_INFO); MODULE_PARM_DESC(ec_master_count, "number of EtherCAT masters to initialize"); -MODULE_PARM_DESC(ec_eoe_devices, "number of EoE devices per master"); +MODULE_PARM_DESC(ec_eoeif_count, "number of EoE interfaces per master"); /** \endcond */ @@ -117,7 +117,7 @@ int __init ec_init_module(void) goto out_free; } - if (ec_master_init(master, i, ec_eoe_devices)) + if (ec_master_init(master, i, ec_eoeif_count)) goto out_free; if (kobject_add(&master->kobj)) { diff --git a/script/ethercat.sh b/script/ethercat.sh index 51c63e84c345d58f04b5a9d4b4a03e36079d0d0c..b71d2a896e7b66f6751580c2e4900bb3bbb8f9be 100755 --- a/script/ethercat.sh +++ b/script/ethercat.sh @@ -65,7 +65,7 @@ test -r $ETHERCAT_CONFIG || { echo "$ETHERCAT_CONFIG not existing"; build_eoe_bridge() { if [ -z "$EOE_BRIDGE" ]; then return; fi - EOE_INTERFACES=`/sbin/ifconfig -a | grep -o -E "^eoe[0-9]+ "` + EOEIF=`/sbin/ifconfig -a | grep -o -E "^eoe[0-9]+ "` # add bridge, if it does not already exist if ! /sbin/brctl show | grep -E -q "^$EOE_BRIDGE"; then @@ -76,8 +76,8 @@ build_eoe_bridge() { fi fi - # check if specified interfaces are bridged - for interf in $EOE_INTERFACES $EOE_EXTRA_INTERFACES; do + # check if specified interfaces are bridged + for interf in $EOEIF $EOE_EXTRA_INTERFACES; do # interface is already part of the bridge if /sbin/brctl show $EOE_BRIDGE | grep -E -q $interf then continue @@ -147,8 +147,12 @@ case "$1" in rc_exit fi - if [ -z "$EOE_DEVICES" ]; then - EOE_DEVICES=0 + if [ -z "$EOE_INTERFACES" ]; then + if [ -n "$EOE_DEVICES"]; then # support legacy sysconfig files + EOE_INTERFACES=$EOE_DEVICES + else + EOE_INTERFACES=0 + fi fi # unload conflicting modules at first @@ -163,7 +167,7 @@ case "$1" in done # load master module - if ! modprobe ec_master ec_eoe_devices=$EOE_DEVICES; then + if ! modprobe ec_master ec_eoeif_count=$EOE_INTERFACES; then /bin/false rc_status -v rc_exit diff --git a/script/sysconfig b/script/sysconfig index d7949b44832d48c6ba2d22d09e3cd05d6ea8d76f..fc05841ef2b1b7c6fb20ea588b4d5beb7a96921c 100644 --- a/script/sysconfig +++ b/script/sysconfig @@ -13,10 +13,10 @@ #DEVICE_INDEX=99 # -# Number of Ethernet-over-EtherCAT devices every master shall create +# Number of Ethernet-over-EtherCAT interfaces every master shall create # on startup. Default is 0. # -#EOE_DEVICES=0 +#EOE_INTERFACES=0 # # Bridge all EoE interfaces after master startup