Changeset 1224


Ignore:
Timestamp:
01/14/10 16:41:02 (11 years ago)
Author:
dingo35
Message:

Move phoenix/smartmouse transmit and receive to ifd_phoenix.c

Location:
trunk/csctapi
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/csctapi/atr.c

    r1193 r1224  
    5252 */
    5353
    54 static bool ATR_GetNextByte (IO_Serial * io, unsigned timeout, BYTE * b, bool invert);
     54static bool ATR_GetNextByte (unsigned timeout, BYTE * b, bool invert);
    5555
    5656/*
     
    198198}
    199199
    200 int ATR_InitFromStream (ATR * atr, IO_Serial * io, unsigned timeout)
     200int ATR_InitFromStream (ATR * atr, unsigned timeout)
    201201{
    202202    BYTE TDi;
     
    207207       
    208208    /* Store T0 and TS */
    209     if (!ATR_GetNextByte (io, timeout, &(atr->TS), invert))
     209    if (!ATR_GetNextByte (timeout, &(atr->TS), invert))
    210210        return ATR_IO_ERROR;
    211211   
     
    219219        return ATR_MALFORMED;
    220220   
    221     if (!ATR_GetNextByte (io, timeout, &(atr->T0), invert))
     221    if (!ATR_GetNextByte (timeout, &(atr->T0), invert))
    222222        return ATR_MALFORMED;
    223223   
     
    238238        {
    239239            pointer++;
    240             if (!ATR_GetNextByte(io, timeout, &(atr->ib[pn][ATR_INTERFACE_BYTE_TA].value),invert))
     240            if (!ATR_GetNextByte(timeout, &(atr->ib[pn][ATR_INTERFACE_BYTE_TA].value),invert))
    241241                return ATR_MALFORMED;
    242242            atr->ib[pn][ATR_INTERFACE_BYTE_TA].present = TRUE;
     
    251251        {
    252252            pointer++;
    253             if (!ATR_GetNextByte(io, timeout, &(atr->ib[pn][ATR_INTERFACE_BYTE_TB].value),invert))
     253            if (!ATR_GetNextByte(timeout, &(atr->ib[pn][ATR_INTERFACE_BYTE_TB].value),invert))
    254254                return ATR_MALFORMED;
    255255            atr->ib[pn][ATR_INTERFACE_BYTE_TB].present = TRUE;
     
    264264        {
    265265            pointer++;
    266             if (!ATR_GetNextByte(io, timeout, &(atr->ib[pn][ATR_INTERFACE_BYTE_TC].value), invert))
     266            if (!ATR_GetNextByte(timeout, &(atr->ib[pn][ATR_INTERFACE_BYTE_TC].value), invert))
    267267                return ATR_MALFORMED;
    268268            atr->ib[pn][ATR_INTERFACE_BYTE_TC].present = TRUE;
     
    277277        {
    278278            pointer++;
    279             if (!ATR_GetNextByte(io, timeout, &(atr->ib[pn][ATR_INTERFACE_BYTE_TD].value), invert))
     279            if (!ATR_GetNextByte(timeout, &(atr->ib[pn][ATR_INTERFACE_BYTE_TD].value), invert))
    280280                return ATR_MALFORMED;
    281281            TDi = atr->ib[pn][ATR_INTERFACE_BYTE_TD].value;
     
    299299    for (i = 0; i < (atr->hbn); i++)
    300300    {
    301         if (!ATR_GetNextByte (io, timeout, &(atr->hb[i]), invert))
     301        if (!ATR_GetNextByte (timeout, &(atr->hb[i]), invert))
    302302            return ATR_MALFORMED;
    303303    }
     
    310310        pointer++;
    311311       
    312         if (!ATR_GetNextByte (io, timeout, (&((atr->TCK).value)), invert))
     312        if (!ATR_GetNextByte (timeout, (&((atr->TCK).value)), invert))
    313313            return ATR_MALFORMED;
    314314    }
     
    580580 */
    581581
    582 static bool ATR_GetNextByte (IO_Serial * io, unsigned timeout, BYTE * byte, bool invert)
     582static bool ATR_GetNextByte (unsigned timeout, BYTE * byte, bool invert)
    583583{
    584584    bool ret;
    585     ret = IO_Serial_Read (io, timeout, 1, byte);
     585    ret = IO_Serial_Read (timeout, 1, byte);
    586586    /* Para tarjetas inversas quiza */
    587587    if (invert)
  • trunk/csctapi/atr.h

    r1071 r1224  
    114114/* Initialization */
    115115extern int ATR_InitFromArray (ATR * atr, BYTE buffer[ATR_MAX_SIZE], unsigned length);
    116 extern int ATR_InitFromStream (ATR * atr, IO_Serial * io, unsigned timeout);
     116extern int ATR_InitFromStream (ATR * atr, unsigned timeout);
    117117
    118118/* General smartcard characteristics */
  • trunk/csctapi/icc_async.c

    r1223 r1224  
    7171   
    7272#if defined(SCI_DEV) || defined(COOL)
    73     if (reader[ridx].typ==R_INTERNAL)
     73    if (reader[ridx].typ == R_INTERNAL)
    7474#ifdef SH4
    7575        reader[ridx].handle = open (reader[ridx].device, O_RDWR|O_NONBLOCK|O_NOCTTY);
     
    110110
    111111#ifdef SCI_DEV
    112     if(reader[ridx].typ==R_INTERNAL)
     112    if(reader[ridx].typ == R_INTERNAL)
    113113    {
    114114        if(!Sci_GetStatus(reader[ridx].handle, &in))
     
    117117    else
    118118#elif COOL
    119     if(reader[ridx].typ==R_INTERNAL)
     119    if(reader[ridx].typ == R_INTERNAL)
    120120    {   
    121121        if (!Cool_GetStatus(&in))
     
    126126
    127127#if defined(TUXBOX) && defined(PPC)
    128     if ((reader[ridx].typ==R_DB2COM1) || (reader[ridx].typ==R_DB2COM2))
     128    if ((reader[ridx].typ == R_DB2COM1) || (reader[ridx].typ == R_DB2COM2))
    129129    {
    130130        ushort msr=1;
     
    132132        IO_Serial_Ioctl_Lock(1);
    133133        ioctl(fdmc, GET_PCDAT, &msr);
    134         if (reader[ridx].typ==R_DB2COM2)
     134        if (reader[ridx].typ == R_DB2COM2)
    135135            in=(!(msr & 1));
    136136        else
     
    403403    else
    404404#endif
    405     if (IFD_Towitoko_Transmit (icc->ifd, &timings, size, sent) != IFD_TOWITOKO_OK)
     405    if (!Phoenix_Transmit (sent, size, &timings, size))
    406406        return ICC_ASYNC_IFD_ERROR;
    407407   
     
    426426    else
    427427#else
    428     if (IFD_Towitoko_Receive (icc->ifd, &timings, size, data) != IFD_TOWITOKO_OK)
    429         return ICC_ASYNC_IFD_ERROR;
    430 #endif
    431    
    432     if (icc->convention == ATR_CONVENTION_INVERSE && reader[ridx].typ!=R_INTERNAL)
     428    if (!Phoenix_Receive (data, size, &timings))
     429        return ICC_ASYNC_IFD_ERROR;
     430#endif
     431   
     432    if (icc->convention == ATR_CONVENTION_INVERSE && reader[ridx].typ != R_INTERNAL)
    433433        ICC_Async_InvertBuffer (size, data);
    434434   
     
    464464}
    465465
    466 unsigned long ICC_Async_GetClockRate (ICC_Async * icc)
     466unsigned long ICC_Async_GetClockRate ()
    467467{
    468468    switch (reader[ridx].cardmhz) {
  • trunk/csctapi/icc_async.h

    r1220 r1224  
    8282extern ATR *ICC_Async_GetAtr (ICC_Async * icc);
    8383extern IFD *ICC_Async_GetIFD (ICC_Async * icc);
    84 extern unsigned long ICC_Async_GetClockRate (ICC_Async * icc);
     84extern unsigned long ICC_Async_GetClockRate ();
    8585
    8686/* Operations */
  • trunk/csctapi/ifd_phoenix.c

    r1220 r1224  
    1010#include "../globals.h"
    1111#include "atr.h"
     12#include "ifd_towitoko.h" //FIXME
    1213
    1314#define OK      1
    1415#define ERROR 0
     16
     17#define IFD_TOWITOKO_MAX_TRANSMIT 255
     18#define IFD_TOWITOKO_ATR_TIMEOUT   800
    1519
    1620int Phoenix_Init ()
     
    4145
    4246int Phoenix_Reset (ATR ** atr)
     47{   
     48        return OK;
     49}
     50
     51int Phoenix_Transmit (BYTE * buffer, unsigned size, IFD_Timings * timings)
    4352{
     53    unsigned block_delay, char_delay, sent=0, to_send = 0;
     54
     55#ifdef DEBUG_IFD
     56    printf ("IFD: Transmit: ");
     57    for (sent = 0; sent < size; sent++)
     58    printf ("%X ", buffer[sent]);
     59    printf ("\n");
     60#endif
     61
     62#define IFD_TOWITOKO_DELAY 0
     63
     64    /* Calculate delays */
     65    char_delay = IFD_TOWITOKO_DELAY + timings->char_delay;
     66    block_delay = IFD_TOWITOKO_DELAY + timings->block_delay;
     67
     68#ifdef USE_GPIO
     69    if (gpio_detect) set_gpio1(0);
     70#endif
     71    for (sent = 0; sent < size; sent = sent + to_send)
     72    {
     73        /* Calculate number of bytes to send */
     74        to_send = MIN(size, IFD_TOWITOKO_MAX_TRANSMIT);
     75               
     76        /* Send data */
     77        if ((sent == 0) && (block_delay != char_delay))
     78        {
     79            if (!IO_Serial_Write (block_delay, 1, buffer))
     80                return ERROR;
     81           
     82            if (!IO_Serial_Write (char_delay, to_send-1, buffer+1))
     83                return ERROR;
     84        }
     85        else
     86        {
     87            if (!IO_Serial_Write (char_delay, to_send, buffer+sent))
     88                return ERROR;
     89        }
     90    }
     91#ifdef USE_GPIO
     92    if (gpio_detect) set_gpio1(1);
     93#endif
    4494    return OK;
    4595}
    4696
    47 int Phoenix_Transmit (BYTE * sent, unsigned size)
    48 {
     97int Phoenix_Receive (BYTE * buffer, unsigned size, IFD_Timings * timings)
     98{
     99    unsigned char_timeout, block_timeout;
     100#ifdef DEBUG_IFD
     101    int i;
     102#endif
     103
     104#define IFD_TOWITOKO_TIMEOUT             1000
     105
     106    /* Calculate timeouts */
     107    char_timeout = IFD_TOWITOKO_TIMEOUT + timings->char_timeout;
     108    block_timeout = IFD_TOWITOKO_TIMEOUT + timings->block_timeout;
     109#ifdef USE_GPIO
     110    if (gpio_detect) set_gpio1(0);
     111#endif
     112    if (block_timeout != char_timeout)
     113    {
     114        /* Read first byte using block timeout */
     115        if (!IO_Serial_Read (block_timeout, 1, buffer))
     116            return ERROR;
     117       
     118        if (size > 1)
     119        {
     120            /* Read remaining data bytes using char timeout */
     121            if (!IO_Serial_Read (char_timeout, size - 1, buffer + 1))
     122                return ERROR;
     123        }
     124    }
     125    else
     126    {
     127        /* Read all data bytes with the same timeout */
     128        if (!IO_Serial_Read (char_timeout, size, buffer))
     129            return ERROR;
     130    }
     131#ifdef USE_GPIO
     132    if (gpio_detect) set_gpio1(1);
     133#endif
     134   
     135#ifdef DEBUG_IFD
     136    printf ("IFD: Receive: ");
     137    for (i = 0; i < size; i++)
     138    printf ("%X ", buffer[i]);
     139    printf ("\n");
     140#endif
     141   
    49142    return OK;
    50143}
    51 
    52 int Phoenix_Receive (BYTE * data, unsigned size)
    53 {
    54     return OK;
    55 }   
    56144
    57145int Phoenix_SetBaudrate (int mhz)
  • trunk/csctapi/ifd_sci.c

    r1221 r1224  
    109109    }           
    110110#else
    111     while(n<SCI_MAX_ATR_SIZE && IO_Serial_Read(ifd->io, IFD_TOWITOKO_ATR_TIMEOUT, 1, buf+n))
     111    while(n<SCI_MAX_ATR_SIZE && IO_Serial_Read(IFD_TOWITOKO_ATR_TIMEOUT, 1, buf+n))
    112112    {
    113113        n++;
  • trunk/csctapi/ifd_towitoko.c

    r1221 r1224  
    437437        {
    438438            parity = par[i];
    439             IO_Serial_Flush(ifd->io);
     439            IO_Serial_Flush();
    440440
    441441            ret = IFD_Towitoko_SetParity (ifd, parity);
     
    475475            (*atr) = ATR_New ();
    476476
    477             if(ATR_InitFromStream ((*atr), ifd->io, IFD_TOWITOKO_ATR_TIMEOUT) == ATR_OK)
     477            if(ATR_InitFromStream ((*atr), IFD_TOWITOKO_ATR_TIMEOUT) == ATR_OK)
    478478                ret = IFD_TOWITOKO_OK;
    479479
     
    493493        }
    494494   
    495         IO_Serial_Flush(ifd->io);
     495        IO_Serial_Flush();
    496496
    497497/*
     
    538538        if ((sent == 0) && (block_delay != char_delay))
    539539        {
    540             if (!IO_Serial_Write (ifd->io, block_delay, 1, buffer))
     540            if (!IO_Serial_Write (block_delay, 1, buffer))
    541541                return IFD_TOWITOKO_IO_ERROR;
    542542           
    543             if (!IO_Serial_Write (ifd->io, char_delay, to_send-1, buffer+1))
     543            if (!IO_Serial_Write (char_delay, to_send-1, buffer+1))
    544544                return IFD_TOWITOKO_IO_ERROR;
    545545        }
    546546        else
    547547        {
    548             if (!IO_Serial_Write (ifd->io, char_delay, to_send, buffer+sent))
     548            if (!IO_Serial_Write (char_delay, to_send, buffer+sent))
    549549                return IFD_TOWITOKO_IO_ERROR;
    550550        }
     
    572572    {
    573573        /* Read first byte using block timeout */
    574         if (!IO_Serial_Read (ifd->io, block_timeout, 1, buffer))
     574        if (!IO_Serial_Read (block_timeout, 1, buffer))
    575575            return IFD_TOWITOKO_IO_ERROR;
    576576       
     
    578578        {
    579579            /* Read remaining data bytes using char timeout */
    580             if (!IO_Serial_Read (ifd->io, char_timeout, size - 1, buffer + 1))
     580            if (!IO_Serial_Read (char_timeout, size - 1, buffer + 1))
    581581                return IFD_TOWITOKO_IO_ERROR;
    582582        }
     
    585585    {
    586586        /* Read all data bytes with the same timeout */
    587         if (!IO_Serial_Read (ifd->io, char_timeout, size, buffer))
     587        if (!IO_Serial_Read (char_timeout, size, buffer))
    588588            return IFD_TOWITOKO_IO_ERROR;
    589589    }
  • trunk/csctapi/ifd_towitoko.h

    r1220 r1224  
    139139/* Asynchronous ICC handling functions */
    140140extern int IFD_Towitoko_ResetAsyncICC (IFD * ifd, ATR ** atr);
    141 extern int IFD_Towitoko_Transmit (IFD * ifd, IFD_Timings * timings, unsigned size, BYTE * buffer);
    142 extern int IFD_Towitoko_Receive (IFD * ifd, IFD_Timings * timings, unsigned size, BYTE * buffer);
    143141
    144142/* Atributes of the drive associated with this IFD */
  • trunk/csctapi/io_serial.c

    r1222 r1224  
    6060static int IO_Serial_Bitrate(int bitrate);
    6161
    62 static bool IO_Serial_WaitToRead (int hnd, unsigned delay_ms, unsigned timeout_ms);
    63 
    64 static bool IO_Serial_WaitToWrite (IO_Serial *io, unsigned delay_ms, unsigned timeout_ms);
     62static bool IO_Serial_WaitToRead (unsigned delay_ms, unsigned timeout_ms);
     63
     64static bool IO_Serial_WaitToWrite (unsigned delay_ms, unsigned timeout_ms);
    6565
    6666static void IO_Serial_DeviceName (char * filename, unsigned length);
     
    7979{
    8080  extern int *oscam_sem;
    81   if ((reader[ridx].typ!=R_DB2COM1) && (reader[ridx].typ!=R_DB2COM2)) return;
     81  if ((reader[ridx].typ != R_DB2COM1) && (reader[ridx].typ != R_DB2COM2)) return;
    8282  if (!flag)
    8383    *oscam_sem=0;
     
    183183   
    184184    if(io->reader_type!=R_INTERNAL)
    185         IO_Serial_Flush(io);
     185        IO_Serial_Flush();
    186186       
    187187    return TRUE;
     
    579579}
    580580
    581 void IO_Serial_Flush (IO_Serial * io)
     581void IO_Serial_Flush ()
    582582{
    583583    BYTE b;
    584     while(IO_Serial_Read(io, 1000, 1, &b));
     584    while(IO_Serial_Read(1000, 1, &b));
    585585}
    586586
     
    598598
    599599
    600 bool IO_Serial_Read (IO_Serial * io, unsigned timeout, unsigned size, BYTE * data)
     600bool IO_Serial_Read (unsigned timeout, unsigned size, BYTE * data)
    601601{
    602602    BYTE c;
     
    607607#endif
    608608   
    609     if((io->reader_type!=R_INTERNAL) && (io->wr>0))
     609    if((reader[ridx].typ != R_INTERNAL) && (wr>0))
    610610    {
    611611        BYTE buf[256];
    612         int n = io->wr;
    613         io->wr = 0;
    614    
    615         if(!IO_Serial_Read (io, timeout, n, buf))
     612        int n = wr;
     613        wr = 0;
     614   
     615        if(!IO_Serial_Read (timeout, n, buf))
    616616        {
    617617            return FALSE;
     
    631631        while( (((tv_spent.tv_sec-tv.tv_sec)*1000) + ((tv_spent.tv_usec-tv.tv_usec)/1000L))<timeout )
    632632        {
    633             if (read (io->fd, &c, 1) == 1)
     633            if (read (reader[ridx].handle, &c, 1) == 1)
    634634            {
    635635                readed=TRUE;
     
    646646#endif
    647647#else
    648         if (IO_Serial_WaitToRead (io->fd, 0, timeout))
     648        if (IO_Serial_WaitToRead (0, timeout))
    649649        {
    650             if (read (io->fd, &c, 1) != 1)
     650            if (read (reader[ridx].handle, &c, 1) != 1)
    651651            {
    652652#ifdef DEBUG_IO
     
    669669            fflush (stdout);
    670670#endif
    671             tcflush (io->fd, TCIFLUSH);
     671            tcflush (reader[ridx].handle, TCIFLUSH);
    672672            return FALSE;
    673673        }
     
    688688
    689689
    690 bool IO_Serial_Write (IO_Serial * io, unsigned delay, unsigned size, BYTE * data)
     690bool IO_Serial_Write (unsigned delay, unsigned size, BYTE * data)
    691691{
    692692    unsigned count, to_send, i_w;
     
    708708            to_send = (delay? 1: size);
    709709       
    710         if (IO_Serial_WaitToWrite (io, delay, 1000))
     710        if (IO_Serial_WaitToWrite (delay, 1000))
    711711        {
    712712            for (i_w=0; i_w < to_send; i_w++) {
     
    716716              }
    717717            }
    718             unsigned int u = write (io->fd, data_w, (1+io_serial_need_dummy_char)*to_send);
     718            unsigned int u = write (reader[ridx].handle, data_w, (1+io_serial_need_dummy_char)*to_send);
    719719            _in_echo_read = 1;
    720720            if (u != (1+io_serial_need_dummy_char)*to_send)
     
    724724                fflush (stdout);
    725725#endif
    726                 if(io->reader_type!=R_INTERNAL)
    727                     io->wr += u;
     726                if(reader[ridx].typ != R_INTERNAL)
     727                    wr += u;
    728728                return FALSE;
    729729            }
    730730           
    731             if(io->reader_type!=R_INTERNAL)
    732                 io->wr += to_send;
     731            if(reader[ridx].typ != R_INTERNAL)
     732                wr += to_send;
    733733           
    734734#ifdef DEBUG_IO
     
    844844}
    845845
    846 static bool IO_Serial_WaitToRead (int hnd, unsigned delay_ms, unsigned timeout_ms)
     846static bool IO_Serial_WaitToRead (unsigned delay_ms, unsigned timeout_ms)
    847847{
    848848   fd_set rfds;
     
    865865   }
    866866   
    867    in_fd=hnd;
     867   in_fd=reader[ridx].handle;
    868868   
    869869   FD_ZERO(&rfds);
     
    895895}
    896896
    897 static bool IO_Serial_WaitToWrite (IO_Serial *io, unsigned delay_ms, unsigned timeout_ms)
     897static bool IO_Serial_WaitToWrite (unsigned delay_ms, unsigned timeout_ms)
    898898{
    899899   fd_set wfds;
     
    904904   
    905905#ifdef SCI_DEV
    906    if(io->reader_type==R_INTERNAL)
     906   if(reader[ridx].typ == R_INTERNAL)
    907907      return TRUE;
    908908#endif
     
    921921   }
    922922
    923    out_fd=io->fd;
     923   out_fd=reader[ridx].handle;
    924924   
    925925   FD_ZERO(&wfds);
     
    960960    memset (io->PnP_id, 0, IO_SERIAL_PNPID_SIZE);
    961961    io->PnP_id_size = 0;
    962     io->wr = 0;
     962    wr = 0;
    963963    //modifyable properties:
    964964    io->input_bitrate = 0;
     
    992992        return FALSE;
    993993
    994     while ((i < IO_SERIAL_PNPID_SIZE) && IO_Serial_Read (io, 200, 1, &(io->PnP_id[i])))
     994    while ((i < IO_SERIAL_PNPID_SIZE) && IO_Serial_Read (200, 1, &(io->PnP_id[i])))
    995995      i++;
    996996
  • trunk/csctapi/io_serial.h

    r1221 r1224  
    6868    BYTE PnP_id[IO_SERIAL_PNPID_SIZE];  /* PnP Id of the serial device */
    6969    unsigned PnP_id_size;           /* Length of PnP Id */
    70     int wr;
    7170    int mhz;            /* mhz specified in config = actual reader clock speed */
    7271    int cardmhz;            /* mhz specified in config = standard (non overclocked) clock speed of card*/
    7372}
    7473IO_Serial;
     74
     75int wr; //FIXME should be in ifd_phoenix.c or .h
    7576
    7677/*
     
    8081/* IO_Serial creation and deletion */
    8182//extern void IO_Serial_Reopen (IO_Serial * io);
    82 extern void IO_Serial_Flush (IO_Serial * io);
     83extern void IO_Serial_Flush ();
    8384extern IO_Serial *IO_Serial_New (int mhz, int cardmhz);
    8485extern void IO_Serial_Delete (IO_Serial * io);
     
    99100
    100101/* Input and output */
    101 extern bool IO_Serial_Read (IO_Serial * io, unsigned timeout, unsigned size, BYTE * data);
    102 extern bool IO_Serial_Write (IO_Serial * io, unsigned delay, unsigned size, BYTE * data);
     102extern bool IO_Serial_Read (unsigned timeout, unsigned size, BYTE * data);
     103extern bool IO_Serial_Write (unsigned delay, unsigned size, BYTE * data);
    103104
    104105/* Serial port atributes */
  • trunk/csctapi/pps.c

    r1209 r1224  
    466466    }
    467467#elif COOL
    468     if(pps->icc->ifd->io->com==R_INTERNAL) {
     468    if(reader[ridx].typ == R_INTERNAL) {
    469469        int mhz = atr_fs_table[pps->parameters.FI] / 10000;
    470470        if (!Cool_SetBaudrate(mhz))
     
    482482        baudrate = 9600;
    483483    else
    484         baudrate = pps->parameters.d * ICC_Async_GetClockRate (pps->icc) / F;
     484        baudrate = pps->parameters.d * ICC_Async_GetClockRate () / F;
    485485
    486486#ifdef DEBUG_PROTOCOL
  • trunk/csctapi/protocol_t0.c

    r1219 r1224  
    121121    /* WWT = 960 * WI * (Fi / f) * 1000 milliseconds */
    122122    double F =  (double) atr_f_table[params->FI];
    123     t0->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate (t0->icc)) * 1000);
     123    t0->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate ()) * 1000);
    124124   
    125125    /* Set timings */
     
    132132   
    133133#ifdef DEBUG_PROTOCOL
    134     printf ("Protocol: T=0: WWT=%d, Clockrate=%lu\n", (int)(t0->wwt),ICC_Async_GetClockRate(t0->icc));
     134    printf ("Protocol: T=0: WWT=%d, Clockrate=%lu\n", (int)(t0->wwt),ICC_Async_GetClockRate());
    135135#endif
    136136   
     
    157157    /* WWT = 960 * WI * (Fi / f) * 1000 milliseconds */
    158158    double F =  (double) atr_f_table[params->FI];
    159     t14->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate (t14->icc)) * 1000);
     159    t14->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate ()) * 1000);
    160160    t14->wwt >>= 1;
    161161   
Note: See TracChangeset for help on using the changeset viewer.