Changeset 844
- Timestamp:
- 12/15/09 22:07:24 (14 years ago)
- Location:
- branches/monitor-improvement
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/Distribution/doc/man/oscam.1
r667 r844 85 85 \fBSIGHUP\fP 86 86 .RS 3n 87 reinit user db, clients and anti-cascading 87 reinit user db, clients and anti-cascading, for newcamd connections: after reloading the ident, please restart newcamd client 88 88 .RE 89 89 .PP -
branches/monitor-improvement/Distribution/doc/man/oscam.conf.5
r822 r844 386 386 status = list of current processes and clients 387 387 shutdown = showdown OSCam 388 reload = reinit user db, clients and anti-cascading 388 reload = reinit user db, clients and anti-cascading, 389 for newcamd connections: after reloading 390 the ident, please restart newcamd client 389 391 details <PID> = details about selected PID 390 392 debug <level> = set debug level (\fBmonlevel\fP > 3 required) -
branches/monitor-improvement/Distribution/doc/txt/oscam.conf.txt
r822 r844 279 279 status = list of current processes and clients 280 280 shutdown = showdown OSCam 281 reload = reinit user db, clients and anti-cascading 281 reload = reinit user db, clients and anti-cascading, 282 for newcamd connections: after reloading 283 the ident, please restart newcamd client 282 284 details <PID> = details about selected PID 283 285 debug <level> = set debug level (monlevel > 3 required) -
branches/monitor-improvement/Distribution/doc/txt/oscam.txt
r667 r844 71 71 SIGNALS 72 72 SIGHUP 73 reinit user db, clients and anti-cascading 73 reinit user db, clients and anti-cascading, for newcamd connections: 74 after reloading the ident, please restart newcamd client 74 75 75 76 SIGUSR1 76 switch debug level to 63 (debug all)/switch debug level to 0(no77 switch debug level to 63 (debug all)/switch debug level to 0 (no 77 78 debugging) 78 79 -
branches/monitor-improvement/csctapi/atr.c
r746 r844 168 168 169 169 /* Store historical bytes */ 170 if (pointer + atr->hbn >= length) 171 return (ATR_MALFORMED); 170 if (pointer + atr->hbn >= length) { 171 cs_log("ATR is malformed, it reports %i historical bytes but there are only %i",atr->hbn, length-pointer-2); 172 if (length-pointer-2 >=0) 173 atr->hbn = length-pointer-2; 174 else { 175 atr->hbn = 0; 176 atr->length = pointer + 1; 177 return (ATR_MALFORMED); 178 } 179 180 } 172 181 173 182 memcpy (atr->hb, buffer + pointer + 1, atr->hbn); … … 455 464 if (name == ATR_PARAMETER_F) 456 465 { 457 if (ATR_GetIntegerValue (atr, ATR_INTEGER_VALUE_FI, &FI) == ATR_OK) 458 (*parameter) = (double) (atr_f_table[FI]); 459 else 460 (*parameter) = (double) ATR_DEFAULT_F; 466 if (ATR_GetIntegerValue (atr, ATR_INTEGER_VALUE_FI, &FI) != ATR_OK) 467 FI = ATR_DEFAULT_FI; 468 (*parameter) = (double) (atr_f_table[FI]); 461 469 return (ATR_OK); 462 470 } -
branches/monitor-improvement/csctapi/atr.h
r8 r844 68 68 69 69 /* Default values for paramenters */ 70 #define ATR_DEFAULT_F 37270 #define ATR_DEFAULT_FI 1 71 71 #define ATR_DEFAULT_D 1 72 72 #define ATR_DEFAULT_I 50 -
branches/monitor-improvement/csctapi/icc_async.c
r746 r844 151 151 icc->timings.block_timeout = timings->block_timeout; 152 152 icc->timings.char_timeout = timings->char_timeout; 153 153 /* if (icc->protocol_type == ATR_PROTOCOL_TYPE_T1) 154 cs_debug("SetTimings: T1: chardelay %d, chartimeout CWT %d, blockdelay BGT??? %d, blocktimeout BWT %d",timings->char_delay,timings->char_timeout, timings->block_delay, timings->block_timeout); 155 else 156 cs_debug("SetTimings: T0/T14: chardelay %d, chartimeout WWT %d, blockdelay %d, blocktimeout %d",timings->char_delay,timings->char_timeout, timings->block_delay, timings->block_timeout);*/ 157 158 #ifdef SCI_DEV 159 #include <sys/ioctl.h> 160 #include "sci_global.h" 161 #include "sci_ioctl.h" 162 if (icc->ifd->io->com == RTYP_SCI) { 163 SCI_PARAMETERS params; 164 if (ioctl(icc->ifd->io->fd, IOCTL_GET_PARAMETERS, ¶ms) < 0 ) 165 return ICC_ASYNC_IFD_ERROR; 166 switch (icc->protocol_type) { 167 case ATR_PROTOCOL_TYPE_T1: 168 params.BWT = icc->timings.block_timeout; 169 params.CWT = icc->timings.char_timeout; 170 //params.BGT = icc->timings.block_delay; load into params.EGT?? 171 break; 172 case ATR_PROTOCOL_TYPE_T0: 173 case ATR_PROTOCOL_TYPE_T14: 174 default: 175 params.WWT = icc->timings.char_timeout; 176 break; 177 } 178 if (ioctl(icc->ifd->io->fd, IOCTL_SET_PARAMETERS, ¶ms)!=0) 179 return ICC_ASYNC_IFD_ERROR; 180 181 cs_debug("Set Timings: T=%d FI=%d ETU=%d WWT=%d CWT=%d BWT=%d EGT=%d clock=%d check=%d P=%d I=%d U=%d", (int)params.T,(int)params.FI, (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); 182 } 183 #endif 154 184 return ICC_ASYNC_OK; 155 185 } -
branches/monitor-improvement/csctapi/ifd_towitoko.c
r746 r844 551 551 params.ETU = 372; 552 552 params.EGT = 3; 553 params. f= 9;553 params.FI = 9; 554 554 params.T = 0; 555 555 … … 616 616 return IFD_TOWITOKO_IO_ERROR; 617 617 618 if(ioctl(ifd->io->fd, IOCTL_GET_PARAMETERS, ¶ms)<0)619 return IFD_TOWITOKO_IO_ERROR;620 621 // cs_dump(buf, n, "BUF:");622 if(n>9 && !memcmp(buf+4, irdeto, 6))623 {624 params.T = 14;625 params.WWT = 1500;626 params.EGT = 5;627 params.f = 5;628 buf[0]=0x3B;629 }630 /*631 if(params.ETU>600 && (buf[0]!=0x3B || buf[0]!=0x3F))632 {633 params.T = 14;634 params.WWT = 1500;635 params.EGT = 5;636 buf[0]=0x3B;637 }638 */639 618 (*atr) = ATR_New (); 640 619 if(ATR_InitFromArray ((*atr), buf, n) == ATR_OK) 641 620 { 642 621 struct timespec req_ts; 643 double a;644 645 double atrparam_d = 0;646 647 ATR_GetParameter(*atr,ATR_PARAMETER_D,&atrparam_d);648 params.ETU = (unsigned char)atrparam_d;649 650 // printf("atr D=%f\n", a);651 ATR_GetParameter(*atr, ATR_PARAMETER_N, &a);652 params.EGT = (unsigned char)a;653 if (params.EGT==255) params.EGT=0;654 ATR_GetParameter(*atr, ATR_PARAMETER_P, &a);655 // printf("atr P=%f\n", a);656 params.P = (unsigned char)a;657 ATR_GetParameter(*atr, ATR_PARAMETER_I, &a);658 // printf("atr I=%f\n", a);659 params.I = (unsigned char)a;660 661 double atrparam_f = 0;662 663 if (ATR_GetParameter(*atr,ATR_PARAMETER_F,&atrparam_f)!=ATR_OK)664 {665 cs_log ("Error getting ATR parameter (F)");666 ATR_Delete (*atr);667 (*atr) = NULL;668 return IFD_TOWITOKO_IO_ERROR;669 }670 if (ATR_GetParameter(*atr,ATR_PARAMETER_D,&atrparam_d)!=ATR_OK)671 {672 cs_log ("Error getting ATR parameter (D)");673 ATR_Delete (*atr);674 (*atr) = NULL;675 return IFD_TOWITOKO_IO_ERROR;676 }677 678 if (params.ETU != 0)679 params.ETU=atrparam_f/atrparam_d;680 else681 params.ETU=372;682 683 if (ifd->io->mhz == 600) { //overclock works on Sky It 919684 params.f = 5;685 cs_log("Forcing params.f to 5");686 }687 688 if(ioctl(ifd->io->fd, IOCTL_SET_PARAMETERS, ¶ms)!=0)689 {690 ATR_Delete (*atr);691 (*atr) = NULL;692 return IFD_TOWITOKO_IO_ERROR;693 }694 695 ioctl(ifd->io->fd, IOCTL_GET_PARAMETERS, ¶ms);696 697 cs_debug("T=%d f=%d ETU=%d WWT=%d CWT=%d BWT=%d EGT=%d clock=%d check=%d P=%d I=%d U=%d", (int)params.T, (int)params.f, (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);698 699 622 req_ts.tv_sec = 0; 700 623 req_ts.tv_nsec = 50000000; … … 794 717 // S02 = irdeto unsigned char atr_test[] = { 0x3B, 0x9F, 0x21, 0x0E, 0x49, 0x52, 0x44, 0x45, 0x54, 0x4F, 0x20, 0x41, 0x43, 0x53, 0x03}; 795 718 //cryptoworks unsigned char atr_test[] = { 0x3B, 0x78, 0x12, 0x00, 0x00, 0x65, 0xC4, 0x05, 0xFF, 0x8F, 0xF1, 0x90, 0x00 }; 796 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 };797 719 ATR_Delete(*atr); //throw away actual ATR 798 720 (*atr) = ATR_New (); -
branches/monitor-improvement/csctapi/pps.c
r755 r844 55 55 static unsigned PPS_GetLength (BYTE * block); 56 56 57 static int PPS_InitICC (PPS * pps );58 59 static int PPS_InitProtocol (PPS * pps );57 static int PPS_InitICC (PPS * pps, int protocol_selected); 58 59 static int PPS_InitProtocol (PPS * pps, int protocol_selected); 60 60 61 61 //static void PPS_SelectFirstProtocol (PPS * pps); … … 78 78 pps->protocol = NULL; 79 79 pps->parameters.t = PPS_DEFAULT_PROTOCOL; 80 pps->parameters. f = ATR_DEFAULT_F;80 pps->parameters.FI = ATR_DEFAULT_FI; 81 81 pps->parameters.d = ATR_DEFAULT_D; 82 82 pps->parameters.n = ATR_DEFAULT_N; … … 93 93 //If necessary perform PPS session 94 94 // 95 //Output is pps->params. f,n,d,t set with correct values95 //Output is pps->params.FI,n,d,t set with correct values 96 96 //and switched SC-device conform these values to correct baudrate 97 // 98 //We need to store FI instread of F, because SCI_DEV works with FI 99 //and it is easier to overclock then 100 //also from FI -> F is easy, other way around not 97 101 98 102 ATR *atr; … … 112 116 if (PPS_HAS_PPS1 (params)) 113 117 { 114 pps->parameters. f = atr_f_table[(params[2] >> 4)];118 pps->parameters.FI = (params[2] >> 4); 115 119 pps->parameters.d = atr_d_table[(params[2] & 0x0F)]; 116 120 } … … 131 135 } 132 136 PPS_success = PPS_OK; 137 int protocol_selected = 0; //stores which TAi,TBi etc. bytes must be used 0 means not set 133 138 atr = ICC_Async_GetAtr (pps->icc); 134 139 if ((*length) <= 0 || !PPS_success) // If not by command, or PPS Exchange by command failed: Try PPS Exchange by ATR or Get parameters from ATR … … 172 177 //If more than one protocol type and/or TA1 parameter values other than the default values and/or N equeal to 255 is/are indicated in the answer to reset, the card shall know unambiguously, after having sent the answer to reset, which protocol type or/and transmission parameter values (FI, D, N) will be used. Consequently a selection of the protocol type and/or the transmission parameters values shall be specified. 173 178 ATR_GetParameter (atr, ATR_PARAMETER_N, &(pps->parameters.n)); 174 #ifndef SCI_DEV175 176 179 ATR_GetProtocolType(atr,2,&(pps->parameters.t)); //get protocol from TD1 177 if ((pps-> parameters.t != 14) && (numprot > 1 || (atr->ib[0][ATR_INTERFACE_BYTE_TA].present == TRUE && atr->ib[0][ATR_INTERFACE_BYTE_TA].value != 0x11) || pps->parameters.n == 255)) {180 if ((pps->icc->ifd->io->com != RTYP_SCI) && (pps->parameters.t != 14) && (numprot > 1 || (atr->ib[0][ATR_INTERFACE_BYTE_TA].present == TRUE && atr->ib[0][ATR_INTERFACE_BYTE_TA].value != 0x11) || pps->parameters.n == 255)) { 178 181 // PTSS PTS0 PTS1 PTS2 PTS3 PCK 179 182 // PTSS PTS0 PTS1 PCK … … 195 198 ret = PPS_Exchange (pps, req, &len); 196 199 if (ret == PPS_OK) { 197 BYTEFI = req[2] >> 4;200 pps->parameters.FI = req[2] >> 4; 198 201 BYTE DI = req[2] & 0x0F; 199 pps->parameters.f = (double) (atr_f_table[FI]);200 202 pps->parameters.d = (double) (atr_d_table[DI]); 201 203 PPS_success = TRUE; 202 cs_debug("PTS Succesfull, selected protocol %i: T%i, F=%.0f, D=%.6f, N=%.0f\n", p, pps->parameters.t, pps->parameters.f, pps->parameters.d, pps->parameters.n); 204 protocol_selected = p; 205 cs_debug("PTS Succesfull, selected protocol %i: T%i, F=%.0f, D=%.6f, N=%.0f\n", protocol_selected, pps->parameters.t, (double) atr_f_table[pps->parameters.FI], pps->parameters.d, pps->parameters.n); 203 206 break; 204 207 } … … 207 210 } 208 211 } 209 #endif210 //FIXME now what to do with T14? Currently, it tries PPS and if TA1 is there, it tries to obey it. If that PPS would fail, code below makes it211 //fallback to default values.212 //Only problem would arise when a card demands succesfull PPS on T14, and sends TA1 which should not be obeyed (!!)213 212 //FIXME Currently InitICC sets baudrate to 9600 for all T14 cards, which is the old behaviour... 214 213 if (!PPS_success) {//last PPS not succesfull 215 if (atr->ib[0][ATR_INTERFACE_BYTE_TA].present == TRUE && pps->parameters.t != 14) { //do not obey TA1 if T14 and no PTS 214 BYTE TA1; 215 if (ATR_GetInterfaceByte (atr, 1 , ATR_INTERFACE_BYTE_TA, &TA1) == ATR_OK && pps->parameters.t != 14) { //do not obey TA1 if T14 and no PTS 216 pps->parameters.FI = TA1 >> 4; 216 217 ATR_GetParameter (atr, ATR_PARAMETER_D, &(pps->parameters.d)); 217 ATR_GetParameter (atr, ATR_PARAMETER_F, &(pps->parameters.f));218 218 } 219 219 else { 220 pps->parameters. f = ATR_DEFAULT_F;220 pps->parameters.FI = ATR_DEFAULT_FI; 221 221 pps->parameters.d = ATR_DEFAULT_D; 222 222 } … … 224 224 // FIXME or would it be wiser to not switch anything and stick to 9600? 225 225 ATR_GetProtocolType (atr, 2, &(pps->parameters.t)); 226 cs_debug("No PTS, selected protocol 1: T%i, F=%.0f, D=%.6f, N=%.0f\n", pps->parameters.t, pps->parameters.f, pps->parameters.d, pps->parameters.n); 226 protocol_selected = 1; 227 cs_debug("No PTS, selected protocol 1: T%i, F=%.0f, D=%.6f, N=%.0f\n", pps->parameters.t, (double) atr_f_table[pps->parameters.FI], pps->parameters.d, pps->parameters.n); 227 228 } 228 229 }//end length<0 229 230 230 231 //make sure no zero values 231 if (!pps->parameters.f) { 232 pps->parameters.f = ATR_DEFAULT_F; 233 cs_log("Warning: F=0 is invalid, forcing F=%.0f",pps->parameters.f); 232 double F = (double) atr_f_table[pps->parameters.FI]; 233 if (!F) { 234 pps->parameters.FI = ATR_DEFAULT_FI; 235 cs_log("Warning: F=0 is invalid, forcing F=%.0f",F); 234 236 } 235 237 if (!pps->parameters.d) { … … 237 239 cs_log("Warning: D=0 is invalid, forcing D=%.0f",pps->parameters.d); 238 240 } 241 242 pps->icc->protocol_type = pps->parameters.t; 239 243 240 244 #ifdef DEBUG_PROTOCOL 241 245 printf("PPS: T=%i, F=%.0f, D=%.6f, N=%.0f\n", 242 246 pps->parameters.t, 243 pps->parameters.f,247 F, 244 248 pps->parameters.d, 245 249 pps->parameters.n); 246 250 #endif 247 251 248 ret = PPS_InitICC(pps );252 ret = PPS_InitICC(pps, protocol_selected); 249 253 250 254 if (ret != PPS_OK) … … 252 256 253 257 /* Initialize selected protocol with selected parameters */ 254 //this is really administrattive shit only, remove 255 ret = PPS_InitProtocol (pps); 258 ret = PPS_InitProtocol (pps, protocol_selected); 256 259 257 260 return ret; … … 362 365 } 363 366 364 static int PPS_InitICC (PPS * pps )367 static int PPS_InitICC (PPS * pps, int selected_protocol) 365 368 { 366 369 #ifdef SCI_DEV 367 //case readertype = internal 368 //params.t = pps->parameters.t 369 //params.f = pps->parameters.f 370 //params.d = pps->parameters.d 371 //if (pps->parameters.n == 255) 372 // params.EGT = 0; 373 //else 374 // params.EGT = pps->parameters.n; 375 //params.WWT should be computed; standard WWT see protocol_T0 376 //In an answer to reset, the interface character TC2 codes the integer value WI over eight bits b8 to b1. When no TC2 appears in the answer to reset, the default value of WI is 10. 377 //if ok return PPS_OK; 378 //else return PPS_ICC_ERROR; 379 // 380 #endif 370 #include <sys/ioctl.h> 371 #include "sci_global.h" 372 #include "sci_ioctl.h" 373 if(pps->icc->ifd->io->com==RTYP_SCI) 374 { 375 int n; 376 SCI_PARAMETERS params; 377 int m; 378 //memset(¶ms,0,sizeof(SCI_PARAMETERS)); 379 if (ioctl(pps->icc->ifd->io->fd, IOCTL_GET_PARAMETERS, ¶ms) < 0 ) 380 return PPS_ICC_ERROR; 381 382 ATR *atr = ICC_Async_GetAtr (pps->icc); 383 384 params.T = pps->parameters.t; 385 386 BYTE oldFI = params.FI; 387 // params.FI = pps->parameters.FI; //somehow setting this gets "card unsupported" 388 /* if (pps->icc->ifd->io->mhz > 368) { 389 int number_of_overclock_steps = ((pps->icc->ifd->io->mhz)/200) - 2; //600 is 1 overclock, 800 2 overclocks etc. 390 do 391 { 392 if (params.FI != 1 && params.FI != 9) 393 params.FI --; 394 number_of_overclock_steps --; 395 } while (number_of_overclock_steps > 0); 396 }*/ 397 if (pps->icc->ifd->io->mhz == 600) 398 params.FI = 5; //routine above should be tested so hardcoding can get removed 399 400 if (oldFI != params.FI) 401 cs_log("Forcing params.FI from %i to %i", oldFI, params.FI); 402 403 double F = (double) atr_f_table[pps->parameters.FI]; 404 params.ETU = F / pps->parameters.d; 405 if (pps->parameters.n == 255) 406 params.EGT = 0; 407 else 408 params.EGT = pps->parameters.n; 409 410 double a; 411 ATR_GetParameter(atr, ATR_PARAMETER_P, &a); 412 params.P=(unsigned char)a; 413 ATR_GetParameter(atr, ATR_PARAMETER_I, &a); 414 params.I=(unsigned char)a; 415 416 if (ioctl(pps->icc->ifd->io->fd, IOCTL_SET_PARAMETERS, ¶ms)!=0) 417 return PPS_ICC_ERROR; 418 419 ioctl(pps->icc->ifd->io->fd, IOCTL_GET_PARAMETERS, ¶ms); 420 421 cs_debug("T=%d f=%d ETU=%d WWT=%d CWT=%d BWT=%d EGT=%d clock=%d check=%d P=%d I=%d U=%d", (int)params.T,(int)atr_f_table[pps->parameters.FI], (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); 422 } 423 #endif 424 { 381 425 unsigned long baudrate; 426 double F = (double) atr_f_table[pps->parameters.FI]; 382 427 if (pps->parameters.t == 14) 383 428 baudrate = 9600; 384 429 else 385 baudrate = pps->parameters.d * ICC_Async_GetClockRate (pps->icc) / pps->parameters.f;430 baudrate = pps->parameters.d * ICC_Async_GetClockRate (pps->icc) / F; 386 431 387 432 #ifdef DEBUG_PROTOCOL … … 390 435 391 436 392 //FIXME currently for SCI_DEV Setbaudrate is dummied393 //but it should be something like394 //case readertype = smart:395 //case readertype = mouse:396 437 if (ICC_Async_SetBaudrate (pps->icc, baudrate) != ICC_ASYNC_OK) 397 438 return PPS_ICC_ERROR; 398 439 399 440 return PPS_OK; 400 } 401 402 static int PPS_InitProtocol (PPS * pps) 441 } 442 } 443 444 static int PPS_InitProtocol (PPS * pps, int selected_protocol) 403 445 { 404 446 int ret; … … 410 452 if ((pps->protocol) != NULL) 411 453 { 412 ret = Protocol_T0_Init ((Protocol_T0 *) pps->protocol, (ICC_Async *) pps->icc, &(pps->parameters) );454 ret = Protocol_T0_Init ((Protocol_T0 *) pps->protocol, (ICC_Async *) pps->icc, &(pps->parameters), selected_protocol); 413 455 414 456 if (ret != PROTOCOL_T0_OK) … … 428 470 if (pps->protocol != NULL) 429 471 { 430 ret = Protocol_T1_Init ((Protocol_T1 *) pps->protocol, (ICC_Async *) pps->icc, &(pps->parameters) );472 ret = Protocol_T1_Init ((Protocol_T1 *) pps->protocol, (ICC_Async *) pps->icc, &(pps->parameters), selected_protocol); 431 473 432 474 if (ret != PROTOCOL_T1_OK) … … 446 488 if ((pps->protocol) != NULL) 447 489 { 448 ret = Protocol_T14_Init ((Protocol_T14 *) pps->protocol, (ICC_Async *) pps->icc, &(pps->parameters) );490 ret = Protocol_T14_Init ((Protocol_T14 *) pps->protocol, (ICC_Async *) pps->icc, &(pps->parameters), selected_protocol); 449 491 450 492 if (ret != PROTOCOL_T14_OK) -
branches/monitor-improvement/csctapi/pps.h
r8 r844 44 44 typedef struct 45 45 { 46 double f;46 BYTE FI; 47 47 double d; 48 48 double n; -
branches/monitor-improvement/csctapi/protocol_t0.c
r496 r844 101 101 } 102 102 103 int Protocol_T0_Init (Protocol_T0 * t0, ICC_Async * icc, PPS_ProtocolParameters * params )103 int Protocol_T0_Init (Protocol_T0 * t0, ICC_Async * icc, PPS_ProtocolParameters * params, int selected_protocol) 104 104 { 105 105 ICC_Async_Timings timings; … … 114 114 /* Integer value WI = TC2, by default 10 */ 115 115 #ifndef PROTOCOL_T0_USE_DEFAULT_TIMINGS 116 if (ATR_GetInterfaceByte (atr, 2, ATR_INTERFACE_BYTE_TC, &(wi)) != ATR_OK)116 if (ATR_GetInterfaceByte (atr, selected_protocol, ATR_INTERFACE_BYTE_TC, &(wi)) != ATR_OK) 117 117 #endif 118 118 wi = PROTOCOL_T0_DEFAULT_WI; 119 119 120 120 /* WWT = 960 * WI * (Fi / f) * 1000 milliseconds */ 121 t0->wwt = (long unsigned int) (960 * wi * (params->f / ICC_Async_GetClockRate (t0->icc)) * 1000); 121 double F = (double) atr_f_table[params->FI]; 122 t0->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate (t0->icc)) * 1000); 122 123 123 124 /* Set timings */ … … 136 137 } 137 138 138 int Protocol_T14_Init (Protocol_T14 * t14, ICC_Async * icc, PPS_ProtocolParameters * params )139 int Protocol_T14_Init (Protocol_T14 * t14, ICC_Async * icc, PPS_ProtocolParameters * params, int selected_protocol) 139 140 { 140 141 ICC_Async_Timings timings; … … 149 150 /* Integer value WI = TC2, by default 10 */ 150 151 #ifndef PROTOCOL_T14_USE_DEFAULT_TIMINGS 151 if (ATR_GetInterfaceByte (atr, 2, ATR_INTERFACE_BYTE_TC, &(wi)) != ATR_OK)152 if (ATR_GetInterfaceByte (atr, selected_protocol, ATR_INTERFACE_BYTE_TC, &(wi)) != ATR_OK) 152 153 #endif 153 154 wi = PROTOCOL_T14_DEFAULT_WI; 154 155 155 156 /* WWT = 960 * WI * (Fi / f) * 1000 milliseconds */ 156 t14->wwt = (long unsigned int) (960 * wi * (params->f / ICC_Async_GetClockRate (t14->icc)) * 1000); 157 double F = (double) atr_f_table[params->FI]; 158 t14->wwt = (long unsigned int) (960 * wi * (F / ICC_Async_GetClockRate (t14->icc)) * 1000); 157 159 t14->wwt >>= 1; 158 160 … … 165 167 ICC_Async_SetTimings (t14->icc, &timings); 166 168 167 #ifdef DEBUG_PROTOCOL169 //#ifdef DEBUG_PROTOCOL 168 170 printf ("Protocol: T=14: WWT=%d\n", (int)(t14->wwt)); 169 #endif171 //#endif 170 172 171 173 return PROTOCOL_T14_OK; -
branches/monitor-improvement/csctapi/protocol_t0.h
r8 r844 82 82 83 83 /* Initialise a protocol handler */ 84 extern int Protocol_T0_Init (Protocol_T0 * t0, ICC_Async * icc, PPS_ProtocolParameters * params );85 extern int Protocol_T14_Init (Protocol_T14 * t14, ICC_Async * icc, PPS_ProtocolParameters * params );84 extern int Protocol_T0_Init (Protocol_T0 * t0, ICC_Async * icc, PPS_ProtocolParameters * params, int selected_protocol); 85 extern int Protocol_T14_Init (Protocol_T14 * t14, ICC_Async * icc, PPS_ProtocolParameters * params, int selected_protocol); 86 86 87 87 /* Send a command and return a response */ -
branches/monitor-improvement/csctapi/protocol_t1.c
r8 r844 75 75 76 76 int 77 Protocol_T1_Init (Protocol_T1 * t1, ICC_Async * icc, PPS_ProtocolParameters * params )77 Protocol_T1_Init (Protocol_T1 * t1, ICC_Async * icc, PPS_ProtocolParameters * params, int selected_protocol) 78 78 { 79 79 ICC_Async_Timings timings; … … 91 91 92 92 /* Set IFSC */ 93 if (ATR_GetInterfaceByte (atr, 3, ATR_INTERFACE_BYTE_TA, &ta) == ATR_NOT_FOUND)93 if (ATR_GetInterfaceByte (atr, selected_protocol, ATR_INTERFACE_BYTE_TA, &ta) == ATR_NOT_FOUND) 94 94 t1->ifsc = PROTOCOL_T1_DEFAULT_IFSC; 95 95 else if ((ta != 0x00) && (ta != 0xFF)) … … 106 106 #ifndef PROTOCOL_T1_USE_DEFAULT_TIMINGS 107 107 /* Calculate CWI and BWI */ 108 if (ATR_GetInterfaceByte (atr, 3, ATR_INTERFACE_BYTE_TB, &tb) == ATR_NOT_FOUND)108 if (ATR_GetInterfaceByte (atr, selected_protocol, ATR_INTERFACE_BYTE_TB, &tb) == ATR_NOT_FOUND) 109 109 { 110 110 #endif … … 143 143 144 144 /* Set the error detection code type */ 145 if (ATR_GetInterfaceByte (atr, 3, ATR_INTERFACE_BYTE_TC, &tc) == ATR_NOT_FOUND)145 if (ATR_GetInterfaceByte (atr, selected_protocol, ATR_INTERFACE_BYTE_TC, &tc) == ATR_NOT_FOUND) 146 146 t1->edc = PROTOCOL_T1_EDC_LRC; 147 147 else -
branches/monitor-improvement/csctapi/protocol_t1.h
r8 r844 73 73 /* Initialise a protocol handler */ 74 74 extern int 75 Protocol_T1_Init (Protocol_T1 * t1, ICC_Async * icc, PPS_ProtocolParameters * params );75 Protocol_T1_Init (Protocol_T1 * t1, ICC_Async * icc, PPS_ProtocolParameters * params, int selected_protocol); 76 76 77 77 /* Send a command and return a response */ -
branches/monitor-improvement/csctapi/sci_global.h
r8 r844 83 83 { 84 84 UCHAR T; 85 ULONG f;85 ULONG FI; 86 86 ULONG ETU; 87 87 ULONG WWT; -
branches/monitor-improvement/oscam-log.c
r843 r844 159 159 if (use_syslog && !use_ac_log) // system-logfile 160 160 syslog(LOG_INFO, "%s", txt); 161 else {161 //else { 162 162 time(&t); 163 163 lt=localtime(&t); … … 179 179 cs_write_log(buf+8); 180 180 // } 181 }181 //} 182 182 store_logentry(buf); 183 183 -
branches/monitor-improvement/oscam.c
r827 r844 337 337 client[i].fchid = account->fchid; // CHID filters 338 338 client[i].cltab = account->cltab; // Class 339 client[i].ftab = account->ftab; // Ident 339 if(!client[i].ncd_server) // newcamd module dosent like ident reloading 340 client[i].ftab = account->ftab; // Ident 340 341 client[i].sidtabok= account->sidtabok; // services 341 342 client[i].sidtabno= account->sidtabno; // services -
branches/monitor-improvement/reader-dre.c
r823 r844 329 329 0x56, 0x58, 0x11 330 330 }; 331 int i; 331 332 switch (ep->emm[0]) { 332 333 case 0x87: //unique EMM 333 memcpy (emmcmd42 + 4, ep->emm + 3, 45); 334 emmcmd42[3] = 0x00; //not sure about this 335 emmcmd42[49] = ep->emm[41]; //keynr 336 emmcmd42[50] = 0x58 + ep->emm[40]; //package nr 337 emmcmd42[51] = provider; 338 if ((dre_cmd (emmcmd42))) { 339 if ((cta_res[cta_lr - 2] != 0x90) || (cta_res[cta_lr - 1] != 0x00)) 340 return 0; //exit if response is not 90 00 334 for (i = 0; i < 2; i++) { 335 memcpy (emmcmd42 + 1, ep->emm + 42 + i*49, 48); 336 emmcmd42[49] = ep->emm[i*49 + 41]; //keynr 337 emmcmd42[50] = 0x58 + ep->emm[40]; //package nr 338 emmcmd42[51] = provider; 339 if ((dre_cmd (emmcmd42))) { 340 if ((cta_res[cta_lr - 2] != 0x90) || (cta_res[cta_lr - 1] != 0x00)) 341 return 0; //exit if response is not 90 00 342 } 341 343 } 342 344 break; -
branches/monitor-improvement/reader-videoguard2.c
r682 r844 608 608 { 609 609 cs_log("Type: Videoguard Sky Italia"); 610 if (reader[ridx].mhz != 357)611 cs_log("Warning: for Sky Italia currently only 'mhz = 357' is known to work! Device %s has mhz = %i",reader[ridx].device,reader[ridx].mhz);612 610 } 613 611 else if ((atrsize == sizeof (atr_directv)) && (memcmp (atr, atr_directv, atrsize) == 0)) … … 630 628 { 631 629 cs_log("Type: Videoguard Sky Italia new (093B)"); 632 if (reader[ridx].mhz != 357)633 cs_log("Warning: for Sky Italia currently only 'mhz = 357' is known to work! Device %s has mhz = %i",reader[ridx].device,reader[ridx].mhz);634 630 } 635 631 else if ((atrsize == sizeof (atr_premiere)) && (memcmp (atr, atr_premiere, atrsize) == 0))
Note:
See TracChangeset
for help on using the changeset viewer.