- Timestamp:
- 01/14/10 11:10:32 (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/icc_async.c
r1208 r1219 142 142 icc->ifd = ifd; 143 143 144 #ifdef NO_PAR_SWITCH145 144 if (icc->convention == ATR_CONVENTION_INVERSE) 146 145 { … … 162 161 #endif 163 162 IO_Serial_Flush(ifd->io); 164 #endif165 163 return ICC_ASYNC_OK; 166 164 #else … … 248 246 } 249 247 250 int ICC_Async_BeginTransmission (ICC_Async * icc)251 {252 /* Setup parity for this ICC */253 #ifndef NO_PAR_SWITCH254 if (icc->convention == ATR_CONVENTION_INVERSE)255 {256 if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_ODD) != IFD_TOWITOKO_OK)257 return ICC_ASYNC_IFD_ERROR;258 }259 else if(icc->protocol_type == ATR_PROTOCOL_TYPE_T14)260 {261 if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK)262 return ICC_ASYNC_IFD_ERROR;263 }264 else265 {266 if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_EVEN) != IFD_TOWITOKO_OK)267 return ICC_ASYNC_IFD_ERROR;268 }269 270 /* Setup baudrate for this ICC */271 /* if (IFD_Towitoko_SetBaudrate (icc->ifd, icc->baudrate)!= IFD_TOWITOKO_OK)272 return ICC_ASYNC_IFD_ERROR;273 */274 #endif275 return ICC_ASYNC_OK;276 }277 278 248 int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * data) 279 249 { … … 332 302 if (icc->convention == ATR_CONVENTION_INVERSE && icc->ifd->io->reader_type!=R_INTERNAL) 333 303 ICC_Async_InvertBuffer (size, data); 334 335 return ICC_ASYNC_OK;336 }337 338 int ICC_Async_EndTransmission (ICC_Async * icc)339 {340 #ifndef NO_PAR_SWITCH341 /* Restore parity */342 if (IFD_Towitoko_SetParity (icc->ifd, IFD_TOWITOKO_PARITY_NONE) != IFD_TOWITOKO_OK)343 return ICC_ASYNC_IFD_ERROR;344 #endif345 304 346 305 return ICC_ASYNC_OK; -
trunk/csctapi/icc_async.h
r1168 r1219 85 85 86 86 /* Operations */ 87 extern int ICC_Async_BeginTransmission (ICC_Async * icc);88 87 extern int ICC_Async_Transmit (ICC_Async * icc, unsigned size, BYTE * buffer); 89 88 extern int ICC_Async_Receive (ICC_Async * icc, unsigned size, BYTE * buffer); 90 extern int ICC_Async_EndTransmission (ICC_Async * icc);91 89 92 90 #endif /* _ICC_ASYNC_ */ -
trunk/csctapi/ifd_towitoko.c
r1208 r1219 613 613 614 614 IO_Serial_Flush(ifd->io); 615 #ifndef NO_PAR_SWITCH616 IFD_Towitoko_SetParity (ifd, IFD_TOWITOKO_PARITY_NONE);617 #endif618 615 619 616 /* -
trunk/csctapi/protocol_t0.c
r1208 r1219 827 827 return PROTOCOL_T0_ERROR; 828 828 829 /* Initialise transmission */830 if (ICC_Async_BeginTransmission (t0->icc) != ICC_ASYNC_OK)831 {832 (*rsp) = NULL;833 return PROTOCOL_T0_ICC_ERROR;834 }835 836 829 /* Send header bytes */ 837 830 if (ICC_Async_Transmit (t0->icc, 5, APDU_Cmd_Header (cmd)) != ICC_ASYNC_OK) 838 831 { 839 ICC_Async_EndTransmission (t0->icc);840 841 832 (*rsp) = NULL; 842 833 return PROTOCOL_T0_ICC_ERROR; … … 985 976 (*rsp) = NULL; 986 977 987 /* End of transmission */988 if (ICC_Async_EndTransmission (t0->icc) != ICC_ASYNC_OK)989 return PROTOCOL_T0_ICC_ERROR;990 991 978 return (ret); 992 979 } … … 1014 1001 return PROTOCOL_T14_ERROR; 1015 1002 1016 /* Initialise transmission */1017 if (ICC_Async_BeginTransmission (t14->icc) != ICC_ASYNC_OK)1018 {1019 (*rsp) = NULL;1020 return PROTOCOL_T14_ICC_ERROR;1021 }1022 1023 1003 if(t14->icc->ifd->io->reader_type!=R_INTERNAL) 1024 1004 { … … 1026 1006 if (ICC_Async_Transmit (t14->icc, 1, &b1) != ICC_ASYNC_OK) 1027 1007 { 1028 ICC_Async_EndTransmission (t14->icc);1029 1030 1008 (*rsp) = NULL; 1031 1009 return PROTOCOL_T14_ICC_ERROR; … … 1035 1013 if (ICC_Async_Transmit (t14->icc, cmd_len, cmd_raw) != ICC_ASYNC_OK) 1036 1014 { 1037 ICC_Async_EndTransmission (t14->icc);1038 1039 1015 (*rsp) = NULL; 1040 1016 return PROTOCOL_T14_ICC_ERROR; … … 1044 1020 if (ICC_Async_Transmit (t14->icc, 1, &ixor) != ICC_ASYNC_OK) 1045 1021 { 1046 ICC_Async_EndTransmission (t14->icc);1047 1048 1022 (*rsp) = NULL; 1049 1023 return PROTOCOL_T14_ICC_ERROR; … … 1059 1033 if (ICC_Async_Transmit (t14->icc, cmd_len+2, buffer) != ICC_ASYNC_OK) 1060 1034 { 1061 ICC_Async_EndTransmission (t14->icc);1062 1063 1035 (*rsp) = NULL; 1064 1036 return PROTOCOL_T14_ICC_ERROR; … … 1147 1119 } 1148 1120 1149 /* End of transmission */1150 if (ICC_Async_EndTransmission (t14->icc) != ICC_ASYNC_OK)1151 return PROTOCOL_T14_ICC_ERROR;1152 1153 1121 return (ret); 1154 1122 } -
trunk/csctapi/protocol_t1.c
r1168 r1219 418 418 int length, ret; 419 419 420 /* Setup transmission */421 if (ICC_Async_BeginTransmission (t1->icc) != ICC_ASYNC_OK)422 ret = PROTOCOL_T1_ICC_ERROR;423 424 else425 420 { 426 421 /* Send T=1 block */ … … 430 425 if (ICC_Async_Transmit (t1->icc, length, buffer) != ICC_ASYNC_OK) 431 426 { 432 ICC_Async_EndTransmission (t1->icc);433 427 ret = PROTOCOL_T1_ICC_ERROR; 434 428 } … … 484 478 } 485 479 } 486 487 /* End of transmission */488 if (ICC_Async_EndTransmission (t1->icc) != ICC_ASYNC_OK)489 ret = PROTOCOL_T1_ICC_ERROR;490 480 491 481 return ret; -
trunk/oscam-config.h
r1171 r1219 1 1 #define CS_LOGHISTORY 2 #define NO_PAR_SWITCH3 2 4 3 #ifdef OS_FREEBSD … … 21 20 # define SCI_DEV 1 22 21 # endif 23 # ifndef NO_PAR_SWITCH24 # define NO_PAR_SWITCH25 # endif26 22 #endif 27 23 … … 30 26 # define CS_NOSHM 31 27 # define NO_FTIME 32 # ifndef NO_PAR_SWITCH33 # define NO_PAR_SWITCH34 # endif35 28 #endif 36 29 … … 40 33 # define CS_LOGFILE "/dev/tty" 41 34 # define NO_ENDIAN_H 42 # ifndef NO_PAR_SWITCH43 # define NO_PAR_SWITCH44 # endif45 35 #endif 46 36
Note:
See TracChangeset
for help on using the changeset viewer.