summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Kursawe <phosphan@gentoo.org>2005-11-07 07:28:51 +0000
committerPatrick Kursawe <phosphan@gentoo.org>2005-11-07 07:28:51 +0000
commit2988c594bd6075a55649eb41f80e326b5fa97b9c (patch)
treeaf5a5f0bf84711f1b950767522fee3e36516be95 /media-gfx/sane-backends
parentsm3600usb.patch was broken by keyword subsitution (diff)
downloadhistorical-2988c594bd6075a55649eb41f80e326b5fa97b9c.tar.gz
historical-2988c594bd6075a55649eb41f80e326b5fa97b9c.tar.bz2
historical-2988c594bd6075a55649eb41f80e326b5fa97b9c.zip
Re-adding patch with substitution turned off
Package-Manager: portage-2.0.51.22-r2
Diffstat (limited to 'media-gfx/sane-backends')
-rw-r--r--media-gfx/sane-backends/ChangeLog5
-rw-r--r--media-gfx/sane-backends/Manifest3
-rw-r--r--media-gfx/sane-backends/files/sm3600usb.patch291
3 files changed, 297 insertions, 2 deletions
diff --git a/media-gfx/sane-backends/ChangeLog b/media-gfx/sane-backends/ChangeLog
index 38d95d1d8592..75b55a99b788 100644
--- a/media-gfx/sane-backends/ChangeLog
+++ b/media-gfx/sane-backends/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for media-gfx/sane-backends
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/ChangeLog,v 1.85 2005/11/07 07:26:22 phosphan Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/ChangeLog,v 1.86 2005/11/07 07:28:51 phosphan Exp $
+
+ 07 Nov 2005; Patrick Kursawe <phosphan@gentoo.org> +files/sm3600usb.patch:
+ Re-adding patch with substitution turned off
07 Nov 2005; Patrick Kursawe <phosphan@gentoo.org> -files/sm3600usb.patch:
sm3600usb.patch was broken by keyword subsitution
diff --git a/media-gfx/sane-backends/Manifest b/media-gfx/sane-backends/Manifest
index 71d3613b381d..e8cd059a2a63 100644
--- a/media-gfx/sane-backends/Manifest
+++ b/media-gfx/sane-backends/Manifest
@@ -6,7 +6,7 @@ MD5 4c8053c87e31c8209998ba49c07d60a5 sane-backends-1.0.13-r3.ebuild 1717
MD5 61d573be9593ba3be2da335586ac7eb2 sane-backends-1.0.16-r1.ebuild 3743
MD5 54cad14b24bc825f61130e50ea2238f8 sane-backends-1.0.16-r3.ebuild 4300
MD5 e73a3bf54c049342701898a62ea3b301 sane-backends-1.0.15-r1.ebuild 2674
-MD5 2748df72c3d34959a666f617dfd49768 ChangeLog 14720
+MD5 bdc75c37d8f49253f70308d15c29131d ChangeLog 14845
MD5 b742040acaeddc3798a21739bd59e8aa metadata.xml 224
MD5 d04dce955a1bf3c5436bc517f2e2070c sane-backends-1.0.15-r3.ebuild 3973
MD5 365f695ec2c079ac06dd5bbf495f87ce files/linux_sg3_err.h 4894
@@ -26,3 +26,4 @@ MD5 d5d1e4a4c8d3839c16329c105f2580d3 files/digest-sane-backends-1.0.16-r3 151
MD5 d5d1e4a4c8d3839c16329c105f2580d3 files/digest-sane-backends-1.0.16-r4 151
MD5 0bc1f6b8682b5585c8e87a325f983ade files/lide25.patch 5565
MD5 83640d1e7caa2aa50c676d40b64866c7 files/digest-sane-backends-1.0.15 157
+MD5 77ad69b7090299a5f758c15aef0ee513 files/sm3600usb.patch 7348
diff --git a/media-gfx/sane-backends/files/sm3600usb.patch b/media-gfx/sane-backends/files/sm3600usb.patch
new file mode 100644
index 000000000000..52909c42b1f5
--- /dev/null
+++ b/media-gfx/sane-backends/files/sm3600usb.patch
@@ -0,0 +1,291 @@
+--- backend/sm3600.c 3 Jul 2005 13:35:48 -0000 1.13
++++ backend/sm3600.c 16 Aug 2005 19:50:34 -0000 1.14
+@@ -55,24 +55,25 @@
+
+ ====================================================================== */
+
+-#include "sane/config.h"
++#include "../include/sane/config.h"
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+
+-#include <usb.h>
+-
+-#define BUILD 5
++#define BUILD 6
+
+ #ifndef BACKEND_NAME
+ #define BACKEND_NAME sm3600
+ #endif
+
+-#include "sane/sane.h"
+-#include "sane/sanei.h"
+-#include "sane/sanei_backend.h"
+-#include "sane/sanei_config.h"
+-#include "sane/saneopts.h"
++#include "../include/sane/sane.h"
++#include "../include/sane/sanei.h"
++#include "../include/sane/sanei_backend.h"
++#include "../include/sane/sanei_config.h"
++#include "../include/sane/saneopts.h"
++#include "../include/sane/sanei_usb.h"
++
++#undef HAVE_LIBUSB
+
+ /* prevent inclusion of scantool.h */
+ #define SCANTOOL_H
+@@ -326,7 +327,8 @@
+ }
+
+ static SANE_Status
+-RegisterSaneDev (struct usb_device *pdevUSB, TModel model, char *szName){
++RegisterSaneDev (TModel model, SANE_String_Const szName)
++{
+ TDevice * q;
+
+ errno = 0;
+@@ -342,7 +344,6 @@
+ q->sane.model = "ScanMaker 3600";
+ q->sane.type = "flatbed scanner";
+
+- q->pdev=pdevUSB;
+ q->model=model;
+
+ ++num_devices;
+@@ -351,13 +352,37 @@
+
+ return SANE_STATUS_GOOD;
+ }
++
++static SANE_Status
++sm_usb_attach (SANE_String_Const dev_name)
++{
++ int fd;
++ SANE_Status err;
++ SANE_Word v, p;
++ TModel model;
++
++ err = sanei_usb_open(dev_name, &fd);
++ if (err)
++ return err;
++ err = sanei_usb_get_vendor_product (fd, &v, &p);
++ if (err)
++ {
++ sanei_usb_close (fd);
++ return err;
++ }
++ DBG (DEBUG_JUNK, "found dev %04X/%04X, %s\n", v, p, dev_name);
++ model = GetScannerModel (v, p);
++ if (model != unknown)
++ RegisterSaneDev (model, dev_name);
++
++ sanei_usb_close(fd);
++ return SANE_STATUS_GOOD;
++}
+
+ SANE_Status
+ sane_init (SANE_Int *version_code, SANE_Auth_Callback authCB)
+ {
+- struct usb_bus *pbus;
+- struct usb_device *pdev;
+- int iBus;
++ int i;
+
+ DBG_INIT();
+
+@@ -372,38 +397,11 @@
+ }
+
+ pdevFirst=NULL;
+-
+- usb_init();
+- usb_find_busses();
+- if (!usb_busses)
+- return SANE_STATUS_IO_ERROR;
+-
+- usb_find_devices();
+-
+- iBus=0;
+- DBG(DEBUG_INFO,"starting bus scan\n");
+- for (pbus = usb_busses; pbus; pbus = pbus->next)
+- {
+- int iDev=0;
+- iBus++;
+- /* 0.1.3b no longer has a "busnum" member */
+- DBG(DEBUG_JUNK,"scanning bus %s\n", pbus->dirname);
+- for (pdev=pbus->devices; pdev; pdev = pdev->next)
+- {
+- TModel model;
+- iDev++;
+- DBG(DEBUG_JUNK,"found dev %04X/%04X\n",
+- pdev->descriptor.idVendor,
+- pdev->descriptor.idProduct);
+- model=GetScannerModel(pdev->descriptor.idVendor,
+- pdev->descriptor.idProduct);
+- if (model!=unknown)
+- {
+- char ach[100];
+- sprintf(ach,"%d/%d",iBus,iDev);
+- RegisterSaneDev(pdev,model,ach);
+- }
+- }
++
++ sanei_usb_init();
++ for (i = 0; aScanners[i].idProduct; i++)
++ {
++ sanei_usb_find_devices(SCANNER_VENDOR, aScanners[i].idProduct, sm_usb_attach);
+ }
+ return SANE_STATUS_GOOD;
+ }
+@@ -464,8 +462,11 @@
+ if (devicename[0]) /* selected */
+ {
+ for (pdev=pdevFirst; pdev; pdev=pdev->pNext)
++{
++DBG(DEBUG_VERBOSE,"%s<>%s\n",devicename, pdev->sane.name);
+ if (!strcmp(devicename,pdev->sane.name))
+ break;
++}
+ /* no dynamic post-registration */
+ }
+ else
+@@ -482,14 +483,11 @@
+ pinstFirst=this;
+ this->model=pdev->model; /* memorize model */
+ /* open and prepare USB scanner handle */
+- this->hScanner=usb_open(pdev->pdev);
+- if (!this->hScanner)
+- return SetError(this,SANE_STATUS_IO_ERROR, "cannot open scanner device");
+- rc=SANE_STATUS_GOOD;
+- if (usb_claim_interface(this->hScanner, 0))
+- return SetError(this,SANE_STATUS_IO_ERROR, "cannot claim IF");
+- if (usb_set_configuration(this->hScanner, 1))
+- return SetError(this,SANE_STATUS_IO_ERROR, "cannot set USB config 1");
++
++ if (sanei_usb_open (devicename, &this->hScanner) != SANE_STATUS_GOOD)
++ return SetError (this, SANE_STATUS_IO_ERROR, "cannot open scanner device");
++
++ rc = SANE_STATUS_GOOD;
+
+ this->quality=fast;
+ return InitOptions(this);
+@@ -505,8 +503,9 @@
+ {
+ if (this->state.bScanning)
+ EndScan(this);
+- usb_close(this->hScanner);
+- this->hScanner=NULL;
++
++ sanei_usb_close(this->hScanner);
++ this->hScanner=-1;
+ }
+ ResetCalibration(this); /* release calibration data */
+ /* unlink active device entry */
+--- backend/sm3600.h 30 Apr 2004 21:02:04 -0000 1.10
++++ backend/sm3600.h 16 Aug 2005 19:50:34 -0000 1.11
+@@ -190,7 +190,7 @@
+ TQuality quality;
+ TMode mode;
+ TModel model;
+- usb_dev_handle *hScanner;
++ int hScanner;
+ FILE *fhLog;
+ FILE *fhScan;
+ int ichPageBuffer; /* write position in full page buffer */
+--- backend/sm3600-scanusb.c 15 Apr 2004 21:06:58 -0000 1.11
++++ backend/sm3600-scanusb.c 16 Aug 2005 19:50:34 -0000 1.12
+@@ -43,7 +43,7 @@
+
+ Userspace scan tool for the Microtek 3600 scanner
+
+-$Id: sm3600-scanusb.c,v 1.11 2004/04/15 21:06:58 eichholz-guest Exp $
++$Id: sm3600-scanusb.c,v 1.12 2005/08/16 19:50:34 hmg-guest Exp $
+
+ (C) Marian Eichholz 2001
+
+@@ -68,14 +68,20 @@
+ int cchBuffer,
+ int cJiffiesTimeout)
+ {
+- return usb_control_msg(this->hScanner,
++ SANE_Status err;
++
++ cJiffiesTimeout = cJiffiesTimeout;
++
++ err = sanei_usb_control_msg (this->hScanner,
+ nReqType,
+ nRequest,
+ nValue,
+ nIndex,
+- pBuffer,
+ cchBuffer,
+- cJiffiesTimeout);
++ pBuffer);
++ if (err)
++ return err;
++ return cchBuffer;
+ }
+
+ /* **********************************************************************
+@@ -90,11 +96,18 @@
+ int cchMax,
+ int cJiffiesTimeout)
+ {
+- return usb_bulk_read(this->hScanner,
+- nEndPoint,
+- pBuffer,
+- cchMax,
+- cJiffiesTimeout);
++ int err;
++ size_t sz = cchMax;
++
++ nEndPoint = nEndPoint;
++ cJiffiesTimeout = cJiffiesTimeout;
++
++ err = sanei_usb_read_bulk(this->hScanner,
++ pBuffer,
++ &sz);
++ if (err)
++ return err;
++ return sz;
+ }
+
+ /* **********************************************************************
+@@ -310,7 +323,9 @@
+ {
+ rc=SetError(this,SANE_STATUS_IO_ERROR,
+ "bulk read of %d bytes failed: %s",
+- cchChunk,usb_strerror());
++ cchChunk,
++ "I/O error"
++ );
+ continue;
+ }
+ }
+@@ -371,7 +386,9 @@
+ else
+ rc=SetError(this,SANE_STATUS_IO_ERROR,
+ "bulk read of %d bytes failed: %s",
+- cchChunk,usb_strerror());
++ cchChunk,
++ "I/O error"
++ );
+ }
+ dprintf(DEBUG_COMM,"writing %d bytes\n",cchRead);
+
+--- backend/sm3600-scanutil.c 15 Apr 2004 21:06:58 -0000 1.11
++++ backend/sm3600-scanutil.c 16 Aug 2005 19:50:34 -0000 1.12
+@@ -43,10 +43,11 @@
+
+ Userspace scan tool for the Microtek 3600 scanner
+
+-$Id: sm3600-scanutil.c,v 1.11 2004/04/15 21:06:58 eichholz-guest Exp $
++$Id: sm3600-scanutil.c,v 1.12 2005/08/16 19:50:34 hmg-guest Exp $
+
+ ====================================================================== */
+
++#include <unistd.h>
+ #include "sm3600-scantool.h"
+
+ /* **********************************************************************