Line data Source code
1 :
2 : struct device;
3 :
4 : void *ldv_dev_get_drvdata(const struct device *dev);
5 : int ldv_dev_set_drvdata(struct device *dev, void *data);
6 :
7 : struct spi_master;
8 : struct device;
9 : struct spi_master *ldv_spi_alloc_master(struct device *host, unsigned size);
10 :
11 : #include <linux/ldv/err.h>
12 :
13 : #include <linux/types.h>
14 : void *ldv_kzalloc(size_t size, gfp_t flags);
15 :
16 : struct clk;
17 :
18 : extern void ldv_clk_disable(struct clk *clk);
19 : extern int ldv_clk_enable(void);
20 :
21 : #include <linux/ldv/common.h>
22 : #include <linux/ldv/irq.h>
23 : #include <verifier/common.h>
24 : #include <verifier/nondet.h>
25 : #include <verifier/memory.h>
26 : #include <verifier/thread.h>
27 :
28 : #include <linux/timer.h>
29 : #include <linux/usb.h>
30 :
31 :
32 : struct ldv_struct_insmod_7 {
33 : int signal_pending;
34 : };
35 1 :
36 : struct ldv_struct_timer_scenario_5 {
37 : struct timer_list *arg0;
38 : int signal_pending;
39 : };
40 1 :
41 : struct ldv_struct_usb_scenario_6 {
42 : struct usb_driver *arg0;
43 : int signal_pending;
44 : };
45 :
46 : /* EMG Function declarations */
47 : void ldv_dispatch_default_deregister_6_7_4(void);
48 : void ldv_dispatch_default_deregister_7_7_5(void);
49 : void ldv_dispatch_default_register_6_7_7(void);
50 : void ldv_dispatch_default_register_7_7_6(void);
51 : void ldv_dispatch_deregister_11_1(struct usb_driver *);
52 : void ldv_dispatch_insmod_deregister_14_2(void);
53 : void ldv_dispatch_insmod_register_14_3(void);
54 : void ldv_dispatch_instance_deregister_8_1(struct timer_list *);
55 : void ldv_dispatch_instance_register_10_3(struct timer_list *);
56 : void ldv_dispatch_register_13_3(struct usb_driver *);
57 : void ldv_dispatch_usb_reset_12_2(void);
58 : int ldv_emg_del_timer(struct timer_list *);
59 : int ldv_emg_del_timer_sync(struct timer_list *);
60 : int ldv_emg_mod_timer(struct timer_list *, long unsigned int);
61 : void ldv_emg_usb_deregister(struct usb_driver *);
62 : int ldv_emg_usb_register(struct usb_driver *);
63 : int ldv_emg_usb_reset_device(struct usb_device *);
64 : void ldv_insmod_7(void *);
65 : void ldv_insmod_hid_exit_7_2(void (*)(void));
66 : int ldv_insmod_hid_init_7_11(int (*)(void));
67 : void ldv_main_14(void *);
68 : void ldv_partially_ordered_scenario_1(void *);
69 : void ldv_partially_ordered_scenario_callback_1_17(int (*)(struct input_dev *, unsigned int, unsigned int, int), struct input_dev *, unsigned int, unsigned int, int);
70 : void ldv_partially_ordered_scenario_callback_1_20(int (*)(struct hid_device *), struct hid_device *);
71 : void ldv_partially_ordered_scenario_callback_1_21(int (*)(struct hid_device *), struct hid_device *);
72 : void ldv_partially_ordered_scenario_callback_1_22(int (*)(struct hid_device *, int), struct hid_device *, int);
73 : void ldv_partially_ordered_scenario_callback_1_4(void (*)(struct hid_device *), struct hid_device *);
74 : int ldv_partially_ordered_scenario_probe_1_12(int (*)(struct hid_device *), struct hid_device *);
75 : void ldv_partially_ordered_scenario_release_1_2(void (*)(struct hid_device *), struct hid_device *);
76 : void ldv_random_containerless_scenario_2(void *);
77 : void ldv_random_containerless_scenario_3(void *);
78 : void ldv_random_containerless_scenario_4(void *);
79 : void ldv_random_containerless_scenario_callback_2_10(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
80 : void ldv_random_containerless_scenario_callback_2_4(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
81 : void ldv_random_containerless_scenario_callback_3_10(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
82 : void ldv_random_containerless_scenario_callback_3_4(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
83 : void ldv_random_containerless_scenario_callback_4_10(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
84 : void ldv_random_containerless_scenario_callback_4_4(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
85 : void ldv_timer_scenario_5(void *);
86 : void ldv_timer_scenario_callback_5_2(void (*)(unsigned long), unsigned long);
87 : void ldv_usb_scenario_6(void *);
88 : void ldv_usb_scenario_post_6_10(int (*)(struct usb_interface *), struct usb_interface *);
89 : void ldv_usb_scenario_pre_6_11(int (*)(struct usb_interface *), struct usb_interface *);
90 : int ldv_usb_scenario_probe_6_14(int (*)(struct usb_interface *, struct usb_device_id *), struct usb_interface *, struct usb_device_id *);
91 : void ldv_usb_scenario_release_6_5(void (*)(struct usb_interface *), struct usb_interface *);
92 : void ldv_usb_scenario_resume_6_8(int (*)(struct usb_interface *), struct usb_interface *);
93 : int main(void);
94 :
95 : /* EMG variable declarations */
96 1 : struct ldv_thread ldv_thread_1;
97 1 : struct ldv_thread ldv_thread_14;
98 1 : struct ldv_thread ldv_thread_2;
99 1 : struct ldv_thread ldv_thread_3;
100 1 : struct ldv_thread ldv_thread_4;
101 1 : struct ldv_thread ldv_thread_5;
102 1 : struct ldv_thread ldv_thread_6;
103 1 : struct ldv_thread ldv_thread_7;
104 :
105 : /* EMG variable initialization */
106 :
107 : /* EMG function definitions */
108 : /* AUX_FUNC ldv_dispatch_default_deregister_6_7_4 */
109 : void ldv_dispatch_default_deregister_6_7_4() {
110 : struct ldv_struct_insmod_7 *cf_arg_1;
111 : /* Skip thread join call */
112 1 : return;
113 : }
114 :
115 : /* AUX_FUNC ldv_dispatch_default_deregister_7_7_5 */
116 : void ldv_dispatch_default_deregister_7_7_5() {
117 : struct ldv_struct_insmod_7 *cf_arg_2;
118 : struct ldv_struct_insmod_7 *cf_arg_3;
119 : struct ldv_struct_insmod_7 *cf_arg_4;
120 : /* Skip thread join call */
121 : /* Skip thread join call */
122 : /* Skip thread join call */
123 1 : return;
124 : }
125 :
126 : /* AUX_FUNC ldv_dispatch_default_register_6_7_7 */
127 : void ldv_dispatch_default_register_6_7_7() {
128 : struct ldv_struct_insmod_7 *cf_arg_1;
129 4 : cf_arg_1 = ldv_xmalloc(sizeof(struct ldv_struct_insmod_7));
130 3 : ldv_partially_ordered_scenario_1(cf_arg_1);
131 1 : return;
132 : }
133 :
134 : /* AUX_FUNC ldv_dispatch_default_register_7_7_6 */
135 : void ldv_dispatch_default_register_7_7_6() {
136 : struct ldv_struct_insmod_7 *cf_arg_2;
137 1 : struct ldv_struct_insmod_7 *cf_arg_3;
138 1 : struct ldv_struct_insmod_7 *cf_arg_4;
139 4 : cf_arg_2 = ldv_xmalloc(sizeof(struct ldv_struct_insmod_7));
140 3 : ldv_random_containerless_scenario_2(cf_arg_2);
141 4 : cf_arg_3 = ldv_xmalloc(sizeof(struct ldv_struct_insmod_7));
142 3 : ldv_random_containerless_scenario_3(cf_arg_3);
143 3 : cf_arg_4 = ldv_xmalloc(sizeof(struct ldv_struct_insmod_7));
144 2 : ldv_random_containerless_scenario_4(cf_arg_4);
145 1 : return;
146 : }
147 :
148 : /* AUX_FUNC ldv_dispatch_deregister_11_1 */
149 : void ldv_dispatch_deregister_11_1(struct usb_driver *arg0) {
150 : struct ldv_struct_usb_scenario_6 *cf_arg_6;
151 : /* Skip thread join call */
152 2 : return;
153 : }
154 :
155 : /* AUX_FUNC ldv_dispatch_insmod_deregister_14_2 */
156 : void ldv_dispatch_insmod_deregister_14_2() {
157 : struct ldv_struct_insmod_7 *cf_arg_7;
158 : /* Skip thread join call */
159 1 : return;
160 : }
161 :
162 : /* AUX_FUNC ldv_dispatch_insmod_register_14_3 */
163 : void ldv_dispatch_insmod_register_14_3() {
164 : struct ldv_struct_insmod_7 *cf_arg_7;
165 4 : cf_arg_7 = ldv_xmalloc(sizeof(struct ldv_struct_insmod_7));
166 4 : ldv_insmod_7(cf_arg_7);
167 1 : return;
168 : }
169 :
170 : /* AUX_FUNC ldv_dispatch_instance_deregister_8_1 */
171 : void ldv_dispatch_instance_deregister_8_1(struct timer_list *arg0) {
172 : struct ldv_struct_timer_scenario_5 *cf_arg_5;
173 : /* Skip thread join call */
174 1 : return;
175 : }
176 :
177 : /* AUX_FUNC ldv_dispatch_instance_register_10_3 */
178 : void ldv_dispatch_instance_register_10_3(struct timer_list *arg0) {
179 : struct ldv_struct_timer_scenario_5 *cf_arg_5;
180 16 : cf_arg_5 = ldv_xmalloc(sizeof(struct ldv_struct_timer_scenario_5));
181 8 : cf_arg_5->arg0 = arg0;
182 16 : ldv_timer_scenario_5(cf_arg_5);
183 4 : return;
184 : }
185 :
186 : /* AUX_FUNC ldv_dispatch_register_13_3 */
187 : void ldv_dispatch_register_13_3(struct usb_driver *arg0) {
188 : struct ldv_struct_usb_scenario_6 *cf_arg_6;
189 4 : cf_arg_6 = ldv_xmalloc(sizeof(struct ldv_struct_usb_scenario_6));
190 2 : cf_arg_6->arg0 = arg0;
191 3 : ldv_usb_scenario_6(cf_arg_6);
192 1 : return;
193 : }
194 :
195 : /* AUX_FUNC ldv_dispatch_usb_reset_12_2 */
196 : void ldv_dispatch_usb_reset_12_2() {
197 : struct ldv_struct_insmod_7 *cf_arg_6;
198 0 : return;
199 : }
200 :
201 : /* AUX_FUNC ldv_emg_del_timer */
202 : int ldv_emg_del_timer(struct timer_list *arg0) {
203 : /* LDV {"comment": "Control function 'del_timer'", "type": "CONTROL_FUNCTION_BEGIN", "function": "ldv_emg_del_timer"} */
204 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
205 : struct timer_list *ldv_8_timer_list_timer_list;
206 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
207 : /* LDV {"action": "ASSIGN", "type": "CONDITION_BEGIN", "comment": "Get timer representing structure."} */
208 1 : ldv_8_timer_list_timer_list = arg0;
209 : /* LDV {"action": "ASSIGN", "type": "CONDITION_END"} */
210 :
211 : /* LDV {"action": "INSTANCE_DEREGISTER", "type": "DISPATCH_BEGIN", "comment": "Deregister TIMER callbacks."} */
212 2 : ldv_dispatch_instance_deregister_8_1(ldv_8_timer_list_timer_list);
213 1 : /* LDV {"action": "INSTANCE_DEREGISTER", "type": "DISPATCH_END"} */
214 :
215 : /* Exit function at a terminal state */
216 : /* End of the process */
217 : /* LDV {"comment": "End of control function based on process 'del_timer'", "type": "CONTROL_FUNCTION_END", "function": "ldv_emg_del_timer"} */
218 : }
219 :
220 : /* AUX_FUNC ldv_emg_del_timer_sync */
221 : int ldv_emg_del_timer_sync(struct timer_list *arg0) {
222 : /* LDV {"comment": "Control function 'del_timer_sync'", "type": "CONTROL_FUNCTION_BEGIN", "function": "ldv_emg_del_timer_sync"} */
223 2 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
224 : struct timer_list *ldv_9_timer_list_timer_list;
225 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
226 : /* LDV {"action": "ASSIGN", "type": "CONDITION_BEGIN", "comment": "Get timer representing structure."} */
227 2 : ldv_9_timer_list_timer_list = arg0;
228 2 : /* LDV {"action": "ASSIGN", "type": "CONDITION_END"} */
229 :
230 : /* LDV {"action": "INSTANCE_DEREGISTER", "type": "DISPATCH_BEGIN", "comment": "Skip the action, since no callbacks has been found."} */
231 : /* Dispatch 'instance_deregister' is not expected by any process, skipping the action */
232 : /* Skip the dispatch because there is no process to receive the signal */
233 : /* LDV {"action": "INSTANCE_DEREGISTER", "type": "DISPATCH_END"} */
234 :
235 : /* Exit function at a terminal state */
236 : /* End of the process */
237 : /* LDV {"comment": "End of control function based on process 'del_timer_sync'", "type": "CONTROL_FUNCTION_END", "function": "ldv_emg_del_timer_sync"} */
238 : }
239 :
240 : /* AUX_FUNC ldv_emg_mod_timer */
241 : int ldv_emg_mod_timer(struct timer_list *arg0, long unsigned int arg1) {
242 : /* LDV {"comment": "Control function 'mod_timer'", "type": "CONTROL_FUNCTION_BEGIN", "function": "ldv_emg_mod_timer"} */
243 4 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
244 4 : struct timer_list *ldv_10_timer_list_timer_list;
245 4 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
246 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
247 :
248 16 : if (ldv_undef_int()) {
249 : /* LDV {"action": "ASSIGN", "type": "CONDITION_BEGIN", "comment": "Get timer representing structure."} */
250 4 : ldv_10_timer_list_timer_list = arg0;
251 : /* LDV {"action": "ASSIGN", "type": "CONDITION_END"} */
252 :
253 : /* LDV {"action": "INSTANCE_REGISTER", "type": "DISPATCH_BEGIN", "comment": "Register TIMER callbacks."} */
254 8 : ldv_dispatch_instance_register_10_3(ldv_10_timer_list_timer_list);
255 : /* LDV {"action": "INSTANCE_REGISTER", "type": "DISPATCH_END"} */
256 :
257 : /* LDV {"action": "SUCCESS", "type": "CONDITION_BEGIN", "comment": "Successfully modified a timer's timeout"} */
258 4 : return 0;
259 : /* LDV {"action": "SUCCESS", "type": "CONDITION_END"} */
260 :
261 : /* Exit function at a terminal state */
262 : }
263 : else {
264 : /* LDV {"action": "FAIL", "type": "CONDITION_BEGIN", "comment": "Failed to modify a timer's timeout"} */
265 12 : return ldv_undef_int_negative();
266 : /* LDV {"action": "FAIL", "type": "CONDITION_END"} */
267 :
268 : /* Exit function at a terminal state */
269 : }
270 : /* End of the process */
271 : /* LDV {"comment": "End of control function based on process 'mod_timer'", "type": "CONTROL_FUNCTION_END", "function": "ldv_emg_mod_timer"} */
272 : }
273 :
274 : /* AUX_FUNC ldv_emg_usb_deregister */
275 : void ldv_emg_usb_deregister(struct usb_driver *arg0) {
276 : /* LDV {"comment": "Control function 'usb_deregister'", "type": "CONTROL_FUNCTION_BEGIN", "function": "ldv_emg_usb_deregister"} */
277 2 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
278 : struct usb_driver *ldv_11_usb_driver_usb_driver;
279 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
280 : /* LDV {"action": "ASSIGN", "type": "CONDITION_BEGIN", "comment": "Get callbacks to deregister provided within 'usb_driver' argument."} */
281 2 : ldv_11_usb_driver_usb_driver = arg0;
282 : /* LDV {"action": "ASSIGN", "type": "CONDITION_END"} */
283 :
284 : /* LDV {"action": "DEREGISTER", "type": "DISPATCH_BEGIN", "comment": "Deregister USB callbacks."} */
285 4 : ldv_dispatch_deregister_11_1(ldv_11_usb_driver_usb_driver);
286 : /* LDV {"action": "DEREGISTER", "type": "DISPATCH_END"} */
287 :
288 : /* Exit function at a terminal state */
289 2 : return;
290 : /* End of the process */
291 : return;
292 : /* LDV {"comment": "End of control function based on process 'usb_deregister'", "type": "CONTROL_FUNCTION_END", "function": "ldv_emg_usb_deregister"} */
293 : }
294 :
295 : /* AUX_FUNC ldv_emg_usb_register */
296 : int ldv_emg_usb_register(struct usb_driver *arg0) {
297 : /* LDV {"comment": "Control function 'usb_register'", "type": "CONTROL_FUNCTION_BEGIN", "function": "ldv_emg_usb_register"} */
298 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
299 1 : struct usb_driver *ldv_13_usb_driver_usb_driver;
300 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
301 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
302 :
303 4 : if (ldv_undef_int()) {
304 : /* LDV {"action": "ASSIGN", "type": "CONDITION_BEGIN", "comment": "Get 'usb' callbacks to register."} */
305 1 : ldv_13_usb_driver_usb_driver = arg0;
306 : /* LDV {"action": "ASSIGN", "type": "CONDITION_END"} */
307 :
308 : /* LDV {"action": "REGISTER", "type": "DISPATCH_BEGIN", "comment": "Register USB callbacks."} */
309 2 : ldv_dispatch_register_13_3(ldv_13_usb_driver_usb_driver);
310 : /* LDV {"action": "REGISTER", "type": "DISPATCH_END"} */
311 :
312 : /* LDV {"action": "FAIL", "type": "CONDITION_BEGIN", "comment": "Fail registration of 'usb' callbacks."} */
313 3 : return ldv_undef_int_negative();
314 : /* LDV {"action": "FAIL", "type": "CONDITION_END"} */
315 :
316 : /* Exit function at a terminal state */
317 : }
318 : else {
319 : /* LDV {"action": "SUCCESS", "type": "CONDITION_BEGIN", "comment": "Registration of 'usb' callbacks has been successful."} */
320 1 : return 0;
321 : /* LDV {"action": "SUCCESS", "type": "CONDITION_END"} */
322 :
323 : /* Exit function at a terminal state */
324 : }
325 : /* End of the process */
326 : /* LDV {"comment": "End of control function based on process 'usb_register'", "type": "CONTROL_FUNCTION_END", "function": "ldv_emg_usb_register"} */
327 : }
328 :
329 : /* AUX_FUNC ldv_emg_usb_reset_device */
330 : int ldv_emg_usb_reset_device(struct usb_device *arg0) {
331 : /* LDV {"comment": "Control function 'usb_reset_device'", "type": "CONTROL_FUNCTION_BEGIN", "function": "ldv_emg_usb_reset_device"} */
332 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
333 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
334 : /* LDV {"action": "USB_RESET", "type": "DISPATCH_BEGIN", "comment": "Trigger reset of the USB device."} */
335 0 : ldv_dispatch_usb_reset_12_2();
336 : /* LDV {"action": "USB_RESET", "type": "DISPATCH_END"} */
337 :
338 : /* LDV {"action": "SUCCESS", "type": "CONDITION_BEGIN", "comment": "Proceed to reset."} */
339 0 : return 0;
340 : /* LDV {"action": "SUCCESS", "type": "CONDITION_END"} */
341 :
342 : /* Exit function at a terminal state */
343 : /* End of the process */
344 : /* LDV {"comment": "End of control function based on process 'usb_reset_device'", "type": "CONTROL_FUNCTION_END", "function": "ldv_emg_usb_reset_device"} */
345 : }
346 :
347 : /* AUX_FUNC ldv_insmod_7 */
348 : void ldv_insmod_7(void *arg0) {
349 : /* LDV {"thread": 7, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'insmod(artificial)'", "function": "ldv_insmod_7"} */
350 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
351 1 : void (*ldv_7_hid_exit_default)(void);
352 1 : int (*ldv_7_hid_init_default)(void);
353 1 : int ldv_7_ret_default;
354 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
355 : /* LDV {"action": "INSMOD_REGISTER", "type": "RECEIVE_BEGIN", "comment": "Trigger module initialization."} */
356 2 : ldv_free(arg0);
357 : /* LDV {"action": "INSMOD_REGISTER", "type": "RECEIVE_END"} */
358 :
359 : /* LDV {"action": "HID_INIT", "type": "CALL_BEGIN", "callback": true, "comment": "Initialize the module after insmod with 'hid_init' function. Invoke callback hid_init from ARTIFICIAL."} */
360 : /* LDV {"type": "CALLBACK", "call": "ldv_7_ret_default = (hid_init)();", "comment": "hid_init"} */
361 2 : ldv_7_ret_default = ldv_insmod_hid_init_7_11(ldv_7_hid_init_default);
362 : /* Callback post-call */
363 2 : ldv_7_ret_default = ldv_post_init(ldv_7_ret_default);
364 : /* LDV {"action": "HID_INIT", "type": "CALL_END"} */
365 :
366 4 : if (ldv_undef_int()) {
367 : /* LDV {"action": "INIT_FAILED", "type": "CONDITION_BEGIN", "comment": "Failed to initialize the module."} */
368 2 : ldv_assume(ldv_7_ret_default != 0);
369 : /* LDV {"action": "INIT_FAILED", "type": "CONDITION_END"} */
370 :
371 : /* LDV {"action": "INSMOD_DEREGISTER", "type": "RECEIVE_BEGIN", "comment": "Trigger module exit."} */
372 : /* Skip a non-replicative signal receiving */
373 : /* LDV {"action": "INSMOD_DEREGISTER", "type": "RECEIVE_END"} */
374 :
375 : /* Exit function at a terminal state */
376 1 : return;
377 : }
378 : else {
379 : /* LDV {"action": "INIT_SUCCESS", "type": "CONDITION_BEGIN", "comment": "Module has been initialized."} */
380 2 : ldv_assume(ldv_7_ret_default == 0);
381 : /* LDV {"action": "INIT_SUCCESS", "type": "CONDITION_END"} */
382 :
383 4 : if (ldv_undef_int()) {
384 : /* LDV {"action": "DEFAULT_REGISTER_6", "type": "DISPATCH_BEGIN", "comment": "Register 'STRUCT_HID_LL_DRIVER' callbacks with unknown registration function."} */
385 2 : ldv_dispatch_default_register_6_7_7();
386 : /* LDV {"action": "DEFAULT_REGISTER_6", "type": "DISPATCH_END"} */
387 :
388 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "DISPATCH_BEGIN", "comment": "Register 'STRUCT_KPARAM_ARRAY' callbacks with unknown registration function."} */
389 2 : ldv_dispatch_default_register_7_7_6();
390 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "DISPATCH_END"} */
391 :
392 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "DISPATCH_BEGIN", "comment": "Deregister 'STRUCT_KPARAM_ARRAY' callbacks with unknown deregistration function."} */
393 2 : ldv_dispatch_default_deregister_7_7_5();
394 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "DISPATCH_END"} */
395 :
396 : /* LDV {"action": "DEFAULT_DEREGISTER_6", "type": "DISPATCH_BEGIN", "comment": "Deregister 'STRUCT_HID_LL_DRIVER' callbacks with unknown deregistration function."} */
397 2 : ldv_dispatch_default_deregister_6_7_4();
398 : /* LDV {"action": "DEFAULT_DEREGISTER_6", "type": "DISPATCH_END"} */
399 :
400 : }
401 : else {
402 : /* LDV {"action": "NONE", "type": "CONDITION_BEGIN", "comment": "Skip default callbacks registrations and deregistrations."} */
403 : /* LDV {"action": "NONE", "type": "CONDITION_END"} */
404 :
405 : }
406 : /* LDV {"action": "HID_EXIT", "type": "CALL_BEGIN", "callback": true, "comment": "Exit the module before its unloading with 'hid_exit' function. Invoke callback hid_exit from ARTIFICIAL."} */
407 : /* LDV {"type": "CALLBACK", "call": "(hid_exit)();", "comment": "hid_exit"} */
408 4 : ldv_insmod_hid_exit_7_2(ldv_7_hid_exit_default);
409 : /* LDV {"action": "HID_EXIT", "type": "CALL_END"} */
410 :
411 : /* LDV {"action": "INSMOD_DEREGISTER", "type": "RECEIVE_BEGIN", "comment": "Trigger module exit."} */
412 : /* Skip a non-replicative signal receiving */
413 : /* LDV {"action": "INSMOD_DEREGISTER", "type": "RECEIVE_END"} */
414 :
415 : /* Exit function at a terminal state */
416 1 : return;
417 : }
418 : /* End of the process */
419 : return;
420 : /* LDV {"comment": "End of control function based on process 'insmod(artificial)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_insmod_7"} */
421 : }
422 :
423 : /* AUX_FUNC_CALLBACK ldv_insmod_hid_exit_7_2 */
424 : void ldv_insmod_hid_exit_7_2(void (*arg0)(void)) {
425 4 : (hid_exit)();
426 2 : }
427 :
428 : /* AUX_FUNC_CALLBACK ldv_insmod_hid_init_7_11 */
429 : int ldv_insmod_hid_init_7_11(int (*arg0)(void)) {
430 7 : return (hid_init)();
431 1 : }
432 :
433 : /* AUX_FUNC ldv_main_14 */
434 : void ldv_main_14(void *arg0) {
435 : /* LDV {"thread": 14, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'main(main)'", "function": "ldv_main_14"} */
436 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
437 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
438 : /* LDV {"action": "INIT", "type": "CONDITION_BEGIN", "comment": "Initialize rule models."} */
439 1 : ldv_initialize();
440 : /* LDV {"action": "INIT", "type": "CONDITION_END"} */
441 :
442 : /* LDV {"action": "INSMOD_REGISTER", "type": "DISPATCH_BEGIN", "comment": "Start environment model scenarios."} */
443 2 : ldv_dispatch_insmod_register_14_3();
444 : /* LDV {"action": "INSMOD_REGISTER", "type": "DISPATCH_END"} */
445 :
446 : /* LDV {"action": "INSMOD_DEREGISTER", "type": "DISPATCH_BEGIN", "comment": "Stop environment model scenarios."} */
447 2 : ldv_dispatch_insmod_deregister_14_2();
448 : /* LDV {"action": "INSMOD_DEREGISTER", "type": "DISPATCH_END"} */
449 :
450 : /* LDV {"action": "FINAL", "type": "CONDITION_BEGIN", "comment": "Check rule model state at the exit."} */
451 1 : ldv_check_final_state();
452 1 : ldv_stop();
453 : /* LDV {"action": "FINAL", "type": "CONDITION_END"} */
454 :
455 : /* Exit function at a terminal state */
456 0 : return;
457 : /* End of the process */
458 : return;
459 : /* LDV {"comment": "End of control function based on process 'main(main)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_main_14"} */
460 : }
461 :
462 : /* AUX_FUNC ldv_partially_ordered_scenario_1 */
463 : void ldv_partially_ordered_scenario_1(void *arg0) {
464 : /* LDV {"thread": 1, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'partially_ordered_scenario(struct_hid_ll_driver)'", "function": "ldv_partially_ordered_scenario_1"} */
465 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
466 1 : void (*ldv_1_callback_close)(struct hid_device *);
467 : int (*ldv_1_callback_hidinput_input_event)(struct input_dev *, unsigned int, unsigned int, int);
468 1 : int (*ldv_1_callback_open)(struct hid_device *);
469 1 : int (*ldv_1_callback_parse)(struct hid_device *);
470 1 : int (*ldv_1_callback_power)(struct hid_device *, int);
471 1 : struct hid_ll_driver *ldv_1_container_struct_hid_ll_driver;
472 1 : unsigned int ldv_1_ldv_param_17_1_default;
473 1 : unsigned int ldv_1_ldv_param_17_2_default;
474 1 : int ldv_1_ldv_param_17_3_default;
475 1 : int ldv_1_ldv_param_22_1_default;
476 1 : struct hid_device *ldv_1_resource_struct_hid_device_ptr;
477 1 : struct input_dev *ldv_1_resource_struct_input_dev_ptr;
478 1 : int ldv_1_ret_default;
479 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
480 1 : /* Initialize automaton variables */
481 2 : ldv_1_ret_default = 1;
482 1 : /* LDV {"action": "DEFAULT_REGISTER_6", "type": "RECEIVE_BEGIN", "comment": "Begin STRUCT_HID_LL_DRIVER callbacks invocations scenario."} */
483 3 : ldv_free(arg0);
484 1 : /* LDV {"action": "DEFAULT_REGISTER_6", "type": "RECEIVE_END"} */
485 :
486 : /* LDV {"action": "DEFAULT_ALLOC_6", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
487 3 : ldv_1_container_struct_hid_ll_driver = ldv_xmalloc_unknown_size(0);
488 : /* LDV {"action": "DEFAULT_ALLOC_6", "type": "CONDITION_END"} */
489 :
490 : /* LDV {"action": "INIT", "type": "CONDITION_BEGIN", "comment": "Alloc memory for common callback arguments."} */
491 3 : ldv_1_resource_struct_hid_device_ptr = ldv_xmalloc_unknown_size(0);
492 3 : ldv_1_resource_struct_input_dev_ptr = ldv_xmalloc_unknown_size(0);
493 : /* LDV {"action": "INIT", "type": "CONDITION_END"} */
494 :
495 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Start with an initialization callback."} */
496 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
497 :
498 : /* Jump to a subprocess 'main' initial state */
499 1 : goto ldv_main_1;
500 : /* End of the process */
501 : return;
502 1 :
503 : /* Sbprocess main */
504 : ldv_main_1:
505 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
506 :
507 4 : if (ldv_undef_int()) {
508 : /* LDV {"action": "PROBE", "type": "CALL_BEGIN", "callback": true, "comment": "Call an initialization callback. Invoke callback start from hid_ll_driver."} */
509 : /* LDV {"type": "CALLBACK", "call": "ldv_1_ret_default = ((& usbhid_start))(ldv_1_resource_struct_hid_device_ptr);", "comment": "probe"} */
510 2 : ldv_1_ret_default = ldv_partially_ordered_scenario_probe_1_12(ldv_1_container_struct_hid_ll_driver->start, ldv_1_resource_struct_hid_device_ptr);
511 : /* Callback post-call */
512 2 : ldv_1_ret_default = ldv_filter_err_code(ldv_1_ret_default);
513 : /* LDV {"action": "PROBE", "type": "CALL_END"} */
514 :
515 4 : if (ldv_undef_int()) {
516 : /* LDV {"action": "Y_RET", "type": "CONDITION_BEGIN", "comment": "Initialization has been successful."} */
517 2 : ldv_assume(ldv_1_ret_default == 0);
518 : /* LDV {"action": "Y_RET", "type": "CONDITION_END"} */
519 :
520 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Initializations are done, proceed to the other callbacks."} */
521 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
522 :
523 : /* Jump to a subprocess 'call' initial state */
524 1 : goto ldv_call_1;
525 : }
526 : else {
527 : /* LDV {"action": "N_RET", "type": "CONDITION_BEGIN", "comment": "Initialization has failed."} */
528 2 : ldv_assume(ldv_1_ret_default != 0);
529 : /* LDV {"action": "N_RET", "type": "CONDITION_END"} */
530 :
531 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Start with an initialization callback."} */
532 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
533 :
534 : /* Jump to a subprocess 'main' initial state */
535 1 : goto ldv_main_1;
536 : }
537 : }
538 : else {
539 : /* LDV {"action": "FREE", "type": "CONDITION_BEGIN", "comment": "Free memory for common callback arguments."} */
540 2 : ldv_free(ldv_1_resource_struct_hid_device_ptr);
541 2 : ldv_free(ldv_1_resource_struct_input_dev_ptr);
542 : /* LDV {"action": "FREE", "type": "CONDITION_END"} */
543 :
544 : /* LDV {"action": "DEFAULT_FREE_6", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
545 2 : ldv_free(ldv_1_container_struct_hid_ll_driver);
546 : /* LDV {"action": "DEFAULT_FREE_6", "type": "CONDITION_END"} */
547 :
548 : /* LDV {"action": "DEFAULT_DEREGISTER_6", "type": "RECEIVE_BEGIN", "comment": "Finish STRUCT_HID_LL_DRIVER callbacks invocations scenario."} */
549 : /* Skip a non-replicative signal receiving */
550 : /* LDV {"action": "DEFAULT_DEREGISTER_6", "type": "RECEIVE_END"} */
551 :
552 : /* Exit function at a terminal state */
553 1 : return;
554 : }
555 : /* End of the subprocess 'main' */
556 : return;
557 1 :
558 : /* Sbprocess call */
559 : ldv_call_1:
560 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
561 :
562 2 : switch (ldv_undef_int()) {
563 3 : case 1: {
564 : /* LDV {"action": "PRE_CALL_22", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
565 : /* LDV {"action": "PRE_CALL_22", "type": "CONDITION_END"} */
566 :
567 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback power from hid_ll_driver."} */
568 : /* LDV {"type": "CALLBACK", "call": "((& usbhid_power))(ldv_1_resource_struct_hid_device_ptr, ldv_1_ldv_param_22_1_default);", "comment": "callback"} */
569 2 : ldv_partially_ordered_scenario_callback_1_22(ldv_1_callback_power, ldv_1_resource_struct_hid_device_ptr, ldv_1_ldv_param_22_1_default);
570 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
571 :
572 : /* LDV {"action": "POST_CALL_22", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
573 : /* LDV {"action": "POST_CALL_22", "type": "CONDITION_END"} */
574 :
575 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Initializations are done, proceed to the other callbacks."} */
576 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
577 :
578 : /* Jump to a subprocess 'call' initial state */
579 1 : goto ldv_call_1;
580 1 : break;
581 : }
582 3 : case 2: {
583 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback parse from hid_ll_driver."} */
584 : /* LDV {"type": "CALLBACK", "call": "((& usbhid_parse))(ldv_1_resource_struct_hid_device_ptr);", "comment": "callback"} */
585 2 : ldv_partially_ordered_scenario_callback_1_21(ldv_1_callback_parse, ldv_1_resource_struct_hid_device_ptr);
586 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
587 :
588 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Initializations are done, proceed to the other callbacks."} */
589 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
590 :
591 : /* Jump to a subprocess 'call' initial state */
592 1 : goto ldv_call_1;
593 : /* Jump to a subprocess 'call' initial state */
594 : goto ldv_call_1;
595 1 : break;
596 : }
597 3 : case 3: {
598 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback open from hid_ll_driver."} */
599 : /* LDV {"type": "CALLBACK", "call": "((& usbhid_open))(ldv_1_resource_struct_hid_device_ptr);", "comment": "callback"} */
600 2 : ldv_partially_ordered_scenario_callback_1_20(ldv_1_callback_open, ldv_1_resource_struct_hid_device_ptr);
601 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
602 :
603 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Initializations are done, proceed to the other callbacks."} */
604 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
605 :
606 : /* Jump to a subprocess 'call' initial state */
607 1 : goto ldv_call_1;
608 : /* Jump to a subprocess 'call' initial state */
609 : goto ldv_call_1;
610 : /* Jump to a subprocess 'call' initial state */
611 : goto ldv_call_1;
612 1 : break;
613 : }
614 3 : case 4: {
615 : /* LDV {"action": "PRE_CALL_17", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
616 : /* LDV {"action": "PRE_CALL_17", "type": "CONDITION_END"} */
617 :
618 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback hidinput_input_event from hid_ll_driver."} */
619 : /* LDV {"type": "CALLBACK", "call": "((& usb_hidinput_input_event))(ldv_1_resource_struct_input_dev_ptr, ldv_1_ldv_param_17_1_default, ldv_1_ldv_param_17_2_default, ldv_1_ldv_param_17_3_default);", "comment": "callback"} */
620 2 : ldv_partially_ordered_scenario_callback_1_17(ldv_1_callback_hidinput_input_event, ldv_1_resource_struct_input_dev_ptr, ldv_1_ldv_param_17_1_default, ldv_1_ldv_param_17_2_default, ldv_1_ldv_param_17_3_default);
621 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
622 :
623 : /* LDV {"action": "POST_CALL_17", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
624 : /* LDV {"action": "POST_CALL_17", "type": "CONDITION_END"} */
625 :
626 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Initializations are done, proceed to the other callbacks."} */
627 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
628 :
629 : /* Jump to a subprocess 'call' initial state */
630 1 : goto ldv_call_1;
631 : /* Jump to a subprocess 'call' initial state */
632 : goto ldv_call_1;
633 : /* Jump to a subprocess 'call' initial state */
634 : goto ldv_call_1;
635 : /* Jump to a subprocess 'call' initial state */
636 : goto ldv_call_1;
637 1 : break;
638 : }
639 3 : case 5: {
640 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback close from hid_ll_driver."} */
641 : /* LDV {"type": "CALLBACK", "call": "((& usbhid_close))(ldv_1_resource_struct_hid_device_ptr);", "comment": "callback"} */
642 2 : ldv_partially_ordered_scenario_callback_1_4(ldv_1_callback_close, ldv_1_resource_struct_hid_device_ptr);
643 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
644 :
645 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Initializations are done, proceed to the other callbacks."} */
646 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
647 :
648 : /* Jump to a subprocess 'call' initial state */
649 1 : goto ldv_call_1;
650 : /* Jump to a subprocess 'call' initial state */
651 : goto ldv_call_1;
652 : /* Jump to a subprocess 'call' initial state */
653 : goto ldv_call_1;
654 : /* Jump to a subprocess 'call' initial state */
655 : goto ldv_call_1;
656 : /* Jump to a subprocess 'call' initial state */
657 : goto ldv_call_1;
658 1 : break;
659 : }
660 3 : case 6: {
661 : /* LDV {"action": "RELEASE", "type": "CALL_BEGIN", "callback": true, "comment": "Do uninitializations before deregistration. Invoke callback stop from hid_ll_driver."} */
662 : /* LDV {"type": "CALLBACK", "call": "((& usbhid_stop))(ldv_1_resource_struct_hid_device_ptr);", "comment": "release"} */
663 2 : ldv_partially_ordered_scenario_release_1_2(ldv_1_container_struct_hid_ll_driver->stop, ldv_1_resource_struct_hid_device_ptr);
664 : /* LDV {"action": "RELEASE", "type": "CALL_END"} */
665 :
666 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Start with an initialization callback."} */
667 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
668 :
669 : /* Jump to a subprocess 'main' initial state */
670 1 : goto ldv_main_1;
671 1 : break;
672 : }
673 2 : default: ldv_stop();
674 1 : }
675 0 : /* End of the subprocess 'call' */
676 0 : return;
677 : /* LDV {"comment": "End of control function based on process 'partially_ordered_scenario(struct_hid_ll_driver)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_partially_ordered_scenario_1"} */
678 : }
679 :
680 : /* AUX_FUNC_CALLBACK ldv_partially_ordered_scenario_callback_1_17 */
681 : void ldv_partially_ordered_scenario_callback_1_17(int (*arg0)(struct input_dev *, unsigned int, unsigned int, int), struct input_dev *arg1, unsigned int arg2, unsigned int arg3, int arg4) {
682 4 : ((& usb_hidinput_input_event))(arg1, arg2, arg3, arg4);
683 1 : }
684 :
685 : /* AUX_FUNC_CALLBACK ldv_partially_ordered_scenario_callback_1_20 */
686 : void ldv_partially_ordered_scenario_callback_1_20(int (*arg0)(struct hid_device *), struct hid_device *arg1) {
687 4 : ((& usbhid_open))(arg1);
688 1 : }
689 :
690 : /* AUX_FUNC_CALLBACK ldv_partially_ordered_scenario_callback_1_21 */
691 : void ldv_partially_ordered_scenario_callback_1_21(int (*arg0)(struct hid_device *), struct hid_device *arg1) {
692 5 : ((& usbhid_parse))(arg1);
693 1 : }
694 :
695 : /* AUX_FUNC_CALLBACK ldv_partially_ordered_scenario_callback_1_22 */
696 : void ldv_partially_ordered_scenario_callback_1_22(int (*arg0)(struct hid_device *, int), struct hid_device *arg1, int arg2) {
697 4 : ((& usbhid_power))(arg1, arg2);
698 1 : }
699 :
700 : /* AUX_FUNC_CALLBACK ldv_partially_ordered_scenario_callback_1_4 */
701 : void ldv_partially_ordered_scenario_callback_1_4(void (*arg0)(struct hid_device *), struct hid_device *arg1) {
702 3 : ((& usbhid_close))(arg1);
703 1 : }
704 :
705 : /* AUX_FUNC_CALLBACK ldv_partially_ordered_scenario_probe_1_12 */
706 : int ldv_partially_ordered_scenario_probe_1_12(int (*arg0)(struct hid_device *), struct hid_device *arg1) {
707 5 : return ((& usbhid_start))(arg1);
708 : }
709 1 :
710 : /* AUX_FUNC_CALLBACK ldv_partially_ordered_scenario_release_1_2 */
711 : void ldv_partially_ordered_scenario_release_1_2(void (*arg0)(struct hid_device *), struct hid_device *arg1) {
712 3 : ((& usbhid_stop))(arg1);
713 1 : }
714 :
715 : /* AUX_FUNC ldv_random_containerless_scenario_2 */
716 : void ldv_random_containerless_scenario_2(void *arg0) {
717 : /* LDV {"thread": 2, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'random_containerless_scenario(struct_kparam_array)'", "function": "ldv_random_containerless_scenario_2"} */
718 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
719 1 : int (*ldv_2_callback_get)(char *, struct kernel_param *);
720 1 : int (*ldv_2_callback_set)(char *, struct kernel_param *);
721 1 : struct kernel_param *ldv_2_container_struct_kernel_param_ptr;
722 1 : char *ldv_2_ldv_param_10_0_default;
723 1 : char *ldv_2_ldv_param_4_0_default;
724 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
725 1 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "RECEIVE_BEGIN", "comment": "Begin STRUCT_KPARAM_ARRAY callbacks invocations scenario."} */
726 3 : ldv_free(arg0);
727 1 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "RECEIVE_END"} */
728 :
729 : /* LDV {"action": "DEFAULT_ALLOC_7", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
730 3 : ldv_2_container_struct_kernel_param_ptr = ldv_xmalloc_unknown_size(0);
731 : /* LDV {"action": "DEFAULT_ALLOC_7", "type": "CONDITION_END"} */
732 :
733 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
734 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
735 :
736 : /* Jump to a subprocess 'call' initial state */
737 1 : goto ldv_call_2;
738 : /* End of the process */
739 : return;
740 1 :
741 : /* Sbprocess call */
742 : ldv_call_2:
743 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
744 :
745 4 : if (ldv_undef_int()) {
746 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
747 3 : ldv_2_ldv_param_4_0_default = ldv_xmalloc_unknown_size(0);
748 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_END"} */
749 :
750 4 : if (ldv_undef_int()) {
751 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
752 3 : ldv_2_ldv_param_10_0_default = ldv_xmalloc_unknown_size(0);
753 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_END"} */
754 :
755 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback set from kernel_param."} */
756 : /* LDV {"type": "CALLBACK", "call": "((& param_set_charp))(ldv_2_ldv_param_10_0_default, ldv_2_container_struct_kernel_param_ptr);", "comment": "callback"} */
757 2 : ldv_random_containerless_scenario_callback_2_10(ldv_2_callback_set, ldv_2_ldv_param_10_0_default, ldv_2_container_struct_kernel_param_ptr);
758 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
759 :
760 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
761 2 : ldv_free(ldv_2_ldv_param_10_0_default);
762 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_END"} */
763 :
764 : }
765 : else {
766 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback get from kernel_param."} */
767 : /* LDV {"type": "CALLBACK", "call": "((& param_get_charp))(ldv_2_ldv_param_4_0_default, ldv_2_container_struct_kernel_param_ptr);", "comment": "callback"} */
768 2 : ldv_random_containerless_scenario_callback_2_4(ldv_2_callback_get, ldv_2_ldv_param_4_0_default, ldv_2_container_struct_kernel_param_ptr);
769 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
770 :
771 : }
772 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
773 4 : ldv_free(ldv_2_ldv_param_4_0_default);
774 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_END"} */
775 :
776 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
777 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
778 :
779 : /* Jump to a subprocess 'call' initial state */
780 1 : goto ldv_call_2;
781 : }
782 : else {
783 : /* LDV {"action": "DEFAULT_FREE_7", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
784 2 : ldv_free(ldv_2_container_struct_kernel_param_ptr);
785 : /* LDV {"action": "DEFAULT_FREE_7", "type": "CONDITION_END"} */
786 :
787 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "RECEIVE_BEGIN", "comment": "Finish STRUCT_KPARAM_ARRAY callbacks invocations scenario."} */
788 : /* Skip a non-replicative signal receiving */
789 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "RECEIVE_END"} */
790 :
791 : /* Exit function at a terminal state */
792 1 : return;
793 : }
794 : /* End of the subprocess 'call' */
795 : return;
796 : /* LDV {"comment": "End of control function based on process 'random_containerless_scenario(struct_kparam_array)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_random_containerless_scenario_2"} */
797 : }
798 :
799 : /* AUX_FUNC ldv_random_containerless_scenario_3 */
800 : void ldv_random_containerless_scenario_3(void *arg0) {
801 : /* LDV {"thread": 3, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'random_containerless_scenario(struct_kparam_array)'", "function": "ldv_random_containerless_scenario_3"} */
802 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
803 1 : int (*ldv_3_callback_get)(char *, struct kernel_param *);
804 1 : int (*ldv_3_callback_set)(char *, struct kernel_param *);
805 1 : struct kernel_param *ldv_3_container_struct_kernel_param_ptr;
806 1 : char *ldv_3_ldv_param_10_0_default;
807 1 : char *ldv_3_ldv_param_4_0_default;
808 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
809 1 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "RECEIVE_BEGIN", "comment": "Begin STRUCT_KPARAM_ARRAY callbacks invocations scenario."} */
810 3 : ldv_free(arg0);
811 1 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "RECEIVE_END"} */
812 :
813 : /* LDV {"action": "DEFAULT_ALLOC_7", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
814 3 : ldv_3_container_struct_kernel_param_ptr = ldv_xmalloc_unknown_size(0);
815 : /* LDV {"action": "DEFAULT_ALLOC_7", "type": "CONDITION_END"} */
816 :
817 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
818 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
819 :
820 : /* Jump to a subprocess 'call' initial state */
821 1 : goto ldv_call_3;
822 : /* End of the process */
823 : return;
824 1 :
825 : /* Sbprocess call */
826 : ldv_call_3:
827 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
828 :
829 4 : if (ldv_undef_int()) {
830 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
831 3 : ldv_3_ldv_param_4_0_default = ldv_xmalloc_unknown_size(0);
832 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_END"} */
833 :
834 4 : if (ldv_undef_int()) {
835 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
836 3 : ldv_3_ldv_param_10_0_default = ldv_xmalloc_unknown_size(0);
837 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_END"} */
838 :
839 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback set from kernel_param."} */
840 : /* LDV {"type": "CALLBACK", "call": "((& param_array_set))(ldv_3_ldv_param_10_0_default, ldv_3_container_struct_kernel_param_ptr);", "comment": "callback"} */
841 2 : ldv_random_containerless_scenario_callback_3_10(ldv_3_callback_set, ldv_3_ldv_param_10_0_default, ldv_3_container_struct_kernel_param_ptr);
842 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
843 :
844 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
845 2 : ldv_free(ldv_3_ldv_param_10_0_default);
846 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_END"} */
847 :
848 : }
849 : else {
850 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback get from kernel_param."} */
851 : /* LDV {"type": "CALLBACK", "call": "((& param_array_get))(ldv_3_ldv_param_4_0_default, ldv_3_container_struct_kernel_param_ptr);", "comment": "callback"} */
852 2 : ldv_random_containerless_scenario_callback_3_4(ldv_3_callback_get, ldv_3_ldv_param_4_0_default, ldv_3_container_struct_kernel_param_ptr);
853 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
854 :
855 : }
856 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
857 4 : ldv_free(ldv_3_ldv_param_4_0_default);
858 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_END"} */
859 :
860 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
861 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
862 :
863 : /* Jump to a subprocess 'call' initial state */
864 1 : goto ldv_call_3;
865 : }
866 : else {
867 : /* LDV {"action": "DEFAULT_FREE_7", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
868 2 : ldv_free(ldv_3_container_struct_kernel_param_ptr);
869 : /* LDV {"action": "DEFAULT_FREE_7", "type": "CONDITION_END"} */
870 :
871 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "RECEIVE_BEGIN", "comment": "Finish STRUCT_KPARAM_ARRAY callbacks invocations scenario."} */
872 : /* Skip a non-replicative signal receiving */
873 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "RECEIVE_END"} */
874 :
875 : /* Exit function at a terminal state */
876 1 : return;
877 : }
878 : /* End of the subprocess 'call' */
879 : return;
880 : /* LDV {"comment": "End of control function based on process 'random_containerless_scenario(struct_kparam_array)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_random_containerless_scenario_3"} */
881 : }
882 :
883 : /* AUX_FUNC ldv_random_containerless_scenario_4 */
884 : void ldv_random_containerless_scenario_4(void *arg0) {
885 : /* LDV {"thread": 4, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'random_containerless_scenario(struct_kparam_array)'", "function": "ldv_random_containerless_scenario_4"} */
886 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
887 1 : int (*ldv_4_callback_get)(char *, struct kernel_param *);
888 1 : int (*ldv_4_callback_set)(char *, struct kernel_param *);
889 1 : struct kernel_param *ldv_4_container_struct_kernel_param_ptr;
890 1 : char *ldv_4_ldv_param_10_0_default;
891 1 : char *ldv_4_ldv_param_4_0_default;
892 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
893 1 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "RECEIVE_BEGIN", "comment": "Begin STRUCT_KPARAM_ARRAY callbacks invocations scenario."} */
894 3 : ldv_free(arg0);
895 1 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "RECEIVE_END"} */
896 :
897 : /* LDV {"action": "DEFAULT_ALLOC_7", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
898 3 : ldv_4_container_struct_kernel_param_ptr = ldv_xmalloc_unknown_size(0);
899 : /* LDV {"action": "DEFAULT_ALLOC_7", "type": "CONDITION_END"} */
900 :
901 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
902 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
903 :
904 : /* Jump to a subprocess 'call' initial state */
905 1 : goto ldv_call_4;
906 : /* End of the process */
907 : return;
908 1 :
909 : /* Sbprocess call */
910 : ldv_call_4:
911 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
912 :
913 4 : if (ldv_undef_int()) {
914 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
915 3 : ldv_4_ldv_param_4_0_default = ldv_xmalloc_unknown_size(0);
916 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_END"} */
917 :
918 4 : if (ldv_undef_int()) {
919 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
920 3 : ldv_4_ldv_param_10_0_default = ldv_xmalloc_unknown_size(0);
921 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_END"} */
922 :
923 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback set from kernel_param."} */
924 : /* LDV {"type": "CALLBACK", "call": "((& param_set_uint))(ldv_4_ldv_param_10_0_default, ldv_4_container_struct_kernel_param_ptr);", "comment": "callback"} */
925 2 : ldv_random_containerless_scenario_callback_4_10(ldv_4_callback_set, ldv_4_ldv_param_10_0_default, ldv_4_container_struct_kernel_param_ptr);
926 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
927 :
928 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
929 2 : ldv_free(ldv_4_ldv_param_10_0_default);
930 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_END"} */
931 :
932 : }
933 : else {
934 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback get from kernel_param."} */
935 : /* LDV {"type": "CALLBACK", "call": "((& param_get_uint))(ldv_4_ldv_param_4_0_default, ldv_4_container_struct_kernel_param_ptr);", "comment": "callback"} */
936 2 : ldv_random_containerless_scenario_callback_4_4(ldv_4_callback_get, ldv_4_ldv_param_4_0_default, ldv_4_container_struct_kernel_param_ptr);
937 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
938 :
939 : }
940 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
941 4 : ldv_free(ldv_4_ldv_param_4_0_default);
942 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_END"} */
943 :
944 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
945 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
946 :
947 : /* Jump to a subprocess 'call' initial state */
948 1 : goto ldv_call_4;
949 : }
950 : else {
951 : /* LDV {"action": "DEFAULT_FREE_7", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
952 2 : ldv_free(ldv_4_container_struct_kernel_param_ptr);
953 : /* LDV {"action": "DEFAULT_FREE_7", "type": "CONDITION_END"} */
954 :
955 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "RECEIVE_BEGIN", "comment": "Finish STRUCT_KPARAM_ARRAY callbacks invocations scenario."} */
956 : /* Skip a non-replicative signal receiving */
957 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "RECEIVE_END"} */
958 :
959 : /* Exit function at a terminal state */
960 1 : return;
961 : }
962 : /* End of the subprocess 'call' */
963 : return;
964 : /* LDV {"comment": "End of control function based on process 'random_containerless_scenario(struct_kparam_array)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_random_containerless_scenario_4"} */
965 : }
966 :
967 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_2_10 */
968 : void ldv_random_containerless_scenario_callback_2_10(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
969 1 : ((& param_set_charp))(arg1, arg2);
970 1 : }
971 :
972 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_2_4 */
973 : void ldv_random_containerless_scenario_callback_2_4(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
974 1 : ((& param_get_charp))(arg1, arg2);
975 1 : }
976 :
977 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_3_10 */
978 : void ldv_random_containerless_scenario_callback_3_10(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
979 1 : ((& param_array_set))(arg1, arg2);
980 1 : }
981 :
982 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_3_4 */
983 : void ldv_random_containerless_scenario_callback_3_4(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
984 1 : ((& param_array_get))(arg1, arg2);
985 1 : }
986 :
987 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_4_10 */
988 : void ldv_random_containerless_scenario_callback_4_10(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
989 1 : ((& param_set_uint))(arg1, arg2);
990 1 : }
991 :
992 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_4_4 */
993 : void ldv_random_containerless_scenario_callback_4_4(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
994 1 : ((& param_get_uint))(arg1, arg2);
995 1 : }
996 :
997 : /* AUX_FUNC ldv_timer_scenario_5 */
998 : void ldv_timer_scenario_5(void *arg0) {
999 : /* LDV {"thread": 5, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'timer_scenario(timer)'", "function": "ldv_timer_scenario_5"} */
1000 4 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
1001 4 : struct timer_list *ldv_5_container_timer_list;
1002 : /* Received labels */
1003 4 : struct ldv_struct_timer_scenario_5 *data = (struct ldv_struct_timer_scenario_5*) arg0;
1004 :
1005 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
1006 : /* LDV {"action": "INSTANCE_REGISTER", "type": "RECEIVE_BEGIN", "comment": "Begin TIMER callbacks invocations scenario."} */
1007 : /* Assign recieved labels */
1008 8 : if (data) {
1009 4 : ldv_5_container_timer_list = data->arg0;
1010 8 : ldv_free(data);
1011 : }
1012 : /* LDV {"action": "INSTANCE_REGISTER", "type": "RECEIVE_END"} */
1013 :
1014 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Time has come: call the timer callback. Invoke callback callback from TIMER."} */
1015 : /* Callback pre-call */
1016 8 : ldv_switch_to_interrupt_context();
1017 24 : if (ldv_5_container_timer_list->function) {
1018 : /* LDV {"type": "CALLBACK", "call": "(ldv_5_container_timer_list->function)(ldv_5_container_timer_list->data);", "comment": "callback"} */
1019 16 : ldv_timer_scenario_callback_5_2(ldv_5_container_timer_list->function, ldv_5_container_timer_list->data);
1020 : }
1021 : /* Callback post-call */
1022 12 : ldv_switch_to_process_context();
1023 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
1024 :
1025 : /* LDV {"action": "INSTANCE_DEREGISTER", "type": "RECEIVE_BEGIN", "comment": "Finish TIMER callbacks invocations scenario."} */
1026 : /* Skip a non-replicative signal receiving */
1027 : /* LDV {"action": "INSTANCE_DEREGISTER", "type": "RECEIVE_END"} */
1028 :
1029 : /* Exit function at a terminal state */
1030 12 : return;
1031 : /* End of the process */
1032 : return;
1033 : /* LDV {"comment": "End of control function based on process 'timer_scenario(timer)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_timer_scenario_5"} */
1034 : }
1035 :
1036 : /* AUX_FUNC_CALLBACK ldv_timer_scenario_callback_5_2 */
1037 : void ldv_timer_scenario_callback_5_2(void (*arg0)(unsigned long), unsigned long arg1) {
1038 16 : (*arg0)(arg1);
1039 8 : }
1040 :
1041 : /* AUX_FUNC ldv_usb_scenario_6 */
1042 : void ldv_usb_scenario_6(void *arg0) {
1043 : /* LDV {"thread": 6, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'usb_scenario(usb)'", "function": "ldv_usb_scenario_6"} */
1044 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
1045 1 : struct usb_driver *ldv_6_container_usb_driver;
1046 1 : struct usb_device_id *ldv_6_ldv_param_14_1_default;
1047 1 : int ldv_6_probe_retval_default;
1048 1 : _Bool ldv_6_reset_flag_default;
1049 1 : struct usb_interface *ldv_6_resource_usb_interface;
1050 1 : struct usb_device *ldv_6_usb_device_usb_device;
1051 1 : /* Received labels */
1052 2 : struct ldv_struct_usb_scenario_6 *data = (struct ldv_struct_usb_scenario_6*) arg0;
1053 1 :
1054 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
1055 1 : /* Initialize automaton variables */
1056 2 : ldv_6_reset_flag_default = false;
1057 1 : /* LDV {"action": "REGISTER", "type": "RECEIVE_BEGIN", "comment": "Begin USB callbacks invocation scenario."} */
1058 : /* Assign recieved labels */
1059 2 : if (data) {
1060 1 : ldv_6_container_usb_driver = data->arg0;
1061 2 : ldv_free(data);
1062 : }
1063 : /* LDV {"action": "REGISTER", "type": "RECEIVE_END"} */
1064 :
1065 6 : if (ldv_undef_int()) {
1066 : /* LDV {"action": "ALLOC_INTERFACE", "type": "CONDITION_BEGIN", "comment": "Allocate memory and initialize new USB interface."} */
1067 3 : ldv_6_resource_usb_interface = ldv_xmalloc(sizeof(struct usb_interface));
1068 3 : ldv_6_usb_device_usb_device = ldv_xmalloc(sizeof(struct usb_device));
1069 1 : ldv_6_resource_usb_interface->dev.parent = & ldv_6_usb_device_usb_device->dev;
1070 : /* LDV {"action": "ALLOC_INTERFACE", "type": "CONDITION_END"} */
1071 :
1072 : /* LDV {"action": "MANAGE_INTERFACE", "type": "SUBPROCESS_BEGIN", "comment": "Manage particular interface on a device."} */
1073 : /* LDV {"action": "MANAGE_INTERFACE", "type": "SUBPROCESS_END"} */
1074 :
1075 : /* Jump to a subprocess 'manage_interface' initial state */
1076 1 : goto ldv_manage_interface_6;
1077 : }
1078 : else {
1079 : /* LDV {"action": "DEREGISTER", "type": "RECEIVE_BEGIN", "comment": "Finish USB callbacks invocations scenario."} */
1080 : /* Skip a non-replicative signal receiving */
1081 : /* LDV {"action": "DEREGISTER", "type": "RECEIVE_END"} */
1082 :
1083 : /* Exit function at a terminal state */
1084 1 : return;
1085 : }
1086 : /* End of the process */
1087 : return;
1088 1 :
1089 : /* Sbprocess manage_interface */
1090 : ldv_manage_interface_6:
1091 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
1092 :
1093 4 : if (ldv_undef_int()) {
1094 : /* LDV {"action": "PRE_CALL_14", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
1095 3 : ldv_6_ldv_param_14_1_default = ldv_xmalloc_unknown_size(0);
1096 : /* LDV {"action": "PRE_CALL_14", "type": "CONDITION_END"} */
1097 :
1098 : /* LDV {"action": "PROBE", "type": "CALL_BEGIN", "callback": true, "comment": "Associate driver-specific data with the USB interface. Invoke callback probe from usb_driver."} */
1099 : /* Callback pre-call */
1100 1 : ldv_pre_probe();
1101 : /* LDV {"type": "CALLBACK", "call": "ldv_6_probe_retval_default = ((& usbhid_probe))(ldv_6_resource_usb_interface, ldv_6_ldv_param_14_1_default);", "comment": "probe"} */
1102 3 : ldv_6_probe_retval_default = ldv_usb_scenario_probe_6_14(ldv_6_container_usb_driver->probe, ldv_6_resource_usb_interface, ldv_6_ldv_param_14_1_default);
1103 : /* Callback post-call */
1104 2 : ldv_6_probe_retval_default = ldv_post_probe(ldv_6_probe_retval_default);
1105 : /* LDV {"action": "PROBE", "type": "CALL_END"} */
1106 :
1107 : /* LDV {"action": "POST_CALL_14", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
1108 2 : ldv_free(ldv_6_ldv_param_14_1_default);
1109 : /* LDV {"action": "POST_CALL_14", "type": "CONDITION_END"} */
1110 :
1111 4 : if (ldv_undef_int()) {
1112 : /* LDV {"action": "FAILED_PROBE", "type": "CONDITION_BEGIN", "comment": "Association of driver-specific data with the USB interface has been failed."} */
1113 2 : ldv_assume(ldv_6_probe_retval_default != 0);
1114 : /* LDV {"action": "FAILED_PROBE", "type": "CONDITION_END"} */
1115 :
1116 : /* LDV {"action": "MANAGE_INTERFACE", "type": "SUBPROCESS_BEGIN", "comment": "Manage particular interface on a device."} */
1117 : /* LDV {"action": "MANAGE_INTERFACE", "type": "SUBPROCESS_END"} */
1118 :
1119 : /* Jump to a subprocess 'manage_interface' initial state */
1120 1 : goto ldv_manage_interface_6;
1121 : }
1122 : else {
1123 : /* LDV {"action": "PROBE_SUCCESS", "type": "CONDITION_BEGIN", "comment": "Check that interface has been probed successfully."} */
1124 2 : ldv_assume(ldv_6_probe_retval_default == 0);
1125 : /* LDV {"action": "PROBE_SUCCESS", "type": "CONDITION_END"} */
1126 :
1127 2 : switch (ldv_undef_int()) {
1128 3 : case 1: {
1129 : /* LDV {"action": "USB_RESET", "type": "RECEIVE_BEGIN", "comment": "Reset USB device."} */
1130 : /* Skip a non-replicative signal receiving */
1131 : /* LDV {"action": "USB_RESET", "type": "RECEIVE_END"} */
1132 :
1133 : /* LDV {"action": "PRE", "type": "CALL_BEGIN", "callback": true, "comment": "Prepare for resetting device. Invoke callback pre_reset from usb_driver."} */
1134 : /* LDV {"type": "CALLBACK", "call": "((& hid_pre_reset))(ldv_6_resource_usb_interface);", "comment": "pre"} */
1135 2 : ldv_usb_scenario_pre_6_11(ldv_6_container_usb_driver->pre_reset, ldv_6_resource_usb_interface);
1136 : /* LDV {"action": "PRE", "type": "CALL_END"} */
1137 :
1138 : /* LDV {"action": "POST", "type": "CALL_BEGIN", "callback": true, "comment": "Initialize device after reset. Invoke callback post_reset from usb_driver."} */
1139 : /* LDV {"type": "CALLBACK", "call": "((& hid_post_reset))(ldv_6_resource_usb_interface);", "comment": "post"} */
1140 2 : ldv_usb_scenario_post_6_10(ldv_6_container_usb_driver->post_reset, ldv_6_resource_usb_interface);
1141 : /* LDV {"action": "POST", "type": "CALL_END"} */
1142 :
1143 1 : break;
1144 1 : }
1145 3 : case 2: {
1146 : /* LDV {"action": "SUSPEND", "type": "CALL_BEGIN", "comment": "Call callback 'suspend' of a process 'usb_scenario' of an interface category 'usb'"} */
1147 : /* Skip callback without implementations */
1148 : /* LDV {"action": "SUSPEND", "type": "CALL_END"} */
1149 :
1150 : /* LDV {"action": "RESUME", "type": "CALL_BEGIN", "callback": true, "comment": "Device is about to be resumed. Invoke callback resume from USB."} */
1151 3 : if (ldv_6_container_usb_driver->resume) {
1152 : /* LDV {"type": "CALLBACK", "call": "(ldv_6_container_usb_driver->resume)(ldv_6_resource_usb_interface);", "comment": "resume"} */
1153 2 : ldv_usb_scenario_resume_6_8(ldv_6_container_usb_driver->resume, ldv_6_resource_usb_interface);
1154 : }
1155 : /* LDV {"action": "RESUME", "type": "CALL_END"} */
1156 :
1157 2 : break;
1158 1 : }
1159 3 : case 3: {
1160 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "comment": "Call callback 'callback' of a process 'usb_scenario' of an interface category 'usb'"} */
1161 : /* Skip callback without implementations */
1162 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
1163 :
1164 1 : break;
1165 1 : }
1166 3 : case 4: {
1167 : /* LDV {"action": "SKIP", "type": "CONDITION_BEGIN", "comment": "Do not suspend or reset device."} */
1168 : /* LDV {"action": "SKIP", "type": "CONDITION_END"} */
1169 :
1170 1 : break;
1171 1 : }
1172 2 : default: ldv_stop();
1173 1 : }
1174 0 : }
1175 : /* LDV {"action": "RELEASE", "type": "CALL_BEGIN", "callback": true, "comment": "USB interface is no more accessible. Invoke callback disconnect from usb_driver."} */
1176 0 : /* LDV {"type": "CALLBACK", "call": "((& usbhid_disconnect))(ldv_6_resource_usb_interface);", "comment": "release"} */
1177 6 : ldv_usb_scenario_release_6_5(ldv_6_container_usb_driver->disconnect, ldv_6_resource_usb_interface);
1178 : /* LDV {"action": "RELEASE", "type": "CALL_END"} */
1179 :
1180 : /* LDV {"action": "MANAGE_INTERFACE", "type": "SUBPROCESS_BEGIN", "comment": "Manage particular interface on a device."} */
1181 : /* LDV {"action": "MANAGE_INTERFACE", "type": "SUBPROCESS_END"} */
1182 :
1183 : /* Jump to a subprocess 'manage_interface' initial state */
1184 1 : goto ldv_manage_interface_6;
1185 : /* Jump to a subprocess 'manage_interface' initial state */
1186 : goto ldv_manage_interface_6;
1187 : }
1188 : else {
1189 : /* LDV {"action": "FREE_INTERFACE", "type": "CONDITION_BEGIN", "comment": "Free allocated memory for USB interface."} */
1190 2 : ldv_free(ldv_6_resource_usb_interface);
1191 2 : ldv_free(ldv_6_usb_device_usb_device);
1192 : /* LDV {"action": "FREE_INTERFACE", "type": "CONDITION_END"} */
1193 :
1194 : /* LDV {"action": "DEREGISTER", "type": "RECEIVE_BEGIN", "comment": "Finish USB callbacks invocations scenario."} */
1195 : /* Skip a non-replicative signal receiving */
1196 : /* LDV {"action": "DEREGISTER", "type": "RECEIVE_END"} */
1197 :
1198 : /* Exit function at a terminal state */
1199 1 : return;
1200 : }
1201 : /* End of the subprocess 'manage_interface' */
1202 : return;
1203 : /* LDV {"comment": "End of control function based on process 'usb_scenario(usb)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_usb_scenario_6"} */
1204 : }
1205 :
1206 : /* AUX_FUNC_CALLBACK ldv_usb_scenario_post_6_10 */
1207 : void ldv_usb_scenario_post_6_10(int (*arg0)(struct usb_interface *), struct usb_interface *arg1) {
1208 2 : ((& hid_post_reset))(arg1);
1209 1 : }
1210 :
1211 : /* AUX_FUNC_CALLBACK ldv_usb_scenario_pre_6_11 */
1212 : void ldv_usb_scenario_pre_6_11(int (*arg0)(struct usb_interface *), struct usb_interface *arg1) {
1213 2 : ((& hid_pre_reset))(arg1);
1214 1 : }
1215 :
1216 : /* AUX_FUNC_CALLBACK ldv_usb_scenario_probe_6_14 */
1217 : int ldv_usb_scenario_probe_6_14(int (*arg0)(struct usb_interface *, struct usb_device_id *), struct usb_interface *arg1, struct usb_device_id *arg2) {
1218 6 : return ((& usbhid_probe))(arg1, arg2);
1219 : }
1220 1 :
1221 : /* AUX_FUNC_CALLBACK ldv_usb_scenario_release_6_5 */
1222 : void ldv_usb_scenario_release_6_5(void (*arg0)(struct usb_interface *), struct usb_interface *arg1) {
1223 6 : ((& usbhid_disconnect))(arg1);
1224 3 : }
1225 :
1226 : /* AUX_FUNC_CALLBACK ldv_usb_scenario_resume_6_8 */
1227 : void ldv_usb_scenario_resume_6_8(int (*arg0)(struct usb_interface *), struct usb_interface *arg1) {
1228 3 : (*arg0)(arg1);
1229 1 : }
1230 :
1231 : /* AUX_FUNC main */
1232 : int main() {
1233 1 : ldv_main_14(0);
1234 0 : return 0;
1235 : }
1236 :
1237 :
1238 : /* AUX_FUNC ERR_PTR */
1239 : static inline void *ERR_PTR (long int error)
1240 : {
1241 :
1242 : return ldv_err_ptr(error);
1243 : }
1244 :
1245 : /* AUX_FUNC PTR_ERR */
1246 : static inline long int PTR_ERR (void const *ptr)
1247 : {
1248 1 :
1249 3 : return ldv_ptr_err(ptr);
1250 : }
1251 :
1252 : /* AUX_FUNC IS_ERR */
1253 : static inline long int IS_ERR (void const *ptr)
1254 : {
1255 1 :
1256 3 : return ldv_is_err(ptr);
1257 : }
1258 :
1259 : /* AUX_FUNC IS_ERR_OR_NULL */
1260 : static inline long int IS_ERR_OR_NULL (void const *ptr)
1261 : {
1262 :
1263 : return ldv_is_err_or_null(ptr);
1264 : }
1265 :
1266 : /* AUX_FUNC ldv_del_timer_sync_5 */
1267 : int ldv_del_timer_sync_5 (struct timer_list *ldv_func_arg1)
1268 : {
1269 :
1270 : /* LDV {"type": "KERNEL_MODEL", "comment": "Perform the model code of the function 'del_timer_sync'"} */
1271 : return ldv_emg_del_timer_sync(ldv_func_arg1);
1272 : }
1273 :
1274 : /* AUX_FUNC ldv_del_timer_6 */
1275 : int ldv_del_timer_6 (struct timer_list *ldv_func_arg1)
1276 : {
1277 :
1278 : /* LDV {"type": "KERNEL_MODEL", "comment": "Perform the model code of the function 'del_timer'"} */
1279 : return ldv_emg_del_timer(ldv_func_arg1);
1280 : }
1281 :
1282 : /* AUX_FUNC kzalloc */
1283 : static inline void *kzalloc (size_t size, gfp_t flags)
1284 : {
1285 1 :
1286 3 : return ldv_kzalloc(size, flags);
1287 : }
1288 :
1289 : /* AUX_FUNC ldv_dev_get_drvdata_8 */
1290 : void *ldv_dev_get_drvdata_8 (struct device const *dev)
1291 : {
1292 11 :
1293 33 : return ldv_dev_get_drvdata(dev);
1294 : }
1295 :
1296 : /* AUX_FUNC ldv_dev_get_drvdata_9 */
1297 : void *ldv_dev_get_drvdata_9 (struct device const *dev)
1298 : {
1299 1 :
1300 3 : return ldv_dev_get_drvdata(dev);
1301 : }
1302 :
1303 : /* AUX_FUNC ldv_dev_get_drvdata_10 */
1304 : void *ldv_dev_get_drvdata_10 (struct device const *dev)
1305 : {
1306 :
1307 : return ldv_dev_get_drvdata(dev);
1308 : }
1309 :
1310 : /* AUX_FUNC ldv_usb_reset_device_11 */
1311 : int ldv_usb_reset_device_11 (struct usb_device *ldv_func_arg1)
1312 : {
1313 0 :
1314 : /* LDV {"type": "KERNEL_MODEL", "comment": "Perform the model code of the function 'usb_reset_device'"} */
1315 0 : return ldv_emg_usb_reset_device(ldv_func_arg1);
1316 : }
1317 :
1318 : /* AUX_FUNC ldv_mod_timer_12 */
1319 : int ldv_mod_timer_12 (struct timer_list *ldv_func_arg1, long unsigned int ldv_func_arg2)
1320 : {
1321 4 :
1322 : /* LDV {"type": "KERNEL_MODEL", "comment": "Perform the model code of the function 'mod_timer'"} */
1323 16 : return ldv_emg_mod_timer(ldv_func_arg1, ldv_func_arg2);
1324 : }
1325 :
1326 : /* AUX_FUNC ldv_del_timer_sync_13 */
1327 : int ldv_del_timer_sync_13 (struct timer_list *ldv_func_arg1)
1328 : {
1329 2 :
1330 : /* LDV {"type": "KERNEL_MODEL", "comment": "Perform the model code of the function 'del_timer_sync'"} */
1331 6 : return ldv_emg_del_timer_sync(ldv_func_arg1);
1332 : }
1333 :
1334 : /* AUX_FUNC ldv_del_timer_14 */
1335 : int ldv_del_timer_14 (struct timer_list *ldv_func_arg1)
1336 : {
1337 1 :
1338 : /* LDV {"type": "KERNEL_MODEL", "comment": "Perform the model code of the function 'del_timer'"} */
1339 3 : return ldv_emg_del_timer(ldv_func_arg1);
1340 : }
1341 :
1342 : /* AUX_FUNC ldv_usb_register_15 */
1343 : static inline int ldv_usb_register_15 (struct usb_driver *driver)
1344 : {
1345 1 :
1346 : /* LDV {"type": "KERNEL_MODEL", "comment": "Perform the model code of the function 'usb_register'"} */
1347 4 : return ldv_emg_usb_register(driver);
1348 : }
1349 :
1350 : /* AUX_FUNC ldv_usb_deregister_16 */
1351 : void ldv_usb_deregister_16 (struct usb_driver *ldv_func_arg1)
1352 : {
1353 :
1354 : /* LDV {"type": "KERNEL_MODEL", "comment": "Perform the model code of the function 'usb_deregister'"} */
1355 4 : ldv_emg_usb_deregister(ldv_func_arg1);
1356 2 : }
|