/[pcsclite]/trunk/Drivers/ccid/src/ccid_usb.c
ViewVC logotype

Log of /trunk/Drivers/ccid/src/ccid_usb.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:

Revision 1792 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 11 09:14:47 2006 UTC (7 years, 4 months ago) by rousseau
File length: 21980 byte(s)
Diff to previous 1791 , to selected 900
OpenUSBByName(): use log level INFO instead of CRITICAL to display
copyright information

Revision 1791 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 11 09:08:43 2006 UTC (7 years, 4 months ago) by rousseau
File length: 21996 byte(s)
Diff to previous 1775 , to selected 900
release the allocated ressources only when the last slot of a multi-slot
reader is closed

Revision 1775 - (view) (download) (annotate) - [select for diffs]
Modified Tue Nov 29 14:33:22 2005 UTC (7 years, 5 months ago) by rousseau
File length: 21443 byte(s)
Diff to previous 1703 , to selected 900
OpenUSBByName(): do not (re)set the usbDevice[].ccid.pbSeq field since
we just copied the complete structure just before

Revision 1703 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 7 15:46:03 2005 UTC (7 years, 6 months ago) by rousseau
File length: 21532 byte(s)
Diff to previous 1641 , to selected 900
remove #ifdef DEBUG_LEVEL_COMM since DEBUG_LEVEL_COMM is a numeric value
and not a compilation flag anymore. Debug is always active and filtered
by pcscd.

Revision 1641 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 5 14:43:02 2005 UTC (7 years, 8 months ago) by rousseau
File length: 21656 byte(s)
Diff to previous 1613 , to selected 900
get_data_rates(): check the response size only if bNumDataRatesSupported
is non zero

Revision 1613 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 13 14:26:22 2005 UTC (7 years, 9 months ago) by rousseau
File length: 21647 byte(s)
Diff to previous 1608 , to selected 900
CloseUSB(): call usb_reset() only if DRIVER_OPTION_RESET_ON_CLOSE is
set.

The problem was that a device reset also disconnects the keyboard on a
keyboard + reader device.

Revision 1608 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 11 13:48:21 2005 UTC (7 years, 9 months ago) by rousseau
File length: 21595 byte(s)
Diff to previous 1585 , to selected 900
get_data_rates(): check that we do not get more data rates than the
reader supports

Revision 1585 - (view) (download) (annotate) - [select for diffs]
Modified Tue Aug 2 13:44:09 2005 UTC (7 years, 9 months ago) by rousseau
File length: 21265 byte(s)
Diff to previous 1569 , to selected 900
OpenUSBByName(): call usb_close() if the device can't be used

Revision 1569 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 4 09:17:27 2005 UTC (7 years, 10 months ago) by rousseau
File length: 21106 byte(s)
Diff to previous 1547 , to selected 900
OpenUSBByName(): vendorID, productID are unsigned
avoids a "comparison between signed and unsigned" warning

Revision 1547 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jun 4 09:44:31 2005 UTC (7 years, 11 months ago) by rousseau
File length: 21097 byte(s)
Diff to previous 1486 , to selected 900
WriteUSB(): do not parse usbDevice[reader_index].dev->bus if it is a
NULL pointer (the device has been removed for example)

Revision 1486 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 2 09:19:36 2005 UTC (8 years ago) by rousseau
File length: 20968 byte(s)
Diff to previous 1485 , to selected 900
get_data_rates(): if the reader do not support GET DATA RATES we return
NULL instead of a manually constructed/fake list

Revision 1485 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 2 09:17:53 2005 UTC (8 years ago) by rousseau
File length: 21312 byte(s)
Diff to previous 1483 , to selected 900
Open*ByName(): initialise dwMaxDataRate field

Revision 1483 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 2 08:30:57 2005 UTC (8 years ago) by rousseau
File length: 21218 byte(s)
Diff to previous 1479 , to selected 900
get_data_rates(): check that the reader sends a DATA RATES list size
multiple of 4 othewise it is an error

