equal
deleted
inserted
replaced
97 add_timer(&timer); |
97 add_timer(&timer); |
98 } |
98 } |
99 |
99 |
100 /*****************************************************************************/ |
100 /*****************************************************************************/ |
101 |
101 |
|
102 int request_lock(void *data) |
|
103 { |
|
104 return 0; |
|
105 } |
|
106 |
|
107 /*****************************************************************************/ |
|
108 |
|
109 void release_lock(void *data) |
|
110 { |
|
111 } |
|
112 |
|
113 /*****************************************************************************/ |
|
114 |
102 int __init init_mini_module(void) |
115 int __init init_mini_module(void) |
103 { |
116 { |
104 printk(KERN_INFO "=== Starting Minimal EtherCAT environment... ===\n"); |
117 printk(KERN_INFO "=== Starting Minimal EtherCAT environment... ===\n"); |
105 |
118 |
106 if ((master = ecrt_request_master(0)) == NULL) { |
119 if ((master = ecrt_request_master(0)) == NULL) { |
107 printk(KERN_ERR "Requesting master 0 failed!\n"); |
120 printk(KERN_ERR "Requesting master 0 failed!\n"); |
108 goto out_return; |
121 goto out_return; |
109 } |
122 } |
|
123 |
|
124 ecrt_master_callbacks(master, request_lock, release_lock, NULL); |
110 |
125 |
111 printk(KERN_INFO "Registering domain...\n"); |
126 printk(KERN_INFO "Registering domain...\n"); |
112 if (!(domain1 = ecrt_master_create_domain(master))) |
127 if (!(domain1 = ecrt_master_create_domain(master))) |
113 { |
128 { |
114 printk(KERN_ERR "Domain creation failed!\n"); |
129 printk(KERN_ERR "Domain creation failed!\n"); |
135 ecrt_master_print(master, 2); |
150 ecrt_master_print(master, 2); |
136 #else |
151 #else |
137 ecrt_master_print(master, 0); |
152 ecrt_master_print(master, 0); |
138 #endif |
153 #endif |
139 |
154 |
|
155 #if 1 |
|
156 if (ecrt_master_start_eoe(master)) { |
|
157 printk(KERN_ERR "Failed to start EoE processing!\n"); |
|
158 goto out_deactivate; |
|
159 } |
|
160 #endif |
140 |
161 |
141 #if 0 |
162 #if 0 |
142 if (!(slave = ecrt_master_get_slave(master, "5"))) { |
163 if (!(slave = ecrt_master_get_slave(master, "5"))) { |
143 printk(KERN_ERR "Failed to get slave 5!\n"); |
164 printk(KERN_ERR "Failed to get slave 5!\n"); |
144 goto out_deactivate; |
165 goto out_deactivate; |
178 add_timer(&timer); |
199 add_timer(&timer); |
179 |
200 |
180 printk(KERN_INFO "=== Minimal EtherCAT environment started. ===\n"); |
201 printk(KERN_INFO "=== Minimal EtherCAT environment started. ===\n"); |
181 return 0; |
202 return 0; |
182 |
203 |
183 #if 0 |
204 #if 1 |
184 out_deactivate: |
205 out_deactivate: |
185 ecrt_master_deactivate(master); |
206 ecrt_master_deactivate(master); |
186 #endif |
207 #endif |
187 out_release_master: |
208 out_release_master: |
188 ecrt_release_master(master); |
209 ecrt_release_master(master); |