Rename output from COMM.DRV to KPCOMM.DRV to avoid clashing with stock driver
LIBRARY name stays COMM for import resolution. Debug strings updated to KPCOMM. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d68405550d
commit
4218da32eb
5 changed files with 92 additions and 92 deletions
170
drv/commdrv.c
170
drv/commdrv.c
|
|
@ -1,4 +1,4 @@
|
|||
// commdrv.c - High-speed COMM.DRV replacement
|
||||
// commdrv.c - KPCOMM.DRV -- High-speed COMM.DRV replacement
|
||||
//
|
||||
// All exported COMM.DRV functions, ring buffer management, port
|
||||
// initialization, 16550 FIFO detection, and flow control.
|
||||
|
|
@ -370,7 +370,7 @@ int16_t FAR PASCAL _export cclrbrk(int16_t commId)
|
|||
PortStateT *port;
|
||||
uint8_t lcr;
|
||||
|
||||
dbgInt16("COMM.DRV: cclrbrk Id", commId);
|
||||
dbgInt16("KPCOMM: cclrbrk Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return -1;
|
||||
|
|
@ -408,14 +408,14 @@ int32_t FAR PASCAL _export cevt(int16_t commId, int16_t evtMask)
|
|||
uint16_t bpVal;
|
||||
_asm mov ssSeg, ss
|
||||
_asm mov bpVal, bp
|
||||
dbgHex16("COMM.DRV: cevt SS", ssSeg);
|
||||
dbgHex16("COMM.DRV: cevt BP", bpVal);
|
||||
dbgDump("COMM.DRV: cevt stk", (void FAR *)((uint32_t)ssSeg << 16 | (bpVal + 6)), 16);
|
||||
dbgHex16("KPCOMM: cevt SS", ssSeg);
|
||||
dbgHex16("KPCOMM: cevt BP", bpVal);
|
||||
dbgDump("KPCOMM: cevt stk", (void FAR *)((uint32_t)ssSeg << 16 | (bpVal + 6)), 16);
|
||||
}
|
||||
#endif
|
||||
|
||||
dbgInt16("COMM.DRV: cevt Id", commId);
|
||||
dbgHex16("COMM.DRV: cevt mask", (uint16_t)evtMask);
|
||||
dbgInt16("KPCOMM: cevt Id", commId);
|
||||
dbgHex16("KPCOMM: cevt mask", (uint16_t)evtMask);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return 0L;
|
||||
|
|
@ -423,7 +423,7 @@ int32_t FAR PASCAL _export cevt(int16_t commId, int16_t evtMask)
|
|||
|
||||
port = &ports[commId];
|
||||
if (!port->isOpen) {
|
||||
dbgStr("COMM.DRV: cevt not open\r\n");
|
||||
dbgStr("KPCOMM: cevt not open\r\n");
|
||||
return 0L;
|
||||
}
|
||||
|
||||
|
|
@ -431,9 +431,9 @@ int32_t FAR PASCAL _export cevt(int16_t commId, int16_t evtMask)
|
|||
|
||||
ptr = &port->comDeb.evtWord;
|
||||
retVal = (int32_t)(void FAR *)ptr;
|
||||
dbgHex16("COMM.DRV: cevt retSeg", (uint16_t)(retVal >> 16));
|
||||
dbgHex16("COMM.DRV: cevt retOff", (uint16_t)(retVal & 0xFFFF));
|
||||
dbgStr("COMM.DRV: cevt OK\r\n");
|
||||
dbgHex16("KPCOMM: cevt retSeg", (uint16_t)(retVal >> 16));
|
||||
dbgHex16("KPCOMM: cevt retOff", (uint16_t)(retVal & 0xFFFF));
|
||||
dbgStr("KPCOMM: cevt OK\r\n");
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
|
@ -448,7 +448,7 @@ uint16_t FAR PASCAL _export cevtget(int16_t commId, int16_t evtMask)
|
|||
PortStateT *port;
|
||||
uint16_t events;
|
||||
|
||||
dbgInt16("COMM.DRV: cevtget Id", commId);
|
||||
dbgInt16("KPCOMM: cevtget Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return 0;
|
||||
|
|
@ -479,8 +479,8 @@ int16_t FAR PASCAL _export cextfcn(int16_t commId, int16_t func)
|
|||
uint8_t mcr;
|
||||
uint16_t base;
|
||||
|
||||
dbgInt16("COMM.DRV: cextfcn Id", commId);
|
||||
dbgInt16("COMM.DRV: cextfcn func", func);
|
||||
dbgInt16("KPCOMM: cextfcn Id", commId);
|
||||
dbgInt16("KPCOMM: cextfcn func", func);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return -1;
|
||||
|
|
@ -547,7 +547,7 @@ int16_t FAR PASCAL _export cflush(int16_t commId, int16_t queue)
|
|||
{
|
||||
PortStateT *port;
|
||||
|
||||
dbgInt16("COMM.DRV: cflush Id", commId);
|
||||
dbgInt16("KPCOMM: cflush Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return -1;
|
||||
|
|
@ -592,7 +592,7 @@ int16_t FAR PASCAL _export cflush(int16_t commId, int16_t queue)
|
|||
// -----------------------------------------------------------------------
|
||||
int16_t FAR PASCAL _export commWriteString(int16_t commId, void FAR *buf, int16_t len)
|
||||
{
|
||||
dbgInt16("COMM.DRV: commWriteStr Id", commId);
|
||||
dbgInt16("KPCOMM: commWriteStr Id", commId);
|
||||
return sndcom(commId, buf, len);
|
||||
}
|
||||
|
||||
|
|
@ -607,7 +607,7 @@ int16_t FAR PASCAL _export commWriteString(int16_t commId, void FAR *buf, int16_
|
|||
// -----------------------------------------------------------------------
|
||||
int FAR PASCAL _export commNotifyWndProc(void)
|
||||
{
|
||||
dbgStr("COMM.DRV: ord101 called\r\n");
|
||||
dbgStr("KPCOMM: ord101 called\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -620,7 +620,7 @@ int16_t FAR PASCAL _export csetbrk(int16_t commId)
|
|||
PortStateT *port;
|
||||
uint8_t lcr;
|
||||
|
||||
dbgInt16("COMM.DRV: csetbrk Id", commId);
|
||||
dbgInt16("KPCOMM: csetbrk Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return -1;
|
||||
|
|
@ -646,7 +646,7 @@ int16_t FAR PASCAL _export ctx(int16_t commId, int16_t ch)
|
|||
{
|
||||
PortStateT *port;
|
||||
|
||||
dbgInt16("COMM.DRV: ctx Id", commId);
|
||||
dbgInt16("KPCOMM: ctx Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return -1;
|
||||
|
|
@ -715,10 +715,10 @@ int16_t FAR PASCAL _export enableNotification(int16_t commId, HWND hwnd, int16_t
|
|||
{
|
||||
PortStateT *port;
|
||||
|
||||
dbgInt16("COMM.DRV: enableNotif Id", commId);
|
||||
dbgHex16("COMM.DRV: enableNotif hwnd", (uint16_t)hwnd);
|
||||
dbgInt16("COMM.DRV: enableNotif rxTh", rxThresh);
|
||||
dbgInt16("COMM.DRV: enableNotif txTh", txThresh);
|
||||
dbgInt16("KPCOMM: enableNotif Id", commId);
|
||||
dbgHex16("KPCOMM: enableNotif hwnd", (uint16_t)hwnd);
|
||||
dbgInt16("KPCOMM: enableNotif rxTh", rxThresh);
|
||||
dbgInt16("KPCOMM: enableNotif txTh", txThresh);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return FALSE;
|
||||
|
|
@ -726,7 +726,7 @@ int16_t FAR PASCAL _export enableNotification(int16_t commId, HWND hwnd, int16_t
|
|||
|
||||
port = &ports[commId];
|
||||
if (!port->isOpen) {
|
||||
dbgStr("COMM.DRV: enableNotif not open\r\n");
|
||||
dbgStr("KPCOMM: enableNotif not open\r\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -743,7 +743,7 @@ int16_t FAR PASCAL _export enableNotification(int16_t commId, HWND hwnd, int16_t
|
|||
port->rxNotifyThresh = rxThresh;
|
||||
port->txNotifyThresh = txThresh;
|
||||
|
||||
dbgStr("COMM.DRV: enableNotif OK\r\n");
|
||||
dbgStr("KPCOMM: enableNotif OK\r\n");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -788,21 +788,21 @@ DCB FAR * FAR PASCAL _export getdcb(int16_t commId)
|
|||
{
|
||||
PortStateT *port;
|
||||
|
||||
dbgInt16("COMM.DRV: getdcb Id", commId);
|
||||
dbgInt16("KPCOMM: getdcb Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
dbgStr("COMM.DRV: getdcb bad id\r\n");
|
||||
dbgStr("KPCOMM: getdcb bad id\r\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
port = &ports[commId];
|
||||
if (!port->isOpen) {
|
||||
dbgStr("COMM.DRV: getdcb not open\r\n");
|
||||
dbgStr("KPCOMM: getdcb not open\r\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dbgHex16("COMM.DRV: getdcb isrHits", isrHitCount);
|
||||
dbgStr("COMM.DRV: getdcb OK\r\n");
|
||||
dbgHex16("KPCOMM: getdcb isrHits", isrHitCount);
|
||||
dbgStr("KPCOMM: getdcb OK\r\n");
|
||||
return &port->dcb;
|
||||
}
|
||||
|
||||
|
|
@ -825,7 +825,7 @@ int16_t FAR PASCAL _export inicom(DCB FAR *dcb)
|
|||
uint16_t txBufSize;
|
||||
uint8_t mcr;
|
||||
|
||||
dbgStr("COMM.DRV: inicom enter\r\n");
|
||||
dbgStr("KPCOMM: inicom enter\r\n");
|
||||
|
||||
// Dump raw stack to see actual parameters passed by caller
|
||||
{
|
||||
|
|
@ -835,42 +835,42 @@ int16_t FAR PASCAL _export inicom(DCB FAR *dcb)
|
|||
_asm mov bpVal, bp
|
||||
_asm mov ssVal, ss
|
||||
stkPtr = (void FAR *)((uint32_t)ssVal << 16 | (bpVal + 6));
|
||||
dbgHex16("COMM.DRV: inicom SS", ssVal);
|
||||
dbgHex16("COMM.DRV: inicom BP", bpVal);
|
||||
dbgDump("COMM.DRV: inicom stk", stkPtr, 24);
|
||||
dbgHex16("KPCOMM: inicom SS", ssVal);
|
||||
dbgHex16("KPCOMM: inicom BP", bpVal);
|
||||
dbgDump("KPCOMM: inicom stk", stkPtr, 24);
|
||||
}
|
||||
|
||||
if (!dcb) {
|
||||
dbgStr("COMM.DRV: inicom NULL dcb\r\n");
|
||||
dbgStr("KPCOMM: inicom NULL dcb\r\n");
|
||||
return IE_DEFAULT;
|
||||
}
|
||||
|
||||
dbgFarPtr("COMM.DRV: inicom dcb", (void FAR *)dcb);
|
||||
dbgDump("COMM.DRV: inicom raw", (void FAR *)dcb, 16);
|
||||
dbgHex16("COMM.DRV: sizeof(DCB)", (uint16_t)sizeof(DCB));
|
||||
dbgFarPtr("KPCOMM: inicom dcb", (void FAR *)dcb);
|
||||
dbgDump("KPCOMM: inicom raw", (void FAR *)dcb, 16);
|
||||
dbgHex16("KPCOMM: sizeof(DCB)", (uint16_t)sizeof(DCB));
|
||||
|
||||
commId = dcb->Id;
|
||||
dbgInt16("COMM.DRV: inicom Id", commId);
|
||||
dbgHex16("COMM.DRV: inicom BaudRate", dcb->BaudRate);
|
||||
dbgHex16("COMM.DRV: inicom ByteSize", (uint16_t)dcb->ByteSize);
|
||||
dbgHex16("COMM.DRV: inicom Parity", (uint16_t)dcb->Parity);
|
||||
dbgHex16("COMM.DRV: inicom StopBits", (uint16_t)dcb->StopBits);
|
||||
dbgInt16("KPCOMM: inicom Id", commId);
|
||||
dbgHex16("KPCOMM: inicom BaudRate", dcb->BaudRate);
|
||||
dbgHex16("KPCOMM: inicom ByteSize", (uint16_t)dcb->ByteSize);
|
||||
dbgHex16("KPCOMM: inicom Parity", (uint16_t)dcb->Parity);
|
||||
dbgHex16("KPCOMM: inicom StopBits", (uint16_t)dcb->StopBits);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
dbgStr("COMM.DRV: inicom IE_BADID\r\n");
|
||||
dbgStr("KPCOMM: inicom IE_BADID\r\n");
|
||||
return IE_BADID;
|
||||
}
|
||||
|
||||
port = &ports[commId];
|
||||
if (port->isOpen) {
|
||||
dbgStr("COMM.DRV: inicom IE_OPEN\r\n");
|
||||
dbgStr("KPCOMM: inicom IE_OPEN\r\n");
|
||||
return IE_OPEN;
|
||||
}
|
||||
|
||||
// Initialize port state
|
||||
initPortState(port, commId);
|
||||
dbgHex16("COMM.DRV: inicom baseAddr", port->baseAddr);
|
||||
dbgHex16("COMM.DRV: inicom irq", (uint16_t)port->irq);
|
||||
dbgHex16("KPCOMM: inicom baseAddr", port->baseAddr);
|
||||
dbgHex16("KPCOMM: inicom irq", (uint16_t)port->irq);
|
||||
|
||||
// Read buffer sizes from SYSTEM.INI if available (COMnBuffer key)
|
||||
{
|
||||
|
|
@ -889,26 +889,26 @@ int16_t FAR PASCAL _export inicom(DCB FAR *dcb)
|
|||
rxBufSize = readSystemIni("386Enh", bufKey, DEFAULT_RX_SIZE);
|
||||
}
|
||||
txBufSize = rxBufSize;
|
||||
dbgHex16("COMM.DRV: inicom rxBufSize", rxBufSize);
|
||||
dbgHex16("KPCOMM: inicom rxBufSize", rxBufSize);
|
||||
|
||||
// Allocate ring buffers
|
||||
if (initBuffers(port, rxBufSize, txBufSize) != 0) {
|
||||
dbgStr("COMM.DRV: inicom IE_MEMORY\r\n");
|
||||
dbgStr("KPCOMM: inicom IE_MEMORY\r\n");
|
||||
return IE_MEMORY;
|
||||
}
|
||||
dbgStr("COMM.DRV: inicom buffers OK\r\n");
|
||||
dbgStr("KPCOMM: inicom buffers OK\r\n");
|
||||
|
||||
// Detect 16550 FIFO
|
||||
port->is16550 = (uint8_t)detect16550(port->baseAddr);
|
||||
dbgHex16("COMM.DRV: inicom is16550", (uint16_t)port->is16550);
|
||||
dbgHex16("KPCOMM: inicom is16550", (uint16_t)port->is16550);
|
||||
|
||||
// Hook ISR
|
||||
if (hookIsr(port) != 0) {
|
||||
dbgStr("COMM.DRV: inicom hookIsr FAIL\r\n");
|
||||
dbgStr("KPCOMM: inicom hookIsr FAIL\r\n");
|
||||
freeBuffers(port);
|
||||
return IE_HARDWARE;
|
||||
}
|
||||
dbgStr("COMM.DRV: inicom ISR hooked\r\n");
|
||||
dbgStr("KPCOMM: inicom ISR hooked\r\n");
|
||||
|
||||
port->isOpen = TRUE;
|
||||
|
||||
|
|
@ -956,7 +956,7 @@ int16_t FAR PASCAL _export inicom(DCB FAR *dcb)
|
|||
// Enable receive and line status interrupts
|
||||
_outp(port->baseAddr + UART_IER, IER_RDA | IER_LSI | IER_MSI);
|
||||
|
||||
dbgInt16("COMM.DRV: inicom OK, ret", commId);
|
||||
dbgInt16("KPCOMM: inicom OK, ret", commId);
|
||||
return commId;
|
||||
}
|
||||
|
||||
|
|
@ -1109,7 +1109,7 @@ void FAR PASCAL _export reactivateOpenCommPorts(void)
|
|||
PortStateT *port;
|
||||
uint8_t mcr;
|
||||
|
||||
dbgStr("COMM.DRV: reactivate\r\n");
|
||||
dbgStr("KPCOMM: reactivate\r\n");
|
||||
|
||||
for (i = 0; i < MAX_PORTS; i++) {
|
||||
port = &ports[i];
|
||||
|
|
@ -1151,7 +1151,7 @@ void FAR PASCAL _export reactivateOpenCommPorts(void)
|
|||
// -----------------------------------------------------------------------
|
||||
int16_t FAR PASCAL _export readCommString(int16_t commId, void FAR *buf, int16_t len)
|
||||
{
|
||||
dbgInt16("COMM.DRV: readCommStr Id", commId);
|
||||
dbgInt16("KPCOMM: readCommStr Id", commId);
|
||||
return reccom(commId, buf, len);
|
||||
}
|
||||
|
||||
|
|
@ -1242,7 +1242,7 @@ int16_t FAR PASCAL _export reccom(int16_t commId, void FAR *buf, int16_t len)
|
|||
uint8_t FAR *dst;
|
||||
int16_t bytesRead;
|
||||
|
||||
dbgInt16("COMM.DRV: reccom Id", commId);
|
||||
dbgInt16("KPCOMM: reccom Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return -1;
|
||||
|
|
@ -1302,28 +1302,28 @@ int16_t FAR PASCAL _export setcom(DCB FAR *dcb)
|
|||
int16_t commId;
|
||||
PortStateT *port;
|
||||
|
||||
dbgStr("COMM.DRV: setcom enter\r\n");
|
||||
dbgStr("KPCOMM: setcom enter\r\n");
|
||||
|
||||
if (!dcb) {
|
||||
dbgStr("COMM.DRV: setcom NULL dcb\r\n");
|
||||
dbgStr("KPCOMM: setcom NULL dcb\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
commId = dcb->Id;
|
||||
dbgInt16("COMM.DRV: setcom Id", commId);
|
||||
dbgHex16("COMM.DRV: setcom BaudRate", dcb->BaudRate);
|
||||
dbgHex16("COMM.DRV: setcom ByteSize", (uint16_t)dcb->ByteSize);
|
||||
dbgHex16("COMM.DRV: setcom Parity", (uint16_t)dcb->Parity);
|
||||
dbgHex16("COMM.DRV: setcom StopBits", (uint16_t)dcb->StopBits);
|
||||
dbgInt16("KPCOMM: setcom Id", commId);
|
||||
dbgHex16("KPCOMM: setcom BaudRate", dcb->BaudRate);
|
||||
dbgHex16("KPCOMM: setcom ByteSize", (uint16_t)dcb->ByteSize);
|
||||
dbgHex16("KPCOMM: setcom Parity", (uint16_t)dcb->Parity);
|
||||
dbgHex16("KPCOMM: setcom StopBits", (uint16_t)dcb->StopBits);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
dbgStr("COMM.DRV: setcom IE_BADID\r\n");
|
||||
dbgStr("KPCOMM: setcom IE_BADID\r\n");
|
||||
return IE_BADID;
|
||||
}
|
||||
|
||||
port = &ports[commId];
|
||||
if (!port->isOpen) {
|
||||
dbgStr("COMM.DRV: setcom port not open\r\n");
|
||||
dbgStr("KPCOMM: setcom port not open\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1359,7 +1359,7 @@ int16_t FAR PASCAL _export setcom(DCB FAR *dcb)
|
|||
|
||||
_enable();
|
||||
|
||||
dbgStr("COMM.DRV: setcom OK\r\n");
|
||||
dbgStr("KPCOMM: setcom OK\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1374,18 +1374,18 @@ int16_t FAR PASCAL _export setque(int16_t commId, int16_t rxSz, int16_t txSz)
|
|||
{
|
||||
PortStateT *port;
|
||||
|
||||
dbgInt16("COMM.DRV: setque Id", commId);
|
||||
dbgInt16("COMM.DRV: setque rxSz", rxSz);
|
||||
dbgInt16("COMM.DRV: setque txSz", txSz);
|
||||
dbgInt16("KPCOMM: setque Id", commId);
|
||||
dbgInt16("KPCOMM: setque rxSz", rxSz);
|
||||
dbgInt16("KPCOMM: setque txSz", txSz);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
dbgStr("COMM.DRV: setque bad id\r\n");
|
||||
dbgStr("KPCOMM: setque bad id\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
port = &ports[commId];
|
||||
if (!port->isOpen) {
|
||||
dbgStr("COMM.DRV: setque port not open\r\n");
|
||||
dbgStr("KPCOMM: setque port not open\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1393,7 +1393,7 @@ int16_t FAR PASCAL _export setque(int16_t commId, int16_t rxSz, int16_t txSz)
|
|||
freeBuffers(port);
|
||||
if (initBuffers(port, (uint16_t)rxSz, (uint16_t)txSz) != 0) {
|
||||
_enable();
|
||||
dbgStr("COMM.DRV: setque IE_MEMORY\r\n");
|
||||
dbgStr("KPCOMM: setque IE_MEMORY\r\n");
|
||||
return IE_MEMORY;
|
||||
}
|
||||
// Sync ComDEB queue sizes
|
||||
|
|
@ -1407,7 +1407,7 @@ int16_t FAR PASCAL _export setque(int16_t commId, int16_t rxSz, int16_t txSz)
|
|||
port->comDeb.qOutTail = 0;
|
||||
_enable();
|
||||
|
||||
dbgStr("COMM.DRV: setque OK\r\n");
|
||||
dbgStr("KPCOMM: setque OK\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1424,7 +1424,7 @@ int16_t FAR PASCAL _export sndcom(int16_t commId, void FAR *buf, int16_t len)
|
|||
uint8_t FAR *src;
|
||||
int16_t bytesWritten;
|
||||
|
||||
dbgInt16("COMM.DRV: sndcom Id", commId);
|
||||
dbgInt16("KPCOMM: sndcom Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return -1;
|
||||
|
|
@ -1479,16 +1479,16 @@ int16_t FAR PASCAL _export stacom(int16_t commId, COMSTAT FAR *stat)
|
|||
PortStateT *port;
|
||||
int16_t errors;
|
||||
|
||||
dbgInt16("COMM.DRV: stacom Id", commId);
|
||||
dbgInt16("KPCOMM: stacom Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
dbgStr("COMM.DRV: stacom bad id\r\n");
|
||||
dbgStr("KPCOMM: stacom bad id\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
port = &ports[commId];
|
||||
if (!port->isOpen) {
|
||||
dbgStr("COMM.DRV: stacom not open\r\n");
|
||||
dbgStr("KPCOMM: stacom not open\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1506,7 +1506,7 @@ int16_t FAR PASCAL _export stacom(int16_t commId, COMSTAT FAR *stat)
|
|||
stat->cbOutQue = port->txCount;
|
||||
}
|
||||
|
||||
dbgHex16("COMM.DRV: stacom errors", (uint16_t)errors);
|
||||
dbgHex16("KPCOMM: stacom errors", (uint16_t)errors);
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
|
@ -1522,7 +1522,7 @@ void FAR PASCAL _export suspendOpenCommPorts(void)
|
|||
int16_t i;
|
||||
PortStateT *port;
|
||||
|
||||
dbgStr("COMM.DRV: suspend\r\n");
|
||||
dbgStr("KPCOMM: suspend\r\n");
|
||||
|
||||
for (i = 0; i < MAX_PORTS; i++) {
|
||||
port = &ports[i];
|
||||
|
|
@ -1553,7 +1553,7 @@ int16_t FAR PASCAL _export trmcom(int16_t commId)
|
|||
{
|
||||
PortStateT *port;
|
||||
|
||||
dbgInt16("COMM.DRV: trmcom Id", commId);
|
||||
dbgInt16("KPCOMM: trmcom Id", commId);
|
||||
|
||||
if (commId < 0 || commId >= MAX_PORTS) {
|
||||
return -1;
|
||||
|
|
@ -1561,7 +1561,7 @@ int16_t FAR PASCAL _export trmcom(int16_t commId)
|
|||
|
||||
port = &ports[commId];
|
||||
if (!port->isOpen) {
|
||||
dbgStr("COMM.DRV: trmcom port not open\r\n");
|
||||
dbgStr("KPCOMM: trmcom port not open\r\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1587,8 +1587,8 @@ int16_t FAR PASCAL _export trmcom(int16_t commId)
|
|||
|
||||
port->isOpen = FALSE;
|
||||
|
||||
dbgHex16("COMM.DRV: trmcom isrHits", isrHitCount);
|
||||
dbgStr("COMM.DRV: trmcom OK\r\n");
|
||||
dbgHex16("KPCOMM: trmcom isrHits", isrHitCount);
|
||||
dbgStr("KPCOMM: trmcom OK\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1605,7 +1605,7 @@ int FAR PASCAL LibMain(HANDLE hInstance, WORD wDataSeg, WORD wHeapSize, LPSTR lp
|
|||
|
||||
ghInstance = hInstance;
|
||||
|
||||
dbgStr("COMM.DRV: LibMain\r\n");
|
||||
dbgStr("KPCOMM: LibMain\r\n");
|
||||
|
||||
if (wHeapSize > 0) {
|
||||
UnlockData(0);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
LIBRARY COMM
|
||||
DESCRIPTION 'High-Speed Serial Communications Driver'
|
||||
DESCRIPTION 'KPCOMM -- High-Speed Serial Communications Driver'
|
||||
EXETYPE WINDOWS
|
||||
CODE PRELOAD FIXED
|
||||
DATA PRELOAD FIXED SINGLE
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// commdrv.h - High-speed COMM.DRV replacement
|
||||
// commdrv.h - KPCOMM.DRV -- High-speed COMM.DRV replacement
|
||||
//
|
||||
// Types, UART register definitions, port state structure, and prototypes.
|
||||
// Drop-in replacement for Windows 3.1 stock COMM.DRV with proper 16550
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// isr.c - Interrupt service routines for COMM.DRV replacement
|
||||
// isr.c - Interrupt service routines for KPCOMM.DRV
|
||||
//
|
||||
// ISR entry points for IRQ3 (COM2/4) and IRQ4 (COM1/3), DPMI interrupt
|
||||
// vector hooking/unhooking, and interrupt dispatch with 16550 FIFO support.
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
# Prerequisites:
|
||||
# - MSVC 1.52 (cl, link in PATH)
|
||||
#
|
||||
# Output is COMM.DRV -- drop-in replacement for stock Windows 3.1 driver.
|
||||
# Output is KPCOMM.DRV -- drop-in replacement for stock Windows 3.1 driver.
|
||||
#
|
||||
# Install:
|
||||
# 1. Copy COMM.DRV to \WINDOWS\SYSTEM
|
||||
# 2. Edit SYSTEM.INI [boot] section: comm.drv=comm.drv
|
||||
# 1. Copy KPCOMM.DRV to \WINDOWS\SYSTEM
|
||||
# 2. Edit SYSTEM.INI [boot] section: comm.drv=kpcomm.drv
|
||||
# 3. Add to [386Enh] section: COM1FIFO=1 (for each port in use)
|
||||
# 4. Restart Windows
|
||||
#
|
||||
|
|
@ -44,7 +44,7 @@ LFLAGS = /NOD /NOE /AL:16
|
|||
LIBS = sdllcew libw
|
||||
|
||||
# Output
|
||||
TARGET = comm.drv
|
||||
TARGET = kpcomm.drv
|
||||
|
||||
# Objects
|
||||
OBJS = commdrv.obj isr.obj
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue