Changeset 1255


Ignore:
Timestamp:
01/16/10 17:56:59 (11 years ago)
Author:
rorothetroll
Message:

resync with trunk

Location:
branches/smartreader
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/smartreader/csctapi/cardterminal.c

    r1239 r1255  
    4949static char CardTerminal_GetStatus (CardTerminal * ct, APDU_Cmd * cmd, APDU_Rsp ** rsp);
    5050
    51 static char CardTerminal_SetParity (CardTerminal * ct, APDU_Cmd * cmd, APDU_Rsp ** rsp);
     51static char CardTerminal_SetParity (APDU_Cmd * cmd, APDU_Rsp ** rsp);
    5252
    5353static char CardTerminal_EjectICC (CardTerminal * ct, APDU_Cmd * cmd, APDU_Rsp ** rsp);
     
    7171}
    7272
    73 char CardTerminal_Init (CardTerminal * ct, int reader_type, int mhz, int cardmhz)
     73char CardTerminal_Init (CardTerminal * ct)
    7474{
    7575    char ret;
    7676    int i;
    7777   
    78     /* Create a new IO_Serial */
    79     ct->io = IO_Serial_New (mhz, cardmhz);
    80    
    81     /* Memory error */
    82     if (ct->io == NULL)
    83         return ERR_MEMORY;
    84    
    8578    /* Initialise serial port */
    86     if (ICC_Async_Device_Init ()) {
    87         printf("ERROR in initializing device\n");
     79    if (ICC_Async_Device_Init ())
    8880        return ERR_TRANS;
    89     }
    90     if (!IO_Serial_Init(ct->io, reader_type))
    91     {
    92         free (ct->io);
    93         ct->io = NULL;
    94         return ERR_TRANS;
    95     }
    96    
     81
    9782    /* Cearte all reader slots */
    9883    ct->num_slots = 0;
     
    11196       
    11297        /* Initialise slot */
    113         ret = CT_Slot_Init (ct->slots[i], ct->io, i);
     98        ret = CT_Slot_Init (ct->slots[i], i);
    11499       
    115100        if (ret != OK)
     
    133118        }
    134119       
    135         IO_Serial_Close (ct->io);
    136         free (ct->io);
    137         ct->io = NULL;
     120        IO_Serial_Close ();
    138121    }
    139122#ifdef HAVE_PTHREAD_H
     
    177160            ret = CardTerminal_GetStatus (ct, cmd, rsp);
    178161        else if (ins == CTBCS_INS_PARITY) /* Get Status */
    179             ret = CardTerminal_SetParity (ct, cmd, rsp);
     162            ret = CardTerminal_SetParity (cmd, rsp);
    180163        else if (ins == CTBCS_INS_EJECT) /* Eject ICC */
    181164            ret = CardTerminal_EjectICC (ct, cmd, rsp);
     
    213196    }
    214197   
    215     if (ct->io != NULL)
    216     {
    217         if (!IO_Serial_Close (ct->io))
     198        if (!IO_Serial_Close ())
    218199            ret = ERR_TRANS;
    219200       
    220         free (ct->io);
    221     }
    222    
    223201    CardTerminal_Clear (ct);
    224202   
     
    296274           
    297275            /* Initialise this slot */
    298             ret = CT_Slot_Init (ct->slots[sn],ct->io,sn);
     276            ret = CT_Slot_Init (ct->slots[sn],sn);
    299277           
    300278            if (ret != OK)
     
    690668}
    691669
    692 static char CardTerminal_SetParity (CardTerminal * ct, APDU_Cmd * cmd, APDU_Rsp ** rsp)
     670static char CardTerminal_SetParity (APDU_Cmd * cmd, APDU_Rsp ** rsp)
    693671{
    694672    BYTE buffer[2], p1, p2;
     
    858836    int i;
    859837   
    860     ct->io = NULL;
    861838    ct->num_slots = 0;
    862839   
  • branches/smartreader/csctapi/cardterminal.h

    r1211 r1255  
    4949typedef struct
    5050{
    51   IO_Serial * io;               /* Serial device */
    5251  CT_Slot * slots[CARDTERMINAL_MAX_SLOTS];  /* Array of CT_Slot's */
    5352  unsigned int num_slots;               /* Number of CT_Slot's */
     
    6867/* Intialice a CardTerminal in a given port */
    6968extern char
    70 CardTerminal_Init (CardTerminal * ct, int reader_type, int mhz, int cardmhz);
     69CardTerminal_Init (CardTerminal * ct);
    7170
    7271/* Send a CT-BCS command to a CardTerminal */
  • branches/smartreader/csctapi/ct_slot.c

    r1225 r1255  
    6464}
    6565
    66 char CT_Slot_Init (CT_Slot * slot, IO_Serial * io, int sn)
     66char CT_Slot_Init (CT_Slot * slot, int sn)
    6767{
    6868    slot->ifd = IFD_Towitoko_New();
     
    7171        return ERR_MEMORY;
    7272   
    73     if (IFD_Towitoko_Init (slot->ifd, io, sn) != IFD_TOWITOKO_OK)
     73    if (IFD_Towitoko_Init (slot->ifd, sn) != IFD_TOWITOKO_OK)
    7474    {
    7575        IFD_Towitoko_Delete (slot->ifd);
  • branches/smartreader/csctapi/ct_slot.h

    r1186 r1255  
    7171/* Intialice a CT_Slot */
    7272extern char
    73 CT_Slot_Init (CT_Slot * slot, IO_Serial * io, int sn);
     73CT_Slot_Init (CT_Slot * slot, int sn);
    7474
    7575/* Check for card inserted */
  • branches/smartreader/csctapi/ctapi.c

    r1211 r1255  
    5050 */
    5151
    52 char CT_init (unsigned short ctn, int reader_type, int mhz, int cardmhz)
     52char CT_init (unsigned short ctn)
    5353{
    5454    CardTerminal *ct;
     
    6969        {   
    7070            /* Initialize CardTerminal */
    71             ret = CardTerminal_Init (ct, reader_type, mhz, cardmhz);
     71            ret = CardTerminal_Init (ct);
    7272           
    7373            /* Add CardTerminal to list */
  • branches/smartreader/csctapi/ctapi.h

    r1211 r1255  
    2020
    2121extern char CT_init (
    22       unsigned short Ctn,                  /* Terminal Number */
    23       int reader_type,                      /* reader type (mouse, smartreader) */
    24       int mhz,
    25       int cardmhz
     22      unsigned short Ctn                  /* Terminal Number */
    2623      );
    2724
  • branches/smartreader/csctapi/icc_async.c

    r1254 r1255  
    6565int ICC_Async_Device_Init ()
    6666{
    67    
     67
     68    wr = 0;
    6869#ifdef DEBUG_IO
    6970    printf ("IO: Opening serial port %s\n", reader[ridx].device);
     
    9596        }
    9697#endif
    97        
     98
     99    if (reader[ridx].typ != R_INTERNAL) { //FIXME move to ifd_phoenix.c
     100        if(!IO_Serial_InitPnP ())
     101            return ICC_ASYNC_IFD_ERROR;
     102        IO_Serial_Flush();
     103    }
     104
    98105    return ICC_ASYNC_OK;
    99106}
     
    238245    else
    239246#endif
    240     if (IFD_Towitoko_ResetAsyncICC (ifd, &(icc->atr)) != IFD_TOWITOKO_OK)
     247    if (!Phoenix_Reset(&(icc->atr)))
    241248    {
    242249        icc->atr = NULL;
     
    277284        if (!IO_Serial_SetParity (PARITY_ODD))
    278285            return ICC_ASYNC_IFD_ERROR;
    279         icc->ifd->io->parity = PARITY_ODD;
    280286    }
    281287    else if(icc->protocol_type == ATR_PROTOCOL_TYPE_T14)
     
    283289        if (!IO_Serial_SetParity (PARITY_NONE))
    284290            return ICC_ASYNC_IFD_ERROR;     
    285         icc->ifd->io->parity = PARITY_NONE;
    286291    }
    287292    else
     
    289294        if (!IO_Serial_SetParity (PARITY_EVEN))
    290295            return ICC_ASYNC_IFD_ERROR;     
    291         icc->ifd->io->parity = PARITY_EVEN;
    292296    }
    293297#ifdef COOL
    294298    if (reader[ridx].typ != R_INTERNAL)
    295299#endif
    296     IO_Serial_Flush(ifd->io);
     300    IO_Serial_Flush();
    297301    return ICC_ASYNC_OK;
    298302#else
  • branches/smartreader/csctapi/ifd_phoenix.c

    r1254 r1255  
    1313#include <termios.h>
    1414
    15 #define OK      1 
     15#define OK      1
    1616#define ERROR 0
    1717
     
    4646
    4747int Phoenix_Reset (ATR ** atr)
    48 {   
    49         return OK;
     48{   
     49
     50#ifdef DEBUG_IFD
     51    printf ("IFD: Resetting card:\n");
     52#endif
     53
     54        int ret;
     55        int i;
     56        int parity[3] = {PARITY_EVEN, PARITY_ODD, PARITY_NONE};
     57#ifdef HAVE_NANOSLEEP
     58        struct timespec req_ts;
     59        req_ts.tv_sec = 0;
     60        req_ts.tv_nsec = 50000000;
     61#endif
     62       
     63        (*atr) = NULL;
     64        for(i=0; i<3; i++) {
     65            IO_Serial_Flush();
     66            if (!IO_Serial_SetParity (parity[i]))
     67                return ERROR;
     68
     69            ret = ERROR;
     70            IO_Serial_Ioctl_Lock(1);
     71#ifdef USE_GPIO
     72            if (gpio_detect){
     73                set_gpio(0);
     74                set_gpio1(0);
     75            }
     76            else
     77#endif
     78                IO_Serial_RTS_Set();
     79#ifdef HAVE_NANOSLEEP
     80            nanosleep (&req_ts, NULL);
     81#else
     82            usleep (50000L);
     83#endif
     84#ifdef USE_GPIO
     85            if (gpio_detect) {
     86                set_gpio_input();
     87                set_gpio1(1);
     88            }
     89            else
     90#endif
     91                IO_Serial_RTS_Clr();
     92            IO_Serial_Ioctl_Lock(0);
     93            (*atr) = ATR_New ();
     94            if(ATR_InitFromStream ((*atr), IFD_TOWITOKO_ATR_TIMEOUT) == ATR_OK)
     95                ret = OK;
     96            // Succesfully retrieve ATR
     97            if (ret == OK)
     98                break;
     99            else
     100            {
     101                ATR_Delete (*atr);
     102                (*atr) = NULL;
     103#ifdef USE_GPIO
     104                if (gpio_detect) set_gpio1(0);
     105#endif
     106            }
     107        }
     108        IO_Serial_Flush();
     109
     110/*
     111        //PLAYGROUND faking ATR for test purposes only
     112        //
     113        // sky 919 unsigned char atr_test[] = { 0x3F, 0xFF, 0x13, 0x25, 0x03, 0x10, 0x80, 0x33, 0xB0, 0x0E, 0x69, 0xFF, 0x4A, 0x50, 0x70, 0x00, 0x00, 0x49, 0x54, 0x02, 0x00, 0x00 };
     114        // HD+ unsigned char atr_test[] = { 0x3F, 0xFF, 0x95, 0x00, 0xFF, 0x91, 0x81, 0x71, 0xFE, 0x47, 0x00, 0x44, 0x4E, 0x41, 0x53, 0x50, 0x31, 0x34, 0x32, 0x20, 0x52, 0x65, 0x76, 0x47, 0x43, 0x34, 0x63 };
     115        // S02 = irdeto unsigned char atr_test[] = { 0x3B, 0x9F, 0x21, 0x0E, 0x49, 0x52, 0x44, 0x45, 0x54, 0x4F, 0x20, 0x41, 0x43, 0x53, 0x03};
     116        //cryptoworks   unsigned char atr_test[] = { 0x3B, 0x78, 0x12, 0x00, 0x00, 0x65, 0xC4, 0x05, 0xFF, 0x8F, 0xF1, 0x90, 0x00 };
     117        ATR_Delete(*atr); //throw away actual ATR
     118        (*atr) = ATR_New ();
     119        ATR_InitFromArray ((*atr), atr_test, sizeof(atr_test));
     120        //END OF PLAYGROUND
     121*/
     122       
     123        return ret;
    50124}
    51125
     
    70144    if (gpio_detect) set_gpio1(0);
    71145#endif
    72     for (sent = 0; sent < size; sent = sent + to_send) 
     146    for (sent = 0; sent < size; sent = sent + to_send)
    73147    {
    74148        /* Calculate number of bytes to send */
  • branches/smartreader/csctapi/ifd_towitoko.c

    r1254 r1255  
    146146}
    147147
    148 int IFD_Towitoko_Init (IFD * ifd, IO_Serial * io, BYTE slot)
     148int IFD_Towitoko_Init (IFD * ifd, BYTE slot)
    149149{
    150150    int ret;
     
    173173    if(reader[ridx].typ == R_INTERNAL)
    174174    {
    175         ifd->io = io;
    176175        ifd->slot = slot;
    177176        ifd->type = IFD_TOWITOKO_MULTICAM;
     
    186185    /* Default ifd settings */
    187186   
    188     ifd->io = io;
    189187    ifd->slot = slot;
    190188    ifd->type = IFD_TOWITOKO_MULTICAM;
     
    197195   
    198196    if (!IO_Serial_SetParity (PARITY_EVEN))
     197    {
     198        IFD_Towitoko_Clear (ifd);
    199199        return IFD_TOWITOKO_IO_ERROR;
    200    
    201     if (ret != IFD_TOWITOKO_OK)
    202     {
    203         IFD_Towitoko_Clear (ifd);
    204         return ret;
    205200    }
    206201   
     
    213208    else
    214209    {   
    215         IO_Serial_Flush(ifd->io);
     210        IO_Serial_Flush();
    216211    }
    217212   
     
    221216int IFD_Towitoko_Close (IFD * ifd)
    222217{
    223     int ret;
    224 
    225218#ifdef USE_GPIO
    226219    if(gpio_detect)
     
    242235}
    243236
    244 int IFD_Towitoko_ActivateICC (IFD * ifd)
     237int IFD_Towitoko_ActivateICC ()
    245238{
    246239#ifdef DEBUG_IFD
     
    279272}
    280273
    281 int IFD_Towitoko_DeactivateICC (IFD * ifd)
     274int IFD_Towitoko_DeactivateICC ()
    282275{
    283276#ifdef DEBUG_IFD
     
    311304
    312305//extern void print_hex_data(unsigned char *data, int len);
    313 
    314 int IFD_Towitoko_ResetAsyncICC (IFD * ifd, ATR ** atr)
    315 {   
    316 
    317 #ifdef DEBUG_IFD
    318     printf ("IFD: Resetting card:\n");
    319 #endif
    320 
    321         int ret;
    322         int parity;
    323         int i;
    324         int par[3] = {PARITY_EVEN, PARITY_ODD, PARITY_NONE};
    325 #ifdef HAVE_NANOSLEEP
    326         struct timespec req_ts;
    327         req_ts.tv_sec = 0;
    328         req_ts.tv_nsec = 50000000;
    329 #endif
    330        
    331         (*atr) = NULL;
    332         for(i=0; i<3; i++)
    333         {
    334             parity = par[i];
    335             IO_Serial_Flush();
    336 
    337             if (!IO_Serial_SetParity (parity))
    338                 return IFD_TOWITOKO_IO_ERROR;
    339 
    340             ret = IFD_TOWITOKO_IO_ERROR;
    341 
    342             IO_Serial_Ioctl_Lock(1);
    343 #ifdef USE_GPIO
    344             if (gpio_detect)
    345             {
    346                 set_gpio(0);
    347                 set_gpio1(0);
    348             }
    349             else
    350 #endif
    351                 IO_Serial_RTS_Set();
    352 
    353 #ifdef HAVE_NANOSLEEP
    354             nanosleep (&req_ts, NULL);
    355 #else
    356             usleep (50000L);
    357 #endif
    358 #ifdef USE_GPIO
    359             if (gpio_detect)
    360             {
    361                 set_gpio_input();
    362                 set_gpio1(1);
    363             }
    364             else
    365 #endif
    366                 IO_Serial_RTS_Clr();
    367            
    368             IO_Serial_Ioctl_Lock(0);
    369 
    370             (*atr) = ATR_New ();
    371 
    372             if(ATR_InitFromStream ((*atr), IFD_TOWITOKO_ATR_TIMEOUT) == ATR_OK)
    373                 ret = IFD_TOWITOKO_OK;
    374 
    375             /* Succesfully retrive ATR */
    376             if (ret == IFD_TOWITOKO_OK)
    377             {           
    378                 break;
    379             }
    380             else
    381             {
    382                 ATR_Delete (*atr);
    383                 (*atr) = NULL;
    384 #ifdef USE_GPIO
    385                 if (gpio_detect) set_gpio1(0);
    386 #endif
    387             }   
    388         }
    389    
    390         IO_Serial_Flush();
    391 
    392 /*
    393         //PLAYGROUND faking ATR for test purposes only
    394         //
    395         // sky 919 unsigned char atr_test[] = { 0x3F, 0xFF, 0x13, 0x25, 0x03, 0x10, 0x80, 0x33, 0xB0, 0x0E, 0x69, 0xFF, 0x4A, 0x50, 0x70, 0x00, 0x00, 0x49, 0x54, 0x02, 0x00, 0x00 };
    396         // HD+ unsigned char atr_test[] = { 0x3F, 0xFF, 0x95, 0x00, 0xFF, 0x91, 0x81, 0x71, 0xFE, 0x47, 0x00, 0x44, 0x4E, 0x41, 0x53, 0x50, 0x31, 0x34, 0x32, 0x20, 0x52, 0x65, 0x76, 0x47, 0x43, 0x34, 0x63 };
    397         // S02 = irdeto unsigned char atr_test[] = { 0x3B, 0x9F, 0x21, 0x0E, 0x49, 0x52, 0x44, 0x45, 0x54, 0x4F, 0x20, 0x41, 0x43, 0x53, 0x03};
    398         //cryptoworks   unsigned char atr_test[] = { 0x3B, 0x78, 0x12, 0x00, 0x00, 0x65, 0xC4, 0x05, 0xFF, 0x8F, 0xF1, 0x90, 0x00 };
    399         ATR_Delete(*atr); //throw away actual ATR
    400         (*atr) = ATR_New ();
    401         ATR_InitFromArray ((*atr), atr_test, sizeof(atr_test));
    402         //END OF PLAYGROUND
    403 */
    404        
    405         return ret;
    406 }
    407306
    408307BYTE IFD_Towitoko_GetType (IFD * ifd)
     
    495394static void IFD_Towitoko_Clear (IFD * ifd)
    496395{
    497     ifd->io = NULL;
    498396    ifd->slot = 0x00;
    499397    ifd->type = 0x00;
  • branches/smartreader/csctapi/ifd_towitoko.h

    r1254 r1255  
    9393typedef struct
    9494{
    95   IO_Serial *io;        /* Handle of serial device */
    9695  BYTE slot;            /* Chipdrive Twin Slot */
    9796  BYTE type;            /* Reader type code */
     
    111110
    112111/* Handling of the drive associated with this IFD */
    113 extern int IFD_Towitoko_Init (IFD * ifd, IO_Serial * io, BYTE slot);
     112extern int IFD_Towitoko_Init (IFD * ifd, BYTE slot);
    114113extern int IFD_Towitoko_Close (IFD * ifd);
    115114
     
    118117
    119118/* General handling of ICC inserted in this IFD */
    120 extern int IFD_Towitoko_ActivateICC (IFD * ifd);
    121 extern int IFD_Towitoko_DeactivateICC (IFD * ifd);
     119extern int IFD_Towitoko_ActivateICC ();
     120extern int IFD_Towitoko_DeactivateICC ();
    122121
    123122/* Asynchronous ICC handling functions */
    124 extern int IFD_Towitoko_ResetAsyncICC (IFD * ifd, ATR ** atr);
     123extern int IFD_Towitoko_ResetAsyncICC (ATR ** atr);
    125124
    126125/* Atributes of the drive associated with this IFD */
  • branches/smartreader/csctapi/io_serial.c

    r1254 r1255  
    6363
    6464static bool IO_Serial_WaitToWrite (unsigned delay_ms, unsigned timeout_ms);
    65 
    66 static bool IO_Serial_InitPnP (IO_Serial * io);
    67 
    68 static void IO_Serial_Clear (IO_Serial * io);
    6965
    7066static int _in_echo_read = 0;
     
    157153 */
    158154
    159 IO_Serial * IO_Serial_New (int mhz, int cardmhz)
    160 {
    161     IO_Serial *io;
    162    
    163     io = (IO_Serial *) malloc (sizeof (IO_Serial));
    164    
    165     if (io != NULL)
    166         IO_Serial_Clear (io);
    167    
    168     return io;
    169 }
    170 
    171 bool IO_Serial_Init (IO_Serial * io, int reader_type)
    172 {
    173     if (reader[ridx].typ != R_INTERNAL)
    174         IO_Serial_InitPnP (io);
    175    
    176     if(reader[ridx].typ!=R_INTERNAL)
    177         IO_Serial_Flush();
    178        
    179     return TRUE;
    180 }
    181 
    182155bool IO_Serial_SetBitrate (unsigned long bitrate, struct termios * tio)
    183156{
     
    217190            return FALSE;
    218191     
    219      // printf("IO: Setting properties: reader_type%d, %ld bps; %d bits/byte; %s parity; %d stopbits; dtr=%d; rts=%d\n", reader[ridx].typ, bitrate, bits, parity == PARITY_EVEN ? "Even" : parity == PARITY_ODD ? "Odd" : "None", stopbits, dtr, rts);
    220192     memset (&newtio, 0, sizeof (newtio));
    221193
     
    391363
    392364
    393 void IO_Serial_GetPnPId (IO_Serial * io, BYTE * pnp_id, unsigned *length)
    394 {
    395     (*length) = io->PnP_id_size;
    396     memcpy (pnp_id, io->PnP_id, io->PnP_id_size);
    397 }
    398 
    399365bool IO_Serial_Read (unsigned timeout, unsigned size, BYTE * data)
    400366{
     
    556522}
    557523
    558 bool IO_Serial_Close (IO_Serial * io)
     524bool IO_Serial_Close ()
    559525{
    560526   
     
    569535        return FALSE;
    570536   
    571     IO_Serial_Clear (io);
     537    wr = 0;
    572538   
    573539    return TRUE;
     
    750716}
    751717
    752 static void IO_Serial_Clear (IO_Serial * io)
    753 {
    754     memset (io->PnP_id, 0, IO_SERIAL_PNPID_SIZE);
    755     io->PnP_id_size = 0;
    756     wr = 0;
    757     //modifyable properties:
    758     io->input_bitrate = 0;
    759     io->output_bitrate = 0;
    760     io->bits = 0;
    761     io->stopbits = 0;
    762     io->parity = 0;
    763     io->dtr = 0;
    764     io->rts = 0;
    765 }
    766 
    767 static bool IO_Serial_InitPnP (IO_Serial * io)
    768 {
    769     int i = 0;
     718bool IO_Serial_InitPnP ()
     719{
     720    unsigned int PnP_id_size = 0;
     721    BYTE PnP_id[IO_SERIAL_PNPID_SIZE];  /* PnP Id of the serial device */
     722
    770723  if (!IO_Serial_SetParams (1200, 7, PARITY_NONE, 1, IO_SERIAL_HIGH, IO_SERIAL_LOW))
    771724        return FALSE;
    772725
    773     while ((i < IO_SERIAL_PNPID_SIZE) && IO_Serial_Read (200, 1, &(io->PnP_id[i])))
    774       i++;
    775 
    776     io->PnP_id_size = i;
     726    while ((PnP_id_size < IO_SERIAL_PNPID_SIZE) && IO_Serial_Read (200, 1, &(PnP_id[PnP_id_size])))
     727      PnP_id_size++;
     728
    777729        return TRUE;
    778730}
  • branches/smartreader/csctapi/io_serial.h

    r1254 r1255  
    4848#define IO_SERIAL_PNPID_SIZE        256
    4949
    50 /*
    51  * Exported datatypes definition
    52  */
    53 
    54 /* IO_Serial exported datatype */
    55 typedef struct
    56 {
    57     /* Settings that can be modified */
    58     unsigned long input_bitrate;
    59     unsigned long  output_bitrate;
    60     unsigned bits;
    61     unsigned stopbits;
    62     int parity;
    63     int dtr;
    64     int rts;   
    65     /* end settings that can be modified */
    66     BYTE PnP_id[IO_SERIAL_PNPID_SIZE];  /* PnP Id of the serial device */
    67     unsigned PnP_id_size;           /* Length of PnP Id */
    68 }
    69 IO_Serial;
    70 
    7150int wr; //FIXME should be in ifd_phoenix.c or .h
    7251
     
    7655
    7756/* IO_Serial creation and deletion */
    78 //extern void IO_Serial_Reopen (IO_Serial * io);
    7957extern void IO_Serial_Flush ();
    80 extern IO_Serial *IO_Serial_New (int mhz, int cardmhz);
    81 extern void IO_Serial_Delete (IO_Serial * io);
    8258
    8359/* Initialization and closing */
    84 extern bool IO_Serial_Init (IO_Serial * io, int reader_type);
    85 extern bool IO_Serial_Close (IO_Serial * io);
     60extern bool IO_Serial_InitPnP (void);
     61extern bool IO_Serial_Close ();
    8662
    8763/* Transmission properties */
     
    9773extern bool IO_Serial_Write (unsigned delay, unsigned size, BYTE * data);
    9874
    99 /* Serial port atributes */
    100 extern void IO_Serial_GetPnPId (IO_Serial * io, BYTE * pnp_id, unsigned *length);
    101 
    10275#endif /* IO_SERIAL */
  • branches/smartreader/reader-common.c

    r1239 r1255  
    309309  cs_ptyp=D_DEVICE;
    310310#ifdef TUXBOX
    311   if ((rc=CT_init(1, reader_device_type(device),reader[ridx].mhz,reader[ridx].cardmhz))!=OK)
     311    reader[ridx].typ = reader_device_type(device);
     312  if ((rc=CT_init(1))!=OK)
    312313    cs_log("[tuxbox] Cannot open device: %s", device);
    313314#else
    314   if ((rc=CT_init(1, reader[ridx].typ,reader[ridx].mhz,reader[ridx].cardmhz))!=OK)
     315  if ((rc=CT_init(1))!=OK)
    315316    cs_log("Cannot open device: %s", device);
    316317#endif
Note: See TracChangeset for help on using the changeset viewer.