Changeset 1170
- Timestamp:
- 01/10/10 19:28:00 (14 years ago)
- Location:
- branches/monitor-improvement
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/monitor-improvement/csctapi/icc_async.c
r1140 r1170 73 73 74 74 /* Activate ICC */ 75 #ifdef SCI_DEV76 75 if (IFD_Towitoko_ActivateICC (ifd) != IFD_TOWITOKO_OK) 77 76 return ICC_ASYNC_IFD_ERROR; 78 #endif79 77 /* Reset ICC */ 80 78 if (IFD_Towitoko_ResetAsyncICC (ifd, &(icc->atr)) != IFD_TOWITOKO_OK) … … 212 210 } 213 211 212 int ICC_Async_BeginTransmission (ICC_Async * icc) 213 { 214 /* Setup parity for this ICC */ 214 215 #ifndef NO_PAR_SWITCH 215 int ICC_Async_BeginTransmission (ICC_Async * icc)216 {217 /* Setup parity for this ICC */218 216 if (icc->convention == ATR_CONVENTION_INVERSE) 219 217 { … … 236 234 return ICC_ASYNC_IFD_ERROR; 237 235 */ 238 return ICC_ASYNC_OK; 239 } 240 241 int ICC_Async_EndTransmission (ICC_Async * icc) 242 { 243 /* Restore parity */ 244 if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK) 245 return ICC_ASYNC_IFD_ERROR; 246 247 return ICC_ASYNC_OK; 248 } 249 #endif 236 #endif 237 return ICC_ASYNC_OK; 238 } 250 239 251 240 int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * data) … … 294 283 } 295 284 285 int ICC_Async_EndTransmission (ICC_Async * icc) 286 { 287 #ifndef NO_PAR_SWITCH 288 /* Restore parity */ 289 if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK) 290 return ICC_ASYNC_IFD_ERROR; 291 #endif 292 293 return ICC_ASYNC_OK; 294 } 295 296 296 ATR * ICC_Async_GetAtr (ICC_Async * icc) 297 297 { … … 307 307 { 308 308 /* Dectivate ICC */ 309 #ifdef SCI_DEV310 309 if (IFD_Towitoko_DeactivateICC (icc->ifd) != IFD_TOWITOKO_OK) 311 310 return ICC_ASYNC_IFD_ERROR; 312 #endif313 311 314 312 /* LED Off */ -
branches/monitor-improvement/csctapi/icc_async.h
r1134 r1170 85 85 86 86 /* Operations */ 87 #ifndef NO_PAR_SWITCH88 87 extern int ICC_Async_BeginTransmission (ICC_Async * icc); 89 extern int ICC_Async_EndTransmission (ICC_Async * icc);90 #endif91 88 extern int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * buffer); 92 89 extern int ICC_Async_Receive (ICC_Async * icc, unsigned size, BYTE * buffer); 90 extern int ICC_Async_EndTransmission (ICC_Async * icc); 93 91 94 92 #endif /* _ICC_ASYNC_ */ -
branches/monitor-improvement/csctapi/ifd_towitoko.c
r1134 r1170 455 455 } 456 456 457 int IFD_Towitoko_ActivateICC (IFD * ifd) 458 { 459 #ifdef DEBUG_IFD 460 printf ("IFD: Activating card\n"); 461 #endif 457 462 #ifdef SCI_DEV 458 int IFD_Towitoko_ActivateICC (IFD * ifd)459 {460 #ifdef DEBUG_IFD461 printf ("IFD: Activating card\n");462 #endif463 463 if(ifd->io->com==RTYP_SCI) 464 464 { … … 486 486 } 487 487 else 488 #endif 488 489 { 489 490 return IFD_TOWITOKO_OK; … … 497 498 #endif 498 499 500 #ifdef SCI_DEV 499 501 if(ifd->io->com==RTYP_SCI) 500 502 { … … 516 518 517 519 } 520 #endif 518 521 519 522 return IFD_TOWITOKO_OK; 520 523 } 521 #endif522 524 523 525 //extern void print_hex_data(unsigned char *data, int len); -
branches/monitor-improvement/csctapi/ifd_towitoko.h
r1134 r1170 137 137 138 138 /* General handling of ICC inserted in this IFD */ 139 #ifdef SCI_DEV140 139 extern int IFD_Towitoko_ActivateICC (IFD * ifd); 141 140 extern int IFD_Towitoko_DeactivateICC (IFD * ifd); 142 #endif143 141 144 142 /* Asynchronous ICC handling functions */ -
branches/monitor-improvement/csctapi/protocol_t0.c
r1140 r1170 827 827 828 828 /* Initialise transmission */ 829 #ifndef NO_PAR_SWITCH830 829 if (ICC_Async_BeginTransmission (t0->icc) != ICC_ASYNC_OK) 831 830 { … … 833 832 return PROTOCOL_T0_ICC_ERROR; 834 833 } 835 #endif836 834 837 835 /* Send header bytes */ 838 836 if (ICC_Async_Transmit (t0->icc, 5, APDU_Cmd_Header (cmd)) != ICC_ASYNC_OK) 839 837 { 840 #ifndef NO_PAR_SWITCH841 838 ICC_Async_EndTransmission (t0->icc); 842 #endif843 839 844 840 (*rsp) = NULL; … … 989 985 990 986 /* End of transmission */ 991 #ifndef NO_PAR_SWITCH992 987 if (ICC_Async_EndTransmission (t0->icc) != ICC_ASYNC_OK) 993 988 return PROTOCOL_T0_ICC_ERROR; 994 #endif995 989 996 990 return (ret); … … 1020 1014 1021 1015 /* Initialise transmission */ 1022 #ifndef NO_PAR_SWITCH1023 1016 if (ICC_Async_BeginTransmission (t14->icc) != ICC_ASYNC_OK) 1024 1017 { … … 1026 1019 return PROTOCOL_T14_ICC_ERROR; 1027 1020 } 1028 #endif1029 1021 1030 1022 if(t14->icc->ifd->io->com!=RTYP_SCI) … … 1033 1025 if (ICC_Async_Transmit (t14->icc, 1, &b1) != ICC_ASYNC_OK) 1034 1026 { 1035 #ifndef NO_PAR_SWITCH1036 1027 ICC_Async_EndTransmission (t14->icc); 1037 #endif1038 1028 1039 1029 (*rsp) = NULL; … … 1044 1034 if (ICC_Async_Transmit (t14->icc, cmd_len, cmd_raw) != ICC_ASYNC_OK) 1045 1035 { 1046 #ifndef NO_PAR_SWITCH1047 1036 ICC_Async_EndTransmission (t14->icc); 1048 #endif1049 1037 1050 1038 (*rsp) = NULL; … … 1055 1043 if (ICC_Async_Transmit (t14->icc, 1, &ixor) != ICC_ASYNC_OK) 1056 1044 { 1057 #ifndef NO_PAR_SWITCH1058 1045 ICC_Async_EndTransmission (t14->icc); 1059 #endif1060 1046 1061 1047 (*rsp) = NULL; … … 1072 1058 if (ICC_Async_Transmit (t14->icc, cmd_len+2, buffer) != ICC_ASYNC_OK) 1073 1059 { 1074 #ifndef NO_PAR_SWITCH1075 1060 ICC_Async_EndTransmission (t14->icc); 1076 #endif1077 1061 1078 1062 (*rsp) = NULL; … … 1163 1147 1164 1148 /* End of transmission */ 1165 #ifndef NO_PAR_SWITCH1166 1149 if (ICC_Async_EndTransmission (t14->icc) != ICC_ASYNC_OK) 1167 1150 return PROTOCOL_T14_ICC_ERROR; 1168 #endif1169 1151 1170 1152 return (ret); -
branches/monitor-improvement/csctapi/protocol_t1.c
r1134 r1170 419 419 420 420 /* Setup transmission */ 421 #ifndef NO_PAR_SWITCH422 421 if (ICC_Async_BeginTransmission (t1->icc) != ICC_ASYNC_OK) 423 422 ret = PROTOCOL_T1_ICC_ERROR; 424 423 425 424 else 426 #endif427 425 { 428 426 /* Send T=1 block */ … … 432 430 if (ICC_Async_Transmit (t1->icc, length, buffer) != ICC_ASYNC_OK) 433 431 { 434 #ifndef NO_PAR_SWITCH435 432 ICC_Async_EndTransmission (t1->icc); 436 #endif437 433 ret = PROTOCOL_T1_ICC_ERROR; 438 434 } … … 490 486 491 487 /* End of transmission */ 492 #ifndef NO_PAR_SWITCH493 488 if (ICC_Async_EndTransmission (t1->icc) != ICC_ASYNC_OK) 494 489 ret = PROTOCOL_T1_ICC_ERROR; 495 #endif496 490 497 491 return ret; -
branches/monitor-improvement/reader-nagra.c
r1166 r1170 530 530 reader[ridx].prid[0][3]=cta_res[8]; 531 531 memcpy(reader[ridx].sa[0], reader[ridx].sa[0], 4); 532 if ( ( cta_res[7] == 0x34 && cta_res[8] == 0x11) || (cta_res[7] == 0x04 && cta_res[8] == 0x01))532 if ( ((cta_res[7] == 0x34) && (cta_res[8] == 0x11)) || ((cta_res[7] == 0x04) && (cta_res[8] == 0x01))) //provider 3411, 0401 needs cw swap 533 533 { 534 cs_debug("[nagra-reader] detect provider with swap cw!"); 534 535 swapCW=1; 535 536 } … … 716 717 cs_sleepms(15); 717 718 } 718 cs_sleepms(1 5);719 cs_sleepms(10); 719 720 if (HAS_CW && do_cmd(0x1C,0x02,0x9C,0x36,NULL)) 720 721 { … … 726 727 if (swapCW==1) 727 728 { 729 cs_debug("[nagra-reader] swapCW"); 728 730 unsigned char tt[8]; 729 731 memcpy(&tt[0],&er->cw[0],8);
Note:
See TracChangeset
for help on using the changeset viewer.