equal
deleted
inserted
replaced
106 domain->working_counter = 0xFFFF; |
106 domain->working_counter = 0xFFFF; |
107 domain->working_counter_changes = 0; |
107 domain->working_counter_changes = 0; |
108 domain->notify_jiffies = 0; |
108 domain->notify_jiffies = 0; |
109 |
109 |
110 INIT_LIST_HEAD(&domain->datagrams); |
110 INIT_LIST_HEAD(&domain->datagrams); |
|
111 INIT_LIST_HEAD(&domain->fmmu_configs); |
111 |
112 |
112 // init kobject and add it to the hierarchy |
113 // init kobject and add it to the hierarchy |
113 memset(&domain->kobj, 0x00, sizeof(struct kobject)); |
114 memset(&domain->kobj, 0x00, sizeof(struct kobject)); |
114 kobject_init(&domain->kobj); |
115 kobject_init(&domain->kobj); |
115 domain->kobj.ktype = &ktype_ec_domain; |
116 domain->kobj.ktype = &ktype_ec_domain; |
200 fmmu->domain = domain; |
201 fmmu->domain = domain; |
201 |
202 |
202 domain->data_size += fmmu->data_size; |
203 domain->data_size += fmmu->data_size; |
203 wc_increment = working_counter_increment[fmmu->dir]; |
204 wc_increment = working_counter_increment[fmmu->dir]; |
204 domain->expected_working_counter += wc_increment; |
205 domain->expected_working_counter += wc_increment; |
|
206 |
|
207 list_add_tail(&fmmu->list, &domain->fmmu_configs); |
205 |
208 |
206 if (domain->master->debug_level) |
209 if (domain->master->debug_level) |
207 EC_DBG("Domain %u: Added %u bytes (now %u) with dir %u -> WC %u" |
210 EC_DBG("Domain %u: Added %u bytes (now %u) with dir %u -> WC %u" |
208 " (now %u).\n", domain->index, fmmu->data_size, |
211 " (now %u).\n", domain->index, fmmu->data_size, |
209 domain->data_size, fmmu->dir, wc_increment, |
212 domain->data_size, fmmu->dir, wc_increment, |
371 } |
374 } |
372 |
375 |
373 return 0; |
376 return 0; |
374 } |
377 } |
375 |
378 |
|
379 /*****************************************************************************/ |
|
380 |
|
381 unsigned int ec_domain_fmmu_count(const ec_domain_t *domain) |
|
382 { |
|
383 const ec_fmmu_config_t *fmmu; |
|
384 unsigned int num = 0; |
|
385 |
|
386 list_for_each_entry(fmmu, &domain->fmmu_configs, list) { |
|
387 num++; |
|
388 } |
|
389 |
|
390 return num; |
|
391 } |
|
392 |
|
393 /*****************************************************************************/ |
|
394 |
|
395 const ec_fmmu_config_t *ec_domain_find_fmmu( |
|
396 const ec_domain_t *domain, |
|
397 unsigned int index |
|
398 ) |
|
399 { |
|
400 const ec_fmmu_config_t *fmmu; |
|
401 |
|
402 list_for_each_entry(fmmu, &domain->fmmu_configs, list) { |
|
403 if (index--) |
|
404 continue; |
|
405 return fmmu; |
|
406 } |
|
407 |
|
408 return NULL; |
|
409 } |
|
410 |
376 /****************************************************************************** |
411 /****************************************************************************** |
377 * Realtime interface |
412 * Realtime interface |
378 *****************************************************************************/ |
413 *****************************************************************************/ |
379 |
414 |
380 int ecrt_domain_reg_pdo_entry_list(ec_domain_t *domain, |
415 int ecrt_domain_reg_pdo_entry_list(ec_domain_t *domain, |