Changeset 4141 for trunk/csctapi/ifd_smartreader.c
- Timestamp:
- 12/18/10 08:10:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/csctapi/ifd_smartreader.c
r4019 r4141 72 72 return ERROR; 73 73 } 74 cs_debug_mask (D_ IFD,"IO:SR: Looking for device %s on bus %s",devname,busname);74 cs_debug_mask (D_DEVICE, "IO:SR: Looking for device %s on bus %s",devname,busname); 75 75 76 76 ret = libusb_init(NULL); … … 101 101 reader->sr_config->out_ep=out_endpoint; 102 102 103 cs_debug_mask (D_ IFD,"IO:SR: Opening smartreader device %s on bus %s",devname,busname);103 cs_debug_mask (D_DEVICE, "IO:SR: Opening smartreader device %s on bus %s",devname,busname); 104 104 105 105 if ((ret=smartreader_usb_open_dev(reader))) { … … 108 108 } 109 109 110 cs_debug_mask (D_ IFD,"IO:SR: Setting smartreader latency timer to 1ms");110 cs_debug_mask (D_DEVICE, "IO:SR: Setting smartreader latency timer to 1ms"); 111 111 112 112 //Set the FTDI latency timer to 1ms … … 184 184 sched_yield(); 185 185 } 186 cs_ddump (buff, total_read, "SR IO: Receive: ");186 cs_ddump_mask(D_DEVICE, buff, total_read, "SR IO: Receive: "); 187 187 return total_read; 188 188 } … … 216 216 atr_ok=ERROR; 217 217 memset(data,0,sizeof(data)); 218 cs_debug_mask (D_ IFD,"IO:SR: Trying with parity %s",parity_str[parity[i]]);218 cs_debug_mask (D_DEVICE, "IO:SR: Trying with parity %s",parity_str[parity[i]]); 219 219 220 220 221 221 // special irdeto case 222 222 if(i==3) { 223 cs_debug_mask (D_ IFD,"IO:SR: Trying irdeto");223 cs_debug_mask (D_DEVICE, "IO:SR: Trying irdeto"); 224 224 reader->sr_config->F=618; /// magic smartreader value 225 225 reader->sr_config->D=1; … … 249 249 //Read the ATR 250 250 ret = smart_read(reader,data, 40,1); 251 cs_debug_mask (D_ IFD,"IO:SR: get ATR ret = %d" , ret);251 cs_debug_mask (D_DEVICE, "IO:SR: get ATR ret = %d" , ret); 252 252 if(ret) 253 cs_ddump (data,ATR_MAX_SIZE*2,"IO:SR: ");253 cs_ddump_mask(D_DEVICE, data,ATR_MAX_SIZE*2,"IO:SR: "); 254 254 255 255 // this is to make sure we don't think this 03 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 is a valid ATR. … … 260 260 261 261 if(data[0]==0x03) { 262 cs_debug_mask (D_ IFD,"IO:SR: Inverse convention detected, setting smartreader inv to 1");262 cs_debug_mask (D_DEVICE, "IO:SR: Inverse convention detected, setting smartreader inv to 1"); 263 263 264 264 reader->sr_config->inv=1; … … 267 267 // parse atr 268 268 if(ATR_InitFromArray (atr, data, ret) == ATR_OK) { 269 cs_debug_mask (D_ IFD,"IO:SR: ATR parsing OK");269 cs_debug_mask (D_DEVICE, "IO:SR: ATR parsing OK"); 270 270 atr_ok=OK; 271 271 if(i==3) { 272 cs_debug_mask (D_ IFD,"IO:SR: Locking F and D for Irdeto mode");272 cs_debug_mask (D_DEVICE, "IO:SR: Locking F and D for Irdeto mode"); 273 273 reader->sr_config->irdeto=TRUE; 274 274 } … … 314 314 return(ret); 315 315 } 316 cs_ddump (buff+offset, written, "SR IO: Transmit: ");316 cs_ddump_mask(D_DEVICE, buff+offset, written, "SR IO: Transmit: "); 317 317 total_written += written; 318 318 offset += write_size; … … 376 376 377 377 char *parity_str[5]={"NONE", "ODD", "EVEN", "MARK", "SPACE"}; 378 cs_debug_mask (D_ IFD,"IO:SR: Setting parity to %s",parity_str[parity]);378 cs_debug_mask (D_DEVICE, "IO:SR: Setting parity to %s",parity_str[parity]); 379 379 380 380 ret = smartreader_set_line_property(reader, (enum smartreader_bits_type) 8, STOP_BIT_2, parity); … … 390 390 { 391 391 392 cs_debug_mask(D_ IFD,"IO:SR: Closing smarteader\n");392 cs_debug_mask(D_DEVICE, "IO:SR: Closing smarteader\n"); 393 393 394 394 reader->sr_config->running=FALSE; … … 439 439 // command 1, set F and D parameter 440 440 if(!reader->sr_config->irdeto) { 441 cs_debug_mask (D_ IFD,"IO:SR: sending F=%04X (%d) to smartreader",Fi,Fi);442 cs_debug_mask (D_ IFD,"IO:SR: sending D=%02X (%d) to smartreader",Di,Di);441 cs_debug_mask (D_DEVICE, "IO:SR: sending F=%04X (%d) to smartreader",Fi,Fi); 442 cs_debug_mask (D_DEVICE, "IO:SR: sending D=%02X (%d) to smartreader",Di,Di); 443 443 FiDi[0]=0x01; 444 444 FiDi[1]=HIBYTE(Fi); … … 448 448 } 449 449 else { 450 cs_debug ("Not setting F and D as we're in Irdeto mode");450 cs_debug_mask(D_ATR, "Not setting F and D as we're in Irdeto mode"); 451 451 } 452 452 … … 454 454 // direct from the source .. 4MHz is the best init frequency for T=0 card, but looks like it's causing issue with some nagra card, reveting to 3.69MHz 455 455 freqk = clock * 10; //clock with type int couldnt hold freq in Hz on all platforms, so I reverted to 10khz units (like mhz) - dingo 456 cs_debug_mask (D_ IFD,"IO:SR: sending Freq=%04X (%d) to smartreader",freqk,freqk);456 cs_debug_mask (D_DEVICE, "IO:SR: sending Freq=%04X (%d) to smartreader",freqk,freqk); 457 457 Freq[0]=0x02; 458 458 Freq[1]=HIBYTE(freqk); … … 461 461 462 462 // command 3, set paramter N 463 cs_debug_mask (D_ IFD,"IO:SR: sending N=%02X (%d) to smartreader",Ni,Ni);463 cs_debug_mask (D_DEVICE, "IO:SR: sending N=%02X (%d) to smartreader",Ni,Ni); 464 464 N[0]=0x03; 465 465 N[1]=Ni; … … 478 478 T=0; // T=1 protocol is handled by oscam 479 479 480 cs_debug_mask (D_ IFD,"IO:SR: sending T=%02X (%d) to smartreader",T,T);480 cs_debug_mask (D_DEVICE, "IO:SR: sending T=%02X (%d) to smartreader",T,T); 481 481 Prot[0]=0x04; 482 482 Prot[1]=T; … … 484 484 485 485 // command 5, set invert y/n 486 cs_debug_mask (D_ IFD,"IO:SR: sending inv=%02X to smartreader",inv);486 cs_debug_mask (D_DEVICE, "IO:SR: sending inv=%02X to smartreader",inv); 487 487 Invert[0]=0x05; 488 488 Invert[1]=inv; … … 593 593 } 594 594 else if(libusb_get_bus_number(dev)==atoi(busname) && libusb_get_device_address(dev)==atoi(devname)) { 595 cs_debug_mask(D_ IFD,"IO:SR: Checking FTDI device: %03d on bus %03d",libusb_get_device_address(dev),libusb_get_bus_number(dev));595 cs_debug_mask(D_DEVICE, "IO:SR: Checking FTDI device: %03d on bus %03d",libusb_get_device_address(dev),libusb_get_bus_number(dev)); 596 596 // check for smargo endpoints. 597 597 if(smartreader_check_endpoint(dev,out_endpoint))
Note:
See TracChangeset
for help on using the changeset viewer.