|
Lines 1-5
Link Here
|
| 1 |
--- vid.c.old Mon May 8 00:59:03 2000 |
1 |
--- vid.c.orig Mon May 8 06:59:03 2000 |
| 2 |
+++ vid.c Wed Jan 31 14:26:27 2001 |
2 |
+++ vid.c Sat Apr 6 18:27:02 2002 |
|
|
3 |
@@ -48,15 +48,15 @@ |
| 4 |
struct usb_ctl_request ur; |
| 5 |
unsigned char data[1024]; |
| 6 |
|
| 7 |
- ur.request.bmRequestType = UT_READ_VENDOR_INTERFACE; |
| 8 |
- ur.request.bRequest = 2; |
| 9 |
+ ur.ucr_request.bmRequestType = UT_READ_VENDOR_INTERFACE; |
| 10 |
+ ur.ucr_request.bRequest = 2; |
| 11 |
|
| 12 |
- USETW(ur.request.wValue, 0); /* unused */ |
| 13 |
- USETW(ur.request.wIndex, reg); /* index */ |
| 14 |
- USETW(ur.request.wLength, 1); /* payload len in bytes */ |
| 15 |
- ur.data = data; |
| 16 |
- ur.flags = 0; |
| 17 |
- ur.actlen = 0; |
| 18 |
+ USETW(ur.ucr_request.wValue, 0); /* unused */ |
| 19 |
+ USETW(ur.ucr_request.wIndex, reg); /* index */ |
| 20 |
+ USETW(ur.ucr_request.wLength, 1); /* payload len in bytes */ |
| 21 |
+ ur.ucr_data = data; |
| 22 |
+ ur.ucr_flags = 0; |
| 23 |
+ ur.ucr_actlen = 0; |
| 24 |
|
| 25 |
if(ioctl(fd, USB_DO_REQUEST, &ur) < 0) { |
| 26 |
return -1; |
| 27 |
@@ -72,15 +72,15 @@ |
| 28 |
|
| 29 |
data[0] = val; |
| 30 |
|
| 31 |
- ur.request.bmRequestType = UT_WRITE_VENDOR_INTERFACE; |
| 32 |
- ur.request.bRequest = 2; |
| 33 |
+ ur.ucr_request.bmRequestType = UT_WRITE_VENDOR_INTERFACE; |
| 34 |
+ ur.ucr_request.bRequest = 2; |
| 35 |
|
| 36 |
- USETW(ur.request.wValue, 0); /* unused */ |
| 37 |
- USETW(ur.request.wIndex, reg); /* index */ |
| 38 |
- USETW(ur.request.wLength, 1); /* payload len in bytes */ |
| 39 |
- ur.data = data; |
| 40 |
- ur.flags = 0; |
| 41 |
- ur.actlen = 0; |
| 42 |
+ USETW(ur.ucr_request.wValue, 0); /* unused */ |
| 43 |
+ USETW(ur.ucr_request.wIndex, reg); /* index */ |
| 44 |
+ USETW(ur.ucr_request.wLength, 1); /* payload len in bytes */ |
| 45 |
+ ur.ucr_data = data; |
| 46 |
+ ur.ucr_flags = 0; |
| 47 |
+ ur.ucr_actlen = 0; |
| 48 |
|
| 49 |
if(ioctl(fd, USB_DO_REQUEST, &ur) < 0) { |
| 50 |
return -1; |
| 3 |
@@ -217,12 +217,15 @@ |
51 |
@@ -217,12 +217,15 @@ |
| 4 |
struct vidstate vs; /* current read state */ |
52 |
struct vidstate vs; /* current read state */ |
| 5 |
int small = 0; /* use 320x240 */ |
53 |
int small = 0; /* use 320x240 */ |
|
Lines 32-39
Link Here
|
| 32 |
|
80 |
|
| 33 |
- if(udi.vendorNo != 0x05A9 || udi.productNo != 0x0511) { |
81 |
- if(udi.vendorNo != 0x05A9 || udi.productNo != 0x0511) { |
| 34 |
- fprintf(stderr, "device %s is not an OmniVision OV511\n", devname); |
82 |
- fprintf(stderr, "device %s is not an OmniVision OV511\n", devname); |
| 35 |
+ if(udi.vendorNo != 0x05A9 || (udi.productNo != 0x0511 && |
83 |
+ if(udi.udi_vendorNo != 0x05A9 || (udi.udi_productNo != 0x0511 && |
| 36 |
+ udi.productNo != 0xa511)) { |
84 |
+ udi.udi_productNo != 0xa511)) { |
| 37 |
+ fprintf(stderr, "device %s is not an OmniVision OV511 or OV511+\n", devname); |
85 |
+ fprintf(stderr, "device %s is not an OmniVision OV511 or OV511+\n", devname); |
| 38 |
exit(1); |
86 |
exit(1); |
| 39 |
} |
87 |
} |
|
Lines 43-50
Link Here
|
| 43 |
continue; |
91 |
continue; |
| 44 |
if(ioctl(fd, USB_GET_DEVICEINFO, &udi) < 0 |
92 |
if(ioctl(fd, USB_GET_DEVICEINFO, &udi) < 0 |
| 45 |
- || udi.vendorNo != 0x05A9 || udi.productNo != 0x0511) { |
93 |
- || udi.vendorNo != 0x05A9 || udi.productNo != 0x0511) { |
| 46 |
+ || udi.vendorNo != 0x05A9 || (udi.productNo != 0x0511 && |
94 |
+ || udi.udi_vendorNo != 0x05A9 || (udi.udi_productNo != 0x0511 && |
| 47 |
+ udi.productNo != 0xa511)) { |
95 |
+ udi.udi_productNo != 0xa511)) { |
| 48 |
close(fd); |
96 |
close(fd); |
| 49 |
fd = -1; |
97 |
fd = -1; |
| 50 |
continue; |
98 |
continue; |
|
Lines 60-66
Link Here
|
| 60 |
devname = dev; |
108 |
devname = dev; |
| 61 |
} |
109 |
} |
| 62 |
+ |
110 |
+ |
| 63 |
+ isplus = udi.productNo == 0xa511; |
111 |
+ isplus = udi.udi_productNo == 0xa511; |
| 64 |
+ bufsize = (isplus ? 961 : 993); |
112 |
+ bufsize = (isplus ? 961 : 993); |
| 65 |
|
113 |
|
| 66 |
/* reset the OV511 */ |
114 |
/* reset the OV511 */ |
|
Lines 148-156
Link Here
|
| 148 |
exit(1); |
196 |
exit(1); |
| 149 |
|
197 |
|
| 150 |
/* select the 993-byte alternative */ |
198 |
/* select the 993-byte alternative */ |
| 151 |
alt.interface_index = 0; |
199 |
- alt.interface_index = 0; |
| 152 |
- alt.alt_no = 1; |
200 |
- alt.alt_no = 1; |
| 153 |
+ alt.alt_no = (isplus ? 7 : 1); |
201 |
+ alt.uai_interface_index = 0; |
|
|
202 |
+ alt.uai_alt_no = (isplus ? 7 : 1); |
| 154 |
if(ioctl(fd, USB_SET_ALTINTERFACE, &alt) < 0) { |
203 |
if(ioctl(fd, USB_SET_ALTINTERFACE, &alt) < 0) { |
| 155 |
perror("USB_SET_ALTINTERFACE"); |
204 |
perror("USB_SET_ALTINTERFACE"); |
| 156 |
exit(1); |
205 |
exit(1); |