Renamed master parameter ec_eoe_devices to ec_eoeif_count.

This commit is contained in:
Florian Pose 2006-08-01 15:19:11 +00:00
parent 7440891396
commit 973af4179d
4 changed files with 18 additions and 14 deletions

View File

@ -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;

View File

@ -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)) {

View File

@ -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

View File

@ -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