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

CVS User rousseau ludovic.rousseau@free.fr
Thu, 07 Oct 2004 14:28:49 -0600


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

Modified Files:
	ccid_usb.h ccid_usb.c 
Log Message:
the first argument of get_desc() is lun instead of channel and the
function uses LunToReaderIndex() to get the reader index


--- /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.h	2004/07/28 08:33:18	1.11
+++ /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.h	2004/10/07 20:28:49	1.12
@@ -18,7 +18,7 @@
 */
 
 /*
- * $Id: ccid_usb.h,v 1.11 2004/07/28 08:33:18 rousseau Exp $
+ * $Id: ccid_usb.h,v 1.12 2004/10/07 20:28:49 rousseau Exp $
  */
 
 status_t OpenUSB(unsigned int reader_index, int channel);
@@ -34,7 +34,7 @@
 status_t CloseUSB(unsigned int reader_index);
 
 #ifdef __USB_H__
-int get_desc(int channel, usb_dev_handle **handle, struct usb_device **dev);
+int get_desc(int lun, usb_dev_handle **handle, struct usb_device **dev);
 
 /*@null@*/ struct usb_interface *get_ccid_usb_interface(struct usb_device *dev);
 #endif
--- /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.c	2004/09/30 13:57:07	1.40
+++ /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.c	2004/10/07 20:28:49	1.41
@@ -18,7 +18,7 @@
 */
 
 /*
- * $Id: ccid_usb.c,v 1.40 2004/09/30 13:57:07 rousseau Exp $
+ * $Id: ccid_usb.c,v 1.41 2004/10/07 20:28:49 rousseau Exp $
  */
 
 #define __CCID_USB__
@@ -522,16 +522,18 @@
  *					get_desc
  *
  ****************************************************************************/
-int get_desc(int channel, usb_dev_handle **handle, struct
+int get_desc(int lun, usb_dev_handle **handle, struct
 	usb_device **dev)
 {
-	if (channel < 0 || channel > CCID_DRIVER_MAX_READERS)
-		return 1;
+	int reader_index;
 
-	*handle = usbDevice[channel].handle;
-	*dev = usbDevice[channel].dev;
+	if (-1 == (reader_index = LunToReaderIndex(lun)))
+		return FALSE;
 
-	return 0;
+	*handle = usbDevice[reader_index].handle;
+	*dev = usbDevice[reader_index].dev;
+
+	return TRUE;
 } /* get_desc */