[Pcsclite-cvs-commit] CVS Drivers/ccid/src

CVS User rousseau ludovic.rousseau@free.fr
Mon, 02 May 2005 09:19:38 +0000


Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory haydn:/tmp/cvs-serv24090

Modified Files:
	ccid_usb.c 
Log Message:
get_data_rates(): if the reader do not support GET DATA RATES we return
NULL instead of a manually constructed/fake list


--- /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.c	2005/05/02 09:17:51	1.57
+++ /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.c	2005/05/02 09:19:36	1.58
@@ -18,7 +18,7 @@
 */
 
 /*
- * $Id: ccid_usb.c,v 1.57 2005/05/02 09:17:51 rousseau Exp $
+ * $Id: ccid_usb.c,v 1.58 2005/05/02 09:19:36 rousseau Exp $
  */
 
 #define __CCID_USB__
@@ -707,28 +707,19 @@
 		sizeof(buffer),
 		usbDevice[reader_index].ccid.readTimeout * 1000);
 
-	if ((n <= 0) /* we got an error? */
-		|| (n%4)) /* or a strange value */
+	/* we got an error? */
+	if (n <= 0)
 	{
-		struct usb_interface *usb_interface;
-
-		if (n <= 0)
-			DEBUG_INFO2("IFD does not support GET_DATA_RATES request: %s",
-				strerror(errno));
-
-		if (n%4)
-			DEBUG_INFO2("Wrong GET DATA RATES size: %d", n);
-
-		/* create a fake answer with only two values */
-		n = 2*4;
-
-		usb_interface = get_ccid_usb_interface(usbDevice[reader_index].dev);
-
-		/* dwDataRate (default data rate) */
-		memcpy(buffer, usb_interface->altsetting->extra +19, 4);
+		DEBUG_INFO2("IFD does not support GET_DATA_RATES request: %s",
+			strerror(errno));
+		return NULL;
+	}
 
-		/* dwMaxDataRate */
-		memcpy(buffer+4, usb_interface->altsetting->extra +23, 4);
+	/* we got a strange value */
+	if (n % 4)
+	{
+		DEBUG_INFO2("Wrong GET DATA RATES size: %d", n);
+		return NULL;
 	}
 
 	/* allocate the buffer (including the end marker) */