Changeset 1168


Ignore:
Timestamp:
01/10/10 18:47:13 (12 years ago)
Author:
dingo35
Message:

Revert rev 1133 Please STOP cluttering up our code with meaningless, unused switches

Location:
trunk/csctapi
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/csctapi/icc_async.c

    r1137 r1168  
    7373   
    7474    /* Activate ICC */
    75 #ifdef SCI_DEV
    7675    if (IFD_Towitoko_ActivateICC (ifd) != IFD_TOWITOKO_OK)
    7776        return ICC_ASYNC_IFD_ERROR;
    78 #endif
    7977    /* Reset ICC */
    8078    if (IFD_Towitoko_ResetAsyncICC (ifd, &(icc->atr)) != IFD_TOWITOKO_OK)
     
    212210}
    213211
     212int ICC_Async_BeginTransmission (ICC_Async * icc)
     213{
     214    /* Setup parity for this ICC */
    214215#ifndef NO_PAR_SWITCH
    215 int ICC_Async_BeginTransmission (ICC_Async * icc)
    216 {
    217     /* Setup parity for this ICC */
    218216    if (icc->convention == ATR_CONVENTION_INVERSE)
    219217    {
     
    236234        return ICC_ASYNC_IFD_ERROR;
    237235*/ 
    238     return ICC_ASYNC_OK;
    239 }
    240 
    241 int ICC_Async_EndTransmission (ICC_Async * icc)
    242 {
    243     /* Restore parity */
    244     if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK)
    245         return ICC_ASYNC_IFD_ERROR;     
    246    
    247     return ICC_ASYNC_OK;
    248 }
    249 #endif
     236#endif
     237    return ICC_ASYNC_OK;
     238}
    250239
    251240int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * data)
     
    294283}
    295284
     285int ICC_Async_EndTransmission (ICC_Async * icc)
     286{
     287#ifndef NO_PAR_SWITCH
     288    /* Restore parity */
     289    if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK)
     290        return ICC_ASYNC_IFD_ERROR;     
     291#endif
     292   
     293    return ICC_ASYNC_OK;
     294}
     295
    296296ATR * ICC_Async_GetAtr (ICC_Async * icc)
    297297{
     
    307307{
    308308    /* Dectivate ICC */
    309 #ifdef SCI_DEV
    310309    if (IFD_Towitoko_DeactivateICC (icc->ifd) != IFD_TOWITOKO_OK)
    311310        return ICC_ASYNC_IFD_ERROR;
    312 #endif
    313311   
    314312    /* LED Off */
  • trunk/csctapi/icc_async.h

    r1133 r1168  
    8585
    8686/* Operations */
    87 #ifndef NO_PAR_SWITCH
    8887extern int ICC_Async_BeginTransmission (ICC_Async * icc);
    89 extern int ICC_Async_EndTransmission (ICC_Async * icc);
    90 #endif
    9188extern int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * buffer);
    9289extern int ICC_Async_Receive (ICC_Async * icc, unsigned size, BYTE * buffer);
     90extern int ICC_Async_EndTransmission (ICC_Async * icc);
    9391
    9492#endif /* _ICC_ASYNC_ */
  • trunk/csctapi/ifd_towitoko.c

    r1133 r1168  
    455455}
    456456
     457int IFD_Towitoko_ActivateICC (IFD * ifd)
     458{
     459#ifdef DEBUG_IFD
     460        printf ("IFD: Activating card\n");
     461#endif
    457462#ifdef SCI_DEV
    458 int IFD_Towitoko_ActivateICC (IFD * ifd)
    459 {
    460 #ifdef DEBUG_IFD
    461         printf ("IFD: Activating card\n");
    462 #endif
    463463    if(ifd->io->com==RTYP_SCI)
    464464    {
     
    486486    }
    487487    else
     488#endif
    488489    {
    489490        return IFD_TOWITOKO_OK;
     
    497498#endif
    498499
     500#ifdef SCI_DEV
    499501    if(ifd->io->com==RTYP_SCI)
    500502    {
     
    516518       
    517519    }
     520#endif
    518521   
    519522    return IFD_TOWITOKO_OK;
    520523}
    521 #endif
    522524
    523525//extern void print_hex_data(unsigned char *data, int len);
  • trunk/csctapi/ifd_towitoko.h

    r1133 r1168  
    137137
    138138/* General handling of ICC inserted in this IFD */
    139 #ifdef SCI_DEV
    140139extern int IFD_Towitoko_ActivateICC (IFD * ifd);
    141140extern int IFD_Towitoko_DeactivateICC (IFD * ifd);
    142 #endif
    143141
    144142/* Asynchronous ICC handling functions */
  • trunk/csctapi/protocol_t0.c

    r1137 r1168  
    827827   
    828828    /* Initialise transmission */
    829 #ifndef NO_PAR_SWITCH
    830829    if (ICC_Async_BeginTransmission (t0->icc) != ICC_ASYNC_OK)
    831830    {
     
    833832        return PROTOCOL_T0_ICC_ERROR;
    834833    }
    835 #endif
    836834   
    837835    /* Send header bytes */
    838836    if (ICC_Async_Transmit (t0->icc, 5, APDU_Cmd_Header (cmd)) != ICC_ASYNC_OK)
    839837    {
    840 #ifndef NO_PAR_SWITCH
    841838        ICC_Async_EndTransmission (t0->icc);
    842 #endif
    843839       
    844840        (*rsp) = NULL;
     
    989985   
    990986    /* End of transmission */
    991 #ifndef NO_PAR_SWITCH
    992987    if (ICC_Async_EndTransmission (t0->icc) != ICC_ASYNC_OK)
    993988        return PROTOCOL_T0_ICC_ERROR;
    994 #endif
    995989   
    996990    return (ret);
     
    10201014   
    10211015    /* Initialise transmission */
    1022 #ifndef NO_PAR_SWITCH
    10231016    if (ICC_Async_BeginTransmission (t14->icc) != ICC_ASYNC_OK)
    10241017    {
     
    10261019        return PROTOCOL_T14_ICC_ERROR;
    10271020    }
    1028 #endif
    10291021   
    10301022    if(t14->icc->ifd->io->com!=RTYP_SCI)
     
    10331025        if (ICC_Async_Transmit (t14->icc, 1, &b1) != ICC_ASYNC_OK)
    10341026        {
    1035 #ifndef NO_PAR_SWITCH
    10361027            ICC_Async_EndTransmission (t14->icc);
    1037 #endif
    10381028           
    10391029            (*rsp) = NULL;
     
    10441034        if (ICC_Async_Transmit (t14->icc, cmd_len, cmd_raw) != ICC_ASYNC_OK)
    10451035        {
    1046 #ifndef NO_PAR_SWITCH
    10471036            ICC_Async_EndTransmission (t14->icc);
    1048 #endif
    10491037           
    10501038            (*rsp) = NULL;
     
    10551043        if (ICC_Async_Transmit (t14->icc, 1, &ixor) != ICC_ASYNC_OK)
    10561044        {
    1057 #ifndef NO_PAR_SWITCH
    10581045            ICC_Async_EndTransmission (t14->icc);
    1059 #endif
    10601046           
    10611047            (*rsp) = NULL;
     
    10721058        if (ICC_Async_Transmit (t14->icc, cmd_len+2, buffer) != ICC_ASYNC_OK)
    10731059        {
    1074 #ifndef NO_PAR_SWITCH
    10751060            ICC_Async_EndTransmission (t14->icc);
    1076 #endif
    10771061           
    10781062            (*rsp) = NULL;
     
    11631147   
    11641148    /* End of transmission */
    1165 #ifndef NO_PAR_SWITCH
    11661149    if (ICC_Async_EndTransmission (t14->icc) != ICC_ASYNC_OK)
    11671150        return PROTOCOL_T14_ICC_ERROR;
    1168 #endif
    11691151   
    11701152    return (ret);
  • trunk/csctapi/protocol_t1.c

    r1133 r1168  
    419419
    420420  /* Setup transmission */
    421 #ifndef NO_PAR_SWITCH
    422421  if (ICC_Async_BeginTransmission (t1->icc) != ICC_ASYNC_OK)
    423422    ret = PROTOCOL_T1_ICC_ERROR;
    424423
    425424  else
    426 #endif
    427425    {
    428426      /* Send T=1 block */
     
    432430      if (ICC_Async_Transmit (t1->icc, length, buffer) != ICC_ASYNC_OK)
    433431        {
    434 #ifndef NO_PAR_SWITCH
    435432          ICC_Async_EndTransmission (t1->icc);
    436 #endif
    437433          ret = PROTOCOL_T1_ICC_ERROR;
    438434        }
     
    490486
    491487  /* End of transmission */
    492 #ifndef NO_PAR_SWITCH
    493488  if (ICC_Async_EndTransmission (t1->icc) != ICC_ASYNC_OK)
    494489    ret = PROTOCOL_T1_ICC_ERROR;
    495 #endif
    496490
    497491  return ret;
Note: See TracChangeset for help on using the changeset viewer.