rpms/ifd-egate/devel ifd-egate-0.05-slow_hubs.patch, NONE, 1.1 ifd-egate.spec, 1.7, 1.8

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Sep 28 22:31:22 UTC 2006


Author: rrelyea

Update of /cvs/dist/rpms/ifd-egate/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv16048/devel

Modified Files:
	ifd-egate.spec 
Added Files:
	ifd-egate-0.05-slow_hubs.patch 
Log Message:
auto-import ifd-egate-0.05-15 on branch devel from ifd-egate-0.05-15.src.rpm

ifd-egate-0.05-slow_hubs.patch:
 egate.c |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

--- NEW FILE ifd-egate-0.05-slow_hubs.patch ---
--- ./egate.c.slowhubs	2006-09-28 14:27:01.027888000 -0700
+++ ./egate.c	2006-09-28 14:27:27.940788000 -0700
@@ -19,6 +19,8 @@
 #define EGATE_CMD_RESET   0x90
 #define EGATE_CMD_FETCHSTATUS  0xa0
 
+#define EGATE_TIMEOUT 100000
+
 #ifdef DEBUG
 /* auxiliary functions */
 void hexdump(const u_int8_t * buffer, int length)
@@ -154,7 +156,7 @@
 	}
         myhandle=egate->usb;
 	rc = do_usb(myhandle, USB_ENDPOINT_IN|USB_TYPE_VENDOR,
-		    EGATE_CMD_FETCHSTATUS,0, 0, &c, 1, 10000);
+		    EGATE_CMD_FETCHSTATUS,0, 0, &c, 1, EGATE_TIMEOUT);
 	sleep(1);
         if (rc == 1) return 1;
         return 0;
@@ -166,10 +168,10 @@
              int pollrc; \
      pollrc = do_usb(egate->usb, USB_ENDPOINT_IN|USB_TYPE_VENDOR, \
 		     EGATE_CMD_FETCHSTATUS, 0, 0, \
-		     &egate->stat, 1, 10000); \
+		     &egate->stat, 1, EGATE_TIMEOUT); \
      if (pollrc != 1) \
 	   return 0; \
-     } while ((egate->stat & EGATE_STAT_MASK) == EGATE_STAT_BUSY && (usleep(1000) || 1)); \
+     } while ((egate->stat & EGATE_STAT_MASK) == EGATE_STAT_BUSY && (usleep(10000) || 1)); \
      if (wanted != -1 && (egate->stat  & EGATE_STAT_MASK) != wanted) {\
          syslog(LOG_NOTICE,"Expected state 0x%x, got state 0x%x", wanted, egate->stat); \
          return 0;\
@@ -193,17 +195,18 @@
 
 	/* reset */
 	rc = do_usb(egate->usb, USB_ENDPOINT_OUT|USB_TYPE_VENDOR,
-		    EGATE_CMD_RESET, 0, 0, buffer, 0, 10000);
+		    EGATE_CMD_RESET, 0, 0, buffer, 0, EGATE_TIMEOUT);
 	if ((rc == -1)) {
 		egate_release_usb(egate);
 		return 0;
 	}
-	usleep(1000);
+	usleep(10000);
 
 	EGATE_POLL(egate, EGATE_STAT_CMND);
 	/* request atr */
 	rc = do_usb(egate->usb, USB_ENDPOINT_IN|USB_TYPE_VENDOR, EGATE_CMD_ATR, 
-		    0, 0, buffer, 255, 10000);
+		    0, 0, buffer, 255, EGATE_TIMEOUT);
+	syslog(LOG_ERR,"Getting ATR, rc = %d\n", rc);
 	if ((rc < 2)) {
 	     /* failed, we should get an atr; minimum atr is TS and T0 */
 		egate_release_usb(egate);
@@ -230,7 +233,7 @@
 	if (!force && (egate->stat & EGATE_STAT_MASK) == EGATE_STAT_CMND)
 		return 0;
 	do_usb(egate->usb, USB_ENDPOINT_OUT|USB_TYPE_VENDOR,
-		    EGATE_CMD_RESET, 0, 0, 0, 0, 10000);
+		    EGATE_CMD_RESET, 0, 0, 0, 0, EGATE_TIMEOUT);
         EGATE_POLL(egate, -1);
 	return 0;
 }