Revision 1479 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 27 14:10:38 2005 UTC (8 years ago) by rousseau
File length: 21280 byte(s)
Diff to previous 1476 , to selected 900
Open*ByName: do not initialise the now disappeared .dwMaxDataRate field

Revision 1476 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 27 14:04:38 2005 UTC (8 years ago) by rousseau
File length: 21374 byte(s)
Diff to previous 1475 , to selected 900
get_data_rates(): if the CCID command GET DATA RATES is nto supported
the array of supported rates contains only the default and max data
rates

Revision 1475 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 27 13:55:52 2005 UTC (8 years ago) by rousseau
File length: 20865 byte(s)
Diff to previous 1467 , to selected 900
get_data_rates(): test if int_array is NULL (and not buffer)

Revision 1467 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 27 13:20:39 2005 UTC (8 years ago) by rousseau
File length: 20862 byte(s)
Diff to previous 1460 , to selected 900
get_data_rates(): use the real interface number instead of 0

Revision 1460 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 27 12:11:47 2005 UTC (8 years ago) by rousseau
File length: 20833 byte(s)
Diff to previous 1459 , to selected 900
get_data_rates(): buffer argument of usb_control_msg is (char *) and not
(unsigned char *)

Revision 1459 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 27 12:10:45 2005 UTC (8 years ago) by rousseau
File length: 20825 byte(s)
Diff to previous 1453 , to selected 900
get_data_rates() returns an unsigned int [] (not just int [])

Revision 1453 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 26 14:34:52 2005 UTC (8 years ago) by rousseau
File length: 20807 byte(s)
Diff to previous 1446 , to selected 900
use the calculated read timeout instead of a fixed value

Revision 1446 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 26 13:43:13 2005 UTC (8 years ago) by rousseau
File length: 20920 byte(s)
Diff to previous 1399 , to selected 900
OpenUSBByName(): get the list of data rates the reader supports

See 3.7.3 Get Data Rates (page 25) from CCID spec 1.00

Revision 1399 - (view) (download) (annotate) - [select for diffs]
Modified Mon Mar 14 18:56:53 2005 UTC (8 years, 2 months ago) by rousseau
File length: 19456 byte(s)
Diff to previous 1327 , to selected 900
change licence from GNU GPL to GNU LGPL

Revision 1327 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 20 14:34:42 2005 UTC (8 years, 2 months ago) by rousseau
File length: 19434 byte(s)
Diff to previous 1325 , to selected 900
add an "interface field" in _usbDevice. This value is set in OpenUSB()
and used in CloseUSB().

The struct usb_device structure is half "corrupted" after the USB device
is removed and we wanted to use it when when closing the driver after a
reader removal. This caused a crash with libusb 0.1.10.

Revision 1325 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 20 14:03:07 2005 UTC (8 years, 2 months ago) by rousseau
File length: 19586 byte(s)
Diff to previous 1312 , to selected 900
Bogus_firmwares[]: add Kobil KAAN Base & KAAN Advanced readers

Revision 1312 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 13 10:37:40 2005 UTC (8 years, 4 months ago) by rousseau
File length: 19492 byte(s)
Diff to previous 1298 , to selected 900
Bogus_firmwares[]: the 3 SMC readers had the same (cut-n-paste) USB
identification

Revision 1298 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 19 17:13:27 2004 UTC (8 years, 5 months ago) by rousseau
File length: 19492 byte(s)
Diff to previous 1287 , to selected 900
SPR 532 firmware previous to 5.04 is bogus regarding min/max pin lengths

Revision 1287 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 19 08:40:42 2004 UTC (8 years, 7 months ago) by rousseau
File length: 19492 byte(s)
Diff to previous 1281 , to selected 900
check firmware version to avoid firmwares with bugs. You can still use a
bigus firmware by setting DRIVER_OPTION_USE_BOGUS_FIRMWARE in Info.plist

