Changeset 1061


Ignore:
Timestamp:
01/04/10 15:49:11 (12 years ago)
Author:
dingo35
Message:

Added algorythm to pps.c to obey/reject TA1 byte

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/csctapi/pps.c

    r1059 r1061  
    232232
    233233            if (NeedsPTS) { //FIXME we MUST discover PTS routine for Dreambox reader, now all cards in DBreaders which need PTS come here!!!
    234                 if (OffersT[0]) {
    235     //If the card is able to process more than one protocol type and if one of those protocol types is indicated as T=0, then the protocol type T=0 shall indicated in TD1 as the first offered protocol, and is assumed if no PTS is performed.
    236                     pps->parameters.t =  ATR_PROTOCOL_TYPE_T0;
    237                     pps->parameters.FI = ATR_DEFAULT_FI; //ignoring TA1 is necessary at least for all viaccess cards on dreambox readers
    238                     pps->parameters.d = ATR_DEFAULT_D;   //but perhaps it is the general thing to do...
    239                 }
     234                if ((pps->parameters.d == 32) || (pps->parameters.d == 12) || (pps->parameters.d == 20))
     235                    pps->parameters.d = 0; //behave conform "old" atr_d_table; viaccess cards that fail PTS need this
    240236            }
    241237            /////Here all non-ISO behaviour
    242             // Nagra HD+
    243             // ATR: 3F FF 95 00 FF 91 81 71 FE 47 00 44 4E 41 53 50 31 34 32 20 52 65 76 47 43 34 63
    244             // Protocol 1: TA1=95 TB1=00 TC1=FF TD1=91 (T1)
    245             // Protocol 2: TA2=81 TD2=71 (T1)
    246             // Protocol 3: TA3=FE TB3=47 TC3=00 no TD3 means T0
    247             //
    248             // Problem1: card somehow fails all PTS attempts; perhaps because N=255 and we try PTS without it?
    249             // Problem2: card reports to support T0 but TA1=FE , which values are (still) undefined . On failure of PTS card reverts to TA=11 which
    250             // makes the card fail
    251             // We know the card needs 115200 (with cardmhz = 368) after ATR
    252             // Solution: longterm: implement PTS2
    253             // Solution: shorterm: this hardcoding
    254             //
    255             unsigned char nagra_hdplus[] = {0x44, 0x4E, 0x41, 0x53, 0x50}; //DNASP, not sure about timings of TIGER & others
    256             if (atr->hbn >= sizeof(nagra_hdplus))
    257                 if (!memcmp(atr->hb, nagra_hdplus, sizeof(nagra_hdplus))) {
    258                     ATR_GetProtocolType (atr, 1, &(pps->parameters.t));
    259                     protocol_selected = 1;
    260                     if (ATR_GetInterfaceByte (atr, 1 , ATR_INTERFACE_BYTE_TA, &TA1) == ATR_OK) {
    261                         pps->parameters.FI = TA1 >> 4;
    262                         ATR_GetParameter (atr, ATR_PARAMETER_D, &(pps->parameters.d));
    263                     }
    264                 }
    265             //
    266             //
    267238            /////End  all non-ISO behaviour
    268239          if (pps->icc->ifd->io->com == RTYP_SCI) {
    269240          //// Here all fixes that are needed until PTS routine for Dreambox is found
    270241            //// End  all fixes that are needed until PTS routine for Dreambox is found
    271                 if (atr->hbn >=6)
    272                     if (!memcmp( atr->hb, "IRDETO", 6 )) { //IRDETO needs TA1 behaviour on /dev/sci  ; which other cards need ignore TA1 on T14?
    273                         pps->parameters.FI = TA1 >> 4;
    274                         ATR_GetParameter (atr, ATR_PARAMETER_D, &(pps->parameters.d));
    275                     }
    276242            }
    277243
     
    454420        double F =  (double) atr_f_table[pps->parameters.FI];
    455421        params.ETU = F / pps->parameters.d;
    456         if (pps->parameters.n == 255)
     422        if (pps->parameters.n == 255) //only for T0 or also for T1?
    457423            params.EGT = 0;
    458424        else
Note: See TracChangeset for help on using the changeset viewer.