Bugfixes and a fake GETBASEIRQ.

This commit is contained in:
Ove Kaaven 1999-07-31 13:00:24 +00:00 committed by Alexandre Julliard
parent 43a2b6a2a5
commit 1c08ac604e

View File

@ -233,7 +233,7 @@ static void comm_notification(int fd,void*private)
} else { } else {
/* check for events */ /* check for events */
if ((ptr->eventmask & EV_RXFLAG) && if ((ptr->eventmask & EV_RXFLAG) &&
memchr(ptr->inbuf + ptr->ibuf_head, ptr->evtchar, bleft)) { memchr(ptr->inbuf + ptr->ibuf_head, ptr->evtchar, len)) {
*(WORD*)(unknown[cid]) |= EV_RXFLAG; *(WORD*)(unknown[cid]) |= EV_RXFLAG;
mask |= CN_EVENT; mask |= CN_EVENT;
} }
@ -564,13 +564,15 @@ LONG WINAPI EscapeCommFunction16(UINT16 cid,UINT16 nFunction)
struct termios port; struct termios port;
TRACE("cid=%d, function=%d\n", cid, nFunction); TRACE("cid=%d, function=%d\n", cid, nFunction);
if ((ptr = GetDeviceStruct(cid)) == NULL) { if ((nFunction != GETMAXCOM) && (nFunction != GETMAXLPT)) {
return -1; if ((ptr = GetDeviceStruct(cid)) == NULL) {
} return -1;
if (tcgetattr(ptr->fd,&port) == -1) { }
ptr->commerror=WinError(); if (tcgetattr(ptr->fd,&port) == -1) {
return -1; ptr->commerror=WinError();
} return -1;
}
} else ptr = NULL;
switch (nFunction) { switch (nFunction) {
case RESETDEV: case RESETDEV:
@ -588,6 +590,19 @@ LONG WINAPI EscapeCommFunction16(UINT16 cid,UINT16 nFunction)
return FLAG_LPT + max; return FLAG_LPT + max;
break; break;
case GETBASEIRQ:
/* FIXME: use tables */
/* just fake something for now */
if (cid & FLAG_LPT) {
/* LPT1: irq 7, LPT2: irq 5 */
return (cid & 0x7f) ? 5 : 7;
} else {
/* COM1: irq 4, COM2: irq 3,
COM3: irq 4, COM4: irq 3 */
return 4 - (cid & 1);
}
break;
#ifdef TIOCM_DTR #ifdef TIOCM_DTR
case CLRDTR: case CLRDTR:
return COMM_WhackModem(ptr->fd, ~TIOCM_DTR, 0); return COMM_WhackModem(ptr->fd, ~TIOCM_DTR, 0);