Revision 1281 - (view) (download) (annotate) - [select for diffs]
Modified Thu Oct 7 20:28:49 2004 UTC (8 years, 7 months ago) by rousseau
File length: 17701 byte(s)
Diff to previous 1256 , to selected 900
the first argument of get_desc() is lun instead of channel and the
function uses LunToReaderIndex() to get the reader index

Revision 1256 - (view) (download) (annotate) - [select for diffs]
Modified Thu Sep 30 13:57:07 2004 UTC (8 years, 7 months ago) by rousseau
File length: 17672 byte(s)
Diff to previous 1151 , to selected 900
get_ccid_usb_interface(): the O2Micro OZ776S reader has a wrong USB
descriptor. The extra[] field is associated with the last endpoint instead
of the main USB descriptor.

Revision 1151 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 6 11:18:41 2004 UTC (8 years, 9 months ago) by rousseau
File length: 16923 byte(s)
Diff to previous 1149 , to selected 900
for multi-slots readers IFDHCreateChannel*()/OpenUSB is called for each
slot. If we are opening a new slot of an already opened reader we reuse
the same data (same libusb structures) and share the same pbSeq.

Revision 1149 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 6 11:00:25 2004 UTC (8 years, 9 months ago) by rousseau
File length: 15940 byte(s)
Diff to previous 1146 , to selected 900
use pbSeq instead of bSeq

Revision 1146 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 4 21:30:14 2004 UTC (8 years, 9 months ago) by rousseau
File length: 15852 byte(s)
Diff to previous 1106 , to selected 900
remove defaultFeatures management (was used for SCR331-DI hack)

Revision 1106 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 28 08:33:18 2004 UTC (8 years, 9 months ago) by rousseau
File length: 15945 byte(s)
Diff to previous 1101 , to selected 900
use reader_index instead of lun as reader identification

Revision 1101 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 26 09:16:16 2004 UTC (8 years, 9 months ago) by rousseau
File length: 15798 byte(s)
Diff to previous 1091 , to selected 900
initialise ccid.defaultFeatures field

Revision 1091 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 21 08:59:28 2004 UTC (8 years, 9 months ago) by rousseau
File length: 15718 byte(s)
Diff to previous 1079 , to selected 900
initialise bMaxSlotIndex and ccid.bCurrentSlotIndex fields

Revision 1079 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 16 09:07:26 2004 UTC (8 years, 10 months ago) by rousseau
File length: 15586 byte(s)
Diff to previous 1077 , to selected 900
OpenUSBByName(): use base 0 instead of 16 in strtoul() so that you can
express the decimal value 15 as: 15 (decimal), 0xF (hex) or 017 (octal).

It is not really needed since the reader descriptions in Info.plist are
all in hex.

Revision 1077 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 16 06:53:25 2004 UTC (8 years, 10 months ago) by rousseau
File length: 15582 byte(s)
Diff to previous 1054 , to selected 900
rename PCSCLITE_MAX_READERS in CCID_DRIVER_MAX_READERS

This value is not defined by pcsc-lite but is internal to the CCID
driver. By default pcsc-lite supports the same number of readers (16).

Revision 1054 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 9 13:23:37 2004 UTC (8 years, 10 months ago) by rousseau
File length: 15573 byte(s)
Diff to previous 1053 , to selected 900
mark potentially null values as /*@null@*/ for splint

Revision 1053 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 9 13:21:44 2004 UTC (8 years, 10 months ago) by rousseau
File length: 15551 byte(s)
Diff to previous 1052 , to selected 900
mark unused arguments as /*@unused@*/ for splint

Revision 1052 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 9 13:19:09 2004 UTC (8 years, 10 months ago) by rousseau
File length: 15538 byte(s)
Diff to previous 1049 , to selected 900
include <sys/types.h> so splint can parse the file

