--- trunk/Drivers/ccid/src/ccid_serial.c 2004/01/15 13:45:37 612 +++ trunk/Drivers/ccid/src/ccid_serial.c 2004/01/27 13:32:55 649 @@ -102,9 +102,9 @@ int fd; /* - * channel used (1..4) + * device used ("/dev/ttyS?" under Linux) */ - int channel; + char *device; /* * serial communication buffer @@ -132,7 +132,7 @@ #include "ccid_serial.h" static _serialDevice serialDevice[PCSCLITE_MAX_READERS] = { - [ 0 ... (PCSCLITE_MAX_READERS-1) ] = { -1, -1 } + [ 0 ... (PCSCLITE_MAX_READERS-1) ] = { -1, NULL } }; /***************************************************************************** @@ -427,9 +427,6 @@ status_t OpenSerial(int lun, int channel) { char dev_name[FILENAME_MAX]; - struct termios current_termios; - int i; - int reader = LunToReaderIndex(lun); DEBUG_COMM3("Lun: %X, Channel: %d", lun, channel); @@ -456,12 +453,29 @@ sprintf(dev_name, "/dev/pcsc/%d", (int) channel); + return OpenSerialByName(lun, dev_name); +} /* OpenSerial */ + +/***************************************************************************** + * + * OpenSerialByName: open the port + * + *****************************************************************************/ +status_t OpenSerialByName(int lun, char *dev_name) +{ + struct termios current_termios; + int i; + int reader = LunToReaderIndex(lun); + + DEBUG_COMM3("Lun: %X, Device: %d", lun, dev_name); + /* check if the same channel is not already used */ for (i=0; i