| 21 |
#include <string.h> |
#include <string.h> |
| 22 |
|
|
| 23 |
#include "pcscdefines.h" |
#include "pcscdefines.h" |
| 24 |
|
#include "defs.h" |
| 25 |
#include "ifdhandler.h" |
#include "ifdhandler.h" |
| 26 |
#include "config.h" |
#include "config.h" |
| 27 |
#include "debug.h" |
#include "debug.h" |
|
#include "defs.h" |
|
| 28 |
#include "utils.h" |
#include "utils.h" |
| 29 |
#include "commands.h" |
#include "commands.h" |
| 30 |
|
|
| 414 |
* IFD_ICC_NOT_PRESENT IFD_PROTOCOL_NOT_SUPPORTED |
* IFD_ICC_NOT_PRESENT IFD_PROTOCOL_NOT_SUPPORTED |
| 415 |
*/ |
*/ |
| 416 |
|
|
| 417 |
RESPONSECODE return_value = IFD_SUCCESS; /* Assume it will work */ |
RESPONSECODE return_value; |
| 418 |
|
int rx_length; |
| 419 |
|
|
| 420 |
DEBUG_INFO2("lun: %X", Lun); |
DEBUG_INFO2("lun: %X", Lun); |
| 421 |
|
|
| 422 |
if (CheckLun(Lun)) |
if (CheckLun(Lun)) |
| 423 |
return IFD_COMMUNICATION_ERROR; |
return IFD_COMMUNICATION_ERROR; |
| 424 |
|
|
| 425 |
|
rx_length = *RxLength; |
| 426 |
switch (SendPci.Protocol) |
switch (SendPci.Protocol) |
| 427 |
{ |
{ |
| 428 |
case T_0: |
case T_0: |
| 429 |
case T_1: |
case T_1: |
| 430 |
return_value = CmdXfrBlock(Lun, TxLength, TxBuffer, RxLength, |
return_value = CmdXfrBlock(Lun, TxLength, TxBuffer, &rx_length, |
| 431 |
RxBuffer); |
RxBuffer); |
| 432 |
break; |
break; |
| 433 |
|
|
| 434 |
default: |
default: |
| 435 |
return_value = IFD_PROTOCOL_NOT_SUPPORTED; |
return_value = IFD_PROTOCOL_NOT_SUPPORTED; |
| 436 |
} |
} |
| 437 |
|
*RxLength = rx_length; |
|
if (return_value != IFD_SUCCESS) |
|
|
*RxLength = 0; |
|
| 438 |
|
|
| 439 |
return return_value; |
return return_value; |
| 440 |
} /* IFDHTransmitToICC */ |
} /* IFDHTransmitToICC */ |