Ignore:
Timestamp:
10/24/09 12:00:35 (11 years ago)
Author:
dingo35
Message:

Optimization of write_card routines + related bugfix in viaccess_do_emm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/reader-videoguard2.c

    r469 r473  
    355355}
    356356
    357 #define CMD_LEN 5
    358 
    359357static int status_ok(const unsigned char *status){
    360358    //cs_log("check status %02x%02x", status[0],status[1]);
     
    366364}
    367365
    368 static int card_write(const uchar *cmd, const uchar *data, int wflag)
    369 {
    370   int l;
    371   uchar buf[256];
    372   memcpy(buf, cmd, CMD_LEN);
    373   l=wflag ? cmd[4] : 0;
    374   if (l && data) memcpy(buf+CMD_LEN, data, l);
    375   l=reader_cmd2icc(buf, CMD_LEN+l);
    376   return(l);
    377 }
    378 
    379 #define write_cmd(cmd, data) (card_write(cmd, data, 1) == 0)
    380 #define read_cmd(cmd, data) (card_write(cmd, data, 0) == 0)
     366#define write_cmd(cmd, data) (card_write(cmd, data) == 0)
     367#define read_cmd(cmd, data) (card_write(cmd, NULL) == 0)
    381368
    382369static int read_cmd_len(const unsigned char *cmd)
Note: See TracChangeset for help on using the changeset viewer.