ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

VOID NTAPI SerialReceiveByte ( IN PKDPC  Dpc,
IN PVOID  pDeviceExtension,
IN PVOID  Unused1,
IN PVOID  Unused2 
)

Definition at line 68 of file misc.c.

Referenced by SerialAddDeviceInternal().

{
    PSERIAL_DEVICE_EXTENSION DeviceExtension;
    PUCHAR ComPortBase;
    UCHAR Byte;
    KIRQL Irql;
    UCHAR IER;
    NTSTATUS Status;

    DeviceExtension = (PSERIAL_DEVICE_EXTENSION)pDeviceExtension;
    ComPortBase = ULongToPtr(DeviceExtension->BaseAddress);

    KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql);
    while (READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_DATA_RECEIVED)
    {
        Byte = READ_PORT_UCHAR(SER_RBR(ComPortBase));
        INFO_(SERIAL, "Byte received on COM%lu: 0x%02x\n",
            DeviceExtension->ComPort, Byte);
        Status = PushCircularBufferEntry(&DeviceExtension->InputBuffer, Byte);
        if (NT_SUCCESS(Status))
            DeviceExtension->SerialPerfStats.ReceivedCount++;
        else
            DeviceExtension->SerialPerfStats.BufferOverrunErrorCount++;
    }
    KeSetEvent(&DeviceExtension->InputBufferNotEmpty, 0, FALSE);
    KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);

    /* allow new interrupts */
    IER = READ_PORT_UCHAR(SER_IER(ComPortBase));
    WRITE_PORT_UCHAR(SER_IER(ComPortBase), IER | SR_IER_DATA_RECEIVED);
}

Generated on Fri May 25 2012 04:46:01 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.