Changeset 1234


Ignore:
Timestamp:
01/15/10 10:52:34 (11 years ago)
Author:
dingo35
Message:

Clean up unused csctapi code

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/csctapi/icc_async.c

    r1224 r1234  
    210210    unsigned np=0;
    211211
    212     /* LED Red */
    213     if (IFD_Towitoko_SetLED () != IFD_TOWITOKO_OK)
    214         return ICC_ASYNC_IFD_ERROR;
    215    
    216212    /* Initialize Baudrate */
    217213    if (IFD_Towitoko_SetBaudrate (ifd, ICC_ASYNC_BAUDRATE)!= IFD_TOWITOKO_OK)
     
    224220#ifdef SCI_DEV
    225221    if (reader[ridx].typ == R_INTERNAL) {
    226         if (!Sci_Reset(ifd, &(icc->atr)))
     222        if (!Sci_Reset(&(icc->atr)))
    227223        {
    228224            icc->atr = NULL;
     
    272268#endif
    273269    *///really should let PPS handle this
    274     /* LED Green */
    275     if (IFD_Towitoko_SetLED () != IFD_TOWITOKO_OK)
    276     {
    277         ATR_Delete (icc->atr);
    278         icc->atr = NULL;
    279         icc->convention = 0;
    280        
    281         return ICC_ASYNC_IFD_ERROR;
    282     }
    283270   
    284271    /* Initialize member variables */
     
    452439        return ICC_ASYNC_IFD_ERROR;
    453440   
    454     /* LED Off */
    455     if (IFD_Towitoko_SetLED () != IFD_TOWITOKO_OK)
    456         return ICC_ASYNC_IFD_ERROR;
    457    
    458441    /* Delete atr */
    459442    ATR_Delete (icc->atr);
  • trunk/csctapi/ifd_sci.c

    r1227 r1234  
    1818#include <fcntl.h>
    1919#endif
     20#include "../globals.h"
    2021
    2122#include "ifd_towitoko.h"
     
    3738}
    3839
    39 int Sci_Reset (IFD * ifd, ATR ** atr)
     40int Sci_Reset (ATR ** atr)
    4041{
    4142    unsigned char buf[SCI_MAX_ATR_SIZE];
     
    6061    params.T = 0;
    6162   
    62     if(ioctl(ifd->io->fd, IOCTL_SET_PARAMETERS, &params)!=0)
     63    if(ioctl(reader[ridx].handle, IOCTL_SET_PARAMETERS, &params)!=0)
    6364        return ERROR;
    6465   
    65     if(ioctl(ifd->io->fd, IOCTL_SET_RESET)<0)
     66    if(ioctl(reader[ridx].handle, IOCTL_SET_RESET)<0)
    6667        return ERROR;
    6768
     
    129130        req_ts.tv_nsec = 50000000;
    130131        nanosleep (&req_ts, NULL);
    131         if (ioctl(ifd->io->fd, IOCTL_SET_ATR_READY)<0)
     132        if (ioctl(reader[ridx].handle, IOCTL_SET_ATR_READY)<0)
    132133            return ERROR;
    133134        return OK;
  • trunk/csctapi/ifd_towitoko.c

    r1224 r1234  
    248248#endif
    249249   
    250     ret = IFD_Towitoko_SetLED ();
    251     if (ret != IFD_TOWITOKO_OK)
    252         return ret;
    253        
    254250    IFD_Towitoko_Clear (ifd);
    255251   
     
    264260        return IFD_TOWITOKO_OK;
    265261    }
    266 /* 
    267     if (IFD_Towitoko_GetMaxBaudrate () < baudrate)
    268     {
    269 #ifdef DEBUG_IFD
    270         printf ("IFD: Tried to set unsupported baudrate: %lu", baudrate);
    271 #endif
    272         return IFD_TOWITOKO_PARAM_ERROR;
    273     }*/
    274    
    275262#ifdef DEBUG_IFD
    276263    printf ("IFD: Setting baudrate to %lu\n", baudrate);
     
    341328}
    342329
    343 int IFD_Towitoko_SetLED ()
    344 {   
    345     return IFD_TOWITOKO_OK;
    346 }
    347 
    348330int IFD_Towitoko_ActivateICC (IFD * ifd)
    349331{
     
    357339
    358340#if defined(TUXBOX) && (defined(MIPSEL) || defined(PPC) || defined(SH4))
    359         if(ioctl(ifd->io->fd, IOCTL_GET_IS_CARD_PRESENT, &in)<0)
     341        if(ioctl(reader[ridx].handle, IOCTL_GET_IS_CARD_PRESENT, &in)<0)
    360342#else
    361         if(ioctl(ifd->io->fd, IOCTL_GET_IS_CARD_ACTIVATED, &in)<0)
     343        if(ioctl(reader[ridx].handle, IOCTL_GET_IS_CARD_ACTIVATED, &in)<0)
    362344#endif
    363345            return IFD_TOWITOKO_IO_ERROR;
     
    395377       
    396378#if defined(TUXBOX) && (defined(MIPSEL) || defined(PPC) || defined(SH4))
    397         if(ioctl(ifd->io->fd, IOCTL_GET_IS_CARD_PRESENT, &in)<0)
     379        if(ioctl(reader[ridx].handle, IOCTL_GET_IS_CARD_PRESENT, &in)<0)
    398380#else
    399         if(ioctl(ifd->io->fd, IOCTL_GET_IS_CARD_ACTIVATED, &in)<0)
     381        if(ioctl(reader[ridx].handle, IOCTL_GET_IS_CARD_ACTIVATED, &in)<0)
    400382#endif
    401383            return IFD_TOWITOKO_IO_ERROR;
     
    403385        if(in)
    404386        {
    405             if(ioctl(ifd->io->fd, IOCTL_SET_DEACTIVATE)<0)
     387            if(ioctl(reader[ridx].handle, IOCTL_SET_DEACTIVATE)<0)
    406388                return IFD_TOWITOKO_IO_ERROR;
    407389        }
     
    454436            else
    455437#endif
    456                 IO_Serial_RTS_Set(ifd->io);
     438                IO_Serial_RTS_Set();
    457439
    458440#ifdef HAVE_NANOSLEEP
     
    469451            else
    470452#endif
    471                 IO_Serial_RTS_Clr(ifd->io);
     453                IO_Serial_RTS_Clr();
    472454           
    473455            IO_Serial_Ioctl_Lock(0);
     
    511493}
    512494
    513 int IFD_Towitoko_Transmit (IFD * ifd, IFD_Timings * timings, unsigned size, BYTE * buffer)
    514 {
    515     unsigned block_delay, char_delay, sent=0, to_send = 0;
    516 
    517 #ifdef DEBUG_IFD
    518     printf ("IFD: Transmit: ");
    519     for (sent = 0; sent < size; sent++)
    520     printf ("%X ", buffer[sent]);
    521     printf ("\n");
    522 #endif
    523 
    524 
    525     /* Calculate delays */
    526     char_delay = IFD_TOWITOKO_DELAY + timings->char_delay;
    527     block_delay = IFD_TOWITOKO_DELAY + timings->block_delay;
    528 
    529 #ifdef USE_GPIO
    530     if (gpio_detect) set_gpio1(0);
    531 #endif
    532     for (sent = 0; sent < size; sent = sent + to_send)
    533     {
    534         /* Calculate number of bytes to send */
    535         to_send = MIN(size, IFD_TOWITOKO_MAX_TRANSMIT);
    536                
    537         /* Send data */
    538         if ((sent == 0) && (block_delay != char_delay))
    539         {
    540             if (!IO_Serial_Write (block_delay, 1, buffer))
    541                 return IFD_TOWITOKO_IO_ERROR;
    542            
    543             if (!IO_Serial_Write (char_delay, to_send-1, buffer+1))
    544                 return IFD_TOWITOKO_IO_ERROR;
    545         }
    546         else
    547         {
    548             if (!IO_Serial_Write (char_delay, to_send, buffer+sent))
    549                 return IFD_TOWITOKO_IO_ERROR;
    550         }
    551     }
    552 #ifdef USE_GPIO
    553     if (gpio_detect) set_gpio1(1);
    554 #endif
    555     return IFD_TOWITOKO_OK;
    556 }
    557 
    558 int IFD_Towitoko_Receive (IFD * ifd, IFD_Timings * timings, unsigned size, BYTE * buffer)
    559 {
    560     unsigned char_timeout, block_timeout;
    561 #ifdef DEBUG_IFD
    562     int i;
    563 #endif
    564        
    565     /* Calculate timeouts */
    566     char_timeout = IFD_TOWITOKO_TIMEOUT + timings->char_timeout;
    567     block_timeout = IFD_TOWITOKO_TIMEOUT + timings->block_timeout;
    568 #ifdef USE_GPIO
    569     if (gpio_detect) set_gpio1(0);
    570 #endif
    571     if (block_timeout != char_timeout)
    572     {
    573         /* Read first byte using block timeout */
    574         if (!IO_Serial_Read (block_timeout, 1, buffer))
    575             return IFD_TOWITOKO_IO_ERROR;
    576        
    577         if (size > 1)
    578         {
    579             /* Read remaining data bytes using char timeout */
    580             if (!IO_Serial_Read (char_timeout, size - 1, buffer + 1))
    581                 return IFD_TOWITOKO_IO_ERROR;
    582         }
    583     }
    584     else
    585     {
    586         /* Read all data bytes with the same timeout */
    587         if (!IO_Serial_Read (char_timeout, size, buffer))
    588             return IFD_TOWITOKO_IO_ERROR;
    589     }
    590 #ifdef USE_GPIO
    591     if (gpio_detect) set_gpio1(1);
    592 #endif
    593    
    594 #ifdef DEBUG_IFD
    595     printf ("IFD: Receive: ");
    596     for (i = 0; i < size; i++)
    597     printf ("%X ", buffer[i]);
    598     printf ("\n");
    599 #endif
    600    
    601     return IFD_TOWITOKO_OK;
    602 }
    603 
    604 
    605495BYTE IFD_Towitoko_GetType (IFD * ifd)
    606496{
     
    658548{
    659549    return 1;
    660 }
    661 
    662 unsigned long
    663 IFD_Towitoko_GetMaxBaudrate ()
    664 {
    665     return 115200L;
    666550}
    667551
  • trunk/csctapi/ifd_towitoko.h

    r1224 r1234  
    131131extern int IFD_Towitoko_GetBaudrate (IFD * ifd, unsigned long *baudrate);
    132132extern int IFD_Towitoko_SetParity (IFD * ifd, BYTE parity);
    133 extern int IFD_Towitoko_SetLED ();
    134133
    135134/* General handling of ICC inserted in this IFD */
     
    144143extern BYTE IFD_Towitoko_GetFirmware (IFD * ifd);
    145144extern unsigned IFD_Towitoko_GetNumSlots ();
    146 extern unsigned long IFD_Towitoko_GetMaxBaudrate ();
    147145extern void IFD_Towitoko_GetDescription (IFD * ifd, BYTE * desc, unsigned length);
    148146
  • trunk/csctapi/io_serial.c

    r1224 r1234  
    6363
    6464static bool IO_Serial_WaitToWrite (unsigned delay_ms, unsigned timeout_ms);
    65 
    66 static void IO_Serial_DeviceName (char * filename, unsigned length);
    6765
    6866static bool IO_Serial_InitPnP (IO_Serial * io);
     
    130128#endif
    131129
    132 bool IO_Serial_DTR_RTS(IO_Serial * io, int dtr, int set)
     130bool IO_Serial_DTR_RTS(int dtr, int set)
    133131{
    134132    unsigned int msr;
     
    136134
    137135#if defined(TUXBOX) && defined(PPC)
    138     if ((io->reader_type==R_DB2COM1) || (io->reader_type==R_DB2COM2))
    139         return(IO_Serial_DTR_RTS_dbox2(io->reader_type==R_DB2COM2, dtr, set));
     136    if ((reader[ridx].typ == R_DB2COM1) || (reader[ridx].typ == R_DB2COM2))
     137        return(IO_Serial_DTR_RTS_dbox2(reader[ridx].typ == R_DB2COM2, dtr, set));
    140138#endif
    141139
    142140    mbit=(dtr) ? TIOCM_DTR : TIOCM_RTS;
    143141#if defined(TIOCMBIS) && defined(TIOBMBIC)
    144     if (ioctl (io->fd, set ? TIOCMBIS : TIOCMBIC, &mbit) < 0)
     142    if (ioctl (reader[ridx].handle, set ? TIOCMBIS : TIOCMBIC, &mbit) < 0)
    145143        return FALSE;
    146144#else
    147     if (ioctl(io->fd, TIOCMGET, &msr) < 0)
     145    if (ioctl(reader[ridx].handle, TIOCMGET, &msr) < 0)
    148146        return FALSE;
    149147    if (set)
     
    151149    else
    152150        msr&=~mbit;
    153     return((ioctl(io->fd, TIOCMSET, &msr)<0) ? FALSE : TRUE);
     151    return((ioctl(reader[ridx].handle, TIOCMSET, &msr)<0) ? FALSE : TRUE);
    154152#endif
    155153}
     
    168166        IO_Serial_Clear (io);
    169167   
    170     io->mhz=mhz;
    171     io->cardmhz=cardmhz;
    172    
    173168    return io;
    174169}
     
    176171bool IO_Serial_Init (IO_Serial * io, int reader_type)
    177172{
    178     io->reader_type = reader_type;
    179     io->fd = reader[ridx].handle;
     173    reader[ridx].typ = reader_type;
     174    reader[ridx].handle = reader[ridx].handle;
    180175
    181176    if (reader_type != R_INTERNAL)
    182177        IO_Serial_InitPnP (io);
    183178   
    184     if(io->reader_type!=R_INTERNAL)
     179    if(reader[ridx].typ!=R_INTERNAL)
    185180        IO_Serial_Flush();
    186181       
     
    195190
    196191#ifdef SCI_DEV
    197     if(io->reader_type==R_INTERNAL)
     192    if(reader[ridx].typ == R_INTERNAL)
    198193        return FALSE;
    199194#endif
     
    202197      return TRUE;
    203198   
    204     if (tcgetattr (io->fd, &currtio) != 0)
     199    if (tcgetattr (reader[ridx].handle, &currtio) != 0)
    205200        return FALSE;
    206201
     
    446441        io->stopbits = 1;
    447442   
    448     if (ioctl (io->fd, TIOCMGET, &mctl) < 0)
     443    if (ioctl (reader[ridx].handle, TIOCMGET, &mctl) < 0)
    449444        return FALSE;
    450445   
     
    464459   
    465460#ifdef SCI_DEV
    466    if(io->reader_type==R_INTERNAL)
     461   if(reader[ridx].typ == R_INTERNAL)
    467462      return FALSE;
    468463#endif
    469464   
    470    //   printf("IO: Setting properties: reader_type%d, %ld bps; %d bits/byte; %s parity; %d stopbits; dtr=%d; rts=%d\n", io->reader_type, io->input_bitrate, io->bits, io->parity == IO_SERIAL_PARITY_EVEN ? "Even" : io->parity == IO_SERIAL_PARITY_ODD ? "Odd" : "None", io->stopbits, io->dtr, io->rts);
     465   //   printf("IO: Setting properties: reader_type%d, %ld bps; %d bits/byte; %s parity; %d stopbits; dtr=%d; rts=%d\n", reader[ridx].typ, io->input_bitrate, io->bits, io->parity == IO_SERIAL_PARITY_EVEN ? "Even" : io->parity == IO_SERIAL_PARITY_ODD ? "Odd" : "None", io->stopbits, io->dtr, io->rts);
    471466   memset (&newtio, 0, sizeof (newtio));
    472467
     
    474469   /* Set the bitrate */
    475470#ifdef OS_LINUX
    476    if (io->mhz == io->cardmhz)
     471   if (reader[ridx].mhz == reader[ridx].cardmhz)
    477472#endif
    478473   { //no overclocking
    479474     cfsetospeed(&newtio, IO_Serial_Bitrate(io->output_bitrate));
    480475     cfsetispeed(&newtio, IO_Serial_Bitrate(io->input_bitrate));
    481      cs_debug("standard baudrate: cardmhz=%d mhz=%d -> effective baudrate %lu", io->cardmhz, io->mhz, io->output_bitrate);
     476     cs_debug("standard baudrate: cardmhz=%d mhz=%d -> effective baudrate %lu", reader[ridx].cardmhz, reader[ridx].mhz, io->output_bitrate);
    482477   }
    483478#ifdef OS_LINUX
     
    485480    /* these structures are only available on linux as fas as we know so limit this code to OS_LINUX */
    486481    struct serial_struct nuts;
    487     ioctl(io->fd, TIOCGSERIAL, &nuts);
    488     int custom_baud = io->output_bitrate * io->mhz / io->cardmhz;
     482    ioctl(reader[ridx].handle, TIOCGSERIAL, &nuts);
     483    int custom_baud = io->output_bitrate * reader[ridx].mhz / reader[ridx].cardmhz;
    489484    nuts.custom_divisor = (nuts.baud_base + (custom_baud/2))/ custom_baud;
    490485    cs_debug("custom baudrate: cardmhz=%d mhz=%d custom_baud=%d baud_base=%d divisor=%d -> effective baudrate %d",
    491                           io->cardmhz, io->mhz, custom_baud, nuts.baud_base, nuts.custom_divisor, nuts.baud_base/nuts.custom_divisor);
     486                          reader[ridx].cardmhz, reader[ridx].mhz, custom_baud, nuts.baud_base, nuts.custom_divisor, nuts.baud_base/nuts.custom_divisor);
    492487    nuts.flags &= ~ASYNC_SPD_MASK;
    493488    nuts.flags |= ASYNC_SPD_CUST;
    494     ioctl(io->fd, TIOCSSERIAL, &nuts);
     489    ioctl(reader[ridx].handle, TIOCSSERIAL, &nuts);
    495490    cfsetospeed(&newtio, IO_Serial_Bitrate(38400));
    496491    cfsetispeed(&newtio, IO_Serial_Bitrate(38400));
     
    561556    newtio.c_cc[VTIME] = 0;
    562557
    563 //  tcdrain(io->fd);
    564     if (tcsetattr (io->fd, TCSANOW, &newtio) < 0)
     558//  tcdrain(reader[ridx].handle);
     559    if (tcsetattr (reader[ridx].handle, TCSANOW, &newtio) < 0)
    565560        return FALSE;
    566 //  tcflush(io->fd, TCIOFLUSH);
    567 //  if (tcsetattr (io->fd, TCSAFLUSH, &newtio) < 0)
     561//  tcflush(reader[ridx].handle, TCIOFLUSH);
     562//  if (tcsetattr (reader[ridx].handle, TCSAFLUSH, &newtio) < 0)
    568563//      return FALSE;
    569564
    570565    IO_Serial_Ioctl_Lock(1);
    571     IO_Serial_DTR_RTS(io, 0, io->rts == IO_SERIAL_HIGH);
    572     IO_Serial_DTR_RTS(io, 1, io->dtr == IO_SERIAL_HIGH);
     566    IO_Serial_DTR_RTS(0, io->rts == IO_SERIAL_HIGH);
     567    IO_Serial_DTR_RTS(1, io->dtr == IO_SERIAL_HIGH);
    573568    IO_Serial_Ioctl_Lock(0);
    574569   
    575570#ifdef DEBUG_IO
    576     printf("IO: Setting properties: reader_type%d, %ld bps; %d bits/byte; %s parity; %d stopbits; dtr=%d; rts=%d\n", io->reader_type, io->input_bitrate, io->bits, io->parity == IO_SERIAL_PARITY_EVEN ? "Even" : io->parity == IO_SERIAL_PARITY_ODD ? "Odd" : "None", io->stopbits, io->dtr, io->rts);
     571    printf("IO: Setting properties: reader_type%d, %ld bps; %d bits/byte; %s parity; %d stopbits; dtr=%d; rts=%d\n", reader[ridx].typ, io->input_bitrate, io->bits, io->parity == IO_SERIAL_PARITY_EVEN ? "Even" : io->parity == IO_SERIAL_PARITY_ODD ? "Odd" : "None", io->stopbits, io->dtr, io->rts);
    577572#endif
    578573    return TRUE;
     
    591586    memcpy (pnp_id, io->PnP_id, io->PnP_id_size);
    592587}
    593 
    594 unsigned IO_Serial_GetCom (IO_Serial * io)
    595 {
    596     return io->reader_type;
    597 }
    598 
    599588
    600589bool IO_Serial_Read (unsigned timeout, unsigned size, BYTE * data)
     
    699688#endif
    700689    /* Discard input data from previous commands */
    701 //  tcflush (io->fd, TCIFLUSH);
     690//  tcflush (reader[ridx].handle, TCIFLUSH);
    702691   
    703692    for (count = 0; count < size; count += to_send)
    704693    {
    705 //      if(io->reader_type==R_INTERNAL)
     694//      if(reader[ridx].typ == R_INTERNAL)
    706695//          to_send = 1;
    707696//      else
     
    744733            fflush (stdout);
    745734#endif
    746 //          tcflush (io->fd, TCIFLUSH);
     735//          tcflush (reader[ridx].handle, TCIFLUSH);
    747736            return FALSE;
    748737        }
     
    759748bool IO_Serial_Close (IO_Serial * io)
    760749{
    761     char filename[IO_SERIAL_FILENAME_LENGTH];
    762    
    763     IO_Serial_DeviceName (filename, IO_SERIAL_FILENAME_LENGTH);
    764    
    765 #ifdef DEBUG_IO
    766     printf ("IO: Clossing serial port %s\n", filename);
     750   
     751#ifdef DEBUG_IO
     752    printf ("IO: Clossing serial port %s\n", reader[ridx].device);
    767753#endif
    768754   
     
    770756    close(fdmc);
    771757#endif
    772     if (close (io->fd) != 0)
     758    if (close (reader[ridx].handle) != 0)
    773759        return FALSE;
    774760   
     
    956942static void IO_Serial_Clear (IO_Serial * io)
    957943{
    958     io->fd = -1;
    959     io->reader_type = 0;
     944    reader[ridx].handle = -1;
     945    reader[ridx].typ = 0;
    960946    memset (io->PnP_id, 0, IO_SERIAL_PNPID_SIZE);
    961947    io->PnP_id_size = 0;
     
    971957}
    972958
    973 static void IO_Serial_DeviceName (char * filename, unsigned length)
    974 {
    975     extern char oscam_device[];
    976    snprintf (filename, length, "%s", oscam_device);
    977 }
    978 
    979959static bool IO_Serial_InitPnP (IO_Serial * io)
    980960{
  • trunk/csctapi/io_serial.h

    r1224 r1234  
    2828#include "defines.h"
    2929
    30 #define IO_Serial_DTR_Set(io) IO_Serial_DTR_RTS(io, 1, 1)
    31 #define IO_Serial_DTR_Clr(io) IO_Serial_DTR_RTS(io, 1, 0)
    32 #define IO_Serial_RTS_Set(io) IO_Serial_DTR_RTS(io, 0, 1)
    33 #define IO_Serial_RTS_Clr(io) IO_Serial_DTR_RTS(io, 0, 0)
     30//#define IO_Serial_DTR_Set() IO_Serial_DTR_RTS(1, 1)
     31//#define IO_Serial_DTR_Clr() IO_Serial_DTR_RTS(1, 0)
     32#define IO_Serial_RTS_Set() IO_Serial_DTR_RTS(0, 1)
     33#define IO_Serial_RTS_Clr() IO_Serial_DTR_RTS(0, 0)
    3434/*
    3535 * Exported constants definition
     
    5555typedef struct
    5656{
    57     int fd;             /* Handle of the serial device */
    5857    /* Settings that can be modified */
    5958    unsigned long input_bitrate;
     
    6867    BYTE PnP_id[IO_SERIAL_PNPID_SIZE];  /* PnP Id of the serial device */
    6968    unsigned PnP_id_size;           /* Length of PnP Id */
    70     int mhz;            /* mhz specified in config = actual reader clock speed */
    71     int cardmhz;            /* mhz specified in config = standard (non overclocked) clock speed of card*/
    7269}
    7370IO_Serial;
     
    9289extern bool IO_Serial_SetProperties (IO_Serial * io);
    9390extern bool IO_Serial_GetProperties (IO_Serial * io);
    94 extern bool IO_Serial_DTR_RTS(IO_Serial * io, int, int);
     91extern bool IO_Serial_DTR_RTS(int, int);
    9592#if defined(TUXBOX) && defined(PPC)
    9693extern void IO_Serial_Ioctl_Lock(int);
     
    104101
    105102/* Serial port atributes */
    106 extern unsigned IO_Serial_GetCom (IO_Serial * io);
    107103extern void IO_Serial_GetPnPId (IO_Serial * io, BYTE * pnp_id, unsigned *length);
    108104
  • trunk/csctapi/pps.c

    r1224 r1234  
    437437        SCI_PARAMETERS params;
    438438        //memset(&params,0,sizeof(SCI_PARAMETERS));
    439         if (ioctl(pps->icc->ifd->io->fd, IOCTL_GET_PARAMETERS, &params) < 0 )
     439        if (ioctl(reader[ridx].handle, IOCTL_GET_PARAMETERS, &params) < 0 )
    440440            return PPS_ICC_ERROR;
    441441
     
    461461        cs_debug("Setting T=%d fs=%lu mhz ETU=%d WWT=%d CWT=%d BWT=%d EGT=%d clock=%d check=%d P=%d I=%d U=%d", (int)params.T, params.fs, (int)params.ETU, (int)params.WWT, (int)params.CWT, (int)params.BWT, (int)params.EGT, (int)params.clock_stop_polarity, (int)params.check, (int)params.P, (int)params.I, (int)params.U);
    462462
    463         if (ioctl(pps->icc->ifd->io->fd, IOCTL_SET_PARAMETERS, &params)!=0)
     463        if (ioctl(reader[ridx].handle, IOCTL_SET_PARAMETERS, &params)!=0)
    464464            return PPS_ICC_ERROR;
    465465       
  • trunk/reader-common.c

    r1221 r1234  
    22#include "reader-common.h"
    33
    4 char oscam_device[128];
    54int  oscam_card_detect;
    65
     
    309308  cs_ptyp_orig=cs_ptyp;
    310309  cs_ptyp=D_DEVICE;
    311   snprintf(oscam_device, sizeof(oscam_device), "%s", device);
    312310#ifdef TUXBOX
    313311  if ((rc=CT_init(1, reader_device_type(device),reader[ridx].mhz,reader[ridx].cardmhz))!=OK)
Note: See TracChangeset for help on using the changeset viewer.