Changeset 1654


Ignore:
Timestamp:
02/22/10 15:31:34 (11 years ago)
Author:
merek
Message:

Merge from Trunk (r1650-r1653) - Thanks to Dingo, roro, and me :P

Location:
branches/monitor-improvement/csctapi
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/monitor-improvement/csctapi/icc_async.c

    r1606 r1654  
    7575
    7676    wr = 0;
    77     if (reader[ridx].typ <= R_MOUSE)   
    78         reader[ridx].handle = open (reader[ridx].device,  O_RDWR | O_NOCTTY| O_NONBLOCK);
    79         if (reader[ridx].handle < 0) {
    80             cs_log("ERROR opening device %s",reader[ridx].device);
    81             return ERROR;
    82         }
    8377
    8478    switch(reader[ridx].typ) {
    8579        case R_MOUSE:
     80            reader[ridx].handle = open (reader[ridx].device,  O_RDWR | O_NOCTTY| O_NONBLOCK);
     81            if (reader[ridx].handle < 0) {
     82                cs_log("ERROR opening device %s",reader[ridx].device);
     83                return ERROR;
     84            }
    8685            break;
    8786#if defined(TUXBOX) && defined(PPC)
    8887        case R_DB2COM1:
    8988        case R_DB2COM2:
     89            reader[ridx].handle = open (reader[ridx].device,  O_RDWR | O_NOCTTY| O_SYNC);
     90            if (reader[ridx].handle < 0) {
     91                cs_log("ERROR opening device %s",reader[ridx].device);
     92                return ERROR;
     93            }
    9094            if ((fdmc = open(DEV_MULTICAM, O_RDWR)) < 0) {
    9195                close(reader[ridx].handle);
     
    292296            break;
    293297        case ATR_PROTOCOL_TYPE_T1:
    294             call (Protocol_T1_Command (command, command_len, rsp));
    295             break;
     298         {
     299            int try = 1;
     300            do {
     301                if (Protocol_T1_Command (command, command_len, rsp) == OK)
     302                    break;
     303                try++;
     304                //try to resync
     305                APDU_Rsp ** rsp;
     306                unsigned char resync[] = { 0x21, 0xC0, 0x00, 0xE1 };
     307                Protocol_T1_Command (resync, sizeof(resync), rsp);
     308                ifsc = DEFAULT_IFSC;
     309            } while (try <= 3);
     310            break;
     311         }
    296312        case ATR_PROTOCOL_TYPE_T14:
    297313            call (Protocol_T14_ExchangeTPDU (command, command_len, rsp));
     
    761777           
    762778                // Towitoko does not allow IFSC > 251 //FIXME not sure whether this limitation still exists
    763                 //ifsc = MIN (ifsc, MAX_IFSC);
    764 
    765                 //FIXME workaround for Smargo until native mode works
    766                 if(reader[ridx].smargopatch == 1)
    767                     ifsc = MIN (ifsc, 28);
    768                 else
    769                     ifsc = MIN (ifsc, MAX_IFSC);
     779                ifsc = MIN (ifsc, MAX_IFSC);
    770780           
    771781            #ifndef PROTOCOL_T1_USE_DEFAULT_TIMINGS
  • branches/monitor-improvement/csctapi/ifd_phoenix.c

    r1624 r1654  
    111111        int i;
    112112        int parity[3] = {PARITY_EVEN, PARITY_ODD, PARITY_NONE};
    113     call (Phoenix_SetBaudrate (DEFAULT_BAUDRATE));
     113        call (Phoenix_SetBaudrate (DEFAULT_BAUDRATE));
    114114        for(i=0; i<3; i++) {
    115             cs_sleepms(200); // pause for 200ms as this might help with the PL2303
     115#ifndef OS_CYGWIN32
     116            /*
     117            * Pause for 200ms as this might help with the PL2303.
     118            * Some users reporting that this breaks cygwin, so we exclude this.
     119            */
     120            cs_sleepms(200);
     121#endif
    116122            IO_Serial_Flush();
    117123            call (IO_Serial_SetParity (parity[i]));
     
    126132#endif
    127133                IO_Serial_RTS_Set();
    128             cs_sleepms(200); // we went form 50 to 200 as this might help with the PL2303
     134#ifdef OS_CYGWIN32
     135            /*
     136            * Pause for 200ms as this might help with the PL2303.
     137            * Some users reporting that this breaks cygwin, so we went back to 50ms.
     138            */
     139            cs_sleepms(50);
     140#else
     141            cs_sleepms(200);
     142#endif
     143
    129144#ifdef USE_GPIO  //felix: set card reset hi (inactive)
    130145            if (gpio_detect) {
     
    134149#endif
    135150                IO_Serial_RTS_Clr();
    136             cs_sleepms(200); // pause for 200ms as this might help with the PL2303
     151#ifndef OS_CYGWIN32
     152            /*
     153            * Pause for 200ms as this might help with the PL2303.
     154            * Some users reporting that this breaks cygwin, so we exclude this.
     155            */
     156            cs_sleepms(200);
     157#endif
    137158            IO_Serial_Ioctl_Lock(0);
    138159            if(ATR_InitFromStream (atr, ATR_TIMEOUT) == ATR_OK)
     
    198219        call (tcgetattr (reader[ridx].handle, &tio) != 0);
    199220        call (IO_Serial_SetBitrate (baudrate, &tio));
    200         cs_sleepms(200); // pause for 200ms as this might help with the PL2303
     221#ifndef OS_CYGWIN32
     222        /*
     223        * Pause for 200ms as this might help with the PL2303.
     224        * Some users reporting that this breaks cygwin, so we exclude this.
     225        */
     226            cs_sleepms(200);
     227#endif
    201228        call (IO_Serial_SetProperties(tio));
    202         cs_sleepms(200); // pause for 200ms as this might help with the PL2303
     229#ifndef OS_CYGWIN32
     230        /*
     231        * Pause for 200ms as this might help with the PL2303.
     232        * Some users reporting that this breaks cygwin, so we exclude this.
     233        */
     234            cs_sleepms(200);
     235#endif
    203236    }
    204237    current_baudrate = baudrate; //so if update fails, current_baudrate is not changed either
  • branches/monitor-improvement/csctapi/ifd_smartreader.c

    r1649 r1654  
    177177            reader->sr_config.F=618; /// magic smartreader value
    178178            reader->sr_config.D=1;
    179             // reader->sr_config.T=2; // will be set to T=1 in EnableSmartReader
    180             reader->sr_config.T=1;
     179            reader->sr_config.T=2; // will be set to T=1 in EnableSmartReader
    181180            reader->sr_config.irdeto=TRUE;
    182181        }
     
    209208            cs_ddump(data,ATR_MAX_SIZE*2,"IO:SR: ");
    210209
    211         if(data[0]!=0x3B && data[0]!=0x03 && data[0]!=0x3F)
     210        if(data[0]!=0x3B && data[0]!=0x03 && data[0]!=0x3F) {
     211            reader->sr_config.irdeto=FALSE;
    212212            continue; // this is not a valid ATR.
     213        }
    213214           
    214215        if(data[0]==0x03) {
     
    365366
    366367    // command 4 , set parameter T
    367     if(reader->sr_config.irdeto) // special trick to get ATR for Irdeto card, we need T=1 at reset, after that oscam takes care of T1 protocol, so we need T=0
     368    if(reader->sr_config.irdeto && T==2) // special trick to get ATR for Irdeto card, we need T=1 at reset, after that oscam takes care of T1 protocol, so we need T=0
    368369        {
    369370        T=1;
Note: See TracChangeset for help on using the changeset viewer.