[Pcsclite-cvs-commit] r2207 - trunk/Drivers/ccid/src
Ludovic Rousseau
rousseau at alioth.debian.org
Wed Nov 15 15:33:41 CET 2006
Author: rousseau
Date: 2006-11-15 15:33:41 +0100 (Wed, 15 Nov 2006)
New Revision: 2207
Modified:
trunk/Drivers/ccid/src/commands.c
Log:
CmdGetSlotStatus(), CCID_Transmit() and CCID_Receive(): return
IFD_NO_SUCH_DEVICE if the lower communication layer returns
STATUS_NO_SUCH_DEVICE
Modified: trunk/Drivers/ccid/src/commands.c
===================================================================
--- trunk/Drivers/ccid/src/commands.c 2006-11-15 14:31:38 UTC (rev 2206)
+++ trunk/Drivers/ccid/src/commands.c 2006-11-15 14:33:41 UTC (rev 2207)
@@ -696,7 +696,11 @@
res = WritePort(reader_index, sizeof(cmd), cmd);
if (res != STATUS_SUCCESS)
+ {
+ if (STATUS_NO_SUCH_DEVICE == res)
+ return IFD_NO_SUCH_DEVICE;
return IFD_COMMUNICATION_ERROR;
+ }
length = SIZE_GET_SLOT_STATUS;
res = ReadPort(reader_index, &length, buffer);
@@ -786,6 +790,7 @@
{
unsigned char cmd[10+CMD_BUF_SIZE]; /* CCID + APDU buffer */
_ccid_descriptor *ccid_descriptor = get_ccid_descriptor(reader_index);
+ status_t ret;
cmd[0] = 0x6F; /* XfrBlock */
i2dw(tx_length, cmd+1); /* APDU length */
@@ -804,7 +809,10 @@
memcpy(cmd+10, tx_buffer, tx_length);
- if (WritePort(reader_index, 10+tx_length, cmd) != STATUS_SUCCESS)
+ ret = WritePort(reader_index, 10+tx_length, cmd);
+ if (STATUS_NO_SUCH_DEVICE == ret)
+ return IFD_NO_SUCH_DEVICE;
+ if (ret != STATUS_SUCCESS)
return IFD_COMMUNICATION_ERROR;
return IFD_SUCCESS;
@@ -822,12 +830,16 @@
unsigned char cmd[10+CMD_BUF_SIZE]; /* CCID + APDU buffer */
unsigned int length;
RESPONSECODE return_value = IFD_SUCCESS;
+ status_t ret;
time_request:
length = sizeof(cmd);
- if (ReadPort(reader_index, &length, cmd) != STATUS_SUCCESS)
+ ret = ReadPort(reader_index, &length, cmd);
+ if (ret != STATUS_SUCCESS)
{
*rx_length = 0;
+ if (STATUS_NO_SUCH_DEVICE == ret)
+ return IFD_NO_SUCH_DEVICE;
return IFD_COMMUNICATION_ERROR;
}
More information about the Pcsclite-cvs-commit
mailing list