Changeset 6098


Ignore:
Timestamp:
12/20/11 16:18:10 (10 years ago)
Author:
corsair
Message:

applied oopepe's ins7e11_restart_patch.patch.txt. Thx!

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/csctapi/icc_async.c

    r5928 r6098  
    336336#if defined(LIBUSB)
    337337            case R_SMART:
    338                 call (SR_Reset(reader, atr));
     338                if ( ! reader->ins7e11_fast_reset) {
     339                    call (SR_Reset(reader, atr));
     340                }
     341                else {
     342                    cs_log("Doing fast reset");
     343                    call (SR_FastReset_With_ATR(reader, atr));
     344                }
    339345                break;
    340346#endif
  • trunk/csctapi/ifd_pcsc.c

    r5907 r6098  
    247247{
    248248    cs_debug_mask (D_IFD, "PCSC : Closing device %s", pcsc_reader->device);
    249     SCardDisconnect((SCARDHANDLE)(pcsc_reader->hCard),SCARD_RESET_CARD);
     249    SCardDisconnect((SCARDHANDLE)(pcsc_reader->hCard),SCARD_LEAVE_CARD);
    250250    SCardReleaseContext(pcsc_reader->hContext);
    251251    pcsc_reader->hCard=0;
  • trunk/csctapi/ifd_phoenix.c

    r5905 r6098  
    110110        int32_t parity[3] = {PARITY_EVEN, PARITY_ODD, PARITY_NONE};
    111111
    112         call (Phoenix_SetBaudrate (reader, DEFAULT_BAUDRATE));
     112        if ( ! reader->ins7e11_fast_reset ) {
     113            call (Phoenix_SetBaudrate (reader, DEFAULT_BAUDRATE));
     114        }
     115        else {
     116            cs_log("Doing fast reset");
     117        }
    113118
    114119        for(i=0; i<3; i++) {
  • trunk/csctapi/ifd_smartreader.c

    r6047 r6098  
    500500}
    501501
     502int32_t SR_FastReset_With_ATR(struct s_reader *reader, ATR *atr)
     503{
     504    unsigned char data[ATR_MAX_SIZE];
     505    int32_t ret;
     506    int32_t atr_ok=ERROR;
     507
     508    smart_fastpoll(reader, TRUE);
     509    //Set the DTR HIGH and RTS HIGH
     510    smartreader_setdtr_rts(reader, 1, 1);
     511    // A card with an active low reset is reset by maintaining RST in state L for at least 40 000 clock cycles
     512    // so if we have a base freq of 3.5712MHz : 40000/3690000 = .0112007168458781 seconds, aka 11ms
     513    // so if we have a base freq of 6.00MHz : 40000/6000000 = .0066666666666666 seconds, aka 6ms
     514    cs_sleepms(20);
     515
     516    //Set the DTR HIGH and RTS LOW
     517    smartreader_setdtr_rts(reader, 1, 0);
     518
     519    //Read the ATR
     520    ret = smart_read(reader,data, ATR_MAX_SIZE,1);
     521
     522    // parse atr
     523    if(ATR_InitFromArray (atr, data, ret) == ATR_OK) {
     524        cs_debug_mask (D_DEVICE, "IO:SR: ATR parsing OK");
     525        atr_ok=OK;
     526    }
     527
     528    smart_fastpoll(reader, FALSE);
     529    return atr_ok;
     530}
     531
    502532static void EnableSmartReader(S_READER *reader, int32_t clock, uint16_t  Fi, unsigned char Di, unsigned char Ni, unsigned char T, unsigned char inv,int32_t parity) {
    503533
  • trunk/csctapi/ifd_smartreader.h

    r5784 r6098  
    2727int32_t SR_Close (struct s_reader *reader);
    2828int32_t SR_FastReset(struct s_reader *reader, int32_t delay);
     29int32_t SR_FastReset_With_ATR(struct s_reader *reader, ATR *atr);
    2930
    3031#endif // __SMARTREADER__
  • trunk/globals.h

    r6092 r6098  
    421421#define ACTION_READER_INIT      8
    422422#define ACTION_READER_RESTART   9
     423#define ACTION_READER_RESET_FAST    10
    423424
    424425#define ACTION_CLIENT_TCP_CONNECT   21
     
    11851186    uint8_t         ins7E[0x1A+1];
    11861187    uint8_t         ins7E11[0x01+1];
     1188    int8_t          ins7e11_fast_reset;
    11871189
    11881190#ifdef MODULE_PANDORA
  • trunk/oscam.c

    r6093 r6098  
    32013201                return NULL;
    32023202                break;
     3203            case ACTION_READER_RESET_FAST:
     3204                reader->ins7e11_fast_reset = 1;
     3205                reader->card_status = CARD_NEED_INIT;
     3206                reader_reset(reader);
     3207                reader->ins7e11_fast_reset = 0;
     3208                break;
    32033209
    32043210            case ACTION_CLIENT_UDP:
  • trunk/reader-videoguard-common.c

    r6064 r6098  
    105105       0x00, 0x50, 0x31, 0x01, 0x00, 0x11 },
    106106       22, 2004, 0, NDS2, "VideoGuard Sky Germany"},
     107    {{ 0x3F, 0xFF, 0x15, 0x25, 0x03, 0x10, 0x80, 0x41, 0xB0, 0x07, 0x69, 0xFF, 0x4A, 0x50, 0x70, 0x00,
     108       0x00, 0x50, 0x31, 0x01, 0x00, 0x15 },
     109       22, 2004, 0, NDS2, "VideoGuard Sky Germany"},
    107110    {{ 0x3F, 0xFF, 0x14, 0x25, 0x03, 0x10, 0x80, 0x41, 0xB0, 0x01, 0x69, 0xFF, 0x4A, 0x50, 0x70, 0x00,
    108111       0x00, 0x5A, 0x48, 0x01, 0x00, 0x00 },
  • trunk/reader-videoguard2.c

    r6064 r6098  
    541541          if (TA1 != reader->ins7E11[0x00]) {
    542542            cs_log("classD0 ins7E11: Scheduling card reset for TA1 change from %02X to %02X", TA1, reader->ins7E11[0x00]);
    543             add_job(reader->client, ACTION_READER_RESTART, NULL, 0);
     543            if (reader->typ == R_MOUSE || reader->typ == R_SC8in1 || reader->typ == R_SMART ) {
     544                add_job(reader->client, ACTION_READER_RESET_FAST, NULL, 0);
     545            }
     546            else {
     547                add_job(reader->client, ACTION_READER_RESTART, NULL, 0);
     548            }
    544549          }
    545550        }
Note: See TracChangeset for help on using the changeset viewer.