# HG changeset patch # User Florian Pose # Date 1320405669 -3600 # Node ID d649573799164390b31cc977201b68fe9a14a25e # Parent e645d0d83b3bbb0c1ce0df2bc570f4af1c4b35f4 Added --enable-wildcards to use 0xffffffff as wildcard for vendor ID and product code. diff -r e645d0d83b3b -r d64957379916 NEWS --- a/NEWS Fri Oct 28 13:07:54 2011 +0200 +++ b/NEWS Fri Nov 04 12:21:09 2011 +0100 @@ -72,6 +72,8 @@ * ethercat tool is now able to handle multiple masters. The --masters option supports ranges like '0,3,8-10'. * A sync manager is always enabled, if it contains registered process data. +* Added a configuration switch --enable-wildcards to use 0xffffffff as a +* wildcard for vendor ID and product code. Changes in 1.4.0: diff -r e645d0d83b3b -r d64957379916 configure.ac --- a/configure.ac Fri Oct 28 13:07:54 2011 +0200 +++ b/configure.ac Fri Nov 04 12:21:09 2011 +0100 @@ -604,6 +604,31 @@ AC_SUBST(ENABLE_TTY,[$tty]) #------------------------------------------------------------------------------ +# Slave identification wildcards +#------------------------------------------------------------------------------ + +AC_ARG_ENABLE([wildcards], + AS_HELP_STRING([--enable-wildcards], + [Enable vendor ID / product code wildcards (default: no)]), + [ + case "${enableval}" in + yes) wildcards=1 + ;; + no) wildcards=0 + ;; + *) AC_MSG_ERROR([Invalid value for --enable-wildcards]) + ;; + esac + ], + [wildcards=0] +) + +if test "x${wildcards}" = "x1"; then + AC_DEFINE([EC_IDENT_WILDCARDS], [1], + [Use vendor id / product code wildcards]) +fi + +#------------------------------------------------------------------------------ AC_CONFIG_FILES([ Doxyfile diff -r e645d0d83b3b -r d64957379916 master/slave_config.c --- a/master/slave_config.c Fri Oct 28 13:07:54 2011 +0200 +++ b/master/slave_config.c Fri Nov 04 12:21:09 2011 +0100 @@ -214,12 +214,28 @@ return -EEXIST; } - if (slave->sii.vendor_id != sc->vendor_id - || slave->sii.product_code != sc->product_code) { - EC_CONFIG_DBG(sc, 1, "Slave %u has an invalid type (0x%08X/0x%08X)" - " for configuration (0x%08X/0x%08X).\n", - slave->ring_position, slave->sii.vendor_id, - slave->sii.product_code, sc->vendor_id, sc->product_code); + if ( +#ifdef EC_IDENT_WILDCARDS + sc->vendor_id != 0xffffffff && +#endif + slave->sii.vendor_id != sc->vendor_id + ) { + EC_CONFIG_DBG(sc, 1, "Slave %u has no matching vendor ID (0x%08X)" + " for configuration (0x%08X).\n", + slave->ring_position, slave->sii.vendor_id, sc->vendor_id); + return -EINVAL; + } + + if ( +#ifdef EC_IDENT_WILDCARDS + sc->product_code != 0xffffffff && +#endif + slave->sii.product_code != sc->product_code + ) { + EC_CONFIG_DBG(sc, 1, "Slave %u has no matching product code (0x%08X)" + " for configuration (0x%08X).\n", + slave->ring_position, slave->sii.product_code, + sc->product_code); return -EINVAL; }