author | Rich Burridge <rich.burridge@oracle.com> |
Thu, 07 Jul 2011 14:07:49 -0700 | |
changeset 377 | 5df42c8502d2 |
permissions | -rw-r--r-- |
377
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
1 |
Index: libopenusb-1.0.1/tests/testopenusb.c |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
2 |
=================================================================== |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
3 |
--- libopenusb-1.0.1/tests/testopenusb.c (revision 122) |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
4 |
+++ libopenusb-1.0.1/tests/testopenusb.c (working copy) |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
5 |
@@ -183,7 +183,7 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
6 |
break; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
7 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
8 |
printf("CALLBACK: lib(%llu) device(%llu) get a event(%s) with arg=%p\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
9 |
- handle, devid, evstring, arg); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
10 |
+ (unsigned long long)handle, (unsigned long long)devid, evstring, arg); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
11 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
12 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
13 |
int convert_string(char *buf, usb_string_desc_t *st, int buflen) |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
14 |
@@ -350,14 +350,16 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
15 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
16 |
ret = openusb_claim_interface(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
17 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
18 |
- printf("Device(%llu) claim interface error:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
19 |
+ printf("Device(%llu) claim interface error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
20 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
21 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
22 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
23 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
24 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
25 |
ret = openusb_set_altsetting(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
26 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
27 |
- printf("Device(%llu) interface(0) set alt:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
28 |
+ printf("Device(%llu) interface(0) set alt:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
29 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
30 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
31 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
32 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
33 |
@@ -424,14 +426,16 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
34 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
35 |
ret = openusb_claim_interface(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
36 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
37 |
- printf("Device(%llu) claim interface error:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
38 |
+ printf("Device(%llu) claim interface error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
39 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
40 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
41 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
42 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
43 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
44 |
ret = openusb_set_altsetting(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
45 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
46 |
- printf("Device(%llu) interface(0) set alt:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
47 |
+ printf("Device(%llu) interface(0) set alt:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
48 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
49 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
50 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
51 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
52 |
@@ -498,14 +502,16 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
53 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
54 |
ret = openusb_claim_interface(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
55 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
56 |
- printf("Device(%llu) claim interface error:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
57 |
+ printf("Device(%llu) claim interface error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
58 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
59 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
60 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
61 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
62 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
63 |
ret = openusb_set_altsetting(devh,0,3);/* alt 3, depends on the fw */ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
64 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
65 |
- printf("Device(%llu) interface(0) set alt:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
66 |
+ printf("Device(%llu) interface(0) set alt:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
67 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
68 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
69 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
70 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
71 |
@@ -593,14 +599,16 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
72 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
73 |
ret = openusb_claim_interface(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
74 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
75 |
- printf("Device(%llu) claim interface error:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
76 |
+ printf("Device(%llu) claim interface error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
77 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
78 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
79 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
80 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
81 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
82 |
ret = openusb_set_altsetting(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
83 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
84 |
- printf("Device(%llu) interface(0) set alt:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
85 |
+ printf("Device(%llu) interface(0) set alt:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
86 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
87 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
88 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
89 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
90 |
@@ -735,7 +743,8 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
91 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
92 |
ret = openusb_claim_interface(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
93 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
94 |
- printf("Device(%llu) claim interface error:%s\n", devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
95 |
+ printf("Device(%llu) claim interface error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
96 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
97 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
98 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
99 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
100 |
@@ -747,7 +756,8 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
101 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
102 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
103 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
104 |
- printf("Device(%llu) interface(0) set alt:%s\n", devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
105 |
+ printf("Device(%llu) interface(0) set alt:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
106 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
107 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
108 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
109 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
110 |
@@ -1027,14 +1037,16 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
111 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
112 |
ret = openusb_claim_interface(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
113 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
114 |
- printf("Device(%llu) claim interface error:%s\n", devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
115 |
+ printf("Device(%llu) claim interface error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
116 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
117 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
118 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
119 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
120 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
121 |
ret = openusb_set_altsetting(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
122 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
123 |
- printf("Device(%llu) interface(0) set alt:%s\n", devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
124 |
+ printf("Device(%llu) interface(0) set alt:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
125 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
126 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
127 |
return -1; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
128 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
129 |
@@ -1195,7 +1207,8 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
130 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
131 |
goto err; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
132 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
133 |
- printf("Device(%llu) opened: %llu\n",devids[0],devh); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
134 |
+ printf("Device(%llu) opened: %llu\n", (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
135 |
+ (unsigned long long)devh); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
136 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
137 |
ret = openusb_get_devid(devh, &devid); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
138 |
if(ret < 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
139 |
@@ -1206,11 +1219,12 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
140 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
141 |
ret = openusb_get_lib_handle(devh,&libh); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
142 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
143 |
- printf("Get device(%llu) lib handle error:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
144 |
+ printf("Get device(%llu) lib handle error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
145 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
146 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
147 |
goto err; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
148 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
149 |
- printf("Lib handle = %llu\n",libh); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
150 |
+ printf("Lib handle = %llu\n", (unsigned long long)libh); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
151 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
152 |
#if 1 /* multi xfer test */ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
153 |
ret = multi_xfer_test(devh); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
154 |
@@ -1241,14 +1255,16 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
155 |
#if 1 /* configuration test */ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
156 |
ret = openusb_set_configuration(devh,1); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
157 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
158 |
- printf("Set device(%llu) config error:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
159 |
+ printf("Set device(%llu) config error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
160 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
161 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
162 |
goto err; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
163 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
164 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
165 |
ret = openusb_get_configuration(devh,&cfg); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
166 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
167 |
- printf("Get device(%llu) config error:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
168 |
+ printf("Get device(%llu) config error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
169 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
170 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
171 |
goto err; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
172 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
173 |
@@ -1259,18 +1275,21 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
174 |
#if 1 /* claim interface test */ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
175 |
ret = openusb_claim_interface(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
176 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
177 |
- printf("Device(%llu) claim interface error:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
178 |
+ printf("Device(%llu) claim interface error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
179 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
180 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
181 |
goto err; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
182 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
183 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
184 |
ret = openusb_is_interface_claimed(devh,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
185 |
- printf("Device(%llu) interface(0) claimed return %d\n", devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
186 |
+ printf("Device(%llu) interface(0) claimed return %d\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
187 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
188 |
ret); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
189 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
190 |
ret = openusb_set_altsetting(devh,0,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
191 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
192 |
- printf("Device(%llu) interface(0) set alt:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
193 |
+ printf("Device(%llu) interface(0) set alt:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
194 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
195 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
196 |
goto err; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
197 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
198 |
@@ -1278,7 +1297,8 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
199 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
200 |
ret = openusb_get_altsetting(devh,0,&alt); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
201 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
202 |
- printf("Device(%llu) interface(0) get alt:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
203 |
+ printf("Device(%llu) interface(0) get alt:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
204 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
205 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
206 |
goto err; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
207 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
208 |
@@ -1286,7 +1306,8 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
209 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
210 |
ret = openusb_release_interface(devh,0); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
211 |
if (ret != 0) { |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
212 |
- printf("Device(%llu) release interface error:%s\n",devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
213 |
+ printf("Device(%llu) release interface error:%s\n", |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
214 |
+ (unsigned long long)devids[0], |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
215 |
openusb_strerror(ret)); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
216 |
goto err; |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
217 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
218 |
@@ -1396,7 +1417,7 @@ |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
219 |
printf("error init\n"); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
220 |
exit(1); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
221 |
} |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
222 |
- printf("lib handle=%llu \n",libhandle); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
223 |
+ printf("lib handle=%llu \n", (unsigned long long)libhandle); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
224 |
printf("openusb_init PASS\n"); |
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
225 |
|
5df42c8502d2
7060741 Move libopenusb to userland
Rich Burridge <rich.burridge@oracle.com>
parents:
diff
changeset
|
226 |
ret = openusb_set_event_callback(libhandle, USB_ATTACH, event_cb, NULL); |