Revision 1049 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 9 08:28:44 2004 UTC (8 years, 10 months ago) by rousseau
File length: 15487 byte(s)
Diff to previous 1043 , to selected 900
lun is (unsigned int) so reader = LunToReaderIndex(lun) is also (unsigned int)

Revision 1043 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 9 07:10:17 2004 UTC (8 years, 10 months ago) by rousseau
File length: 15451 byte(s)
Diff to previous 900
lun is (unsigned int) instead of (int)

Avoid a warning by splint in #define LunToReaderIndex(Lun) (Lun>>16)
Left operand of >> may be negative (int): lun >> 16

Revision 900 - (view) (download) (annotate) - [selected]
Modified Tue May 25 14:46:02 2004 UTC (8 years, 11 months ago) by rousseau
File length: 15397 byte(s)
Diff to previous 895
add support for SCardGetAttrib(.., IOCTL_SMARTCARD_VENDOR_VERIFY_PIN, ..)
to know if the reader supports SCardControl(.., IOCTL_SMARTCARD_VENDOR_VERIFY_PIN, ..)

Revision 895 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 25 08:23:20 2004 UTC (8 years, 11 months ago) by rousseau
File length: 15317 byte(s)
Diff to previous 892 , to selected 900
set length to 0 when a usb_bulk_read() error is returned

Revision 892 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 24 12:58:43 2004 UTC (8 years, 11 months ago) by rousseau
File length: 15301 byte(s)
Diff to previous 878 , to selected 900
recompile using gcc -pedantic and correct:
- some C++ syntax comments
- many signedness "problems"

Revision 878 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 17 14:37:08 2004 UTC (9 years ago) by rousseau
File length: 15224 byte(s)
Diff to previous 781 , to selected 900
do not export get_end_points() declaration and make the function static

Revision 781 - (view) (download) (annotate) - [select for diffs]
Modified Thu Apr 8 14:35:57 2004 UTC (9 years, 1 month ago) by rousseau
File length: 15119 byte(s)
Diff to previous 774 , to selected 900
add support for the libusb naming scheme: usb:%04x/%04x:libusb:%s

Revision 774 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 6 13:15:34 2004 UTC (9 years, 1 month ago) by rousseau
File length: 14295 byte(s)
Diff to previous 762 , to selected 900
add { } to avoid ambiguities now that DEBUG_* are "if (x) y" constructions

Revision 762 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 5 09:47:21 2004 UTC (9 years, 1 month ago) by rousseau
File length: 14277 byte(s)
Diff to previous 738 , to selected 900
define ALLOW_PROPRIETARY_CLASS by default

Proprietary USB Class (0xFF) are (or are not) accepted
A proprietary class is used for devices released before the final CCID
specifications were ready.
We should not have problems with non CCID devices becasue the
Manufacturer and Product ID are also used to identify the device */

Revision 738 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 30 13:01:05 2004 UTC (9 years, 1 month ago) by rousseau
File length: 13944 byte(s)
Diff to previous 694 , to selected 900
allow proprietary CCID Class byte but only if ALLOW_PROPRIETARY_CLASS is
defined. You should know what you do. Only useful for pre-CCID devices.

Revision 694 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 12 16:09:32 2004 UTC (9 years, 3 months ago) by rousseau
File length: 13810 byte(s)
Diff to previous 683 , to selected 900
fill dwDefaultClock and dwMaxDataRate according to the reader descriptor

Revision 683 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 9 13:57:14 2004 UTC (9 years, 3 months ago) by rousseau
File length: 13685 byte(s)
Diff to previous 682 , to selected 900
first bSeq is 0 (even if 1 works ok)

Revision 682 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 9 13:55:09 2004 UTC (9 years, 3 months ago) by rousseau
File length: 13685 byte(s)
Diff to previous 672 , to selected 900
usb_reset() the device before usb_close()