@@ -283,7 +286,7 @@
         
 	/* send via usb */
 	rc = do_usb(egate->usb, USB_TYPE_VENDOR, EGATE_CMD_SENDCMD, 
-		    0, 0, buffer_out, 5, 10000);
+		    0, 0, buffer_out, 5, EGATE_TIMEOUT);
 	if (rc != 5) {
 		/* not the whole buffer was transmitted ! */
                 egate_condreset(egate, 0);
@@ -304,7 +307,7 @@
             
                    rc = do_usb(egate->usb, USB_ENDPOINT_OUT|USB_TYPE_VENDOR, 
 			      EGATE_CMD_WRITE, 0, 0, &buffer_out[5],
-                              write_bytes, 10000);
+                              write_bytes, EGATE_TIMEOUT);
                   if (rc != write_bytes) {
                        /* not the whole buffer was transmitted ! */
                        syslog(LOG_NOTICE,"Incomplete data-out transfer");
@@ -324,7 +327,7 @@
             	/* receive answer via usb */
   	    	rc = do_usb(egate->usb, USB_ENDPOINT_IN|USB_TYPE_VENDOR, 
 				EGATE_CMD_READ, 0, 0, buffer_in,
-		  read_bytes, 10000);
+		  read_bytes, EGATE_TIMEOUT);
                 if (rc != read_bytes) {
                      syslog(LOG_NOTICE,"Incomplete data-in transfer");
 		     egate_condreset(egate, 0);
@@ -342,7 +345,7 @@
         
 	/* receive answer via usb */
 	rc = do_usb(egate->usb, USB_ENDPOINT_IN|USB_TYPE_VENDOR, 
-		    EGATE_CMD_READ, 0, 0, &buffer_in[read_bytes], 2, 10000);
+		    EGATE_CMD_READ, 0, 0, &buffer_in[read_bytes], 2, EGATE_TIMEOUT);
 	if (rc < 2) {
              
              syslog(LOG_NOTICE,"Incomplete response-in transfer");


Index: ifd-egate.spec
===================================================================
RCS file: /cvs/dist/rpms/ifd-egate/devel/ifd-egate.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ifd-egate.spec	11 Sep 2006 20:42:40 -0000	1.7
+++ ifd-egate.spec	28 Sep 2006 22:31:20 -0000	1.8
@@ -4,7 +4,7 @@
 
 Name: ifd-egate
 Version: 0.05 
-Release: 14
+Release: 15
 Summary: Axalto Egate SmartCard device driver for PCSC-lite
 Group: System Environment/Base
 License: BSD/LGPL
@@ -14,6 +14,7 @@
 Patch1: ifd-egate-0.05-makefile.patch
 Patch2: ifd-egate-0.05-write.patch
 Patch3: ifd-egate-0.05-multiple_cards.patch
+Patch4: ifd-egate-0.05-slow_hubs.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: pcsc-lite-devel
 BuildRequires: libusb-devel >= %{libusb_version}
@@ -35,6 +36,7 @@
 %patch1 -p1 -b .makefile
 %patch2 -p1 -b .write
 %patch3 -p1 -b .multiple_cards
+%patch4 -p1 -b .slow_hubs
 
 %build
 make %{?_smp_mflags}
@@ -58,6 +60,9 @@
 %{dropdir}/ifd-egate.bundle/
 
 %changelog
+* Mon Sep 28 2006 Bob Relyea <rrelyea at redhat.com>     0.05-15
+- Fix slow hub issues
+
 * Mon Sep 11 2006 Bob Relyea <rrelyea at redhat.com>     0.05-14
 - Fix multiple card support
 




More information about the fedora-cvs-commits mailing list