[Pcsclite-cvs-commit] r6801 - trunk/Drivers/ccid/src

ludovic.rousseau at free.fr ludovic.rousseau at free.fr
Tue Nov 26 14:14:49 UTC 2013


Author: rousseau
Date: 2013-11-26 14:14:49 +0000 (Tue, 26 Nov 2013)
New Revision: 6801

Modified:
   trunk/Drivers/ccid/src/ccid_usb.c
Log:
Do not get the data rates if bNumDataRatesSupported = 0

According to CCID spec 1.1: " If the value is 00h, all data rates
between the default data rate dwDataRate and the maximum data rate
dwMaxDataRate are supported. "

Some readers do not support control request 0x03 GET_DATA_RATES if they
declare bNumDataRatesSupported = 0. That should not generate a critical
error.

This change will fix bug [#314516] Do not log ccid_usb.c:1142:ControlUSB() control failed (1/4): -9 Success
https://alioth.debian.org/tracker/index.php?func=detail&aid=314516&group_id=30105&atid=410088

and also fix bug [#313651] Do not call get_data_rates() if bNumDataRatesSupported is 0
https://alioth.debian.org/tracker/index.php?func=detail&aid=313651&group_id=30105&atid=410088


Modified: trunk/Drivers/ccid/src/ccid_usb.c
===================================================================
--- trunk/Drivers/ccid/src/ccid_usb.c	2013-11-26 14:10:35 UTC (rev 6800)
+++ trunk/Drivers/ccid/src/ccid_usb.c	2013-11-26 14:14:49 UTC (rev 6801)
@@ -635,7 +635,13 @@
 				usbDevice[reader_index].ccid.bMaxSlotIndex = device_descriptor[4];
 				usbDevice[reader_index].ccid.bCurrentSlotIndex = 0;
 				usbDevice[reader_index].ccid.readTimeout = DEFAULT_COM_READ_TIMEOUT;
-				usbDevice[reader_index].ccid.arrayOfSupportedDataRates = get_data_rates(reader_index, config_desc, num);
+				if (device_descriptor[27])
+					usbDevice[reader_index].ccid.arrayOfSupportedDataRates = get_data_rates(reader_index, config_desc, num);
+				else
+				{
+					usbDevice[reader_index].ccid.arrayOfSupportedDataRates = NULL;
+					DEBUG_INFO("bNumDataRatesSupported is 0");
+				}
 				usbDevice[reader_index].ccid.bInterfaceProtocol = usb_interface->altsetting->bInterfaceProtocol;
 				usbDevice[reader_index].ccid.bNumEndpoints = usb_interface->altsetting->bNumEndpoints;
 				usbDevice[reader_index].ccid.dwSlotStatus = IFD_ICC_PRESENT;




More information about the Pcsclite-cvs-commit mailing list