PRB:Status Error Bit Ignored by Windows 95 Serial Port Driver

Last reviewed: April 7, 1997
Article ID: Q138895
4.00 WINDOWS kbprg

The information in this article applies to:

  • Microsoft Win32 Device Development Kit (DDK) for Windows 95, version 4.00

SYMPTOMS

Under certain rare conditions, the overrun (OR) error, framing error (FE), and parity error (PE) status error bits are momentarily ignored in the Microsoft Windows 95 serial port driver, Serial.vxd. This behavior only affects users expecting "bursts" or packets of information coming into the serial COM ports.

If you are using the standard error reporting simply to notify the user in standard applications, this behavior will probably not affect you.

CAUSE

The bits affected are in the LSR (line status register) in the serial chip. When the Serial.vxd driver determines that data is available and there are currently no errors, it enters a loop clearing the FIFO (first in, first out) buffer. This is a very fast loop which only needs to read a minimum of two bytes or a maximum of seventeen bytes to clear the hardware buffer depending on the type of chip in use. Remember, worst case, one last byte may be clocking in while you are reading another byte. It is assumed that the loop time is easily fast enough to complete before subsequent incoming bytes are ready to be read.

To check for remaining byte(s), the loop reads the LSR, which contains the DR (data ready) bit. The remaining bits are ignored. However, reading the LSR, clears the OR, FE, and PE error bits.

If an error occurs in the brief time on the way to this loop, it is ignored and cleared. There are two cases where this might be a problem if the FIFO triggering is set to the maximum, or if an 8250-style chip is being used. One case occurs during a high speed continuous data transfer just bordering on overrun, where the very first error must be flagged immediately. The other case involves a high speed burst or packet of data, again bordering on overrun where the error occurs just at the end of the transfer so that the one and only error might be missed occasionally.

As you would expect, applications handling any sort of continuing data, not in a burst, quickly get subsequent error codes being reported. Any condition, such as overrun still continues to cause ongoing errors, and at the user level, it is noted by an application.

RESOLUTION

Either of the following steps can be used to correct this behavior:

- If you are using the maximum FIFO setting, reduce it to give headroom to

  avoid overrun error possibilities. This relates specifically to overrun,
  not parity or framing errors.

  -or-

- There is currently no fix or patch available to correct this behavior.
  However, you can write your own version of the device driver that
  corrects this problem, after inspecting the Serial example supplied on
  the Win32 DDK compact disc. In the supplied public Win32 DDK sample, look
  in Serial.asm, and search for the data_availxx: labels to find the data
  reading loop. To correct this behavior, add a save location to place the
  LSR in before masking to get to the DR bit in a similar loop.

REFERENCES

Intel product specification #231658-005 ISBN 1-55512-090-3, pages 2-26 - 2-79.


KBCategory: kbprg
KBSubcategory: NTDdkComm
Additional reference words: 95 Windows Bug Serial COMM win95
Keywords : kbprg NTDDKComm
Version : 4.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 7, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.