Changeset 16
- Timestamp:
- 04/05/09 01:32:36 (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/io_serial.c
r14 r16 505 505 506 506 extern int mhz; 507 extern int reader_irdeto_mode; 507 508 if (mhz == 600) { 508 509 /* for 6MHz */ 509 struct serial_struct nuts; 510 ioctl(io->fd, TIOCGSERIAL, &nuts); 511 nuts.custom_divisor = nuts.baud_base / 9600 * 3.57 / 6; 512 nuts.flags &= ~ASYNC_SPD_MASK; 513 nuts.flags |= ASYNC_SPD_CUST; 514 ioctl(io->fd, TIOCSSERIAL, &nuts); 515 cfsetospeed(&newtio, IO_Serial_Bitrate(38400)); 516 cfsetispeed(&newtio, IO_Serial_Bitrate(38400)); 510 if (reader_irdeto_mode) { 511 cfsetospeed(&newtio, IO_Serial_Bitrate(props->output_bitrate)); 512 cfsetispeed(&newtio, IO_Serial_Bitrate(props->input_bitrate)); 513 } else { 514 struct serial_struct nuts; 515 ioctl(io->fd, TIOCGSERIAL, &nuts); 516 nuts.custom_divisor = nuts.baud_base / 9600 * 3.57 / 6; 517 nuts.flags &= ~ASYNC_SPD_MASK; 518 nuts.flags |= ASYNC_SPD_CUST; 519 ioctl(io->fd, TIOCSSERIAL, &nuts); 520 cfsetospeed(&newtio, IO_Serial_Bitrate(38400)); 521 cfsetispeed(&newtio, IO_Serial_Bitrate(38400)); 522 } 517 523 } else if (mhz == 357 || mhz == 358) { 518 524 /* for 3.57 MHz */ 519 cfsetospeed(&newtio, IO_Serial_Bitrate(props->output_bitrate)); 520 cfsetispeed(&newtio, IO_Serial_Bitrate(props->input_bitrate)); 525 if (reader_irdeto_mode) { 526 struct serial_struct nuts; 527 ioctl(io->fd, TIOCGSERIAL, &nuts); 528 nuts.custom_divisor = nuts.baud_base / 5713; 529 nuts.flags &= ~ASYNC_SPD_MASK; 530 nuts.flags |= ASYNC_SPD_CUST; 531 ioctl(io->fd, TIOCSSERIAL, &nuts); 532 cfsetospeed(&newtio, IO_Serial_Bitrate(38400)); 533 cfsetispeed(&newtio, IO_Serial_Bitrate(38400)); 534 } else { 535 cfsetospeed(&newtio, IO_Serial_Bitrate(props->output_bitrate)); 536 cfsetispeed(&newtio, IO_Serial_Bitrate(props->input_bitrate)); 537 } 521 538 } else { 522 539 /* invalid */ -
trunk/reader-common.c
r14 r16 5 5 int mpcs_card_detect; 6 6 int mhz; 7 int reader_irdeto_mode; 7 8 8 9 uchar cta_cmd[272], cta_res[260], atr[64]; … … 138 139 for (i=0; i<5; i++) 139 140 { 141 reader_irdeto_mode = i%2 == 1; 140 142 cta_cmd[0] = CTBCS_CLA; 141 143 cta_cmd[1] = CTBCS_INS_REQUEST;
Note:
See TracChangeset
for help on using the changeset viewer.