Date: Sun, 9 Dec 2001 23:07:03 +0100 (CET) From: "Erik H. Bakke" <ebakke@trolltech.com> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/32653: Added patches to improve USB scanner supportOB Message-ID: <200112092207.fB9M73779097@steinbit.troll.no>
next in thread | raw e-mail | index | archive | help
>Number: 32653 >Category: ports >Synopsis: Added patches to improve USB scanner supportOB >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Dec 09 14:20:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Erik H. Bakke >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD steinbit.troll.no 5.0-CURRENT FreeBSD 5.0-CURRENT #14: Sun Dec 9 20:12:22 CET 2001 root@steinbit.troll.no:/usr/src/sys/i386/compile/WETLANDER i386 >Description: Added two patches to improve the support for USB scanners on FreeBSD. The port maintainer is ports@freebsd.org, so I submit my patches here. The patches rely on pr kern/32652 for the new ioctl. >How-To-Repeat: >Fix: diff -ruN sane-backends.bak/files/patch-backend_snapscan.c sane-backends/files/patch-backend_snapscan.c --- sane-backends.bak/files/patch-backend_snapscan.c Thu Jan 1 01:00:00 1970 +++ sane-backends/files/patch-backend_snapscan.c Sun Dec 9 22:52:08 2001 @@ -0,0 +1,19 @@ +--- backend/snapscan.c.bak Sun Dec 9 22:51:01 2001 ++++ backend/snapscan.c Sun Dec 9 22:51:01 2001 +@@ -1016,7 +1016,11 @@ + + vendor[0] = model[0] = '\0'; + ++#if defined( __FreeBSD__ ) ++ if(strstr (name, "uscanner")) ++#else /* __FreeBSD__ */ + if((strstr (name, "usb")) || (strstr (name, "USB"))) ++#endif /* __FreeBSD__ */ + { + DBG (DL_VERBOSE, "%s: Detected (kind of) an USB device\n", me); + +@@ -3540,3 +3544,4 @@ + * Revision 1.1 1997/10/13 02:25:54 charter + * Initial revision + * */ ++ diff -ruN sane-backends.bak/files/patch-sanei_sanei_usb.c sane-backends/files/patch-sanei_sanei_usb.c --- sane-backends.bak/files/patch-sanei_sanei_usb.c Thu Jan 1 01:00:00 1970 +++ sane-backends/files/patch-sanei_sanei_usb.c Sun Dec 9 22:49:43 2001 @@ -0,0 +1,42 @@ +--- sanei/sanei_usb.c.bak Sun Dec 9 22:40:14 2001 ++++ sanei/sanei_usb.c Sun Dec 9 22:49:04 2001 +@@ -112,6 +112,9 @@ + SANE_Word * product) + { + SANE_Word vendorID, productID; ++#if defined( __FreeBSD__ ) ++ u_int32_t vendorproductID; ++#endif /* __FreeBSD__ */ + + #if defined (__linux__) + #define IOCTL_SCANNER_VENDOR _IOR('U', 0x20, int) +@@ -145,8 +148,24 @@ + if (product) + *product = productID; + #else /* not defined (__linux__) */ ++#if defined( __FreeBSD__ ) ++#define USB_GET_DEVICE_ID _IOR('U', 140, int) ++ /* read the vendo and product IDs via the IOCTLs */ ++ if( ioctl( fd, USB_GET_DEVICE_ID, &vendorproductID ) == -1 ) ++ { ++ DBG( 3, "sanei_usb_get_vendor_product: ioctl( productid ) of fd %d " ++ "failed: %s\n", fd, strerror( errno ) ); ++ } ++ productID = vendorproductID & 0xffff; ++ vendorID = ( vendorproductID >> 16 ) & 0xffff; ++ if( vendor ) ++ *vendor = vendorID; ++ if( product ) ++ *product = productID; ++#else /* __FreeBSD__ */ + vendorID = 0; + productID = 0; ++#endif /* __FreeBSD__ */ + #endif /* not defined (__linux__) */ + + if (!vendorID || !productID) +@@ -309,3 +328,4 @@ + *size = write_size; + return SANE_STATUS_GOOD; + } ++ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112092207.fB9M73779097>