Revision 672 - (view) (download) (annotate) - [select for diffs]
Modified Tue Feb 3 15:43:51 2004 UTC (9 years, 3 months ago) by rousseau
File length: 13647 byte(s)
Diff to previous 662 , to selected 900
add dwMaxIFSD field

Revision 662 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 29 10:33:52 2004 UTC (9 years, 3 months ago) by rousseau
File length: 13563 byte(s)
Diff to previous 655 , to selected 900
- remove device_name[] from struct _usbDevice
- use naming scheme usb:vendor/product
- simplify (a bit) the code

Revision 655 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 27 14:46:01 2004 UTC (9 years, 3 months ago) by rousseau
File length: 13753 byte(s)
Diff to previous 650 , to selected 900
use DEBUG_CRITICAL2() instead of DEBUG_CRITICAL()

Revision 650 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 27 13:39:47 2004 UTC (9 years, 3 months ago) by rousseau
File length: 13752 byte(s)
Diff to previous 649 , to selected 900
add support of USB devices with multiple interfaces (like the Silitek
SK-3105 keyboard)

Revision 649 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 27 13:32:55 2004 UTC (9 years, 3 months ago) by rousseau
File length: 12461 byte(s)
Diff to previous 612 , to selected 900
add support of IFDHCreateChannelByName

Revision 612 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 15 13:45:37 2004 UTC (9 years, 4 months ago) by rousseau
File length: 11583 byte(s)
Diff to previous 608 , to selected 900
call ccid_open_hack() in IFDHCreateChannel() instead of in each OpenPort()

Revision 608 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 15 08:30:31 2004 UTC (9 years, 4 months ago) by rousseau
File length: 11685 byte(s)
Diff to previous 581 , to selected 900
remove function name from debug message since __FUNCTION__ is now used in
DEBUG_* macro definition

Revision 581 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 6 07:21:27 2004 UTC (9 years, 4 months ago) by rousseau
File length: 11694 byte(s)
Diff to previous 579 , to selected 900
the USB extra field length shall be exactly 54 bytes to be CCID.

Revision 579 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jan 5 20:53:59 2004 UTC (9 years, 4 months ago) by rousseau
File length: 11684 byte(s)
Diff to previous 570 , to selected 900
add a test on the USB extra field length to avoid a crash and print an
error message. This occurs when the reader is _not_ CCID and the CCID
driver is used (wrong Info.plist for example).

Revision 570 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 16 10:11:09 2003 UTC (9 years, 5 months ago) by rousseau
File length: 11454 byte(s)
Diff to previous 525 , to selected 900
read and write timeouts are not symmetric. write timout can be shorter
since the reader and card is not supposed to do anything before
receiving (write) a command.

Revision 525 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 28 18:18:11 2003 UTC (9 years, 6 months ago) by rousseau
File length: 11096 byte(s)
Diff to previous 406 , to selected 900
correctly use the device name in a debug message instead of a not yet initialised field.

Revision 406 - (view) (download) (annotate) - [select for diffs]
Modified Wed Sep 10 09:01:30 2003 UTC (9 years, 8 months ago) by rousseau
File length: 11123 byte(s)
Diff to previous 301 , to selected 900
redesign to separate communication media and CCID protocol. call
ccid_open_hack() upon open to do some reader dependent magic.

Revision 301 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 20 08:37:34 2003 UTC (9 years, 9 months ago) by rousseau
File length: 12736 byte(s)
Diff to previous 279 , to selected 900
do not duplicate the Info.plist filename but "calculate" it once

Revision 279 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 14 06:53:21 2003 UTC (9 years, 9 months ago) by rousseau
File length: 12051 byte(s)
Diff to previous 269 , to selected 900
use a 1 minute USB timeout instead of the 1 second used for debug

Revision 269 - (view) (download) (annotate) - [select for diffs]
Added Tue Aug 12 12:40:23 2003 UTC (9 years, 9 months ago) by rousseau
File length: 12101 byte(s)
Diff to selected 900
Initial revision

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC 1.1.5