198 printk(KERN_ERR "Error requesting master 0!\n"); |
198 printk(KERN_ERR "Error requesting master 0!\n"); |
199 goto out_msr_cleanup; |
199 goto out_msr_cleanup; |
200 } |
200 } |
201 |
201 |
202 printk(KERN_INFO "Registering domains...\n"); |
202 printk(KERN_INFO "Registering domains...\n"); |
203 |
|
204 if (!(domain1 = ecrt_master_create_domain(master))) { |
203 if (!(domain1 = ecrt_master_create_domain(master))) { |
205 printk(KERN_ERR "Could not register domain!\n"); |
204 printk(KERN_ERR "Could not register domain!\n"); |
206 goto out_release_master; |
205 goto out_release_master; |
207 } |
206 } |
208 |
207 |
209 printk(KERN_INFO "Registering domain fields...\n"); |
208 printk(KERN_INFO "Registering domain fields...\n"); |
210 |
|
211 if (ecrt_domain_register_field_list(domain1, domain1_fields)) { |
209 if (ecrt_domain_register_field_list(domain1, domain1_fields)) { |
212 printk(KERN_ERR "Failed to register domain fields.\n"); |
210 printk(KERN_ERR "Failed to register domain fields.\n"); |
213 goto out_release_master; |
211 goto out_release_master; |
214 } |
212 } |
215 |
213 |
216 printk(KERN_INFO "Activating master...\n"); |
214 printk(KERN_INFO "Activating master...\n"); |
217 |
|
218 if (ecrt_master_activate(master)) { |
215 if (ecrt_master_activate(master)) { |
219 printk(KERN_ERR "Could not activate master!\n"); |
216 printk(KERN_ERR "Could not activate master!\n"); |
220 goto out_release_master; |
217 goto out_release_master; |
221 } |
218 } |
222 |
219 |
223 ecrt_master_print(master); |
220 #if 0 |
224 |
|
225 //ecrt_master_debug(master, 2); |
|
226 if (ecrt_master_fetch_sdo_lists(master)) { |
221 if (ecrt_master_fetch_sdo_lists(master)) { |
227 printk(KERN_ERR "Failed to fetch SDO lists!\n"); |
222 printk(KERN_ERR "Failed to fetch SDO lists!\n"); |
228 goto out_deactivate; |
223 goto out_deactivate; |
229 } |
224 } |
230 //ecrt_master_debug(master, 0); |
225 ecrt_master_print(master, 2); |
231 |
226 #else |
232 ecrt_master_print(master); |
227 ecrt_master_print(master, 0); |
|
228 #endif |
|
229 |
233 |
230 |
234 #ifdef BLOCK1 |
231 #ifdef BLOCK1 |
235 if (!(slave = ecrt_master_get_slave(master, "1"))) { |
232 if (!(slave = ecrt_master_get_slave(master, "1"))) { |
236 printk(KERN_ERR "Failed to get slave 1!\n"); |
233 printk(KERN_ERR "Failed to get slave 1!\n"); |
237 goto out_deactivate; |
234 goto out_deactivate; |
285 ipipe_init_attr(&attr); |
282 ipipe_init_attr(&attr); |
286 attr.name = "IPIPE-MSR-MODULE"; |
283 attr.name = "IPIPE-MSR-MODULE"; |
287 attr.priority = IPIPE_ROOT_PRIO + 1; |
284 attr.priority = IPIPE_ROOT_PRIO + 1; |
288 attr.entry = &domain_entry; |
285 attr.entry = &domain_entry; |
289 ipipe_register_domain(&this_domain, &attr); |
286 ipipe_register_domain(&this_domain, &attr); |
290 |
|
291 return 0; |
287 return 0; |
292 |
288 |
293 out_deactivate: |
289 out_deactivate: |
294 ecrt_master_deactivate(master); |
290 ecrt_master_deactivate(master); |
295 out_release_master: |
291 out_release_master: |