Hi,
This patch makes endpoint detection more generic. Basically, only one
bulk-in
endpoint is required, everything else is optional.
The patch is on top of the PV8630 removal patch.
Bye,
Henning
--- linux-2.4.21-pre3.pv/drivers/usb/scanner.c 2003-01-13 00:03:49.000000000 +0100
+++ linux-2.4.21-pre3.endpoint2/drivers/usb/scanner.c 2003-01-13 00:21:29.000000000
++0100
@@ -335,9 +335,10 @@
* - Print information about user-supplied ids only once at startup instead
* of everytime any USB device is plugged in.
* - Removed PV8630 ioctls. Use the standard ioctls instead.
+ * - Made endpoint detection more generic. Basically, only one bulk-in
+ * endpoint is required, everything else is optional.
*
* TODO
- * - Remove the 2/3 endpoint limitation
* - Performance
* - Select/poll methods
* - More testing
@@ -868,38 +869,45 @@
endpoint = interface[0].endpoint;
/*
- * Start checking for one or two bulk endpoints and an optional
- * interrupt endpoint. If we have an interrupt endpoint go ahead and
+ * Start checking for bulk and interrupt endpoints. We are only using the first
+ * one of each type of endpoint. If we have an interrupt endpoint go ahead and
* setup the handler. FIXME: This is a future enhancement...
*/
dbg("probe_scanner: Number of Endpoints:%d", (int) interface->bNumEndpoints);
- if ((interface->bNumEndpoints < 1) || (interface->bNumEndpoints > 3)) {
- info("probe_scanner: Only 1, 2, or 3 endpoints supported.");
- return NULL;
- }
-
ep_cnt = have_bulk_in = have_bulk_out = have_intr = 0;
while (ep_cnt < interface->bNumEndpoints) {
- if (!have_bulk_in && IS_EP_BULK_IN(endpoint[ep_cnt])) {
+ if (IS_EP_BULK_IN(endpoint[ep_cnt])) {
ep_cnt++;
+ if (have_bulk_in) {
+ info ("probe_scanner: ignoring additional
+bulk_in_ep:%d", ep_cnt);
+ continue;
+ }
have_bulk_in = ep_cnt;
dbg("probe_scanner: bulk_in_ep:%d", have_bulk_in);
continue;
}
- if (!have_bulk_out && IS_EP_BULK_OUT(endpoint[ep_cnt])) {
+ if (IS_EP_BULK_OUT(endpoint[ep_cnt])) {
ep_cnt++;
+ if (have_bulk_out) {
+ info ("probe_scanner: ignoring additional
+bulk_out_ep:%d", ep_cnt);
+ continue;
+ }
have_bulk_out = ep_cnt;
dbg("probe_scanner: bulk_out_ep:%d", have_bulk_out);
continue;
}
- if (!have_intr && IS_EP_INTR(endpoint[ep_cnt])) {
+ if (IS_EP_INTR(endpoint[ep_cnt])) {
ep_cnt++;
+ if (have_intr) {
+ info ("probe_scanner: ignoring additional intr_ep:%d",
+ep_cnt);
+ continue;
+ }
have_intr = ep_cnt;
dbg("probe_scanner: intr_ep:%d", have_intr);
continue;
@@ -913,28 +921,8 @@
* Perform a quick check to make sure that everything worked as it
* should have.
*/
-
- switch(interface->bNumEndpoints) {
- case 1:
- if (!have_bulk_in) {
- info("probe_scanner: One bulk-in endpoint required.");
- return NULL;
- }
- break;
- case 2:
- if (!have_bulk_in || !have_bulk_out) {
- info("probe_scanner: Two bulk endpoints required.");
- return NULL;
- }
- break;
- case 3:
- if (!have_bulk_in || !have_bulk_out || !have_intr) {
- info("probe_scanner: Two bulk endpoints and one interrupt
endpoint required.");
- return NULL;
- }
- break;
- default:
- info("probe_scanner: Endpoint determination failed -- consult
Documentation/usb/scanner.txt");
+ if (!have_bulk_in) {
+ err("probe_scanner: One bulk-in endpoint required.");
return NULL;
}
@@ -1015,7 +1003,6 @@
break;
case 0x055f: /* Mustek */
case 0x0400: /* Another Mustek */
- case 0x0ff5: /* And yet another Mustek */
scn->rd_nak_timeout = HZ * 1;
default:
scn->rd_nak_timeout = RD_NAK_TIMEOUT;
-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel