Changeset 1969


Ignore:
Timestamp:
04/06/10 14:04:17 (12 years ago)
Author:
merek
Message:
  • Next try to disable cache2
  • Merge from UMP r1999
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/csctapi/icc_async.c

    r1960 r1969  
    8282        case R_SC8in1:
    8383            pthread_mutex_init(&sc8in1, NULL);
     84            int pos = strlen(reader->device)-2; //this is where : should be located; is also valid length of physical device name
     85            if (reader->device[pos] != 0x3a) //0x3a = ":"
     86                cs_log("ERROR: '%c' detected instead of slot separator `:` at second to last position of device %s", reader->device[pos], reader->device);
     87            reader->slot=(int)reader->device[pos+1] - 0x30;//FIXME test boundaries
     88            reader->device[pos]= 0; //slot 1 reader now gets correct physicalname
    8489        case R_MOUSE:
    8590            reader->handle = open (reader->device,  O_RDWR | O_NOCTTY| O_NONBLOCK);
  • trunk/csctapi/ifd_sc8in1.c

    r1966 r1969  
    5555  }
    5656  cs_ddump_mask (D_DEVICE, buff, lenwrite, "IO: Sending: ");
    57   if(!write(reader->handle, buff, lenwrite)) { //dont use IO_Serial_Write since mcr commands dont echo back
     57  if (!write(reader->handle, buff, lenwrite)) { //dont use IO_Serial_Write since mcr commands dont echo back
    5858    cs_log("ERROR: SC8in1 Command write error");
    5959    return ERROR;
     
    151151    //additional init, Phoenix_Init is also called for Sc8in1 !
    152152    struct termios termio;
    153     int i,speed,fd = reader->handle;
     153    int i,pos, speed,fd = reader->handle;
    154154    unsigned int is_mcr, sc8in1_clock = 0;
    155155    tcgetattr(reader->handle,&termio);
     
    168168    for (i=0; i<CS_MAXREADER; i++) //copy handle to other slots, FIXME change this if multiple sc8in1 readers
    169169        if (reader[i].typ == R_SC8in1) {
     170            if (reader[i].slot == 0) {//not initialized yet
     171                pos = strlen(reader[i].device)-2; //this is where : should be located; is also valid length of physical device name
     172                if (reader[i].device[pos] != 0x3a) //0x3a = ":"
     173                    cs_log("ERROR: '%c' detected instead of slot separator `:` at second to last position of device %s", reader[i].device[pos], reader[i].device);
     174                reader[i].slot=(int)reader[i].device[pos+1] - 0x30;//FIXME test boundaries
     175                reader[i].device[pos]= 0; //slot 1 reader now gets correct physicalname
     176            }
    170177            reader[i].handle = fd;
    171178            if (!is_mcr)
    172179                continue;
    173180            //if MCR set clock
    174             switch (reader->mhz) {
     181            switch (reader[i].mhz) {
    175182                case 357:
    176183                case 358:
     
    191198                    break;
    192199            }
    193             sc8in1_clock |= (speed << (reader->slot - 1) * 2);
     200            sc8in1_clock |= (speed << (reader[i].slot - 1) * 2);
    194201        }
    195     buff[0] = 0x63; //MCR set clock
    196     buff[1] = (sc8in1_clock >> 8) & 0xFF;
    197     buff[2] = sc8in1_clock & 0xFF;
    198     sc8in1_command(reader,  buff, 3, 0);
    199 //      }
     202    if (is_mcr) {
     203        buff[0] = 0x63; //MCR set clock
     204        buff[1] = (sc8in1_clock >> 8) & 0xFF;
     205        buff[2] = sc8in1_clock & 0xFF;
     206        sc8in1_command(reader,  buff, 3, 0);
     207    }
    200208
    201209    return OK;
  • trunk/globals.h

    r1968 r1969  
    871871extern int cs_auth_client(struct s_auth *, char*);
    872872extern void cs_disconnect_client(void);
    873 extern int check_ecmcache(ECM_REQUEST *, ulong, int);
     873extern int check_ecmcache(ECM_REQUEST *, ulong);
    874874extern void store_logentry(char *);
    875875extern int write_to_pipe(int, int, uchar *, int);
  • trunk/oscam-reader.c

    r1968 r1969  
    387387    return;
    388388  }
    389   if (check_ecmcache(er, client[er->cidx].grp, reader->cachecm))
    390   {
    391     er->rc=2;
    392     write_ecm_answer(fd_c2m, er);
    393     return;
     389  // cache2
     390  if (reader->cachecm) {
     391    if (check_ecmcache(er, client[er->cidx].grp))
     392    {
     393      er->rc=2;
     394      write_ecm_answer(fd_c2m, er);
     395      return;
     396    }
    394397  }
    395398  if (proxy)
  • trunk/oscam.c

    r1968 r1969  
    547547    }
    548548        if (reader[ridx].typ == R_SC8in1 && port == 99) { //SC8in1 reader gets threaded, not forked
    549             int pos = strlen(reader[ridx].device)-2; //this is where : should be located; is also valid length of physical device name
    550             if (reader[ridx].device[pos] != 0x3a) //0x3a = ":"
    551                 cs_log("ERROR: '%c' detected instead of slot separator `:` at second to last position of device %s", reader[ridx].device[pos], reader[ridx].device);
    552             reader[ridx].slot=(int)reader[ridx].device[pos+1] - 0x30;//FIXME test boundaries
    553             reader[ridx].device[pos]= 0; //slot 1 reader now gets correct physicalname
    554549                        if (reader[ridx].handle == 0)
    555550                reader_device_init(&reader[ridx]);
     
    13451340}
    13461341
    1347 int check_ecmcache(ECM_REQUEST *er, ulong grp, int cachecm)
    1348 {
    1349     // disable caching
    1350     if (!cachecm) return(0);
    1351 
     1342int check_ecmcache(ECM_REQUEST *er, ulong grp)
     1343{
    13521344    int i;
    13531345    //cs_ddump(ecmd5, CS_ECMSTORESIZE, "ECM search");
     
    21362128
    21372129        // cache1
    2138         if (check_ecmcache(er, client[cs_idx].grp, reader[ridx].cachecm))
    2139             er->rc = 1;
     2130        if(reader[ridx].cachecm) {
     2131            if (check_ecmcache(er, client[cs_idx].grp))
     2132                er->rc = 1;
     2133        }
    21402134
    21412135#ifdef CS_ANTICASC
Note: See TracChangeset for help on using the changeset viewer.