mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-02-05 19:39:50 +08:00
Reverted revision number checking from r1228.
This commit is contained in:
@@ -246,7 +246,6 @@ typedef struct {
|
||||
uint16_t position; /**< Slave position. */
|
||||
uint32_t vendor_id; /**< Slave vendor ID. */
|
||||
uint32_t product_code; /**< Slave product code. */
|
||||
uint32_t revision_number; /**< Slave revision number. */
|
||||
uint16_t index; /**< Pdo entry index. */
|
||||
uint8_t subindex; /**< Pdo entry subindex. */
|
||||
unsigned int *offset; /**< Pointer to a variable to store the Pdo entry's
|
||||
@@ -351,8 +350,7 @@ ec_slave_config_t *ecrt_master_slave_config(
|
||||
uint16_t alias, /**< Slave alias. */
|
||||
uint16_t position, /**< Slave position. */
|
||||
uint32_t vendor_id, /**< Expected vendor ID. */
|
||||
uint32_t product_code, /**< Expected product code. */
|
||||
uint32_t revision_number /**< Expected revision number. */
|
||||
uint32_t product_code /**< Expected product code. */
|
||||
);
|
||||
|
||||
/** Finishes the configuration phase and prepares for realtime mode.
|
||||
|
||||
@@ -320,8 +320,7 @@ int ecrt_domain_reg_pdo_entry_list(ec_domain_t *domain,
|
||||
|
||||
for (reg = regs; reg->index; reg++) {
|
||||
if (!(sc = ecrt_master_slave_config(domain->master, reg->alias,
|
||||
reg->position, reg->vendor_id, reg->product_code,
|
||||
reg->revision_number)))
|
||||
reg->position, reg->vendor_id, reg->product_code)))
|
||||
return -1;
|
||||
|
||||
if ((ret = ecrt_slave_config_reg_pdo_entry(sc, reg->index,
|
||||
|
||||
@@ -1287,7 +1287,7 @@ void ecrt_master_receive(ec_master_t *master)
|
||||
|
||||
ec_slave_config_t *ecrt_master_slave_config(ec_master_t *master,
|
||||
uint16_t alias, uint16_t position, uint32_t vendor_id,
|
||||
uint32_t product_code, uint32_t revision_number)
|
||||
uint32_t product_code)
|
||||
{
|
||||
ec_slave_config_t *sc;
|
||||
unsigned int found = 0;
|
||||
@@ -1304,21 +1304,18 @@ ec_slave_config_t *ecrt_master_slave_config(ec_master_t *master,
|
||||
EC_INFO("Using existing slave configuration for %u:%u\n",
|
||||
alias, position);
|
||||
}
|
||||
if (sc->vendor_id != vendor_id
|
||||
|| sc->product_code != product_code
|
||||
|| sc->revision_number != revision_number) {
|
||||
if (sc->vendor_id != vendor_id || sc->product_code != product_code) {
|
||||
EC_ERR("Slave type mismatch. Slave was configured as"
|
||||
" 0x%08X/0x%08X/0x%08X before. Now configuring with"
|
||||
" 0x%08X/0x%08X/0x%08X.\n",
|
||||
sc->vendor_id, sc->product_code, sc->revision_number,
|
||||
vendor_id, product_code, revision_number);
|
||||
" 0x%08X/0x%08X before. Now configuring with"
|
||||
" 0x%08X/0x%08X.\n", sc->vendor_id, sc->product_code,
|
||||
vendor_id, product_code);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
if (master->debug_level) {
|
||||
EC_INFO("Creating slave configuration for %u:%u,"
|
||||
" 0x%08X/0x%08X/0x%08X.\n", alias, position,
|
||||
vendor_id, product_code, revision_number);
|
||||
" 0x%08X/0x%08X.\n", alias, position, vendor_id,
|
||||
product_code);
|
||||
}
|
||||
|
||||
if (!(sc = (ec_slave_config_t *) kmalloc(sizeof(ec_slave_config_t),
|
||||
@@ -1328,7 +1325,7 @@ ec_slave_config_t *ecrt_master_slave_config(ec_master_t *master,
|
||||
}
|
||||
|
||||
ec_slave_config_init(sc, master,
|
||||
alias, position, vendor_id, product_code, revision_number);
|
||||
alias, position, vendor_id, product_code);
|
||||
|
||||
// try to find the addressed slave
|
||||
ec_slave_config_attach(sc);
|
||||
|
||||
@@ -58,8 +58,7 @@ void ec_slave_config_init(
|
||||
uint16_t alias, /**< Slave alias. */
|
||||
uint16_t position, /**< Slave position. */
|
||||
uint32_t vendor_id, /**< Expected vendor ID. */
|
||||
uint32_t product_code, /**< Expected product code. */
|
||||
uint32_t revision_number /**< Expected revision number. */
|
||||
uint32_t product_code /**< Expected product code. */
|
||||
)
|
||||
{
|
||||
ec_direction_t dir;
|
||||
@@ -69,7 +68,6 @@ void ec_slave_config_init(
|
||||
sc->position = position;
|
||||
sc->vendor_id = vendor_id;
|
||||
sc->product_code = product_code;
|
||||
sc->revision_number = revision_number;
|
||||
sc->slave = NULL;
|
||||
|
||||
for (dir = EC_DIR_OUTPUT; dir <= EC_DIR_INPUT; dir++)
|
||||
@@ -188,14 +186,12 @@ int ec_slave_config_attach(
|
||||
return -2;
|
||||
}
|
||||
if (slave->sii.vendor_id != sc->vendor_id
|
||||
|| slave->sii.product_code != sc->product_code
|
||||
|| slave->sii.revision_number != sc->revision_number) {
|
||||
EC_ERR("Slave %u has an invalid type (0x%08X/0x%08X/0x%08X) for"
|
||||
" configuration %u:%u (0x%08X/0x%08X/0x%08X).\n",
|
||||
slave->ring_position,
|
||||
slave->sii.vendor_id, slave->sii.product_code,
|
||||
slave->sii.revision_number, sc->alias, sc->position,
|
||||
sc->vendor_id, sc->product_code, sc->revision_number);
|
||||
|| slave->sii.product_code != sc->product_code) {
|
||||
EC_ERR("Slave %u has an invalid type (0x%08X/0x%08X) for"
|
||||
" configuration %u:%u (0x%08X/0x%08X).\n",
|
||||
slave->ring_position, slave->sii.vendor_id,
|
||||
slave->sii.product_code, sc->alias, sc->position,
|
||||
sc->vendor_id, sc->product_code);
|
||||
return -3;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ struct ec_slave_config {
|
||||
ring position. */
|
||||
uint32_t vendor_id; /**< Slave vendor ID. */
|
||||
uint32_t product_code; /**< Slave product code. */
|
||||
uint32_t revision_number; /**< Slave revision number. */
|
||||
|
||||
ec_slave_t *slave; /**< Slave pointer. This is \a NULL, if the slave is
|
||||
offline. */
|
||||
@@ -80,7 +79,7 @@ struct ec_slave_config {
|
||||
/*****************************************************************************/
|
||||
|
||||
void ec_slave_config_init(ec_slave_config_t *, ec_master_t *, uint16_t,
|
||||
uint16_t, uint32_t, uint32_t, uint32_t);
|
||||
uint16_t, uint32_t, uint32_t);
|
||||
void ec_slave_config_clear(ec_slave_config_t *);
|
||||
|
||||
int ec_slave_config_attach(ec_slave_config_t *);
|
||||
|
||||
Reference in New Issue
Block a user