master/domain.c
changeset 76 9dc136e3801c
parent 73 9f4ea66d89a3
child 84 b4ae98855cea
equal deleted inserted replaced
75:aae1b9520e4d 76:9dc136e3801c
   203     ec_slave_t *slave;
   203     ec_slave_t *slave;
   204     const ec_slave_type_t *type;
   204     const ec_slave_type_t *type;
   205     ec_master_t *master;
   205     ec_master_t *master;
   206     const ec_sync_t *sync;
   206     const ec_sync_t *sync;
   207     const ec_field_t *field;
   207     const ec_field_t *field;
   208     unsigned int field_idx, found, i, j;
   208     unsigned int field_idx, i, j;
   209     uint32_t field_offset;
   209     uint32_t field_offset;
   210 
   210 
   211     if (!field_count) {
   211     if (!field_count) {
   212         printk(KERN_ERR "EtherCAT: field_count may not be 0!\n");
   212         printk(KERN_ERR "EtherCAT: field_count may not be 0!\n");
   213         return NULL;
   213         return NULL;
   232                type->vendor_name, type->product_name);
   232                type->vendor_name, type->product_name);
   233         return NULL;
   233         return NULL;
   234     }
   234     }
   235 
   235 
   236     field_idx = 0;
   236     field_idx = 0;
   237     found = 0;
   237     for (i = 0; type->sync_managers[i]; i++) {
   238     for (i = 0; type->sync_managers[i] && !found; i++) {
       
   239         sync = type->sync_managers[i];
   238         sync = type->sync_managers[i];
   240         field_offset = 0;
   239         field_offset = 0;
   241         for (j = 0; sync->fields[j]; j++) {
   240         for (j = 0; sync->fields[j]; j++) {
   242             field = sync->fields[j];
   241             field = sync->fields[j];
   243             if (field->type == field_type) {
   242             if (field->type == field_type) {
   250             }
   249             }
   251             field_offset += field->size;
   250             field_offset += field->size;
   252         }
   251         }
   253     }
   252     }
   254 
   253 
   255     printk(KERN_ERR "EtherCAT: Slave %i (\"%s %s\") has less than %i fields of"
   254     printk(KERN_ERR "EtherCAT: Slave %i (\"%s %s\") has less than %i field(s)"
   256            " type %i, starting at %i!\n", slave->ring_position,
   255 	   " of type %i, starting at %i (only %i)!\n", slave->ring_position,
   257            vendor_name, product_name, field_count, field_type, field_index);
   256            vendor_name, product_name, field_count, field_type, field_index,
       
   257 	   field_idx);
   258     return NULL;
   258     return NULL;
   259 }
   259 }
   260 
   260 
   261 /*****************************************************************************/
   261 /*****************************************************************************/
   262 
   262