remove whitespace from end of lines
authorSteven Edwards <winehacker@gmail.com>
Sun, 8 May 2005 02:16:32 +0000 (02:16 +0000)
committerSteven Edwards <winehacker@gmail.com>
Sun, 8 May 2005 02:16:32 +0000 (02:16 +0000)
svn path=/trunk/; revision=15108

388 files changed:
reactos/drivers/bus/acpi/ospm/acpisys.c
reactos/drivers/bus/acpi/ospm/bn.c
reactos/drivers/bus/acpi/ospm/busmgr/bm.c
reactos/drivers/bus/acpi/ospm/busmgr/bmnotify.c
reactos/drivers/bus/acpi/ospm/busmgr/bmpm.c
reactos/drivers/bus/acpi/ospm/busmgr/bmpower.c
reactos/drivers/bus/acpi/ospm/busmgr/bmrequest.c
reactos/drivers/bus/acpi/ospm/busmgr/bmsearch.c
reactos/drivers/bus/acpi/ospm/busmgr/bmutils.c
reactos/drivers/bus/acpi/ospm/busmgr/bmxface.c
reactos/drivers/bus/acpi/ospm/fdo.c
reactos/drivers/bus/acpi/ospm/include/bm.h
reactos/drivers/bus/acpi/ospm/include/bn.h
reactos/drivers/bus/acpi/ospm/osl.c
reactos/drivers/bus/acpi/ospm/pdo.c
reactos/drivers/bus/isapnp/isapnp.c
reactos/drivers/bus/pci/fdo.c
reactos/drivers/bus/pci/pci.c
reactos/drivers/bus/pci/pcidef.h
reactos/drivers/bus/pci/pdo.c
reactos/drivers/bus/serenum/detect.c
reactos/drivers/bus/serenum/fdo.c
reactos/drivers/bus/serenum/misc.c
reactos/drivers/bus/serenum/pdo.c
reactos/drivers/bus/serenum/serenum.c
reactos/drivers/bus/serenum/serenum.h
reactos/drivers/dd/blue/blue.c
reactos/drivers/dd/bootvid/bootvid.c
reactos/drivers/dd/bootvid/bootvid.h
reactos/drivers/dd/debugout/debugout.c
reactos/drivers/dd/green/createclose.c
reactos/drivers/dd/green/dispatch.c
reactos/drivers/dd/green/green.c
reactos/drivers/dd/green/green.h
reactos/drivers/dd/green/keyboard.c
reactos/drivers/dd/green/misc.c
reactos/drivers/dd/green/pnp.c
reactos/drivers/dd/green/screen.c
reactos/drivers/dd/mpu401/mpu401.c
reactos/drivers/dd/mpu401/portio.c
reactos/drivers/dd/null/null.c
reactos/drivers/dd/parallel/parallel.c
reactos/drivers/dd/parallel/parallel.h
reactos/drivers/dd/ramdrv/ramdrv.c
reactos/drivers/dd/serial/circularbuffer.c
reactos/drivers/dd/serial/cleanup.c
reactos/drivers/dd/serial/close.c
reactos/drivers/dd/serial/create.c
reactos/drivers/dd/serial/devctrl.c
reactos/drivers/dd/serial/info.c
reactos/drivers/dd/serial/legacy.c
reactos/drivers/dd/serial/misc.c
reactos/drivers/dd/serial/pnp.c
reactos/drivers/dd/serial/power.c
reactos/drivers/dd/serial/rw.c
reactos/drivers/dd/serial/serial.c
reactos/drivers/dd/serial/serial.h
reactos/drivers/dd/sndblst/portio.c
reactos/drivers/dd/sndblst/sndblst.c
reactos/drivers/dd/sound/dsp.c
reactos/drivers/dd/sound/mixer.c
reactos/drivers/dd/sound/sb16.c
reactos/drivers/dd/sound/sb16.h
reactos/drivers/dd/sound/sound.c
reactos/drivers/dd/sound/wave.c
reactos/drivers/dd/sound/wave.h
reactos/drivers/dd/test/test.c
reactos/drivers/fs/cdfs/cdfs.c
reactos/drivers/fs/cdfs/cleanup.c
reactos/drivers/fs/cdfs/close.c
reactos/drivers/fs/cdfs/common.c
reactos/drivers/fs/cdfs/create.c
reactos/drivers/fs/cdfs/dirctl.c
reactos/drivers/fs/cdfs/fcb.c
reactos/drivers/fs/cdfs/finfo.c
reactos/drivers/fs/cdfs/fsctl.c
reactos/drivers/fs/cdfs/misc.c
reactos/drivers/fs/cdfs/rw.c
reactos/drivers/fs/ext2/attr.c
reactos/drivers/fs/ext2/blockdev.c
reactos/drivers/fs/ext2/dir.c
reactos/drivers/fs/ext2/ext2fs.h
reactos/drivers/fs/ext2/file.c
reactos/drivers/fs/ext2/inode.c
reactos/drivers/fs/ext2/quota.c
reactos/drivers/fs/ext2/rw.c
reactos/drivers/fs/ext2/security.c
reactos/drivers/fs/ext2/super.c
reactos/drivers/fs/fs_rec/fat.c
reactos/drivers/fs/minix/bitops.c
reactos/drivers/fs/minix/block.c
reactos/drivers/fs/minix/blockdev.c
reactos/drivers/fs/minix/cache.c
reactos/drivers/fs/minix/dir.c
reactos/drivers/fs/minix/inode.c
reactos/drivers/fs/minix/minix.h
reactos/drivers/fs/minix/mount.c
reactos/drivers/fs/minix/rw.c
reactos/drivers/fs/ms/create.c
reactos/drivers/fs/ms/finfo.c
reactos/drivers/fs/ms/fsctrl.c
reactos/drivers/fs/ms/msfs.c
reactos/drivers/fs/ms/rw.c
reactos/drivers/fs/np/create.c
reactos/drivers/fs/np/finfo.c
reactos/drivers/fs/np/fsctrl.c
reactos/drivers/fs/np/npfs.c
reactos/drivers/fs/np/rw.c
reactos/drivers/fs/ntfs/attrib.c
reactos/drivers/fs/ntfs/close.c
reactos/drivers/fs/ntfs/dirctl.c
reactos/drivers/fs/ntfs/fcb.c
reactos/drivers/fs/ntfs/finfo.c
reactos/drivers/fs/ntfs/fsctl.c
reactos/drivers/fs/ntfs/linux-ntfs/aops.c
reactos/drivers/fs/ntfs/linux-ntfs/attrib.c
reactos/drivers/fs/ntfs/linux-ntfs/attrib.h
reactos/drivers/fs/ntfs/linux-ntfs/compress.c
reactos/drivers/fs/ntfs/linux-ntfs/debug.c
reactos/drivers/fs/ntfs/linux-ntfs/debug.h
reactos/drivers/fs/ntfs/linux-ntfs/dir.c
reactos/drivers/fs/ntfs/linux-ntfs/dir.h
reactos/drivers/fs/ntfs/linux-ntfs/endian.h
reactos/drivers/fs/ntfs/linux-ntfs/file.c
reactos/drivers/fs/ntfs/linux-ntfs/inode.c
reactos/drivers/fs/ntfs/linux-ntfs/inode.h
reactos/drivers/fs/ntfs/linux-ntfs/layout.h
reactos/drivers/fs/ntfs/linux-ntfs/malloc.h
reactos/drivers/fs/ntfs/linux-ntfs/mft.c
reactos/drivers/fs/ntfs/linux-ntfs/mft.h
reactos/drivers/fs/ntfs/linux-ntfs/mst.c
reactos/drivers/fs/ntfs/linux-ntfs/namei.c
reactos/drivers/fs/ntfs/linux-ntfs/ntfs.h
reactos/drivers/fs/ntfs/linux-ntfs/super.c
reactos/drivers/fs/ntfs/linux-ntfs/sysctl.c
reactos/drivers/fs/ntfs/linux-ntfs/sysctl.h
reactos/drivers/fs/ntfs/linux-ntfs/time.c
reactos/drivers/fs/ntfs/linux-ntfs/types.h
reactos/drivers/fs/ntfs/linux-ntfs/unistr.c
reactos/drivers/fs/ntfs/linux-ntfs/volume.h
reactos/drivers/fs/ntfs/mft.c
reactos/drivers/fs/ntfs/ntfs.h
reactos/drivers/fs/ntfs/rw.c
reactos/drivers/fs/template/template.c
reactos/drivers/fs/vfat/blockdev.c
reactos/drivers/fs/vfat/cleanup.c
reactos/drivers/fs/vfat/close.c
reactos/drivers/fs/vfat/create.c
reactos/drivers/fs/vfat/dir.c
reactos/drivers/fs/vfat/direntry.c
reactos/drivers/fs/vfat/dirwr.c
reactos/drivers/fs/vfat/ea.c
reactos/drivers/fs/vfat/fcb.c
reactos/drivers/fs/vfat/finfo.c
reactos/drivers/fs/vfat/flush.c
reactos/drivers/fs/vfat/fsctl.c
reactos/drivers/fs/vfat/iface.c
reactos/drivers/fs/vfat/misc.c
reactos/drivers/fs/vfat/rw.c
reactos/drivers/fs/vfat/shutdown.c
reactos/drivers/fs/vfat/string.c
reactos/drivers/fs/vfat/vfat.h
reactos/drivers/fs/vfat/volume.c
reactos/drivers/input/i8042prt/i8042prt.c
reactos/drivers/input/i8042prt/i8042prt.h
reactos/drivers/input/i8042prt/keyboard.c
reactos/drivers/input/i8042prt/mouse.c
reactos/drivers/input/i8042prt/ps2pp.c
reactos/drivers/input/i8042prt/registry.c
reactos/drivers/input/kbdclass/kbdclass.c
reactos/drivers/input/mouclass/mouclass.c
reactos/drivers/input/sermouse/sermouse.c
reactos/drivers/lib/bzip2/blocksort.c
reactos/drivers/lib/bzip2/bzip2.c
reactos/drivers/lib/bzip2/bzip2recover.c
reactos/drivers/lib/bzip2/bzlib.c
reactos/drivers/lib/bzip2/bzlib.h
reactos/drivers/lib/bzip2/bzlib_private.h
reactos/drivers/lib/bzip2/compress.c
reactos/drivers/lib/bzip2/crctable.c
reactos/drivers/lib/bzip2/decompress.c
reactos/drivers/lib/bzip2/dlltest.c
reactos/drivers/lib/bzip2/huffman.c
reactos/drivers/lib/bzip2/randtable.c
reactos/drivers/lib/bzip2/spewG.c
reactos/drivers/lib/bzip2/unzcrash.c
reactos/drivers/lib/csq/csq.c
reactos/drivers/lib/ip/network/address.c
reactos/drivers/lib/ip/network/arp.c
reactos/drivers/lib/ip/network/icmp.c
reactos/drivers/lib/ip/network/interface.c
reactos/drivers/lib/ip/network/ip.c
reactos/drivers/lib/ip/network/loopback.c
reactos/drivers/lib/ip/network/memtrack.c
reactos/drivers/lib/ip/network/neighbor.c
reactos/drivers/lib/ip/network/ports.c
reactos/drivers/lib/ip/network/receive.c
reactos/drivers/lib/ip/network/router.c
reactos/drivers/lib/ip/network/transmit.c
reactos/drivers/lib/ip/transport/datagram/datagram.c
reactos/drivers/lib/ip/transport/rawip/rawip.c
reactos/drivers/lib/ip/transport/tcp/accept.c
reactos/drivers/lib/ip/transport/tcp/event.c
reactos/drivers/lib/ip/transport/tcp/if.c
reactos/drivers/lib/ip/transport/tcp/tcp.c
reactos/drivers/lib/ip/transport/udp/udp.c
reactos/drivers/lib/oskittcp/include/freebsd/dev/include/vm/vm.h
reactos/drivers/lib/oskittcp/include/freebsd/dev/include/vm/vm_param.h
reactos/drivers/lib/oskittcp/include/freebsd/src/sys/machine/cpufunc.h
reactos/drivers/lib/oskittcp/include/freebsd/src/sys/machine/spl.h
reactos/drivers/lib/oskittcp/include/freebsd/src/sys/netinet/ip_fw.h
reactos/drivers/lib/oskittcp/include/freebsd/src/sys/netinet/ip_var.h
reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/mbuf.h
reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/proc.h
reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/queue.h
reactos/drivers/lib/oskittcp/include/memtrack.h
reactos/drivers/lib/oskittcp/include/oskittcp.h
reactos/drivers/lib/oskittcp/oskittcp/defaults.c
reactos/drivers/lib/oskittcp/oskittcp/in_pcb.c
reactos/drivers/lib/oskittcp/oskittcp/in_proto.c
reactos/drivers/lib/oskittcp/oskittcp/interface.c
reactos/drivers/lib/oskittcp/oskittcp/ip_output.c
reactos/drivers/lib/oskittcp/oskittcp/kern_clock.c
reactos/drivers/lib/oskittcp/oskittcp/param.c
reactos/drivers/lib/oskittcp/oskittcp/raw_ip.c
reactos/drivers/lib/oskittcp/oskittcp/route.c
reactos/drivers/lib/oskittcp/oskittcp/sleep.c
reactos/drivers/lib/oskittcp/oskittcp/tcp_input.c
reactos/drivers/lib/oskittcp/oskittcp/tcp_output.c
reactos/drivers/lib/oskittcp/oskittcp/uipc_mbuf.c
reactos/drivers/lib/oskittcp/oskittcp/uipc_socket.c
reactos/drivers/lib/oskittcp/oskittcp/uipc_socket2.c
reactos/drivers/lib/undis/ndis/compat.c
reactos/drivers/net/afd/afd/bind.c
reactos/drivers/net/afd/afd/connect.c
reactos/drivers/net/afd/afd/context.c
reactos/drivers/net/afd/afd/event.c
reactos/drivers/net/afd/afd/info.c
reactos/drivers/net/afd/afd/listen.c
reactos/drivers/net/afd/afd/lock.c
reactos/drivers/net/afd/afd/main.c
reactos/drivers/net/afd/afd/read.c
reactos/drivers/net/afd/afd/select.c
reactos/drivers/net/afd/afd/tdi.c
reactos/drivers/net/afd/afd/tdiconn.c
reactos/drivers/net/afd/afd/write.c
reactos/drivers/net/afd/include/afd.h
reactos/drivers/net/afd/include/tdiconn.h
reactos/drivers/net/dd/ne2000/ne2000/8390.c
reactos/drivers/net/dd/ne2000/ne2000/main.c
reactos/drivers/net/dd/pcnet/pcnet.c
reactos/drivers/net/dd/pcnet/pcnet.h
reactos/drivers/net/dd/pcnet/requests.c
reactos/drivers/net/lan/lan/lan.c
reactos/drivers/net/lan/lan/routines.c
reactos/drivers/net/ndis/include/miniport.h
reactos/drivers/net/ndis/ndis/buffer.c
reactos/drivers/net/ndis/ndis/cl.c
reactos/drivers/net/ndis/ndis/co.c
reactos/drivers/net/ndis/ndis/config.c
reactos/drivers/net/ndis/ndis/efilter.c
reactos/drivers/net/ndis/ndis/hardware.c
reactos/drivers/net/ndis/ndis/io.c
reactos/drivers/net/ndis/ndis/main.c
reactos/drivers/net/ndis/ndis/memory.c
reactos/drivers/net/ndis/ndis/miniport.c
reactos/drivers/net/ndis/ndis/protocol.c
reactos/drivers/net/ndis/ndis/string.c
reactos/drivers/net/ndis/ndis/stubs.c
reactos/drivers/net/npf/bucket_lookup.c
reactos/drivers/net/npf/count_packets.c
reactos/drivers/net/npf/dump.c
reactos/drivers/net/npf/functions.c
reactos/drivers/net/npf/jitter.c
reactos/drivers/net/npf/jitter.h
reactos/drivers/net/npf/memory_t.h
reactos/drivers/net/npf/normal_lookup.c
reactos/drivers/net/npf/normal_lookup.h
reactos/drivers/net/npf/openclos.c
reactos/drivers/net/npf/packet.c
reactos/drivers/net/npf/packet.h
reactos/drivers/net/npf/read.c
reactos/drivers/net/npf/resource.h
reactos/drivers/net/npf/tcp_session.c
reactos/drivers/net/npf/time_calls.c
reactos/drivers/net/npf/time_calls.h
reactos/drivers/net/npf/tme.c
reactos/drivers/net/npf/tme.h
reactos/drivers/net/npf/win_bpf.h
reactos/drivers/net/npf/win_bpf_filter.c
reactos/drivers/net/npf/win_bpf_filter_init.c
reactos/drivers/net/npf/write.c
reactos/drivers/net/packet/bucket_lookup.c
reactos/drivers/net/packet/count_packets.c
reactos/drivers/net/packet/dump.c
reactos/drivers/net/packet/functions.c
reactos/drivers/net/packet/jitter.c
reactos/drivers/net/packet/jitter.h
reactos/drivers/net/packet/memory_t.h
reactos/drivers/net/packet/normal_lookup.c
reactos/drivers/net/packet/normal_lookup.h
reactos/drivers/net/packet/openclos.c
reactos/drivers/net/packet/packet.c
reactos/drivers/net/packet/packet.h
reactos/drivers/net/packet/read.c
reactos/drivers/net/packet/resource.h
reactos/drivers/net/packet/tcp_session.c
reactos/drivers/net/packet/time_calls.c
reactos/drivers/net/packet/time_calls.h
reactos/drivers/net/packet/tme.c
reactos/drivers/net/packet/tme.h
reactos/drivers/net/packet/win_bpf.h
reactos/drivers/net/packet/win_bpf_filter.c
reactos/drivers/net/packet/win_bpf_filter_init.c
reactos/drivers/net/packet/write.c
reactos/drivers/net/tcpip/datalink/lan.c
reactos/drivers/net/tcpip/include/info.h
reactos/drivers/net/tcpip/include/ip.h
reactos/drivers/net/tcpip/include/lan.h
reactos/drivers/net/tcpip/include/linux.h
reactos/drivers/net/tcpip/include/lock.h
reactos/drivers/net/tcpip/include/memtrack.h
reactos/drivers/net/tcpip/include/pool.h
reactos/drivers/net/tcpip/include/ports.h
reactos/drivers/net/tcpip/include/routines.h
reactos/drivers/net/tcpip/include/tcp.h
reactos/drivers/net/tcpip/include/tcpcore.h
reactos/drivers/net/tcpip/include/tcpdef.h
reactos/drivers/net/tcpip/include/tcpip.h
reactos/drivers/net/tcpip/include/titypes.h
reactos/drivers/net/tcpip/tcpip/buffer.c
reactos/drivers/net/tcpip/tcpip/dispatch.c
reactos/drivers/net/tcpip/tcpip/fileobjs.c
reactos/drivers/net/tcpip/tcpip/iinfo.c
reactos/drivers/net/tcpip/tcpip/info.c
reactos/drivers/net/tcpip/tcpip/main.c
reactos/drivers/net/tcpip/tcpip/mockbuffer.c
reactos/drivers/net/tcpip/tcpip/mockpool.c
reactos/drivers/net/tcpip/tcpip/ninfo.c
reactos/drivers/net/tcpip/tcpip/pool.c
reactos/drivers/net/tcpip/tcpip/tinfo.c
reactos/drivers/net/tdi/cte/string.c
reactos/drivers/net/tdi/cte/stubs.c
reactos/drivers/net/tdi/tdi/dereg.c
reactos/drivers/net/tdi/tdi/handler.c
reactos/drivers/net/tdi/tdi/stubs.c
reactos/drivers/net/tditest/tditest/tditest.c
reactos/drivers/storage/atapi/atapi.c
reactos/drivers/storage/atapi/atapi.h
reactos/drivers/storage/cdrom/cdrom.c
reactos/drivers/storage/class2/class2.c
reactos/drivers/storage/disk/disk.c
reactos/drivers/storage/diskdump/diskdump.c
reactos/drivers/storage/floppy/csqrtns.c
reactos/drivers/storage/floppy/csqrtns.h
reactos/drivers/storage/floppy/floppy.c
reactos/drivers/storage/floppy/floppy.h
reactos/drivers/storage/floppy/hardware.c
reactos/drivers/storage/floppy/hardware.h
reactos/drivers/storage/floppy/ioctl.c
reactos/drivers/storage/floppy/ioctl.h
reactos/drivers/storage/floppy/readwrite.c
reactos/drivers/storage/scsiport/scsiport.c
reactos/drivers/test/csqtest/csqtest.c
reactos/drivers/usb/cromwell/uhci/uhci-hcd.c
reactos/drivers/usb/cromwell/uhci/uhci-hcd.h
reactos/drivers/video/displays/framebuf/palette.c
reactos/drivers/video/displays/framebuf/pointer.c
reactos/drivers/video/displays/framebuf/screen.c
reactos/drivers/video/displays/vga/main/enable.c
reactos/drivers/video/displays/vga/objects/bitblt.c
reactos/drivers/video/displays/vga/objects/copybits.c
reactos/drivers/video/displays/vga/objects/pointer.c
reactos/drivers/video/displays/vga/vgavideo/vgavideo.c
reactos/drivers/video/miniport/vbe/vbemp.c
reactos/drivers/video/miniport/vbe/vbemp.h
reactos/drivers/video/miniport/vga/initvga.c
reactos/drivers/video/miniport/vga/vgamp.c
reactos/drivers/video/miniport/xboxvmp/xboxvmp.c
reactos/drivers/video/miniport/xboxvmp/xboxvmp.h
reactos/drivers/video/videoprt/dispatch.c
reactos/drivers/video/videoprt/dma.c
reactos/drivers/video/videoprt/event.c
reactos/drivers/video/videoprt/int10.c
reactos/drivers/video/videoprt/resource.c
reactos/drivers/video/videoprt/spinlock.c
reactos/drivers/video/videoprt/videoprt.c
reactos/drivers/video/videoprt/videoprt.h

index a6f5b65..2fac05b 100644 (file)
@@ -16,7 +16,7 @@
 
 #ifdef  ALLOC_PRAGMA
 
-// Make the initialization routines discardable, so that they 
+// Make the initialization routines discardable, so that they
 // don't waste space
 
 #pragma  alloc_text(init, DriverEntry)
@@ -27,8 +27,8 @@
 NTSTATUS
 STDCALL
 ACPIDispatchDeviceControl(
-  IN PDEVICE_OBJECT DeviceObject, 
-  IN PIRP Irp) 
+  IN PDEVICE_OBJECT DeviceObject,
+  IN PIRP Irp)
 {
   PIO_STACK_LOCATION IrpSp;
   NTSTATUS Status;
index eca4fb7..2995887 100644 (file)
@@ -176,7 +176,7 @@ bn_add_device(
         * -------------
         * Either fixed-feature or generic (namespace) types.
         */
-       if (strncmp(device->id.hid, BN_HID_POWER_BUTTON, 
+       if (strncmp(device->id.hid, BN_HID_POWER_BUTTON,
                sizeof(BM_DEVICE_HID)) == 0) {
 
                if (device->id.type == BM_TYPE_FIXED_BUTTON) {
@@ -185,7 +185,7 @@ bn_add_device(
 
                        /* Register for fixed-feature events. */
                        status = acpi_install_fixed_event_handler(
-                               ACPI_EVENT_POWER_BUTTON, bn_notify_fixed, 
+                               ACPI_EVENT_POWER_BUTTON, bn_notify_fixed,
                                (void*)button);
                }
                else {
@@ -201,7 +201,7 @@ bn_add_device(
         * -------------
         * Either fixed-feature or generic (namespace) types.
         */
-       else if (strncmp( device->id.hid, BN_HID_SLEEP_BUTTON, 
+       else if (strncmp( device->id.hid, BN_HID_SLEEP_BUTTON,
                sizeof(BM_DEVICE_HID)) == 0) {
 
                if (device->id.type == BM_TYPE_FIXED_BUTTON) {
@@ -210,7 +210,7 @@ bn_add_device(
 
                        /* Register for fixed-feature events. */
                        status = acpi_install_fixed_event_handler(
-                               ACPI_EVENT_SLEEP_BUTTON, bn_notify_fixed, 
+                               ACPI_EVENT_SLEEP_BUTTON, bn_notify_fixed,
                                (void*)button);
                }
                else {
@@ -224,7 +224,7 @@ bn_add_device(
         * LID Switch?
         * -----------
         */
-       else if (strncmp( device->id.hid, BN_HID_LID_SWITCH, 
+       else if (strncmp( device->id.hid, BN_HID_LID_SWITCH,
                sizeof(BM_DEVICE_HID)) == 0) {
 
                button->type = BN_TYPE_LID_SWITCH;
@@ -360,7 +360,7 @@ bn_initialize (void)
         */
        MEMCPY(criteria.hid, BN_HID_LID_SWITCH, sizeof(BN_HID_LID_SWITCH));
        status = bm_register_driver(&criteria, &driver);
-       
+
        if (status == AE_NOT_FOUND)
                status = AE_OK;
 
@@ -457,13 +457,13 @@ bn_notify_fixed (
 
        case BN_TYPE_POWER_BUTTON_FIXED:
                DEBUG_PRINT(ACPI_INFO, ("Fixed-feature button status change event detected.\n"));
-               /*bm_generate_event(button->device_handle, BN_PROC_ROOT, 
+               /*bm_generate_event(button->device_handle, BN_PROC_ROOT,
                        BN_PROC_POWER_BUTTON, BN_NOTIFY_STATUS_CHANGE, 0);*/
                break;
 
        case BN_TYPE_SLEEP_BUTTON_FIXED:
                DEBUG_PRINT(ACPI_INFO, ("Fixed-feature button status change event detected.\n"));
-               /*bm_generate_event(button->device_handle, BN_PROC_ROOT, 
+               /*bm_generate_event(button->device_handle, BN_PROC_ROOT,
                        BN_PROC_SLEEP_BUTTON, BN_NOTIFY_STATUS_CHANGE, 0);*/
                break;
 
@@ -507,11 +507,11 @@ bn_notify (
        case BM_NOTIFY_DEVICE_ADDED:
                status = bn_add_device(device_handle, context);
                break;
-               
+
        case BM_NOTIFY_DEVICE_REMOVED:
                status = bn_remove_device(context);
                break;
-               
+
        case BN_NOTIFY_STATUS_CHANGE:
                DEBUG_PRINT(ACPI_INFO, ("Button status change event detected.\n"));
 
@@ -525,7 +525,7 @@ bn_notify (
 
                case BN_TYPE_POWER_BUTTON:
                case BN_TYPE_POWER_BUTTON_FIXED:
-                       /*bm_generate_event(device_handle, BN_PROC_ROOT, 
+                       /*bm_generate_event(device_handle, BN_PROC_ROOT,
                                BN_PROC_POWER_BUTTON, notify_type, 0);*/
                        break;
 
index 5dc9cb2..2388744 100644 (file)
@@ -214,7 +214,7 @@ bm_get_status (
         * Evaluate _STA:
         * --------------
         */
-       status = bm_evaluate_simple_integer(device->acpi_handle, "_STA", 
+       status = bm_evaluate_simple_integer(device->acpi_handle, "_STA",
                &(device->status));
 
        return status;
@@ -263,12 +263,12 @@ bm_get_identification (
        }
 
        if (info.valid & ACPI_VALID_UID) {
-               MEMCPY((void*)device->id.uid, (void*)info.unique_id, 
+               MEMCPY((void*)device->id.uid, (void*)info.unique_id,
                        sizeof(BM_DEVICE_UID));
        }
 
        if (info.valid & ACPI_VALID_HID) {
-               MEMCPY((void*)device->id.hid, (void*)info.hardware_id, 
+               MEMCPY((void*)device->id.hid, (void*)info.hardware_id,
                        sizeof(BM_DEVICE_HID));
        }
 
@@ -311,7 +311,7 @@ bm_get_flags (
                /*
                 * Presence of _DCK indicates a docking station.
                 */
-               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, 
+               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle,
                        "_DCK", &acpi_handle))) {
                        device->flags |= BM_FLAGS_DOCKING_STATION;
                }
@@ -320,7 +320,7 @@ bm_get_flags (
                 * Presence of _EJD and/or _EJx indicates 'ejectable'.
                 * TODO: _EJx...
                 */
-               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, 
+               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle,
                        "_EJD", &acpi_handle))) {
                        device->flags |= BM_FLAGS_EJECTABLE;
                }
@@ -328,9 +328,9 @@ bm_get_flags (
                /*
                 * Presence of _PR0 or _PS0 indicates 'power manageable'.
                 */
-               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, 
+               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle,
                        "_PR0", &acpi_handle)) ||
-                       ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, 
+                       ACPI_SUCCESS(acpi_get_handle(device->acpi_handle,
                        "_PS0", &acpi_handle))) {
                        device->flags |= BM_FLAGS_POWER_CONTROL;
                }
@@ -338,7 +338,7 @@ bm_get_flags (
                /*
                 * Presence of _CRS indicates 'configurable'.
                 */
-               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, 
+               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle,
                        "_CRS", &acpi_handle))) {
                        device->flags |= BM_FLAGS_CONFIGURABLE;
                }
@@ -351,9 +351,9 @@ bm_get_flags (
                /*
                 * Presence of _HID or _ADR indicates 'identifiable'.
                 */
-               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, 
+               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle,
                        "_HID", &acpi_handle)) ||
-                  ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, 
+                  ACPI_SUCCESS(acpi_get_handle(device->acpi_handle,
                   "_ADR", &acpi_handle))) {
                        device->flags |= BM_FLAGS_IDENTIFIABLE;
                }
@@ -361,7 +361,7 @@ bm_get_flags (
                /*
                 * Presence of _STA indicates 'dynamic status'.
                 */
-               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, 
+               if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle,
                        "_STA", &acpi_handle))) {
                        device->flags |= BM_FLAGS_DYNAMIC_STATUS;
                }
@@ -428,7 +428,7 @@ bm_add_namespace_device (
        /*
         * Device Type:
         * ------------
-        */ 
+        */
        switch (acpi_type) {
        case INTERNAL_TYPE_SCOPE:
                device->id.type = BM_TYPE_SCOPE;
@@ -481,7 +481,7 @@ bm_add_namespace_device (
                /*
                 * Power Management:
                 * -----------------
-                * If this node doesn't provide direct power control  
+                * If this node doesn't provide direct power control
                 * then we inherit PM capabilities from its parent.
                 *
                 * TODO: Inherit!
@@ -572,8 +572,8 @@ bm_enumerate_namespace (void)
                if (ACPI_SUCCESS(status)) {
 
                        /*
-                        * TODO: This is a hack to get around the problem 
-                        *       identifying scope objects.  Scopes 
+                        * TODO: This is a hack to get around the problem
+                        *       identifying scope objects.  Scopes
                         *       somehow need to be uniquely identified.
                         */
                        status = acpi_get_type(child_handle, &acpi_type);
@@ -621,7 +621,7 @@ bm_enumerate_namespace (void)
                else {
                        level--;
                        child_handle = parent_handle;
-                       acpi_get_parent(parent_handle, 
+                       acpi_get_parent(parent_handle,
                                &parent_handle);
 
                        if (parent) {
@@ -683,7 +683,7 @@ bm_add_fixed_feature_device (
        node->device.acpi_handle = ACPI_ROOT_OBJECT;
        node->device.id.type = BM_TYPE_FIXED_BUTTON;
        if (device_hid) {
-               MEMCPY((void*)node->device.id.hid, device_hid, 
+               MEMCPY((void*)node->device.id.hid, device_hid,
                        sizeof(node->device.id.hid));
        }
        node->device.flags = BM_FLAGS_FIXED_FEATURE;
@@ -950,14 +950,14 @@ bm_initialize (void)
         */
        DEBUG_PRINT(ACPI_INFO, ("Registering for all device notifications.\n"));
 
-       status = acpi_install_notify_handler(ACPI_ROOT_OBJECT, 
+       status = acpi_install_notify_handler(ACPI_ROOT_OBJECT,
                ACPI_SYSTEM_NOTIFY, &bm_notify, NULL);
        if (ACPI_FAILURE(status)) {
                DEBUG_PRINT(ACPI_ERROR, ("Unable to register for standard notifications.\n"));
                return_ACPI_STATUS(status);
        }
 
-       status = acpi_install_notify_handler(ACPI_ROOT_OBJECT, 
+       status = acpi_install_notify_handler(ACPI_ROOT_OBJECT,
                ACPI_DEVICE_NOTIFY, &bm_notify, NULL);
        if (ACPI_FAILURE(status)) {
                DEBUG_PRINT(ACPI_ERROR, ("Unable to register for device-specific notifications.\n"));
@@ -1019,13 +1019,13 @@ bm_terminate (void)
 
        DEBUG_PRINT(ACPI_INFO, ("Unregistering for device notifications.\n"));
 
-       status = acpi_remove_notify_handler(ACPI_ROOT_OBJECT, 
+       status = acpi_remove_notify_handler(ACPI_ROOT_OBJECT,
                ACPI_SYSTEM_NOTIFY, &bm_notify);
        if (ACPI_FAILURE(status)) {
                DEBUG_PRINT(ACPI_ERROR, ("Unable to un-register for standard notifications.\n"));
        }
 
-       status = acpi_remove_notify_handler(ACPI_ROOT_OBJECT, 
+       status = acpi_remove_notify_handler(ACPI_ROOT_OBJECT,
                ACPI_DEVICE_NOTIFY, &bm_notify);
        if (ACPI_FAILURE(status)) {
                DEBUG_PRINT(ACPI_ERROR, ("Unable to un-register for device-specific notifications.\n"));
index c64d5d4..952dfcb 100644 (file)
@@ -63,13 +63,13 @@ bm_generate_notify (
 
        DEBUG_PRINT(ACPI_INFO, ("Sending notify [0x%02x] to device [0x%02x].\n", notify_type, node->device.handle));
 
-       if (!(node->device.flags & BM_FLAGS_DRIVER_CONTROL) || 
+       if (!(node->device.flags & BM_FLAGS_DRIVER_CONTROL) ||
                !(node->driver.notify)) {
                DEBUG_PRINT(ACPI_WARN, ("No driver installed for device [0x%02x].\n", node->device.handle));
                return_ACPI_STATUS(AE_NOT_EXIST);
        }
 
-       status = node->driver.notify(notify_type, node->device.handle, 
+       status = node->driver.notify(notify_type, node->device.handle,
                &(node->driver.context));
 
        return_ACPI_STATUS(status);
@@ -130,7 +130,7 @@ bm_device_check (
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
        }
-       
+
        if (old_status == node->device.status) {
                return_ACPI_STATUS(AE_OK);
        }
@@ -138,12 +138,12 @@ bm_device_check (
        if (status_change) {
                *status_change = TRUE;
        }
-       
+
        /*
         * Device Insertion?
         * -----------------
         */
-       if ((device->status & BM_STATUS_PRESENT) && 
+       if ((device->status & BM_STATUS_PRESENT) &&
                !(old_status & BM_STATUS_PRESENT)) {
                /* TODO: Make sure driver is loaded, and if not, load. */
                status = bm_generate_notify(node, BM_NOTIFY_DEVICE_ADDED);
@@ -153,7 +153,7 @@ bm_device_check (
         * Device Removal?
         * ---------------
         */
-       else if (!(device->status & BM_STATUS_PRESENT) && 
+       else if (!(device->status & BM_STATUS_PRESENT) &&
                (old_status & BM_STATUS_PRESENT)) {
                /* TODO: Unload driver if last device instance. */
                status = bm_generate_notify(node, BM_NOTIFY_DEVICE_REMOVED);
@@ -247,7 +247,7 @@ bm_notify (
        /*
         * Device-Specific or Standard?
         * ----------------------------
-        * Device-specific notifies are forwarded to the control module's 
+        * Device-specific notifies are forwarded to the control module's
         * notify() function for processing.  Standard notifies are handled
         * internally.
         */
index 336cb99..89d8add 100644 (file)
@@ -72,21 +72,21 @@ bm_get_inferred_power_state (
        /*
         * Calculate Power State:
         * ----------------------
-        * Try to infer the devices's power state by checking the state of 
-        * the devices's power resources.  We start by evaluating _PR0 
-        * (resource requirements at D0) and work through _PR1 and _PR2.  
-        * We know the current devices power state when all resources (for 
-        * a give Dx state) are ON.  If no power resources are on then the 
+        * Try to infer the devices's power state by checking the state of
+        * the devices's power resources.  We start by evaluating _PR0
+        * (resource requirements at D0) and work through _PR1 and _PR2.
+        * We know the current devices power state when all resources (for
+        * a give Dx state) are ON.  If no power resources are on then the
         * device is assumed to be off (D3).
         */
        for (i=ACPI_STATE_D0; i<ACPI_STATE_D3; i++) {
 
-               status = bm_evaluate_reference_list(device->acpi_handle, 
+               status = bm_evaluate_reference_list(device->acpi_handle,
                        object_name, &pr_list);
 
                if (ACPI_SUCCESS(status)) {
 
-                       status = bm_pr_list_get_state(&pr_list, 
+                       status = bm_pr_list_get_state(&pr_list,
                                &list_state);
 
                        if (ACPI_SUCCESS(status)) {
@@ -137,7 +137,7 @@ bm_get_power_state (
        device->power.state = ACPI_STATE_UNKNOWN;
 
        if (device->flags & BM_FLAGS_POWER_STATE) {
-               status = bm_evaluate_simple_integer(device->acpi_handle, 
+               status = bm_evaluate_simple_integer(device->acpi_handle,
                        "_PSC", &(device->power.state));
        }
        else {
@@ -204,24 +204,24 @@ bm_set_power_state (
        /*
         * Get Resources:
         * --------------
-        * Get the power resources associated with the device's current 
+        * Get the power resources associated with the device's current
         * and target power states.
         */
        if (device->power.state != ACPI_STATE_UNKNOWN) {
                object_name[3] = '0' + device->power.state;
-               bm_evaluate_reference_list(device->acpi_handle, 
+               bm_evaluate_reference_list(device->acpi_handle,
                        object_name, &current_list);
        }
 
        object_name[3] = '0' + state;
-       bm_evaluate_reference_list(device->acpi_handle, object_name, 
+       bm_evaluate_reference_list(device->acpi_handle, object_name,
                &target_list);
 
        /*
         * Transition Resources:
         * ---------------------
-        * Transition all power resources referenced by this device to 
-        * the correct power state (taking into consideration sequencing 
+        * Transition all power resources referenced by this device to
+        * the correct power state (taking into consideration sequencing
         * and dependencies to other devices).
         */
        if (current_list.count || target_list.count) {
@@ -234,7 +234,7 @@ bm_set_power_state (
        /*
         * Execute _PSx:
         * -------------
-        * Execute the _PSx method corresponding to the target Dx state, 
+        * Execute the _PSx method corresponding to the target Dx state,
         * if it exists.
         */
        object_name[2] = 'S';
@@ -287,17 +287,17 @@ bm_get_pm_capabilities (
         * Power Management Flags:
         * -----------------------
         */
-       if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PSC", 
+       if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PSC",
                &acpi_handle))) {
                device->power.flags |= BM_FLAGS_POWER_STATE;
        }
 
-       if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_IRC", 
+       if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_IRC",
                &acpi_handle))) {
                device->power.flags |= BM_FLAGS_INRUSH_CURRENT;
        }
 
-       if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PRW", 
+       if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PRW",
                &acpi_handle))) {
                device->power.flags |= BM_FLAGS_WAKE_CAPABLE;
        }
@@ -317,22 +317,22 @@ bm_get_pm_capabilities (
         * Figure out which Dx states are supported by this device for the
         * S0 (working) state.  Note that D0 and D3 are required (assumed).
         */
-       device->power.dx_supported[ACPI_STATE_S0] = BM_FLAGS_D0_SUPPORT | 
+       device->power.dx_supported[ACPI_STATE_S0] = BM_FLAGS_D0_SUPPORT |
                BM_FLAGS_D3_SUPPORT;
 
-       if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR1", 
-               &acpi_handle))) || 
-               (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS1", 
+       if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR1",
+               &acpi_handle))) ||
+               (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS1",
                &acpi_handle)))) {
-               device->power.dx_supported[ACPI_STATE_S0] |= 
+               device->power.dx_supported[ACPI_STATE_S0] |=
                        BM_FLAGS_D1_SUPPORT;
        }
 
-       if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR2", 
-               &acpi_handle))) || 
-               (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS2", 
+       if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR2",
+               &acpi_handle))) ||
+               (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS2",
                &acpi_handle)))) {
-               device->power.dx_supported[ACPI_STATE_S0] |= 
+               device->power.dx_supported[ACPI_STATE_S0] |=
                        BM_FLAGS_D2_SUPPORT;
        }
 
@@ -352,28 +352,28 @@ bm_get_pm_capabilities (
                /*
                 * Evalute _SxD:
                 * -------------
-                * Which returns the highest (power) Dx state supported in 
-                * this system (Sx) state.  We convert this value to a bit 
+                * Which returns the highest (power) Dx state supported in
+                * this system (Sx) state.  We convert this value to a bit
                 * mask of supported states (conceptually simpler).
                 */
-               status = bm_evaluate_simple_integer(device->acpi_handle, 
+               status = bm_evaluate_simple_integer(device->acpi_handle,
                        object_name, &dx_supported);
                if (ACPI_SUCCESS(status)) {
                        switch (dx_supported) {
                        case 0:
-                               device->power.dx_supported[i] |= 
+                               device->power.dx_supported[i] |=
                                        BM_FLAGS_D0_SUPPORT;
                                /* fall through */
                        case 1:
-                               device->power.dx_supported[i] |= 
+                               device->power.dx_supported[i] |=
                                        BM_FLAGS_D1_SUPPORT;
                                /* fall through */
                        case 2:
-                               device->power.dx_supported[i] |= 
+                               device->power.dx_supported[i] |=
                                        BM_FLAGS_D2_SUPPORT;
                                /* fall through */
                        case 3:
-                               device->power.dx_supported[i] |= 
+                               device->power.dx_supported[i] |=
                                        BM_FLAGS_D3_SUPPORT;
                                break;
                        }
@@ -381,12 +381,12 @@ bm_get_pm_capabilities (
                        /*
                         * Validate:
                         * ---------
-                        * Mask of any states that _Sx_d falsely advertises 
-                        * (e.g.claims D1 support but neither _PR2 or _PS2 
-                        * exist).  In other words, S1-S5 can't offer a Dx 
+                        * Mask of any states that _Sx_d falsely advertises
+                        * (e.g.claims D1 support but neither _PR2 or _PS2
+                        * exist).  In other words, S1-S5 can't offer a Dx
                         * state that isn't supported by S0.
                         */
-                       device->power.dx_supported[i] &= 
+                       device->power.dx_supported[i] &=
                                device->power.dx_supported[ACPI_STATE_S0];
                }
 
index 5e76999..6b04ea7 100644 (file)
@@ -27,7 +27,7 @@
  * TODO:
  * -----
  *     1. Sequencing of power resource list transitions.
- *     2. Global serialization of power resource transtions (see ACPI 
+ *     2. Global serialization of power resource transtions (see ACPI
  *         spec section 7.1.2/7.1.3).
  *      3. Better error handling.
  */
@@ -51,13 +51,13 @@ bm_pr_notify (
        BM_NOTIFY               notify_type,
        BM_HANDLE               device_handle,
        void                    **context);
-       
+
 ACPI_STATUS
 bm_pr_request (
        BM_REQUEST              *request,
        void                    *context);
 
-       
+
 /****************************************************************************
  *                             Internal Functions
  ****************************************************************************/
@@ -133,7 +133,7 @@ bm_pr_get_state (
 
        pr->state = ACPI_STATE_UNKNOWN;
 
-       /* 
+       /*
         * Evaluate _STA:
         * --------------
         * Evalute _STA to determine whether the power resource is ON or OFF.
@@ -151,7 +151,7 @@ bm_pr_get_state (
        }
 
        /*
-        * Mask off all bits but the first as some systems return non-standard 
+        * Mask off all bits but the first as some systems return non-standard
         * values (e.g. 0x51).
         */
        switch (device_status & 0x01) {
@@ -269,7 +269,7 @@ bm_pr_list_get_state (
         * -----------------------------
         * The current state of a list of power resources is ON if all
         * power resources are currently in the ON state.  In other words,
-        * if any power resource in the list is OFF then the collection 
+        * if any power resource in the list is OFF then the collection
         * isn't fully ON.
         */
        for (i = 0; i < pr_list->count; i++) {
@@ -328,13 +328,13 @@ bm_pr_list_transition (
        /*
         * Reference Target:
         * -----------------
-        * Reference all resources for the target power state first (so 
-        * the device doesn't get turned off while transitioning).  Power 
+        * Reference all resources for the target power state first (so
+        * the device doesn't get turned off while transitioning).  Power
         * resources that aren't on (new reference count of 1) are turned on.
         */
        for (i = 0; i < target_list->count; i++) {
 
-               status = bm_get_device_context(target_list->handles[i], 
+               status = bm_get_device_context(target_list->handles[i],
                        (BM_DRIVER_CONTEXT*)(&pr));
                if (ACPI_FAILURE(status)) {
                        DEBUG_PRINT(ACPI_WARN, ("Invalid reference to power resource [0x%02X].\n", target_list->handles[i]));
@@ -355,12 +355,12 @@ bm_pr_list_transition (
         * Dereference Current:
         * --------------------
         * Dereference all resources for the current power state.  Power
-        * resources no longer referenced (new reference count of 0) are 
+        * resources no longer referenced (new reference count of 0) are
         * turned off.
         */
        for (i = 0; i < current_list->count; i++) {
 
-               status = bm_get_device_context(current_list->handles[i], 
+               status = bm_get_device_context(current_list->handles[i],
                        (BM_DRIVER_CONTEXT*)(&pr));
                if (ACPI_FAILURE(status)) {
                        DEBUG_PRINT(ACPI_WARN, ("Invalid reference to power resource [0x%02X].\n", target_list->handles[i]));
@@ -434,7 +434,7 @@ bm_pr_add_device (
        pr->device_handle = device->handle;
        pr->acpi_handle = device->acpi_handle;
 
-       /* 
+       /*
         * Get information on this power resource.
         */
        status = acpi_evaluate_object(pr->acpi_handle, NULL, NULL, &buffer);
index a371381..d048536 100644 (file)
@@ -62,7 +62,7 @@ bm_generate_request (
 
        DEBUG_PRINT(ACPI_INFO, ("Sending request [0x%02x] to device [0x%02x].\n", request->command, node->device.handle));
 
-       if (!(node->device.flags & BM_FLAGS_DRIVER_CONTROL) || 
+       if (!(node->device.flags & BM_FLAGS_DRIVER_CONTROL) ||
                !(node->driver.request)) {
                DEBUG_PRINT(ACPI_WARN, ("No driver installed for device [0x%02x].\n", node->device.handle));
                return_ACPI_STATUS(AE_NOT_EXIST);
@@ -137,7 +137,7 @@ bm_request (
                if (ACPI_FAILURE(status)) {
                        break;
                }
-               status = bm_copy_to_buffer(&(request->buffer), 
+               status = bm_copy_to_buffer(&(request->buffer),
                        &(device->power.state), sizeof(BM_POWER_STATE));
                break;
 
@@ -145,7 +145,7 @@ bm_request (
        {
                BM_POWER_STATE *power_state = NULL;
 
-               status = bm_cast_buffer(&(request->buffer), 
+               status = bm_cast_buffer(&(request->buffer),
                        (void**)&power_state, sizeof(BM_POWER_STATE));
                if (ACPI_FAILURE(status)) {
                        break;
index fa15bb8..b749119 100644 (file)
@@ -57,7 +57,7 @@ bm_compare (
                return AE_BAD_PARAMETER;
        }
 
-       /* 
+       /*
         * Present?
         * --------
         * We're only going to match on devices that are present.
@@ -67,22 +67,22 @@ bm_compare (
                return AE_NOT_FOUND;
        }
 
-       /* 
+       /*
         * type?
         */
        if (criteria->type && !(criteria->type & device->id.type)) {
                return AE_NOT_FOUND;
        }
 
-       /* 
+       /*
         * hid?
         */
-       if ((criteria->hid[0]) && (0 != STRNCMP(criteria->hid, 
+       if ((criteria->hid[0]) && (0 != STRNCMP(criteria->hid,
                device->id.hid, sizeof(BM_DEVICE_HID)))) {
                return AE_NOT_FOUND;
        }
 
-       /* 
+       /*
         * adr?
         */
        if ((criteria->adr) && (criteria->adr != device->id.adr)) {
@@ -149,7 +149,7 @@ bm_search(
                if (node->scope.head) {
                        status = bm_compare(&(node->device), criteria);
                        if (ACPI_SUCCESS(status)) {
-                               results->handles[results->count++] = 
+                               results->handles[results->count++] =
                                        node->device.handle;
                        }
                        node = node->scope.head;
@@ -163,16 +163,16 @@ bm_search(
                else {
                        status = bm_compare(&(node->device), criteria);
                        if (ACPI_SUCCESS(status)) {
-                               results->handles[results->count++] = 
+                               results->handles[results->count++] =
                                        node->device.handle;
                        }
 
                        /*
                         * Locate Next Device:
                         * -------------------
-                        * The next node is either a peer at this level 
-                        * (node->next is valid), or we work are way back 
-                        * up the tree until we either find a non-parsed 
+                        * The next node is either a peer at this level
+                        * (node->next is valid), or we work are way back
+                        * up the tree until we either find a non-parsed
                         * peer or hit the top (node->parent is NULL).
                         */
                        while (!node->next && node->parent) {
index 4871d94..4093187 100644 (file)
@@ -199,7 +199,7 @@ bm_extract_package_data (
 
        if (!package || (package->type != ACPI_TYPE_PACKAGE) ||
                (package->package.count == 0) || !package_format ||
-               (package_format->length < 1) || 
+               (package_format->length < 1) ||
                (!package_format->pointer) || !buffer) {
                return_ACPI_STATUS(AE_BAD_PARAMETER);
        }
@@ -228,7 +228,7 @@ bm_extract_package_data (
                                tail_offset += sizeof(ACPI_INTEGER);
                                break;
                        case 'S':
-                               size_required += sizeof(u8*) + 
+                               size_required += sizeof(u8*) +
                                        sizeof(ACPI_INTEGER) + 1;
                                tail_offset += sizeof(ACPI_INTEGER);
                                break;
@@ -243,12 +243,12 @@ bm_extract_package_data (
                case ACPI_TYPE_BUFFER:
                        switch (format[i]) {
                        case 'S':
-                               size_required += sizeof(u8*) + 
+                               size_required += sizeof(u8*) +
                                        element->string.length + 1;
                                tail_offset += sizeof(u8*);
                                break;
                        case 'B':
-                               size_required += sizeof(u8*) + 
+                               size_required += sizeof(u8*) +
                                        element->buffer.length;
                                tail_offset += sizeof(u8*);
                                break;
@@ -293,14 +293,14 @@ bm_extract_package_data (
                case ACPI_TYPE_INTEGER:
                        switch (format[i]) {
                        case 'N':
-                               *((ACPI_INTEGER*)head) = 
+                               *((ACPI_INTEGER*)head) =
                                        element->integer.value;
                                head += sizeof(ACPI_INTEGER);
                                break;
                        case 'S':
                                pointer = (u8**)head;
                                *pointer = tail;
-                               *((ACPI_INTEGER*)tail) = 
+                               *((ACPI_INTEGER*)tail) =
                                        element->integer.value;
                                head += sizeof(ACPI_INTEGER*);
                                tail += sizeof(ACPI_INTEGER);
@@ -320,7 +320,7 @@ bm_extract_package_data (
                        case 'S':
                                pointer = (u8**)head;
                                *pointer = tail;
-                               memcpy(tail, element->string.pointer, 
+                               memcpy(tail, element->string.pointer,
                                        element->string.length);
                                head += sizeof(u8*);
                                tail += element->string.length;
@@ -331,7 +331,7 @@ bm_extract_package_data (
                        case 'B':
                                pointer = (u8**)head;
                                *pointer = tail;
-                               memcpy(tail, element->buffer.pointer, 
+                               memcpy(tail, element->buffer.pointer,
                                        element->buffer.length);
                                head += sizeof(u8*);
                                tail += element->buffer.length;
@@ -361,11 +361,11 @@ bm_extract_package_data (
  * PARAMETERS:  <TBD>
  *
  * RETURN:      AE_OK
- *              AE_BUFFER_OVERFLOW  Evaluated object returned data, but 
+ *              AE_BUFFER_OVERFLOW  Evaluated object returned data, but
  *                                  caller did not provide buffer.
  *
  * DESCRIPTION: Helper for acpi_evaluate_object that handles buffer
- *              allocation.  Note that the caller is responsible for 
+ *              allocation.  Note that the caller is responsible for
  *              freeing buffer->pointer!
  *
  ****************************************************************************/
@@ -389,8 +389,8 @@ bm_evaluate_object (
        /*
         * Evalute Object:
         * ---------------
-        * The first attempt is just to get the size of the object data 
-        * (that is unless there's no return data, e.g. _INI); the second 
+        * The first attempt is just to get the size of the object data
+        * (that is unless there's no return data, e.g. _INI); the second
         * gets the data.
         */
        status = acpi_evaluate_object(acpi_handle, pathname, arguments, buffer);
@@ -407,14 +407,14 @@ bm_evaluate_object (
                }
 
                /* Re-evaluate -- this time it should work */
-               status = acpi_evaluate_object(acpi_handle, pathname, 
+               status = acpi_evaluate_object(acpi_handle, pathname,
                        arguments, buffer);
        }
 
        if (ACPI_FAILURE(status)) {
                DEBUG_EVAL_ERROR(ACPI_WARN, acpi_handle, pathname, status);
                if (buffer && buffer->pointer) {
-                       acpi_os_free(buffer->pointer); 
+                       acpi_os_free(buffer->pointer);
                        buffer->pointer = NULL;
                        buffer->length = 0;
                }
@@ -467,7 +467,7 @@ bm_evaluate_simple_integer (
         * Validate Data:
         * --------------
         */
-       status = bm_cast_buffer(&buffer, (void**)&element, 
+       status = bm_cast_buffer(&buffer, (void**)&element,
                sizeof(ACPI_OBJECT));
        if (ACPI_FAILURE(status)) {
                DEBUG_EVAL_ERROR(ACPI_WARN, acpi_handle, pathname, status);
@@ -535,7 +535,7 @@ bm_evaluate_reference_list (
         * Validate Package:
         * -----------------
         */
-       status = bm_cast_buffer(&buffer, (void**)&package, 
+       status = bm_cast_buffer(&buffer, (void**)&package,
                sizeof(ACPI_OBJECT));
        if (ACPI_FAILURE(status)) {
                DEBUG_EVAL_ERROR(ACPI_WARN, acpi_handle, pathname, status);
@@ -571,7 +571,7 @@ bm_evaluate_reference_list (
                 * Resolve reference string (e.g. "\_PR_.CPU_") to an
                 * ACPI_HANDLE.
                 */
-               status = acpi_get_handle(acpi_handle, 
+               status = acpi_get_handle(acpi_handle,
                        element->string.pointer, &reference_handle);
                if (ACPI_FAILURE(status)) {
                        status = AE_BAD_DATA;
@@ -583,7 +583,7 @@ bm_evaluate_reference_list (
                /*
                 * Resolve ACPI_HANDLE to BM_HANDLE.
                 */
-               status = bm_get_handle(reference_handle, 
+               status = bm_get_handle(reference_handle,
                        &(reference_list->handles[i]));
                if (ACPI_FAILURE(status)) {
                        status = AE_BAD_DATA;
index 68ec19d..7d7578c 100644 (file)
@@ -79,7 +79,7 @@ bm_get_device_status (
        if (!BM_NODE_PRESENT(node->parent)) {
                return_ACPI_STATUS(AE_OK);
        }
-       
+
        /*
         * Dynamic Status?
         * ---------------
@@ -94,7 +94,7 @@ bm_get_device_status (
         * Evaluate _STA:
         * --------------
         */
-       status = bm_evaluate_simple_integer(node->device.acpi_handle, "_STA", 
+       status = bm_evaluate_simple_integer(node->device.acpi_handle, "_STA",
                &(node->device.status));
        if (ACPI_SUCCESS(status)) {
                *device_status = node->device.status;
@@ -232,7 +232,7 @@ bm_register_driver (
        /*
         * Install driver:
         * ----------------
-        * For each match, record the driver information and execute the 
+        * For each match, record the driver information and execute the
         * driver's Notify() funciton (if present) to notify the driver
         * of the device's presence.
         */
@@ -247,7 +247,7 @@ bm_register_driver (
                DEBUG_PRINT(ACPI_INFO, ("Registering driver for device [0x%02x].\n", node->device.handle));
 
                /* Notify driver of new device. */
-               status = driver->notify(BM_NOTIFY_DEVICE_ADDED, 
+               status = driver->notify(BM_NOTIFY_DEVICE_ADDED,
                        node->device.handle, &(node->driver.context));
                if (ACPI_SUCCESS(status)) {
                        node->driver.notify = driver->notify;
@@ -319,7 +319,7 @@ bm_unregister_driver (
                DEBUG_PRINT(ACPI_INFO, ("Unregistering driver for device [0x%02x].\n", node->device.handle));
 
                /* Notify driver of device removal. */
-               status = node->driver.notify(BM_NOTIFY_DEVICE_REMOVED, 
+               status = node->driver.notify(BM_NOTIFY_DEVICE_REMOVED,
                        node->device.handle, &(node->driver.context));
 
                node->device.flags &= ~BM_FLAGS_DRIVER_CONTROL;
index 09224d6..4e77a3e 100644 (file)
@@ -128,7 +128,7 @@ AcpiCreateResourceList(PCM_RESOURCE_LIST* pResourceList,
   RESOURCE* resource;
   ULONG i;
   KIRQL Dirql;
-  
+
   /* Count number of resources */
   Done = FALSE;
   resource = resources;
@@ -161,7 +161,7 @@ AcpiCreateResourceList(PCM_RESOURCE_LIST* pResourceList,
     }
     resource = (RESOURCE *) ((NATIVE_UINT) resource + (NATIVE_UINT) resource->length);
   }
-  
+
   /* Allocate memory */
   *ResourceListSize = sizeof(CM_RESOURCE_LIST) + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) * (NumberOfResources - 1);
   ResourceList = (PCM_RESOURCE_LIST)ExAllocatePool(PagedPool, *ResourceListSize);
@@ -175,7 +175,7 @@ AcpiCreateResourceList(PCM_RESOURCE_LIST* pResourceList,
   ResourceList->List[0].PartialResourceList.Revision = 1;
   ResourceList->List[0].PartialResourceList.Count = NumberOfResources;
   ResourceDescriptor = ResourceList->List[0].PartialResourceList.PartialDescriptors;
-  
+
   /* Fill resources list structure */
   Done = FALSE;
   resource = resources;
@@ -189,7 +189,7 @@ AcpiCreateResourceList(PCM_RESOURCE_LIST* pResourceList,
         for (i = 0; i < irq_data->number_of_interrupts; i++)
         {
           ResourceDescriptor->Type = CmResourceTypeInterrupt;
-          
+
           ResourceDescriptor->ShareDisposition =
             (irq_data->shared_exclusive == SHARED ? CmResourceShareShared : CmResourceShareDeviceExclusive);
           ResourceDescriptor->Flags =
@@ -253,7 +253,7 @@ AcpiCreateResourceList(PCM_RESOURCE_LIST* pResourceList,
     }
     resource = (RESOURCE *) ((NATIVE_UINT) resource + (NATIVE_UINT) resource->length);
   }
-  
+
   acpi_rs_dump_resource_list(resource);
   return TRUE;
 }
index 1c712b2..342e628 100644 (file)
@@ -158,7 +158,7 @@ typedef char                                BM_DEVICE_HID[9];
 #define BM_HID_SLEEP_BUTTON            "PNP0C0E"
 
 /*
- * BM_DEVICE_CID: 
+ * BM_DEVICE_CID:
  *     The compatibility ID can be a string with 44 characters
  *     The extra pad is in case there is a change.  It also
  *     provides 8 byte alignment for the BM_DEVICE_ID structure.
@@ -564,7 +564,7 @@ bm_pr_initialize (void);
 
 ACPI_STATUS
 bm_pr_terminate (void);
-       
+
 /* bmutils.c */
 
 ACPI_STATUS
index 9265196..94f0e8b 100644 (file)
@@ -56,7 +56,7 @@
  * Hardware IDs:
  * -------------
  * TODO: Power and Sleep button HIDs also exist in <bm.h>.  Should all
- *       HIDs (ACPI well-known devices) exist in one place (e.g. 
+ *       HIDs (ACPI well-known devices) exist in one place (e.g.
  *       acpi_hid.h)?
  */
 #define BN_HID_POWER_BUTTON            "PNP0C0C"
index ed11cd6..24c90e2 100644 (file)
@@ -151,7 +151,7 @@ acpi_os_map_memory(ACPI_PHYSICAL_ADDRESS phys, u32 size, void **virt)
   *virt = MmMapIoSpace(Address, size, MmNonCached);
   if (!*virt)
     return AE_ERROR;
+
   return AE_OK;
 }
 
@@ -510,7 +510,7 @@ acpi_os_delete_semaphore(
 
   DPRINT("acpi_os_delete_semaphore(handle 0x%X)\n", handle);
 
-  if (!Mutex) 
+  if (!Mutex)
     return AE_BAD_PARAMETER;
 
   ExFreePool(Mutex);
@@ -541,7 +541,7 @@ acpi_os_wait_semaphore(
 
 ACPI_STATUS
 acpi_os_signal_semaphore(
-    ACPI_HANDLE             handle, 
+    ACPI_HANDLE             handle,
     u32                     units)
 {
   PFAST_MUTEX Mutex = (PFAST_MUTEX)handle;
index cf8aa65..9471ff9 100644 (file)
@@ -115,21 +115,21 @@ PdoQueryResources(
 {
   PPDO_DEVICE_EXTENSION DeviceExtension;
   PCM_RESOURCE_LIST ResourceList;
-  
+
   DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-  
+
   if (DeviceExtension->ResourceListSize == 0)
   {
     return Irp->IoStatus.Status;
   }
-  
+
   ResourceList = ExAllocatePool(PagedPool, DeviceExtension->ResourceListSize);
   if (!ResourceList)
   {
     Irp->IoStatus.Information = 0;
     return STATUS_INSUFFICIENT_RESOURCES;
   }
-  
+
   RtlCopyMemory(ResourceList, DeviceExtension->ResourceList, DeviceExtension->ResourceListSize);
   Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
   return STATUS_SUCCESS;
index fccdd1a..2e3d498 100644 (file)
@@ -17,7 +17,7 @@
 
 #ifdef  ALLOC_PRAGMA
 
-// Make the initialization routines discardable, so that they 
+// Make the initialization routines discardable, so that they
 // don't waste space
 
 #pragma  alloc_text(init, DriverEntry)
@@ -464,7 +464,7 @@ static NTSTATUS ParseAnsiName(PUNICODE_STRING Name, PUSHORT Size)
   *Size -= size1;
 
   /* Clean whitespace from end of string */
-  while ((size1 > 0) && (Buffer[--size1] == ' ')) 
+  while ((size1 > 0) && (Buffer[--size1] == ' '))
     Buffer[size1] = '\0';
 
   DPRINT("ANSI name: %s\n", Buffer);
@@ -986,7 +986,7 @@ static BOOLEAN CreateLogicalDevice(PISAPNP_DEVICE_EXTENSION DeviceExtension,
                  case ISAPNP_SRIN_CDEVICE_ID:
                          if ((Size == 4) && (compat < MAX_COMPATIBLE_ID)) {
                                  Peek(tmp, 4);
-                                 LogicalDevice->CVendorId[compat] = UCHAR2USHORT(tmp[0], tmp[1]); 
+                                 LogicalDevice->CVendorId[compat] = UCHAR2USHORT(tmp[0], tmp[1]);
                                  LogicalDevice->CDeviceId[compat] = UCHAR2USHORT(tmp[2], tmp[3]);
                                  compat++;
                                  Size = 0;
@@ -1146,7 +1146,7 @@ static BOOLEAN ParseResourceMap(PISAPNP_DEVICE_EXTENSION DeviceExtension,
                                  size = 0;
                          }
                          break;
-  
+
       case ISAPNP_SRIN_CDEVICE_ID:
         /* FIXME: Parse compatible IDs */
         break;
@@ -1433,7 +1433,7 @@ ISAPNPQueryBusRelations(
   DeviceExtension = (PISAPNP_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
 
   if (Irp->IoStatus.Information) {
-    /* FIXME: Another bus driver has already created a DEVICE_RELATIONS 
+    /* FIXME: Another bus driver has already created a DEVICE_RELATIONS
               structure so we must merge this structure with our own */
   }
 
@@ -1721,7 +1721,7 @@ ISAPNPAddDevice(
 NTSTATUS
 STDCALL
 DriverEntry(
-  IN PDRIVER_OBJECT DriverObject, 
+  IN PDRIVER_OBJECT DriverObject,
   IN PUNICODE_STRING RegistryPath)
 {
   DbgPrint("ISA Plug and Play Bus Driver\n");
index aa7bc7a..b9a1daf 100644 (file)
@@ -208,7 +208,7 @@ FdoQueryBusRelations(
   DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
 
   if (Irp->IoStatus.Information) {
-    /* FIXME: Another bus driver has already created a DEVICE_RELATIONS 
+    /* FIXME: Another bus driver has already created a DEVICE_RELATIONS
               structure so we must merge this structure with our own */
   }
 
index 43a8bbc..cd92acb 100644 (file)
@@ -19,7 +19,7 @@
 
 #ifdef  ALLOC_PRAGMA
 
-// Make the initialization routines discardable, so that they 
+// Make the initialization routines discardable, so that they
 // don't waste space
 
 #pragma  alloc_text(init, DriverEntry)
@@ -34,8 +34,8 @@
 NTSTATUS
 STDCALL
 PciDispatchDeviceControl(
-  IN PDEVICE_OBJECT DeviceObject, 
-  IN PIRP Irp) 
+  IN PDEVICE_OBJECT DeviceObject,
+  IN PIRP Irp)
 {
   PIO_STACK_LOCATION IrpSp;
   NTSTATUS Status;
index 6f472e0..75b6a49 100644 (file)
@@ -45,7 +45,7 @@
 #define  PCI_STATUS_FAST_BACK  0x80    /* Accept fast-back to back */
 #define  PCI_STATUS_PARITY     0x100   /* Detected parity error */
 #define  PCI_STATUS_DEVSEL_MASK        0x600   /* DEVSEL timing */
-#define  PCI_STATUS_DEVSEL_FAST        0x000   
+#define  PCI_STATUS_DEVSEL_FAST        0x000
 #define  PCI_STATUS_DEVSEL_MEDIUM 0x200
 #define  PCI_STATUS_DEVSEL_SLOW 0x400
 #define  PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
@@ -74,8 +74,8 @@
 
 /*
  * Base addresses specify locations in memory or I/O space.
- * Decoded size can be determined by writing a value of 
- * 0xffffffff to the register, and reading it back.  Only 
+ * Decoded size can be determined by writing a value of
+ * 0xffffffff to the register, and reading it back.  Only
  * 1 bits are decoded.
  */
 #define PCI_BASE_ADDRESS_0     0x10    /* 32 bits */
@@ -99,7 +99,7 @@
 /* Header type 0 (normal devices) */
 #define PCI_CARDBUS_CIS                0x28
 #define PCI_SUBSYSTEM_VENDOR_ID        0x2c
-#define PCI_SUBSYSTEM_ID       0x2e  
+#define PCI_SUBSYSTEM_ID       0x2e
 #define PCI_ROM_ADDRESS                0x30    /* Bits 31..11 are address, 10..1 reserved */
 #define  PCI_ROM_ADDRESS_ENABLE        0x01
 #define PCI_ROM_ADDRESS_MASK   (~0x7ffUL)
index 3f01c06..659a5bd 100644 (file)
@@ -171,7 +171,7 @@ PdoQueryCapabilities(
 
   if (DeviceCapabilities->Version != 1)
     return STATUS_UNSUCCESSFUL;
-  
+
   DeviceCapabilities->UniqueID = FALSE;
   DeviceCapabilities->Address = DeviceExtension->SlotNumber.u.AsULONG;
   DeviceCapabilities->UINumber = (ULONG)-1; /* FIXME */
index 6a315af..156e70d 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Serial enumerator driver
  * FILE:            drivers/bus/serenum/detect.c
  * PURPOSE:         Detection of serial devices
- * 
+ *
  * PROGRAMMERS:     Jason Filby (jasonfilby@yahoo.com)
  *                  Filip Navara (xnavara@volny.cz)
  *                  Hervé Poussineau (hpoussin@reactos.com)
@@ -26,9 +26,9 @@ SerenumDeviceIoControl(
        PIRP Irp;
        IO_STATUS_BLOCK IoStatus;
        NTSTATUS Status;
-       
+
        KeInitializeEvent (&Event, NotificationEvent, FALSE);
-       
+
        Irp = IoBuildDeviceIoControlRequest(CtlCode,
                DeviceObject,
                InputBuffer,
@@ -43,21 +43,21 @@ SerenumDeviceIoControl(
                DPRINT("Serenum: IoBuildDeviceIoControlRequest() failed\n");
                return STATUS_INSUFFICIENT_RESOURCES;
        }
-       
+
        Status = IoCallDriver(DeviceObject, Irp);
-       
+
        if (Status == STATUS_PENDING)
        {
                DPRINT("Serenum: Operation pending\n");
                KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
                Status = IoStatus.Status;
        }
-       
+
        if (OutputBufferSize)
        {
                *OutputBufferSize = IoStatus.Information;
        }
-       
+
        return Status;
 }
 
@@ -73,7 +73,7 @@ ReadBytes(
        KEVENT event;
        LARGE_INTEGER zero;
        NTSTATUS Status;
-       
+
        KeInitializeEvent(&event, NotificationEvent, FALSE);
        zero.QuadPart = 0;
        Irp = IoBuildSynchronousFsdRequest(
@@ -85,7 +85,7 @@ ReadBytes(
                &ioStatus);
        if (!Irp)
                return FALSE;
-       
+
        Status = IoCallDriver(LowerDevice, Irp);
        if (Status == STATUS_PENDING)
        {
@@ -110,9 +110,9 @@ ReportDetectedDevice(
        PPDO_DEVICE_EXTENSION PdoDeviceExtension = NULL;
        PFDO_DEVICE_EXTENSION FdoDeviceExtension;
        NTSTATUS Status;
-       
+
        DPRINT("Serenum: SerenumReportDetectedDevice() called with %wZ (%wZ) detected\n", DeviceId, DeviceDescription);
-       
+
        Status = IoCreateDevice(
                DeviceObject->DriverObject,
                sizeof(PDO_DEVICE_EXTENSION),
@@ -122,7 +122,7 @@ ReportDetectedDevice(
                FALSE,
                &Pdo);
        if (!NT_SUCCESS(Status)) goto ByeBye;
-       
+
        Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;
        Pdo->Flags |= DO_POWER_PAGABLE;
        PdoDeviceExtension = (PPDO_DEVICE_EXTENSION)Pdo->DeviceExtension;
@@ -137,17 +137,17 @@ ReportDetectedDevice(
        if (!NT_SUCCESS(Status)) goto ByeBye;
        Status = SerenumDuplicateUnicodeString(&PdoDeviceExtension->CompatibleIds, CompatibleIds, PagedPool);
        if (!NT_SUCCESS(Status)) goto ByeBye;
-       
+
        /* Device attached to serial port (Pdo) may delegate work to
         * serial port stack (Fdo = DeviceObject variable) */
        Pdo->StackSize = DeviceObject->StackSize + 1;
-       
+
        FdoDeviceExtension->AttachedPdo = Pdo;
        PdoDeviceExtension->AttachedFdo = DeviceObject;
-       
+
        Pdo->Flags |= DO_BUFFERED_IO;
        Pdo->Flags &= ~DO_DEVICE_INITIALIZING;
-       
+
        return STATUS_SUCCESS;
 
 ByeBye:
@@ -200,7 +200,7 @@ SerenumWait(ULONG milliseconds)
 {
        KTIMER Timer;
        LARGE_INTEGER DueTime;
-       
+
        DueTime.QuadPart = milliseconds * -10;
        KeInitializeTimer(&Timer);
        KeSetTimer(&Timer, DueTime, NULL);
@@ -224,7 +224,7 @@ SerenumDetectPnpDevice(
        SERIAL_TIMEOUTS Timeouts;
        SERIALPERF_STATS PerfStats;
        NTSTATUS Status;
-       
+
        /* 1. COM port initialization, check for device enumerate */
        CHECKPOINT;
        Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_DTR,
@@ -239,7 +239,7 @@ SerenumDetectPnpDevice(
                NULL, 0, &Msr, &Size);
        if (!NT_SUCCESS(Status)) return Status;
        if ((Msr & SR_MSR_DSR) == 0) goto SerenumDisconnectIdle;
-       
+
        /* 2. COM port setup, 1st phase */
        CHECKPOINT;
        BaudRate = SERIAL_BAUD_1200;
@@ -263,7 +263,7 @@ SerenumDetectPnpDevice(
                NULL, 0, NULL, NULL);
        if (!NT_SUCCESS(Status)) return Status;
        SerenumWait(200);
-       
+
        /* 3. Wait for response, 1st phase */
        CHECKPOINT;
        Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_RTS,
@@ -279,7 +279,7 @@ SerenumDetectPnpDevice(
        Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer), &Size);
        if (!NT_SUCCESS(Status)) return Status;
        if (Size != 0) goto SerenumCollectPnpComDeviceId;
-       
+
        /* 4. COM port setup, 2nd phase */
        CHECKPOINT;
        Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_DTR,
@@ -293,7 +293,7 @@ SerenumDetectPnpDevice(
                &Purge, 0, NULL, NULL);
        if (!NT_SUCCESS(Status)) return Status;
        SerenumWait(200);
-       
+
        /* 5. Wait for response, 2nd phase */
        CHECKPOINT;
        Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
@@ -310,7 +310,7 @@ SerenumDetectPnpDevice(
                NULL, 0, &Msr, &Size);
        if (!NT_SUCCESS(Status)) return Status;
        if ((Msr & SR_MSR_DSR) == 0) goto SerenumVerifyDisconnect; else goto SerenumConnectIdle;
-       
+
        /* 6. Collect PnP COM device ID */
 SerenumCollectPnpComDeviceId:
        CHECKPOINT;
@@ -346,7 +346,7 @@ SerenumCollectPnpComDeviceId:
                NULL, 0, &Msr, &Size);
        if (!NT_SUCCESS(Status)) return Status;
        if ((Msr & SR_MSR_DSR) == 0) goto SerenumVerifyDisconnect;
-       
+
        /* 7. Verify disconnect */
 SerenumVerifyDisconnect:
        CHECKPOINT;
@@ -358,7 +358,7 @@ SerenumVerifyDisconnect:
        if (!NT_SUCCESS(Status)) return Status;
        SerenumWait(5000);
        goto SerenumDisconnectIdle;
-       
+
        /* 8. Connect idle */
 SerenumConnectIdle:
        CHECKPOINT;
@@ -382,7 +382,7 @@ SerenumConnectIdle:
                return STATUS_DEVICE_NOT_CONNECTED;
        else
                return STATUS_SUCCESS;
-       
+
        /* 9. Disconnect idle */
 SerenumDisconnectIdle:
        CHECKPOINT;
@@ -423,20 +423,20 @@ SerenumDetectLegacyDevice(
        UNICODE_STRING HardwareIds;
        UNICODE_STRING CompatibleIds;
        NTSTATUS Status;
-       
+
        DPRINT("Serenum: SerenumDetectLegacyDevice(DeviceObject %p, LowerDevice %p)\n",
                DeviceObject,
                LowerDevice);
-       
+
        RtlZeroMemory(Buffer, sizeof(Buffer));
-       
+
        /* Reset UART */
        CHECKPOINT;
        Mcr = 0; /* MCR: DTR/RTS/OUT2 off */
        Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL,
-               &Mcr, sizeof(Mcr), NULL, NULL); 
+               &Mcr, sizeof(Mcr), NULL, NULL);
        if (!NT_SUCCESS(Status)) return Status;
-       
+
        /* Set communications parameters */
        CHECKPOINT;
        /* DLAB off */
@@ -456,7 +456,7 @@ SerenumDetectLegacyDevice(
        Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_LINE_CONTROL,
                &LCR, sizeof(LCR), NULL, NULL);
        if (!NT_SUCCESS(Status)) return Status;
-       
+
        /* Flush receive buffer */
        CHECKPOINT;
        Command = SERIAL_PURGE_RXCLEAR;
@@ -465,7 +465,7 @@ SerenumDetectLegacyDevice(
        if (!NT_SUCCESS(Status)) return Status;
        /* Wait 100 ms */
        SerenumWait(100);
-       
+
        /* Enable DTR/RTS */
        CHECKPOINT;
        Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
@@ -474,7 +474,7 @@ SerenumDetectLegacyDevice(
        Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_RTS,
                NULL, 0, NULL, NULL);
        if (!NT_SUCCESS(Status)) return Status;
-       
+
        /* Set timeout to 500 microseconds */
        CHECKPOINT;
        Timeouts.ReadIntervalTimeout = 100;
@@ -484,12 +484,12 @@ SerenumDetectLegacyDevice(
        Status = SerenumDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_TIMEOUTS,
                &Timeouts, sizeof(Timeouts), NULL, NULL);
        if (!NT_SUCCESS(Status)) return Status;
-       
+
        /* Fill the read buffer */
        CHECKPOINT;
        Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), &Count);
        if (!NT_SUCCESS(Status)) return Status;
-       
+
        for (i = 0; i < Count; i++)
        {
                if (Buffer[i] == 'B')
index 5a55ac3..98eb650 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Serial enumerator driver
  * FILE:            drivers/bus/serenum/fdo.c
  * PURPOSE:         IRP_MJ_PNP operations for FDOs
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -19,9 +19,9 @@ SerenumAddDevice(
        PDEVICE_OBJECT Fdo;
        PFDO_DEVICE_EXTENSION DeviceExtension;
        NTSTATUS Status;
-       
+
        DPRINT("Serenum: SerenumAddDevice called. Pdo = %p\n", Pdo);
-       
+
        /* Create new device object */
        Status = IoCreateDevice(DriverObject,
                                sizeof(FDO_DEVICE_EXTENSION),
@@ -37,7 +37,7 @@ SerenumAddDevice(
        }
        DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension;
        RtlZeroMemory(DeviceExtension, sizeof(FDO_DEVICE_EXTENSION));
-       
+
        /* Register device interface */
        Status = IoRegisterDeviceInterface(
                Pdo,
@@ -50,7 +50,7 @@ SerenumAddDevice(
                IoDeleteDevice(Fdo);
                return Status;
        }
-       
+
        DeviceExtension->Common.IsFDO = TRUE;
        DeviceExtension->Common.PnpState = dsStopped;
        DeviceExtension->Pdo = Pdo;
@@ -65,7 +65,7 @@ SerenumAddDevice(
        }
        Fdo->Flags |= DO_BUFFERED_IO;
        Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
-       
+
        return STATUS_SUCCESS;
 }
 
@@ -76,21 +76,21 @@ SerenumFdoStartDevice(
 {
        PFDO_DEVICE_EXTENSION DeviceExtension;
        NTSTATUS Status;
-       
+
        DPRINT("Serenum: SerenumFdoStartDevice() called\n");
        DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-       
+
        ASSERT(DeviceExtension->Common.PnpState == dsStopped);
-       
+
        Status = IoSetDeviceInterfaceState(&DeviceExtension->SerenumInterfaceName, TRUE);
        if (!NT_SUCCESS(Status))
        {
                DPRINT("Serenum: IoSetDeviceInterfaceState() failed with status 0x%08lx\n", Status);
                return Status;
        }
-       
+
        DeviceExtension->Common.PnpState = dsStarted;
-       
+
        return STATUS_SUCCESS;
 }
 
@@ -104,10 +104,10 @@ SerenumFdoQueryBusRelations(
        ULONG NumPDO;
        ULONG i;
        NTSTATUS Status = STATUS_SUCCESS;
-       
+
        DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        ASSERT(DeviceExtension->Common.IsFDO);
-       
+
        /* Do enumeration if needed */
        if (!(DeviceExtension->Flags & FLAG_ENUMERATION_DONE))
        {
@@ -124,14 +124,14 @@ SerenumFdoQueryBusRelations(
                DeviceExtension->Flags |= FLAG_ENUMERATION_DONE;
        }
        NumPDO = (DeviceExtension->AttachedPdo != NULL ? 1 : 0);
-       
+
        DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePoolWithTag(
                PagedPool,
                sizeof(DEVICE_RELATIONS) + sizeof(PDEVICE_OBJECT) * (NumPDO - 1),
                SERENUM_TAG);
        if (!DeviceRelations)
                return STATUS_INSUFFICIENT_RESOURCES;
-       
+
        /* Fill returned structure */
        DeviceRelations->Count = NumPDO;
        for (i = 0; i < NumPDO; i++)
@@ -139,7 +139,7 @@ SerenumFdoQueryBusRelations(
                ObReferenceObject(DeviceExtension->AttachedPdo);
                DeviceRelations->Objects[i] = DeviceExtension->AttachedPdo;
        }
-       
+
        *pDeviceRelations = DeviceRelations;
        return Status;
 }
@@ -153,10 +153,10 @@ SerenumFdoPnp(
        PIO_STACK_LOCATION Stack;
        ULONG_PTR Information = 0;
        NTSTATUS Status;
-       
+
        Stack = IoGetCurrentIrpStackLocation(Irp);
        MinorFunction = Stack->MinorFunction;
-       
+
        switch (MinorFunction)
        {
                /* FIXME: do all these minor functions
@@ -196,7 +196,7 @@ SerenumFdoPnp(
                                        break;
                                }
                                default:
-                                       DPRINT1("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n", 
+                                       DPRINT1("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
                                                Stack->Parameters.QueryDeviceRelations.Type);
                                        return ForwardIrpAndForget(DeviceObject, Irp);
                        }
@@ -208,7 +208,7 @@ SerenumFdoPnp(
                        return ForwardIrpAndForget(DeviceObject, Irp);
                }
        }
-       
+
        Irp->IoStatus.Information = Information;
        Irp->IoStatus.Status = Status;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
index 03ef526..1a6477e 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Serial enumerator driver
  * FILE:            drivers/dd/serenum/misc.c
  * PURPOSE:         Misceallenous operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -19,23 +19,23 @@ SerenumDuplicateUnicodeString(
        IN POOL_TYPE PoolType)
 {
        ASSERT(Destination);
-       
+
        if (Source == NULL)
        {
                RtlInitUnicodeString(Destination, NULL);
                return STATUS_SUCCESS;
        }
-       
+
        Destination->Buffer = ExAllocatePool(PoolType, Source->MaximumLength);
        if (Destination->Buffer == NULL)
        {
                return STATUS_INSUFFICIENT_RESOURCES;
        }
-       
+
        Destination->MaximumLength = Source->MaximumLength;
        Destination->Length = Source->Length;
        RtlCopyMemory(Destination->Buffer, Source->Buffer, Source->MaximumLength);
-       
+
        return STATUS_SUCCESS;
 }
 
@@ -53,9 +53,9 @@ SerenumInitMultiSzString(
        UNICODE_STRING UnicodeString;
        ULONG DestinationSize = 0;
        NTSTATUS Status = STATUS_SUCCESS;
-       
+
        ASSERT(Destination);
-       
+
        /* Calculate length needed for destination unicode string */
        va_start(args, Destination);
        Source = va_arg(args, PCSZ);
@@ -72,7 +72,7 @@ SerenumInitMultiSzString(
                RtlInitUnicodeString(Destination, NULL);
                return STATUS_SUCCESS;
        }
-       
+
        /* Initialize destination string */
        DestinationSize += sizeof(WCHAR); // final NULL
        Destination->Buffer = (PWSTR)ExAllocatePoolWithTag(PagedPool, DestinationSize, SERENUM_TAG);
@@ -80,7 +80,7 @@ SerenumInitMultiSzString(
                return STATUS_INSUFFICIENT_RESOURCES;
        Destination->Length = 0;
        Destination->MaximumLength = (USHORT)DestinationSize;
-       
+
        /* Copy arguments to destination string */
        /* Use a temporary unicode string, which buffer is shared with
         * destination string, to copy arguments */
@@ -133,18 +133,18 @@ ForwardIrpAndWait(
        PDEVICE_OBJECT LowerDevice;
        KEVENT Event;
        NTSTATUS Status;
-       
+
        ASSERT(((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO);
        LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
-       
+
        ASSERT(LowerDevice);
-       
+
        KeInitializeEvent(&Event, NotificationEvent, FALSE);
        IoCopyCurrentIrpStackLocationToNext(Irp);
-       
+
        DPRINT("Serenum: Calling lower device %p [%wZ]\n", LowerDevice, &LowerDevice->DriverObject->DriverName);
        IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
-       
+
        Status = IoCallDriver(LowerDevice, Irp);
        if (Status == STATUS_PENDING)
        {
@@ -152,7 +152,7 @@ ForwardIrpAndWait(
                if (NT_SUCCESS(Status))
                        Status = Irp->IoStatus.Status;
        }
-       
+
        return Status;
 }
 
@@ -163,10 +163,10 @@ ForwardIrpToLowerDeviceAndForget(
 {
        PFDO_DEVICE_EXTENSION DeviceExtension;
        PDEVICE_OBJECT LowerDevice;
-       
+
        DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        ASSERT(DeviceExtension->Common.IsFDO);
-       
+
        LowerDevice = DeviceExtension->LowerDevice;
        ASSERT(LowerDevice);
        DPRINT("Serenum: calling lower device 0x%p [%wZ]\n",
@@ -182,10 +182,10 @@ ForwardIrpToAttachedFdoAndForget(
 {
        PPDO_DEVICE_EXTENSION DeviceExtension;
        PDEVICE_OBJECT Fdo;
-       
+
        DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        ASSERT(!DeviceExtension->Common.IsFDO);
-       
+
        Fdo = DeviceExtension->AttachedFdo;
        ASSERT(Fdo);
        DPRINT("Serenum: calling attached Fdo 0x%p [%wZ]\n",
@@ -200,11 +200,11 @@ ForwardIrpAndForget(
        IN PIRP Irp)
 {
        PDEVICE_OBJECT LowerDevice;
-       
+
        ASSERT(((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO);
        LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
        ASSERT(LowerDevice);
-       
+
        IoSkipCurrentIrpStackLocation(Irp);
        return IoCallDriver(LowerDevice, Irp);
 }
index 615f051..23ace64 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Serial enumerator driver
  * FILE:            drivers/bus/serenum/pdo.c
  * PURPOSE:         IRP_MJ_PNP operations for PDOs
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -16,11 +16,11 @@ SerenumPdoStartDevice(
        IN PDEVICE_OBJECT DeviceObject)
 {
        PPDO_DEVICE_EXTENSION DeviceExtension;
-       
+
        DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-       
+
        ASSERT(DeviceExtension->Common.PnpState == dsStopped);
-       
+
        DeviceExtension->Common.PnpState = dsStarted;
        return STATUS_SUCCESS;
 }
@@ -36,11 +36,11 @@ SerenumPdoQueryId(
        PUNICODE_STRING SourceString;
        UNICODE_STRING String;
        NTSTATUS Status;
-       
+
        IdType = IoGetCurrentIrpStackLocation(Irp)->Parameters.QueryId.IdType;
        DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        RtlInitUnicodeString(&String, NULL);
-       
+
        switch (IdType)
        {
                case BusQueryDeviceID:
@@ -71,7 +71,7 @@ SerenumPdoQueryId(
                        DPRINT1("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_ID / unknown query id type 0x%lx\n", IdType);
                        return STATUS_NOT_SUPPORTED;
        }
-       
+
        Status = SerenumDuplicateUnicodeString(
                &String,
                SourceString,
@@ -87,21 +87,21 @@ SerenumPdoQueryDeviceRelations(
 {
        PFDO_DEVICE_EXTENSION DeviceExtension;
        PDEVICE_RELATIONS DeviceRelations;
-       
+
        DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        ASSERT(DeviceExtension->Common.IsFDO);
-       
+
        DeviceRelations = (PDEVICE_RELATIONS)ExAllocatePoolWithTag(
                PagedPool,
                sizeof(DEVICE_RELATIONS),
                SERENUM_TAG);
        if (!DeviceRelations)
                return STATUS_INSUFFICIENT_RESOURCES;
-       
+
        ObReferenceObject(DeviceObject);
        DeviceRelations->Count = 1;
        DeviceRelations->Objects[0] = DeviceObject;
-       
+
        *pDeviceRelations = DeviceRelations;
        return STATUS_SUCCESS;
 }
@@ -115,10 +115,10 @@ SerenumPdoPnp(
        PIO_STACK_LOCATION Stack;
        ULONG_PTR Information = 0;
        NTSTATUS Status;
-       
+
        Stack = IoGetCurrentIrpStackLocation(Irp);
        MinorFunction = Stack->MinorFunction;
-       
+
        switch (MinorFunction)
        {
                /* FIXME: do all these minor functions
@@ -165,7 +165,7 @@ SerenumPdoPnp(
                                }
                                default:
                                {
-                                       DPRINT1("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n", 
+                                       DPRINT1("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
                                                Stack->Parameters.QueryDeviceRelations.Type);
                                        Status = STATUS_NOT_IMPLEMENTED;
                                        break;
@@ -178,7 +178,7 @@ SerenumPdoPnp(
                        PDEVICE_CAPABILITIES DeviceCapabilities;
                        ULONG i;
                        DPRINT("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES\n");
-                       
+
                        DeviceCapabilities = (PDEVICE_CAPABILITIES)Stack->Parameters.DeviceCapabilities.Capabilities;
                        /* FIXME: capabilities can change with connected device */
                        DeviceCapabilities->LockSupported = FALSE;
@@ -234,7 +234,7 @@ SerenumPdoPnp(
                                        PUNICODE_STRING Source;
                                        PWSTR Description;
                                        DPRINT("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT / DeviceTextDescription\n");
-                                       
+
                                        Source = &((PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->DeviceDescription;
                                        Description = ExAllocatePool(PagedPool, Source->Length + sizeof(WCHAR));
                                        if (!Description)
@@ -279,7 +279,7 @@ SerenumPdoPnp(
                {
                        PPNP_BUS_INFORMATION BusInfo;
                        DPRINT("Serenum: IRP_MJ_PNP / IRP_MN_QUERY_BUS_INFORMATION\n");
-                       
+
                        BusInfo = (PPNP_BUS_INFORMATION)ExAllocatePool(PagedPool, sizeof(PNP_BUS_INFORMATION));
                        if (!BusInfo)
                                Status = STATUS_INSUFFICIENT_RESOURCES;
@@ -306,7 +306,7 @@ SerenumPdoPnp(
                        Status = Irp->IoStatus.Status;
                }
        }
-       
+
        Irp->IoStatus.Information = Information;
        Irp->IoStatus.Status = Status;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
index 5715843..e931d07 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS Serial enumerator driver
  * FILE:            drivers/bus/serenum/serenum.c
  * PURPOSE:         Serial enumeration driver entry point
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -35,7 +35,7 @@ IrpStub(
        IN PIRP Irp)
 {
        NTSTATUS Status = STATUS_NOT_SUPPORTED;
-       
+
        if (((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
        {
                /* Forward some IRPs to lower device */
@@ -82,7 +82,7 @@ IrpStub(
                        }
                }
        }
-       
+
        Irp->IoStatus.Status = Status;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
        return Status;
@@ -97,16 +97,16 @@ DriverEntry(
        IN PUNICODE_STRING RegPath)
 {
        ULONG i;
-       
+
        DriverObject->DriverUnload = DriverUnload;
        DriverObject->DriverExtension->AddDevice = SerenumAddDevice;
-       
+
        for (i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++)
                DriverObject->MajorFunction[i] = IrpStub;
-       
+
        //DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = SerialQueryInformation;
        DriverObject->MajorFunction[IRP_MJ_PNP] = SerenumPnp;
        //DriverObject->MajorFunction[IRP_MJ_POWER] = SerialPower;
-       
+
        return STATUS_SUCCESS;
 }
index 1341666..b09ec9c 100644 (file)
@@ -3,41 +3,41 @@
   #include <ddk/ntddser.h>
   #include <ddk/wdmguid.h>
   #include <stdio.h>
-  
+
   #include <debug.h>
 
   #define SR_MSR_DSR 0x20
   #define ExFreePoolWithTag(p, tag) ExFreePool(p)
-  
+
   /* FIXME: these prototypes MUST NOT be here! */
   NTSTATUS STDCALL
   IoAttachDeviceToDeviceStackSafe(
     IN PDEVICE_OBJECT SourceDevice,
     IN PDEVICE_OBJECT TargetDevice,
     OUT PDEVICE_OBJECT *AttachedToDeviceObject);
-  
+
 #elif defined(_MSC_VER)
   #include <ntddk.h>
   #include <ntddser.h>
   #include <c:/progra~1/winddk/inc/ddk/wdm/wxp/wdmguid.h>
   #include <stdio.h>
-  
+
   #define STDCALL
-  
+
   #define DPRINT1 DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
   #define CHECKPOINT1 DbgPrint("(%s:%d)\n")
-  
+
   #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
-  
+
   NTSTATUS STDCALL
   IoAttachDeviceToDeviceStackSafe(
     IN PDEVICE_OBJECT SourceDevice,
     IN PDEVICE_OBJECT TargetDevice,
     OUT PDEVICE_OBJECT *AttachedToDeviceObject);
-  
+
   #define DPRINT DPRINT1
   #define CHECKPOINT CHECKPOINT1
-  
+
   #define SR_MSR_DSR 0x20
 #else
   #error Unknown compiler!
@@ -61,13 +61,13 @@ typedef struct _COMMON_DEVICE_EXTENSION
 typedef struct _FDO_DEVICE_EXTENSION
 {
        COMMON_DEVICE_EXTENSION Common;
-       
+
        PDEVICE_OBJECT LowerDevice;
        PDEVICE_OBJECT Pdo;
        IO_REMOVE_LOCK RemoveLock;
-       
+
        UNICODE_STRING SerenumInterfaceName;
-       
+
        PDEVICE_OBJECT AttachedPdo;
        ULONG Flags;
 } FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
@@ -75,9 +75,9 @@ typedef struct _FDO_DEVICE_EXTENSION
 typedef struct _PDO_DEVICE_EXTENSION
 {
        COMMON_DEVICE_EXTENSION Common;
-       
+
        PDEVICE_OBJECT AttachedFdo;
-       
+
        UNICODE_STRING DeviceDescription; // REG_SZ
        UNICODE_STRING DeviceId;          // REG_SZ
        UNICODE_STRING HardwareIds;       // REG_MULTI_SZ
index 7796238..5059e35 100644 (file)
@@ -220,23 +220,23 @@ ScrWrite(PDEVICE_OBJECT DeviceObject,
                   vidmem[(cursorx * 2) + (cursory * columns * 2)] = ' ';
                   vidmem[(cursorx * 2) + (cursory * columns * 2) + 1] = (char) DeviceExtension->CharAttribute;
                   break;
-                  
+
                case '\n':
                   cursory++;
                   cursorx = 0;
                   break;
-                  
+
                case '\r':
                   cursorx = 0;
                   break;
-                  
+
                case '\t':
                   offset = TAB_WIDTH - (cursorx % TAB_WIDTH);
                   for (j = 0; j < offset; j++)
                      {
                         vidmem[(cursorx * 2) + (cursory * columns * 2)] = ' ';
                         cursorx++;
-                        
+
                         if (cursorx >= columns)
                            {
                               cursory++;
@@ -244,7 +244,7 @@ ScrWrite(PDEVICE_OBJECT DeviceObject,
                            }
                      }
                   break;
-                  
+
                default:
                   vidmem[(cursorx * 2) + (cursory * columns * 2)] = *pch;
                   vidmem[(cursorx * 2) + (cursory * columns * 2) + 1] = (char) DeviceExtension->CharAttribute;
@@ -278,7 +278,7 @@ ScrWrite(PDEVICE_OBJECT DeviceObject,
                      }
                }
          }
-       
+
        /* Set the cursor position */
        offset = (cursory * columns) + cursorx;
     }
@@ -451,7 +451,7 @@ ScrIoControl(PDEVICE_OBJECT DeviceObject,
             }
 
           Buf->dwTransfered = Buf->nLength;
-                
+
           Irp->IoStatus.Information = 0;
           Status = STATUS_SUCCESS;
         }
index 20807f3..38b6150 100644 (file)
@@ -224,7 +224,7 @@ InbvInitVGAMode(VOID)
 BOOL STDCALL
 VidResetDisplay(VOID)
 {
-   /* 
+   /*
     * We are only using standard VGA facilities so we can rely on the
     * HAL 'int10mode3' reset to cleanup the hardware state.
     */
@@ -368,17 +368,17 @@ InbvDisplayCompressedBitmap()
       while ((j < bminfo->bV5SizeImage) && (k < (ULONG) (bminfo->bV5Width * bminfo->bV5Height)))
       {
          unsigned char b;
-    
+
          clen = BootimageBitmap[bfOffBits + j];
          j++;
-    
+
          if (clen > 0)
          {
             /* Encoded mode */
-    
+
             b = BootimageBitmap[bfOffBits + j];
             j++;
-    
+
             for (i = 0; i < (clen / 2); i++)
             {
                ImageData[k] = (b & 0xf0) >> 4;
@@ -397,7 +397,7 @@ InbvDisplayCompressedBitmap()
             /* Absolute mode */
             b = BootimageBitmap[bfOffBits + j];
             j++;
-    
+
             if (b == 0)
             {
                /* End of line */
@@ -428,13 +428,13 @@ InbvDisplayCompressedBitmap()
                {
                   DPRINT("Unaligned copy!\n");
                }
-    
+
                clen = b;
                for (i = 0; i < (clen / 2); i++)
                {
                   b = BootimageBitmap[bfOffBits + j];
                   j++;
-       
+
                   ImageData[k] = (b & 0xf0) >> 4;
                   k++;
                   ImageData[k] = b & 0xf;
@@ -559,7 +559,7 @@ VidInitialize(VOID)
 
    InbvMapVideoMemory();
    InbvInitVGAMode();
-  
+
    Status = PsCreateSystemThread(
       &BitmapThreadHandle,
       THREAD_ALL_ACCESS,
@@ -568,7 +568,7 @@ VidInitialize(VOID)
       &BitmapThreadId,
       InbvBitmapThreadMain,
       NULL);
+
    if (!NT_SUCCESS(Status))
    {
       return FALSE;
@@ -586,7 +586,7 @@ VidDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
    PIO_STACK_LOCATION IrpSp;
    NTSTATUS Status;
    NTBOOTVID_FUNCTION_TABLE* FunctionTable;
+
    IrpSp = IoGetCurrentIrpStackLocation(Irp);
    Status = STATUS_SUCCESS;
 
@@ -609,7 +609,7 @@ VidDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
                break;
 
             case IOCTL_BOOTVID_CLEANUP:
-               VidCleanUp();     
+               VidCleanUp();
                break;
 
             default:
index bb80162..23c8077 100644 (file)
@@ -45,44 +45,44 @@ typedef long FXPT2DOT30;
 
 typedef struct tagCIEXYZ
 {
-   FXPT2DOT30 ciexyzX; 
-   FXPT2DOT30 ciexyzY; 
-   FXPT2DOT30 ciexyzZ; 
+   FXPT2DOT30 ciexyzX;
+   FXPT2DOT30 ciexyzY;
+   FXPT2DOT30 ciexyzZ;
 } CIEXYZ, *LPCIEXYZ;
 
 typedef struct tagCIEXYZTRIPLE
 {
-   CIEXYZ ciexyzRed; 
-   CIEXYZ ciexyzGreen; 
-   CIEXYZ ciexyzBlue; 
+   CIEXYZ ciexyzRed;
+   CIEXYZ ciexyzGreen;
+   CIEXYZ ciexyzBlue;
 } CIEXYZTRIPLE, *LPCIEXYZTRIPLE;
 
-typedef struct { 
-   DWORD bV5Size; 
-   LONG bV5Width; 
-   LONG bV5Height; 
-   WORD bV5Planes; 
-   WORD bV5BitCount; 
-   DWORD bV5Compression; 
-   DWORD bV5SizeImage; 
-   LONG bV5XPelsPerMeter; 
-   LONG bV5YPelsPerMeter; 
-   DWORD bV5ClrUsed; 
-   DWORD bV5ClrImportant; 
-   DWORD bV5RedMask; 
-   DWORD bV5GreenMask; 
-   DWORD bV5BlueMask; 
-   DWORD bV5AlphaMask; 
-   DWORD bV5CSType; 
-   CIEXYZTRIPLE bV5Endpoints; 
-   DWORD bV5GammaRed; 
-   DWORD bV5GammaGreen; 
-   DWORD bV5GammaBlue; 
-   DWORD bV5Intent; 
-   DWORD bV5ProfileData; 
-   DWORD bV5ProfileSize; 
-   DWORD bV5Reserved; 
-} BITMAPV5HEADER, *PBITMAPV5HEADER; 
+typedef struct {
+   DWORD bV5Size;
+   LONG bV5Width;
+   LONG bV5Height;
+   WORD bV5Planes;
+   WORD bV5BitCount;
+   DWORD bV5Compression;
+   DWORD bV5SizeImage;
+   LONG bV5XPelsPerMeter;
+   LONG bV5YPelsPerMeter;
+   DWORD bV5ClrUsed;
+   DWORD bV5ClrImportant;
+   DWORD bV5RedMask;
+   DWORD bV5GreenMask;
+   DWORD bV5BlueMask;
+   DWORD bV5AlphaMask;
+   DWORD bV5CSType;
+   CIEXYZTRIPLE bV5Endpoints;
+   DWORD bV5GammaRed;
+   DWORD bV5GammaGreen;
+   DWORD bV5GammaBlue;
+   DWORD bV5Intent;
+   DWORD bV5ProfileData;
+   DWORD bV5ProfileSize;
+   DWORD bV5Reserved;
+} BITMAPV5HEADER, *PBITMAPV5HEADER;
 
 /*
  * Private driver structures
index 7597730..bae70e1 100644 (file)
  * NOTES:
  * In your usermode application, do something like this:
  *
- *  DebugHandle = CreateFile("\\\\.\\DebugOut", 
- *                           GENERIC_WRITE, 
- *                           0, 
+ *  DebugHandle = CreateFile("\\\\.\\DebugOut",
+ *                           GENERIC_WRITE,
+ *                           0,
  *                           NULL,
- *                           OPEN_EXISTING, 
- *                           FILE_ATTRIBUTE_NORMAL, 
+ *                           OPEN_EXISTING,
+ *                           FILE_ATTRIBUTE_NORMAL,
  *                           NULL);
  *
  * and write to your hearts content to DebugHandle.
@@ -35,7 +35,7 @@ DebugOutDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
   char Buf[513];
   unsigned Remaining;
   unsigned Length;
+
   nErrCode = STATUS_SUCCESS;
 
   switch(piosStack->MajorFunction)
@@ -88,7 +88,7 @@ DebugOutUnload(PDRIVER_OBJECT DriverObject)
 {
 }
 
-NTSTATUS STDCALL 
+NTSTATUS STDCALL
 DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
 {
   PDEVICE_OBJECT DebugOutDevice;
index c16a1cd..fea2d1d 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS VT100 emulator
  * FILE:            drivers/dd/green/createclose.c
  * PURPOSE:         IRP_MJ_CREATE, IRP_MJ_CLOSE and IRP_MJ_CLEANUP operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -17,7 +17,7 @@ GreenCreate(
        IN PIRP Irp)
 {
        DPRINT("Green: IRP_MJ_CREATE\n");
-       
+
        Irp->IoStatus.Status = STATUS_SUCCESS;
        Irp->IoStatus.Information = 0;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
@@ -30,7 +30,7 @@ GreenClose(
        IN PIRP Irp)
 {
        DPRINT("Green: IRP_MJ_CLOSE\n");
-       
+
        Irp->IoStatus.Status = STATUS_SUCCESS;
        Irp->IoStatus.Information = 0;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
index 18ca673..fcced05 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS VT100 emulator
  * FILE:            drivers/dd/green/dispatch.c
  * PURPOSE:         Dispatch routines
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -20,16 +20,16 @@ GreenDispatch(
        GREEN_DEVICE_TYPE DeviceType;
        ULONG_PTR Information;
        NTSTATUS Status;
-       
+
        MajorFunction = IoGetCurrentIrpStackLocation(Irp)->MajorFunction;
        DeviceType = ((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Type;
-       
+
        Information = Irp->IoStatus.Information;
        Status = Irp->IoStatus.Status;
-       
+
        DPRINT("Green: Dispatching major function 0x%lx, DeviceType %d\n",
                MajorFunction, DeviceType);
-       
+
        if (MajorFunction == IRP_MJ_CREATE && DeviceType == Green)
                return GreenCreate(DeviceObject, Irp);
        else if (MajorFunction == IRP_MJ_CLOSE && DeviceType == Green)
@@ -57,7 +57,7 @@ GreenDispatch(
                DPRINT1("Green: unknown combination: MajorFunction 0x%lx, DeviceType %d\n",
                        MajorFunction, DeviceType);
        }
-       
+
        Irp->IoStatus.Information = Information;
        Irp->IoStatus.Status = Status;
        IoCompleteRequest (Irp, IO_NO_INCREMENT);
index d21e73a..a83db8f 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS VT100 emulator
  * FILE:            drivers/dd/green/green.c
  * PURPOSE:         Driver entry point
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -26,19 +26,19 @@ DriverEntry(
        IN PUNICODE_STRING RegPath)
 {
        ULONG i;
-       
+
        DriverObject->DriverUnload = DriverUnload;
        DriverObject->DriverExtension->AddDevice = GreenAddDevice;
-       
+
        for (i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++)
                DriverObject->MajorFunction[i] = GreenDispatch;
-       
+
        /* keyboard only */
        //DriverObject->DriverStartIo = GreenStartIo;
-       
+
        /* keyboard and screen */
        DriverObject->MajorFunction[IRP_MJ_CREATE] = GreenCreate;
        DriverObject->MajorFunction[IRP_MJ_CLOSE] = GreenClose;
-       
+
        return STATUS_SUCCESS;
 }
index 46cda1d..dfcc9a2 100644 (file)
@@ -4,19 +4,19 @@
   #include <ntos/halfuncs.h>
   #include <ddk/ntddblue.h>
   #include <ddk/ntddkbd.h> /* should be in kbdmou.h */
-  
+
   #include <debug.h>
-  
+
   /* FIXME: should be in kbdmou.h */
   typedef struct _CONNECT_DATA {
     PDEVICE_OBJECT ClassDeviceObject;
     PVOID ClassService;
   } CONNECT_DATA, *PCONNECT_DATA;
-  
+
   /* FIXME: should be in kbdmou.h */
   #define IOCTL_INTERNAL_KEYBOARD_CONNECT \
     CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
-  
+
   NTSTATUS STDCALL
   ObReferenceObjectByName(PUNICODE_STRING ObjectPath,
     ULONG Attributes,
     KPROCESSOR_MODE AccessMode,
     PVOID ParseContext,
     PVOID* ObjectPtr);
-  
+
   /* FIXME: should be in kbdmou.h */
   typedef VOID (*PSERVICE_CALLBACK_ROUTINE)(PDEVICE_OBJECT, PKEYBOARD_INPUT_DATA, PKEYBOARD_INPUT_DATA, PULONG);
-  
+
   typedef struct _CLASS_INFORMATION
   {
     PDEVICE_OBJECT DeviceObject;
     PVOID CallBack;
   } CLASS_INFORMATION, *PCLASS_INFORMATION;
-  
+
   #define KEYBOARD_BUFFER_SIZE 100
-  
+
 #elif defined(_MSC_VER)
   #include <ntddk.h>
   #include <ntddser.h>
   #include <kbdmou.h>
 
   #define STDCALL
-  
+
   #define DPRINT1 DbgPrint("(%s:%d) ", __FILE__, __LINE__), DbgPrint
   #define CHECKPOINT1 DbgPrint("(%s:%d)\n", __FILE__, __LINE__)
   #define DPRINT DPRINT1
@@ -69,11 +69,11 @@ typedef struct _KEYBOARD_DEVICE_EXTENSION
 {
        COMMON_DEVICE_EXTENSION Common;
        PDEVICE_OBJECT Green;
-       
+
        CLASS_INFORMATION ClassInformation;
        HANDLE WorkerThreadHandle;
        KDPC KeyboardDpc;
-       
+
        ULONG ActiveQueue;
        ULONG InputDataCount[2];
        KEYBOARD_INPUT_DATA KeyboardInputData[2][KEYBOARD_BUFFER_SIZE];
@@ -83,7 +83,7 @@ typedef struct _SCREEN_DEVICE_EXTENSION
 {
        COMMON_DEVICE_EXTENSION Common;
        PDEVICE_OBJECT Green;
-       
+
        PUCHAR VideoMemory;   /* Pointer to video memory */
        USHORT CharAttribute; /* Current color attribute */
        ULONG  Mode;
@@ -91,9 +91,9 @@ typedef struct _SCREEN_DEVICE_EXTENSION
        UCHAR  Rows;          /* Number of rows          */
        UCHAR  Columns;       /* Number of columns       */
        UCHAR  TabWidth;
-       
+
        ULONG LogicalOffset;  /* Position of the cursor  */
-       
+
        UCHAR SendBuffer[1024];
        ULONG SendBufferPosition;
 } SCREEN_DEVICE_EXTENSION, *PSCREEN_DEVICE_EXTENSION;
@@ -102,12 +102,12 @@ typedef struct _GREEN_DEVICE_EXTENSION
 {
        COMMON_DEVICE_EXTENSION Common;
        PDEVICE_OBJECT Serial;
-       
+
        PDEVICE_OBJECT LowerDevice;
        ULONG BaudRate;
        SERIAL_LINE_CONTROL LineControl;
        SERIAL_TIMEOUTS Timeouts;
-       
+
        PDEVICE_OBJECT Keyboard;
        PDEVICE_OBJECT Screen;
 } GREEN_DEVICE_EXTENSION, *PGREEN_DEVICE_EXTENSION;
index dd8c592..4033531 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS VT100 emulator
  * FILE:            drivers/dd/green/keyboard.c
  * PURPOSE:         Keyboard part of green management
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -21,14 +21,14 @@ TranslateCharToScanCodes(
 {
        BOOLEAN NormalKey = FALSE;
        USHORT MakeCode;
-       
+
        if (InputBufferSize == 0)
                return FALSE;
-       
+
        switch (*InputBuffer)
        {
                case 0x1b: MakeCode = 0x01; NormalKey = TRUE; break; /* ESC */
-               
+
                case '1': MakeCode = 0x02; NormalKey = TRUE; break;
                case '2': MakeCode = 0x03; NormalKey = TRUE; break;
                case '3': MakeCode = 0x04; NormalKey = TRUE; break;
@@ -42,7 +42,7 @@ TranslateCharToScanCodes(
                case '-': MakeCode = 0x0c; NormalKey = TRUE; break;
                case '=': MakeCode = 0x0d; NormalKey = TRUE; break;
                case '\b': MakeCode = 0x0e; NormalKey = TRUE; break;
-               
+
                case '\t': MakeCode = 0x0f; NormalKey = TRUE; break;
                case 'q': MakeCode = 0x10; NormalKey = TRUE; break;
                case 'w': MakeCode = 0x11; NormalKey = TRUE; break;
@@ -56,9 +56,9 @@ TranslateCharToScanCodes(
                case 'p': MakeCode = 0x19; NormalKey = TRUE; break;
                case '[': MakeCode = 0x1a; NormalKey = TRUE; break;
                case ']': MakeCode = 0x1b; NormalKey = TRUE; break;
-               
+
                case '\r': MakeCode = 0x1c; NormalKey = TRUE; break;
-               
+
                case 'a': MakeCode = 0x1e; NormalKey = TRUE; break;
                case 's': MakeCode = 0x1f; NormalKey = TRUE; break;
                case 'd': MakeCode = 0x20; NormalKey = TRUE; break;
@@ -70,11 +70,11 @@ TranslateCharToScanCodes(
                case 'l': MakeCode = 0x26; NormalKey = TRUE; break;
                case ';': MakeCode = 0x27; NormalKey = TRUE; break;
                case '\'': MakeCode = 0x28; NormalKey = TRUE; break;
-               
+
                case '`': MakeCode = 0x29; NormalKey = TRUE; break;
-               
+
                case '\\': MakeCode = 0x2b; NormalKey = TRUE; break;
-               
+
                case 'z': MakeCode = 0x2c; NormalKey = TRUE; break;
                case 'x': MakeCode = 0x2d; NormalKey = TRUE; break;
                case 'c': MakeCode = 0x2e; NormalKey = TRUE; break;
@@ -85,7 +85,7 @@ TranslateCharToScanCodes(
                case ',': MakeCode = 0x33; NormalKey = TRUE; break;
                case '.': MakeCode = 0x34; NormalKey = TRUE; break;
                case '/': MakeCode = 0x35; NormalKey = TRUE; break;
-               
+
                case ' ': MakeCode = 0x39; NormalKey = TRUE; break;
        }
        if (NormalKey && *OutputBufferSize >= 2)
@@ -97,7 +97,7 @@ TranslateCharToScanCodes(
                *BytesConsumed = 2;
                return TRUE;
        }
-       
+
        /* Consume strange character by ignoring it */
        DPRINT1("Green: strange byte received 0x%02x ('%c')\n",
                *InputBuffer, *InputBuffer >= 32 ? *InputBuffer : '.');
@@ -114,9 +114,9 @@ KeyboardInitialize(
        PKEYBOARD_DEVICE_EXTENSION DeviceExtension;
        UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\KeyboardClass1");
        NTSTATUS Status;
-       
+
        DPRINT("Green: KeyboardInitialize() called\n");
-       
+
        Status = IoCreateDevice(DriverObject,
                sizeof(KEYBOARD_DEVICE_EXTENSION),
                &DeviceName, /* FIXME: don't hardcode string */
@@ -126,15 +126,15 @@ KeyboardInitialize(
                &Fdo);
        if (!NT_SUCCESS(Status))
                return Status;
-       
+
        DeviceExtension = (PKEYBOARD_DEVICE_EXTENSION)Fdo->DeviceExtension;
        RtlZeroMemory(DeviceExtension, sizeof(KEYBOARD_DEVICE_EXTENSION));
        DeviceExtension->Common.Type = Keyboard;
        Fdo->Flags |= DO_POWER_PAGABLE | DO_BUFFERED_IO;
        Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
-       
+
        *KeyboardFdo = Fdo;
-       
+
        return STATUS_SUCCESS;
 }
 
@@ -148,9 +148,9 @@ KeyboardDpcSendData(
        PKEYBOARD_DEVICE_EXTENSION DeviceExtension;
        ULONG Queue;
        ULONG InputDataConsumed;
-       
+
        DeviceExtension = (PKEYBOARD_DEVICE_EXTENSION)pDeviceExtension;
-       
+
        Queue = DeviceExtension->ActiveQueue % 2;
        InterlockedIncrement((PLONG)&DeviceExtension->ActiveQueue);
        (*(PSERVICE_CALLBACK_ROUTINE)DeviceExtension->ClassInformation.CallBack)(
@@ -158,7 +158,7 @@ KeyboardDpcSendData(
                        DeviceExtension->KeyboardInputData[Queue],
                        &DeviceExtension->KeyboardInputData[Queue][DeviceExtension->InputDataCount[Queue]],
                        &InputDataConsumed);
-       
+
        DeviceExtension->InputDataCount[Queue] = 0;
 }
 static VOID STDCALL
@@ -180,22 +180,22 @@ KeyboardDeviceWorker(
        ULONG BytesConsumed;
        PKEYBOARD_INPUT_DATA Input;
        NTSTATUS Status;
-       
+
        DPRINT("Green: KeyboardDeviceWorker() called\n");
-       
+
        DeviceObject = (PDEVICE_OBJECT)Context;
        DeviceExtension = (PKEYBOARD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        GreenDeviceExtension = (PGREEN_DEVICE_EXTENSION)DeviceExtension->Green->DeviceExtension;
        LowerDevice = GreenDeviceExtension->Serial;
        BufferSize = sizeof(Buffer);
-       
+
        /* Initialize device extension */
        DeviceExtension->ActiveQueue = 0;
        DeviceExtension->InputDataCount[0] = 0;
        DeviceExtension->InputDataCount[1] = 0;
        KeInitializeDpc(&DeviceExtension->KeyboardDpc, KeyboardDpcSendData, DeviceExtension);
        RtlZeroMemory(&DeviceExtension->KeyboardInputData, sizeof(DeviceExtension->KeyboardInputData));
-       
+
        /* main read loop */
        while (TRUE)
        {
@@ -214,7 +214,7 @@ KeyboardDeviceWorker(
                        KeStallExecutionProcessor(10);
                        continue;
                }
-               
+
                Status = IoCallDriver(LowerDevice, Irp);
                if (Status == STATUS_PENDING)
                {
@@ -223,15 +223,15 @@ KeyboardDeviceWorker(
                }
                if (!NT_SUCCESS(Status))
                        continue;
-               
+
                /* Read all available data and process */
                i = 0;
                while (i < ioStatus.Information)
                {
                        Queue = DeviceExtension->ActiveQueue % 2;
-                       
+
                        Input = &DeviceExtension->KeyboardInputData[Queue][DeviceExtension->InputDataCount[Queue]];
-                       
+
                        /* Translate current chars to scan codes */
                        SpaceInQueue = KEYBOARD_BUFFER_SIZE - DeviceExtension->InputDataCount[Queue];
                        if (TranslateCharToScanCodes(
@@ -243,7 +243,7 @@ KeyboardDeviceWorker(
                        {
                                DPRINT1("Green: got char 0x%02x (%c)\n", Buffer[i], Buffer[i] >= 32 ? Buffer[i] : ' ');
                                DeviceExtension->InputDataCount[Queue] += BytesConsumed;
-                               
+
                                /* Send the data to the keyboard class driver */
                                KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
                                KeInsertQueueDpc(&DeviceExtension->KeyboardDpc, NULL, NULL);
@@ -262,7 +262,7 @@ KeyboardDeviceWorker(
                        }
                }
        }
-       
+
        PsTerminateSystemThread(STATUS_SUCCESS);
 }
 
@@ -277,30 +277,30 @@ KeyboardInternalDeviceControl(
        OBJECT_ATTRIBUTES objectAttributes;
        PDEVICE_OBJECT LowerDevice;
        NTSTATUS Status;
-       
+
        Stack = IoGetCurrentIrpStackLocation(Irp);
        Irp->IoStatus.Information = 0;
        DeviceExtension = (PKEYBOARD_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        GreenDeviceExtension = (PGREEN_DEVICE_EXTENSION)DeviceExtension->Green->DeviceExtension;
        LowerDevice = GreenDeviceExtension->Serial;
        DPRINT1("Green: LowerDevice %p\n", LowerDevice);
-       
+
        switch (Stack->Parameters.DeviceIoControl.IoControlCode)
        {
                case IOCTL_INTERNAL_KEYBOARD_CONNECT:
                {
                        ULONG Fcr;
-                       
+
                        DPRINT("Green: IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_KEYBOARD_CONNECT\n");
                        if (Stack->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONNECT_DATA))
                        {
                                Status = STATUS_INVALID_PARAMETER;
                                break;
                        }
-                       
+
                        DeviceExtension->ClassInformation =
                                *((PCLASS_INFORMATION)Stack->Parameters.DeviceIoControl.Type3InputBuffer);
-                       
+
                        /* Initialize serial port */
                        Fcr = 0;
                        Status = GreenDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_FIFO_CONTROL,
@@ -314,12 +314,12 @@ KeyboardInternalDeviceControl(
                        Status = GreenDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_LINE_CONTROL,
                                &GreenDeviceExtension->LineControl, sizeof(GreenDeviceExtension->LineControl), NULL, NULL);
                        if (!NT_SUCCESS(Status)) break;
-                       
+
                        /* Set timeouts */
                        Status = GreenDeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_TIMEOUTS,
                                &GreenDeviceExtension->Timeouts, sizeof(GreenDeviceExtension->Timeouts), NULL, NULL);
                        if (!NT_SUCCESS(Status)) break;
-                       
+
                        /* Start read loop */
                        InitializeObjectAttributes(&objectAttributes, NULL, OBJ_KERNEL_HANDLE, NULL, NULL);
                        Status = PsCreateSystemThread(
@@ -339,7 +339,7 @@ KeyboardInternalDeviceControl(
                        Status = STATUS_INVALID_DEVICE_REQUEST;
                }
        }
-       
+
        Irp->IoStatus.Status = Status;
        IoCompleteRequest (Irp, IO_NO_INCREMENT);
        return Status;
index e5a4872..28a0d47 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS VT100 emulator
  * FILE:            drivers/dd/green/misc.c
  * PURPOSE:         Misceallenous operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -24,9 +24,9 @@ GreenDeviceIoControl(
        PIRP Irp;
        IO_STATUS_BLOCK IoStatus;
        NTSTATUS Status;
-       
+
        KeInitializeEvent (&Event, NotificationEvent, FALSE);
-       
+
        Irp = IoBuildDeviceIoControlRequest(CtlCode,
                DeviceObject,
                InputBuffer,
@@ -41,20 +41,20 @@ GreenDeviceIoControl(
                DPRINT("Green: IoBuildDeviceIoControlRequest() failed\n");
                return STATUS_INSUFFICIENT_RESOURCES;
        }
-       
+
        Status = IoCallDriver(DeviceObject, Irp);
-       
+
        if (Status == STATUS_PENDING)
        {
                DPRINT("Green: Operation pending\n");
                KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
                Status = IoStatus.Status;
        }
-       
+
        if (OutputBufferSize)
        {
                *OutputBufferSize = IoStatus.Information;
        }
-       
+
        return Status;
 }
index 698accc..554d12f 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS VT100 emulator
  * FILE:            drivers/dd/green/pnp.c
  * PURPOSE:         IRP_MJ_PNP operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (hpoussin@reactos.com)
  */
 
@@ -20,9 +20,9 @@ GreenAddDevice(
        PGREEN_DEVICE_EXTENSION DeviceExtension;
        UNICODE_STRING serialPortName;
        NTSTATUS Status;
-       
+
        DPRINT("Green: AddDevice(DriverObject %p, Pdo %p)\n", DriverObject, Pdo);
-       
+
        /* Create green FDO */
        Status = IoCreateDevice(DriverObject,
                sizeof(GREEN_DEVICE_EXTENSION),
@@ -33,11 +33,11 @@ GreenAddDevice(
                &Fdo);
        if (!NT_SUCCESS(Status))
                return Status;
-       
+
        DeviceExtension = (PGREEN_DEVICE_EXTENSION)Fdo->DeviceExtension;
        RtlZeroMemory(DeviceExtension, sizeof(GREEN_DEVICE_EXTENSION));
        DeviceExtension->Common.Type = Green;
-       
+
        Status = KeyboardInitialize(DriverObject, &DeviceExtension->Keyboard);
        if (!NT_SUCCESS(Status))
        {
@@ -45,7 +45,7 @@ GreenAddDevice(
                return Status;
        }
        ((PKEYBOARD_DEVICE_EXTENSION)DeviceExtension->Keyboard->DeviceExtension)->Green = Fdo;
-       
+
        Status = ScreenInitialize(DriverObject, &DeviceExtension->Screen);
        if (!NT_SUCCESS(Status))
        {
@@ -54,7 +54,7 @@ GreenAddDevice(
                return Status;
        }
        ((PSCREEN_DEVICE_EXTENSION)DeviceExtension->Screen->DeviceExtension)->Green = Fdo;
-       
+
        /* initialize green Fdo */
        DeviceExtension->LowerDevice = IoAttachDeviceToDeviceStack(Fdo, Pdo);
        DeviceExtension->LineControl.WordLength = 8;
@@ -66,7 +66,7 @@ GreenAddDevice(
        DeviceExtension->Timeouts.ReadTotalTimeoutMultiplier = INFINITE;
        DeviceExtension->Timeouts.WriteTotalTimeoutMultiplier = 0; /* FIXME */
        DeviceExtension->Timeouts.WriteTotalTimeoutConstant = 0; /* FIXME */
-       
+
        /* open associated serial port */
        RtlInitUnicodeString(&serialPortName, L"\\Device\\Serial1"); /* FIXME: don't hardcode string */
        Status = ObReferenceObjectByName(
@@ -79,9 +79,9 @@ GreenAddDevice(
                NULL,
                (PVOID*)&DeviceExtension->Serial);
        /* FIXME: we never ObDereferenceObject */
-       
+
        Fdo->Flags |= DO_POWER_PAGABLE | DO_BUFFERED_IO;
        Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
-       
+
        return Status;
 }
index 3543f70..834c31a 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS VT100 emulator
  * FILE:            drivers/dd/green/screen.c
  * PURPOSE:         Screen part of green management
- * 
+ *
  * PROGRAMMERS:     Eric Kohl (ekohl@abo.rhein-zeitung.de)
  *                  Art Yerkes
  *                  Hervé Poussineau (hpoussin@reactos.com)
@@ -38,7 +38,7 @@ AddToSendBuffer(
        int CurrentInt;
        UCHAR CurrentChar;
        NTSTATUS Status;
-       
+
        SizeLeft = sizeof(DeviceExtension->SendBuffer) - DeviceExtension->SendBufferPosition;
        if (SizeLeft < NumberOfChars * 2 || NumberOfChars == 0)
        {
@@ -64,7 +64,7 @@ AddToSendBuffer(
                DeviceExtension->SendBufferPosition = 0;
                SizeLeft = sizeof(DeviceExtension->SendBuffer);
        }
-       
+
        va_start(args, NumberOfChars);
        while (NumberOfChars-- > 0)
        {
@@ -72,10 +72,10 @@ AddToSendBuffer(
                if (CurrentInt > 0)
                {
                        CurrentChar = (UCHAR)CurrentInt;
-                       
+
                        /* Why 0xff chars are printed on a 'dir' ? */
                        if (CurrentChar == 0xff) CurrentChar = ' ';
-                       
+
                        DeviceExtension->SendBuffer[DeviceExtension->SendBufferPosition++] = CurrentChar;
                        SizeLeft--;
                }
@@ -111,9 +111,9 @@ ScreenInitialize(
        PSCREEN_DEVICE_EXTENSION DeviceExtension;
        UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\BlueScreen");
        NTSTATUS Status;
-       
+
        DPRINT("Green: ScreenInitialize() called\n");
-       
+
        Status = IoCreateDevice(DriverObject,
                sizeof(SCREEN_DEVICE_EXTENSION),
                &DeviceName, /* FIXME: don't hardcode string */
@@ -123,7 +123,7 @@ ScreenInitialize(
                &Fdo);
        if (!NT_SUCCESS(Status))
                return Status;
-       
+
        DeviceExtension = (PSCREEN_DEVICE_EXTENSION)Fdo->DeviceExtension;
        RtlZeroMemory(DeviceExtension, sizeof(SCREEN_DEVICE_EXTENSION));
        DeviceExtension->Common.Type = Screen;
@@ -140,21 +140,21 @@ ScreenInitialize(
                return STATUS_INSUFFICIENT_RESOURCES;
        }
        DeviceExtension->TabWidth = 8;
-       
+
        /* more initialization */
        DeviceExtension->Mode = ENABLE_PROCESSED_OUTPUT |
                ENABLE_WRAP_AT_EOL_OUTPUT;
-       
+
        /* initialize screen at next write */
        AddToSendBuffer(DeviceExtension, 2, ESC, 'c'); /* reset device */
        AddToSendBuffer(DeviceExtension, 4, ESC, '[', '7', 'l'); /* disable line wrap */
        AddToSendBuffer(DeviceExtension, 4, ESC, '[', '3', 'g'); /* clear all tabs */
-       
+
        Fdo->Flags |= DO_POWER_PAGABLE | DO_BUFFERED_IO;
        Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
-       
+
        *ScreenFdo = Fdo;
-       
+
        return STATUS_SUCCESS;
 }
 
@@ -168,19 +168,19 @@ ScreenWrite(
        PSCREEN_DEVICE_EXTENSION DeviceExtension;
        PUCHAR VideoMemory; /* FIXME: is it useful? */
        ULONG VideoMemorySize; /* FIXME: is it useful? */
-       
+
        ULONG Columns, Rows;
        ULONG CursorX, CursorY;
        ULONG i, j;
        NTSTATUS Status;
-       
+
        DPRINT("Green: IRP_MJ_WRITE\n");
-       
+
        Stack = IoGetCurrentIrpStackLocation (Irp);
        Buffer = Irp->UserBuffer;
        DeviceExtension = (PSCREEN_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        VideoMemory = DeviceExtension->VideoMemory;
-       
+
        Columns = DeviceExtension->Columns;
        Rows = DeviceExtension->Rows;
        CursorX = (DeviceExtension->LogicalOffset / 2) % Columns + 1;
@@ -191,14 +191,14 @@ ScreenWrite(
        for (i = 0; i < Stack->Parameters.Write.Length; i++)
                DbgPrint(" 0x%02x", Buffer[i]);
        DbgPrint("\n");
-       
+
        if (!(DeviceExtension->Mode & ENABLE_PROCESSED_OUTPUT))
        {
                /* raw output mode */
                CHECKPOINT;
                Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
                IoCompleteRequest (Irp, IO_NO_INCREMENT);
-               
+
                return STATUS_NOT_SUPPORTED;
        }
        else
@@ -271,7 +271,7 @@ ScreenWrite(
                                                DPRINT1("Y: %lu -> %lu\n", CursorY, CursorY + 1);
                                                CursorY++;
                                                AddToSendBuffer(DeviceExtension, 6, ESC, '[', -(int)CursorY, ';', '1', 'H');
-                                               
+
                                        }
                                }
                        }
@@ -284,16 +284,16 @@ ScreenWrite(
                        }
                }
        }
-       
+
        DeviceExtension->LogicalOffset = ((CursorX-1) + (CursorY-1) * Columns) * 2;
-       
+
        /* flush output buffer */
        AddToSendBuffer(DeviceExtension, 0);
-       
+
        Status = STATUS_SUCCESS;
        Irp->IoStatus.Status = Status;
        IoCompleteRequest (Irp, IO_NO_INCREMENT);
-       
+
        return Status;
 }
 
@@ -305,35 +305,35 @@ ScreenDeviceControl(
        PIO_STACK_LOCATION Stack;
        PSCREEN_DEVICE_EXTENSION DeviceExtension;
        NTSTATUS Status;
-       
+
        Stack = IoGetCurrentIrpStackLocation(Irp);
        DeviceExtension = (PSCREEN_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-       
+
        switch (Stack->Parameters.DeviceIoControl.IoControlCode)
        {
                case IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO:
                {
                        PCONSOLE_SCREEN_BUFFER_INFO pcsbi;
                        DPRINT("Green: IRP_MJ_DEVICE_CONTROL / IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO\n");
-                       
+
                        pcsbi = (PCONSOLE_SCREEN_BUFFER_INFO)Irp->AssociatedIrp.SystemBuffer;
-                       
+
                        pcsbi->dwSize.X = DeviceExtension->Columns;
                        pcsbi->dwSize.Y = DeviceExtension->Rows;
-                       
+
                        pcsbi->dwCursorPosition.X = (SHORT)(DeviceExtension->LogicalOffset % DeviceExtension->Columns);
                        pcsbi->dwCursorPosition.Y = (SHORT)(DeviceExtension->LogicalOffset / DeviceExtension->Columns);
-                       
+
                        pcsbi->wAttributes = DeviceExtension->CharAttribute;
-                       
+
                        pcsbi->srWindow.Left   = 1;
                        pcsbi->srWindow.Right  = DeviceExtension->Columns;
                        pcsbi->srWindow.Top    = 1;
                        pcsbi->srWindow.Bottom = DeviceExtension->Rows;
-                       
+
                        pcsbi->dwMaximumWindowSize.X = DeviceExtension->Columns;
                        pcsbi->dwMaximumWindowSize.Y = DeviceExtension->Rows;
-                       
+
                        Irp->IoStatus.Information = sizeof(CONSOLE_SCREEN_BUFFER_INFO);
                        Status = STATUS_SUCCESS;
                        break;
@@ -342,7 +342,7 @@ ScreenDeviceControl(
                {
                        PCONSOLE_SCREEN_BUFFER_INFO pcsbi;
                        DPRINT("Green: IRP_MJ_DEVICE_CONTROL / IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO\n");
-                       
+
                        pcsbi = (PCONSOLE_SCREEN_BUFFER_INFO)Irp->AssociatedIrp.SystemBuffer;
                        /* FIXME: remove */ { pcsbi->dwCursorPosition.X++; }
                        /* FIXME: remove */ { pcsbi->dwCursorPosition.Y++; }
@@ -350,19 +350,19 @@ ScreenDeviceControl(
                        ASSERT(pcsbi->dwCursorPosition.Y >= 1);
                        ASSERT(pcsbi->dwCursorPosition.X <= DeviceExtension->Columns);
                        ASSERT(pcsbi->dwCursorPosition.Y <= DeviceExtension->Rows);
-                       
+
                        DeviceExtension->LogicalOffset = (
                                (pcsbi->dwCursorPosition.Y-1) * DeviceExtension->Columns +
                                (pcsbi->dwCursorPosition.X-1)) * 2;
                        AddToSendBuffer(DeviceExtension, 6, ESC, '[',
                                -(int)pcsbi->dwCursorPosition.Y, ';',
                                -(int)pcsbi->dwCursorPosition.X, 'H');
-                       
+
                        /* flush buffer */
                        AddToSendBuffer(DeviceExtension, 0);
-                       
+
                        DeviceExtension->CharAttribute = pcsbi->wAttributes;
-                       
+
                        Irp->IoStatus.Information = 0;
                        Status = STATUS_SUCCESS;
                        break;
@@ -371,10 +371,10 @@ ScreenDeviceControl(
                {
                        PCONSOLE_CURSOR_INFO pcci = (PCONSOLE_CURSOR_INFO)Irp->AssociatedIrp.SystemBuffer;
                        DPRINT("Green: IRP_MJ_DEVICE_CONTROL / IOCTL_CONSOLE_GET_CURSOR_INFO\n");
-                       
+
                        pcci->dwSize = 1;
                        pcci->bVisible = TRUE;
-                       
+
                        Irp->IoStatus.Information = sizeof (CONSOLE_CURSOR_INFO);
                        Status = STATUS_SUCCESS;
                        break;
@@ -383,9 +383,9 @@ ScreenDeviceControl(
                {
                        PCONSOLE_MODE pcm = (PCONSOLE_MODE)Irp->AssociatedIrp.SystemBuffer;
                        DPRINT("Green: IRP_MJ_DEVICE_CONTROL / IOCTL_CONSOLE_GET_MODE\n");
-                       
+
                        pcm->dwMode = DeviceExtension->Mode;
-                       
+
                        Irp->IoStatus.Information = sizeof(CONSOLE_MODE);
                        Status = STATUS_SUCCESS;
                        break;
@@ -394,9 +394,9 @@ ScreenDeviceControl(
                {
                        PCONSOLE_MODE pcm = (PCONSOLE_MODE)Irp->AssociatedIrp.SystemBuffer;
                        DPRINT("Green: IRP_MJ_DEVICE_CONTROL / IOCTL_CONSOLE_SET_MODE\n");
-                       
+
                        DeviceExtension->Mode = pcm->dwMode;
-                       
+
                        Irp->IoStatus.Information = 0;
                        Status = STATUS_SUCCESS;
                        break;
@@ -422,7 +422,7 @@ ScreenDeviceControl(
                case IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE:
                {
                        DPRINT("Green: IRP_MJ_DEVICE_CONTROL / IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE\n");
-                       
+
                        DeviceExtension->CharAttribute = (WORD)*(PWORD)Irp->AssociatedIrp.SystemBuffer;
                        Irp->IoStatus.Information = 0;
                        Status = STATUS_SUCCESS;
@@ -453,7 +453,7 @@ ScreenDeviceControl(
                        ULONG x, y;
                        BOOLEAN DoOptimization = FALSE;
                        DPRINT("Green: IRP_MJ_DEVICE_CONTROL / IOCTL_CONSOLE_DRAW\n");
-                       
+
                        ConsoleDraw = (PCONSOLE_DRAW)MmGetSystemAddressForMdl(Irp->MdlAddress);
                        /* FIXME: remove */ { ConsoleDraw->X++; ConsoleDraw->CursorX++; }
                        /* FIXME: remove */ { ConsoleDraw->Y++; ConsoleDraw->CursorY++; }
@@ -472,7 +472,7 @@ ScreenDeviceControl(
                        ASSERT(ConsoleDraw->CursorY >= 1);
                        ASSERT(ConsoleDraw->CursorX <= DeviceExtension->Columns);
                        ASSERT(ConsoleDraw->CursorY <= DeviceExtension->Rows);
-                       
+
 #if 0
                        if (ConsoleDraw->X == 1
                                && ConsoleDraw->Y == 1
@@ -501,7 +501,7 @@ ScreenDeviceControl(
                        }
 #endif
                        /* add here more optimizations if needed */
-                       
+
                        if (!DoOptimization)
                        {
                                for (y = 0; y < ConsoleDraw->SizeY; y++)
@@ -517,17 +517,17 @@ ScreenDeviceControl(
                                        }
                                }
                        }
-                       
+
                        DeviceExtension->LogicalOffset = (
                                (ConsoleDraw->CursorY-1) * DeviceExtension->Columns +
                                (ConsoleDraw->CursorX-1)) * 2;
                        AddToSendBuffer(DeviceExtension, 6, ESC, '[',
                                -(int)(ConsoleDraw->CursorY), ';',
                                -(int)(ConsoleDraw->CursorX), 'H');
-                       
+
                        /* flush buffer */
                        AddToSendBuffer(DeviceExtension, 0);
-                       
+
                        Irp->IoStatus.Information = 0;
                        Status = STATUS_SUCCESS;
                        break;
@@ -537,7 +537,7 @@ ScreenDeviceControl(
                                Stack->Parameters.DeviceIoControl.IoControlCode);
                        Status = STATUS_NOT_IMPLEMENTED;
        }
-       
+
        Irp->IoStatus.Status = Status;
        IoCompleteRequest (Irp, IO_NO_INCREMENT);
        return Status;
index ca780c0..aa8c0cb 100644 (file)
@@ -81,7 +81,7 @@ NTSTATUS InitDevice(
 //    Parameters = Instance->DriverObject->DriverExtension;
 
     DPRINT("DeviceObject at 0x%x, DeviceExtension at 0x%x\n", DeviceObject, Parameters);
-    
+
     if (! Parameters)
     {
         DPRINT("NULL POINTER!\n");
@@ -103,9 +103,9 @@ NTSTATUS InitDevice(
     Parameters->IRQ = DEFAULT_IRQ;
 
 // Only to be enabled once we can get support for multiple cards working :)
-/*    
+/*
     DPRINT("Loading settings from: %S\n", RegistryPath);
-    
+
     s = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, RegistryPath, Table,
                                 &Parameters, NULL);
 */
@@ -144,7 +144,7 @@ MPU401Create(PDEVICE_OBJECT DeviceObject,
  */
 {
     DPRINT("MPU401Create() called!\n");
-    
+
     // Initialize the MPU-401?
     // ... do stuff ...
 
@@ -181,7 +181,7 @@ MPU401Close(PDEVICE_OBJECT DeviceObject,
   NTSTATUS Status;
 
   DPRINT("MPU401Close() called!\n");
-  
+
   DeviceExtension = DeviceObject->DeviceExtension;
 
   Status = STATUS_SUCCESS;
@@ -248,7 +248,7 @@ MPU401DeviceControl(PDEVICE_OBJECT DeviceObject,
 
     DeviceExtension = DeviceObject->DeviceExtension;
     Stack = IoGetCurrentIrpStackLocation(Irp);
-    
+
     DPRINT("Control code %d [0x%x]\n", Stack->Parameters.DeviceIoControl.IoControlCode,
                 Stack->Parameters.DeviceIoControl.IoControlCode);
 
@@ -260,7 +260,7 @@ MPU401DeviceControl(PDEVICE_OBJECT DeviceObject,
             Data = (PBYTE) Irp->AssociatedIrp.SystemBuffer;
 
             DPRINT("Sending %d bytes of MIDI data to 0x%d:\n", Stack->Parameters.DeviceIoControl.InputBufferLength, DeviceExtension->Port);
-            
+
             for (ByteCount = 0; ByteCount < Stack->Parameters.DeviceIoControl.InputBufferLength; ByteCount ++)
             {
                 DPRINT("0x%x ", Data[ByteCount]);
@@ -272,11 +272,11 @@ MPU401DeviceControl(PDEVICE_OBJECT DeviceObject,
 
             Irp->IoStatus.Status = STATUS_SUCCESS;
             IoCompleteRequest(Irp, IO_NO_INCREMENT);
-            
+
             return(STATUS_SUCCESS);
         }
     }
-    
+
     return(STATUS_SUCCESS);
 
 /*
index 5d169bb..9c05196 100644 (file)
@@ -17,7 +17,7 @@
 BOOLEAN WaitToSend(UINT BasePort)
 {
     int TimeOut;
-    
+
     DbgPrint("WaitToSend ");
 
     // Check if it's OK to send
@@ -31,7 +31,7 @@ BOOLEAN WaitToSend(UINT BasePort)
         DbgPrint("FAILED\n");
         return FALSE;
     }
-    
+
     DbgPrint("SUCCEEDED\n");
 
     return TRUE;
@@ -55,7 +55,7 @@ BOOLEAN WaitToReceive(UINT BasePort)
         DbgPrint("FAILED\n");
         return FALSE;
     }
-    
+
     DbgPrint("SUCCEEDED\n");
 
     return TRUE;
index e8a9012..a5b88d3 100644 (file)
@@ -29,7 +29,7 @@ NullDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
 {
  PIO_STACK_LOCATION piosStack = IoGetCurrentIrpStackLocation(Irp);
  NTSTATUS nErrCode;
+
  nErrCode = STATUS_SUCCESS;
  Irp->IoStatus.Information = 0;
 
@@ -117,7 +117,7 @@ NullUnload(PDRIVER_OBJECT DriverObject)
 }
 
 /* TODO: \Device\Zero should be memory-mappable */
-NTSTATUS STDCALL 
+NTSTATUS STDCALL
 DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
 {
  PDEVICE_OBJECT pdoNullDevice;
index 639135b..4093458 100644 (file)
@@ -5,7 +5,7 @@
  * FILE:             services/parallel/parallel.c
  * PURPOSE:          Parallel port driver
  * PROGRAMMER:       David Welch (welch@mcmail.com)
- * UPDATE HISTORY: 
+ * UPDATE HISTORY:
  *              ??/??/??: Created
  *              18/06/98: Made more NT like
  */
@@ -44,7 +44,7 @@ static void Parallel_putchar(unsigned char ch)
  *          ch = character to write
  */
 {
-       
+
        int count=0;
        int status;
        int wait=0;
@@ -55,13 +55,13 @@ static void Parallel_putchar(unsigned char ch)
             count++;
          }
        while ( count < 500000 && !(status & LP_PBUSY) );
-         
+
        if (count==500000)
          {
             DPRINT("printer_putchar(): timed out\n");
             return;
          }
-       
+
        WRITE_PORT_UCHAR((PUCHAR)LP_B,ch);
        while (wait != 10000) { wait++; }
        WRITE_PORT_UCHAR((PUCHAR)LP_C, (LP_PSELECP | LP_PINITP | LP_PSTROBE ));
@@ -82,7 +82,7 @@ Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
    PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
    NTSTATUS status;
    int i;
-   
+
    switch (Stack->MajorFunction)
      {
       case IRP_MJ_CREATE:
@@ -90,11 +90,11 @@ Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
        Parallel_Reset();
        status = STATUS_SUCCESS;
        break;
-       
+
       case IRP_MJ_CLOSE:
        status = STATUS_SUCCESS;
        break;
-       
+
       case IRP_MJ_WRITE:
        DPRINT("(Parallel Port Driver) Writing %d bytes\n",
               Stack->Parameters.Write.Length);
@@ -104,15 +104,15 @@ Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
          }
        status = STATUS_SUCCESS;
        break;
-       
+
       default:
        status = STATUS_NOT_IMPLEMENTED;
        break;
      }
-   
+
    Irp->IoStatus.Status = status;
    Irp->IoStatus.Information = 0;
-   
+
    IoCompleteRequest(Irp, IO_NO_INCREMENT);
    return(status);
 }
@@ -130,9 +130,9 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
    PDEVICE_OBJECT DeviceObject;
    UNICODE_STRING DeviceName = ROS_STRING_INITIALIZER(L"\\Device\\Parallel");
    NTSTATUS Status;
-   
+
    DPRINT("Parallel Port Driver 0.0.1\n");
-   
+
    Status = IoCreateDevice(DriverObject,
                           0,
                           &DeviceName,
@@ -150,7 +150,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
    DriverObject->MajorFunction[IRP_MJ_CREATE] = Dispatch;
    DriverObject->MajorFunction[IRP_MJ_WRITE] = Dispatch;
    DriverObject->DriverUnload = NULL;
-   
+
    return(STATUS_SUCCESS);
 }
 
index 7b45c41..c28e27e 100644 (file)
@@ -99,7 +99,7 @@
  * gets inverted, but it is also active low.
  */
 
-/* 
+/*
  * bit defines for 8255 status port
  * base + 1
  * accessed with LP_S(minor), which gets the byte...
 #define LP_PSELECD     0x10  /* unchanged input, active high */
 #define LP_PERRORP     0x08  /* unchanged input, active low */
 
-/* 
+/*
  * defines for 8255 control port
- * base + 2 
+ * base + 2
  * accessed with LP_C(minor)
  */
 #define LP_PINTEN      0x10
 #define LP_PAUTOLF     0x02  /* inverted output, active low */
 #define LP_PSTROBE     0x01  /* inverted output, active low */
 
-/* 
- * the value written to ports to test existence. PC-style ports will 
+/*
+ * the value written to ports to test existence. PC-style ports will
  * return the value written. AT-style ports will return 0. so why not
- * make them the same ? 
+ * make them the same ?
  */
 #define LP_DUMMY       0x00
 
index b3304be..d1eae39 100644 (file)
@@ -41,7 +41,7 @@ NTSTATUS STDCALL RamdrvDispatchDeviceControl(PDEVICE_OBJECT DeviceObject,
         Status = STATUS_INVALID_DEVICE_REQUEST;
    }
    Irp->IoStatus.Status = Status;
-   IoCompleteRequest(Irp, NT_SUCCESS(Status) ? IO_DISK_INCREMENT : IO_NO_INCREMENT);   
+   IoCompleteRequest(Irp, NT_SUCCESS(Status) ? IO_DISK_INCREMENT : IO_NO_INCREMENT);
    return Status;
 }
 
@@ -98,17 +98,17 @@ NTSTATUS STDCALL DriverEntry(IN PDRIVER_OBJECT DriverObject,
   unsigned int dstlen = 1024 * 1440;
   FILE_STANDARD_INFORMATION finfo;
   DWORD err;
-  
+
   DPRINT("Ramdisk driver\n");
-  
+
   /* Export other driver entry points... */
   DriverObject->MajorFunction[IRP_MJ_CREATE] = RamdrvDispatchOpenClose;
   DriverObject->MajorFunction[IRP_MJ_CLOSE] = RamdrvDispatchOpenClose;
   DriverObject->MajorFunction[IRP_MJ_READ] = RamdrvDispatchReadWrite;
   DriverObject->MajorFunction[IRP_MJ_WRITE] = RamdrvDispatchReadWrite;
   DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = RamdrvDispatchDeviceControl;
-  
-  
+
+
   // create device and symbolic link
   Status = IoCreateDevice( DriverObject,
                           sizeof( RAMDRV_DEVICE_EXTENSION ),
index 1c7d709..7be1060 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/circularbuffer.c
  * PURPOSE:         Operations on a circular buffer
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 
@@ -84,7 +84,7 @@ IncreaseCircularBufferSize(
        IN ULONG NewBufferSize)
 {
        PUCHAR NewBuffer;
-       
+
        DPRINT("Serial: IncreaseCircularBufferSize(pBuffer %p, NewBufferSize %lu)\n", pBuffer, NewBufferSize);
        ASSERT(pBuffer);
        ASSERT(pBuffer->Length);
@@ -92,7 +92,7 @@ IncreaseCircularBufferSize(
                return STATUS_INVALID_PARAMETER;
        else if (pBuffer->Length == NewBufferSize)
                return STATUS_SUCCESS;
-       
+
        NewBuffer = (PUCHAR)ExAllocatePoolWithTag(NonPagedPool, NewBufferSize * sizeof(UCHAR), SERIAL_TAG);
        if (!NewBuffer)
                return STATUS_INSUFFICIENT_RESOURCES;
index a22cb9c..fe3929a 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/cleanup.c
  * PURPOSE:         Serial IRP_MJ_CLEANUP operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 
index 2b048d2..6bee7c7 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/close.c
  * PURPOSE:         Serial IRP_MJ_CLOSE operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 
@@ -17,11 +17,11 @@ SerialClose(
        IN PIRP Irp)
 {
        PSERIAL_DEVICE_EXTENSION pDeviceExtension;
-       
+
        DPRINT("Serial: IRP_MJ_CLOSE\n");
        pDeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        pDeviceExtension->IsOpened = FALSE;
-       
+
        Irp->IoStatus.Information = 0;
        Irp->IoStatus.Status = STATUS_SUCCESS;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
index 3757bc9..e0e978e 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/create.c
  * PURPOSE:         Serial IRP_MJ_CREATE operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 
@@ -20,40 +20,40 @@ SerialCreate(
        PFILE_OBJECT FileObject;
        PSERIAL_DEVICE_EXTENSION DeviceExtension;
        NTSTATUS Status;
-       
+
        DPRINT("Serial: IRP_MJ_CREATE\n");
        Stack = IoGetCurrentIrpStackLocation(Irp);
        FileObject = Stack->FileObject;
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-       
+
        ASSERT(FileObject);
-       
+
        if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE)
        {
                CHECKPOINT;
                Status = STATUS_NOT_A_DIRECTORY;
                goto ByeBye;
        }
-       
-       if (FileObject->FileName.Length != 0 || 
+
+       if (FileObject->FileName.Length != 0 ||
                FileObject->RelatedFileObject != NULL)
        {
                CHECKPOINT;
                Status = STATUS_ACCESS_DENIED;
                goto ByeBye;
        }
-       
+
        if(DeviceExtension->IsOpened)
        {
                DPRINT("Serial: COM%lu is already opened\n", DeviceExtension->ComPort);
                Status = STATUS_ACCESS_DENIED;
                goto ByeBye;
        }
-       
+
        DPRINT("Serial: open COM%lu: successfull\n", DeviceExtension->ComPort);
        DeviceExtension->IsOpened = TRUE;
        Status = STATUS_SUCCESS;
-       
+
 ByeBye:
        Irp->IoStatus.Status = Status;
        Irp->IoStatus.Information = 0;
index ee4c0bf..431118b 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/devctrl.c
  * PURPOSE:         Serial IRP_MJ_DEVICE_CONTROL operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 
@@ -23,7 +23,7 @@ SerialGetUserBuffers(
        ASSERT(Irp);
        ASSERT(BufferIn);
        ASSERT(BufferOut);
-       
+
        switch (IO_METHOD_FROM_CTL_CODE(IoControlCode))
        {
                case METHOD_BUFFERED:
@@ -39,7 +39,7 @@ SerialGetUserBuffers(
                        *BufferOut = Irp->UserBuffer;
                        return;
        }
-       
+
        /* Should never happen */
 }
 
@@ -52,7 +52,7 @@ SerialSetBaudRate(
        PUCHAR ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
        ULONG BaudRate;
        NTSTATUS Status = STATUS_SUCCESS;
-       
+
        if (NewBaudRate & SERIAL_BAUD_USER)
        {
                BaudRate = NewBaudRate & ~SERIAL_BAUD_USER;
@@ -83,7 +83,7 @@ SerialSetBaudRate(
                        default: Status = STATUS_INVALID_PARAMETER;
                }
        }
-       
+
        if (NT_SUCCESS(Status))
        {
                Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
@@ -99,11 +99,11 @@ SerialSetBaudRate(
                        WRITE_PORT_UCHAR(SER_DLM(ComPortBase), divisor >> 8);
                        /* Switch back to normal registers */
                        WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr);
-                       
+
                        IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
                }
        }
-       
+
        if (NT_SUCCESS(Status))
                DeviceExtension->BaudRate = BaudRate;
        return Status;
@@ -117,13 +117,13 @@ SerialSetLineControl(
        PUCHAR ComPortBase;
        UCHAR Lcr = 0;
        NTSTATUS Status;
-       
+
        ASSERT(DeviceExtension);
        ASSERT(NewSettings);
-       
+
        DPRINT("Serial: SerialSetLineControl(COM%lu, Settings { %lu %lu %lu })\n",
                DeviceExtension->ComPort, NewSettings->StopBits, NewSettings->Parity, NewSettings->WordLength);
-       
+
        /* Verify parameters */
        switch (NewSettings->WordLength)
        {
@@ -133,10 +133,10 @@ SerialSetLineControl(
                case 8: Lcr |= SR_LCR_CS8; break;
                default: return STATUS_INVALID_PARAMETER;
        }
-       
+
        if (NewSettings->WordLength < 5 || NewSettings->WordLength > 8)
                return STATUS_INVALID_PARAMETER;
-       
+
        switch (NewSettings->Parity)
        {
                case NO_PARITY:    Lcr |= SR_LCR_PNO; break;
@@ -146,7 +146,7 @@ SerialSetLineControl(
                case SPACE_PARITY: Lcr |= SR_LCR_PSP; break;
                default: return STATUS_INVALID_PARAMETER;
        }
-       
+
        switch (NewSettings->StopBits)
        {
                case STOP_BIT_1:
@@ -165,21 +165,21 @@ SerialSetLineControl(
                default:
                        return STATUS_INVALID_PARAMETER;
        }
-       
+
        /* Update current parameters */
        ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
        Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
        if (!NT_SUCCESS(Status))
                return Status;
        WRITE_PORT_UCHAR(SER_LCR(ComPortBase), Lcr);
-       
+
        /* Read junk out of RBR */
        READ_PORT_UCHAR(SER_RBR(ComPortBase));
        IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
-       
+
        if (NT_SUCCESS(Status))
                DeviceExtension->SerialLineControl = *NewSettings;
-       
+
        return Status;
 }
 
@@ -188,7 +188,7 @@ SerialClearPerfStats(
        IN PSERIAL_DEVICE_EXTENSION DeviceExtension)
 {
        ASSERT(DeviceExtension);
-       
+
        RtlZeroMemory(&DeviceExtension->SerialPerfStats, sizeof(SERIALPERF_STATS));
        DeviceExtension->BreakInterruptErrorCount = 0;
        return TRUE;
@@ -219,9 +219,9 @@ SerialGetCommProp(
        IN PSERIAL_DEVICE_EXTENSION DeviceExtension)
 {
        ASSERT(pCommProp);
-       
+
        RtlZeroMemory(pCommProp, sizeof(SERIAL_COMMPROP));
-       
+
        pCommProp->PacketLength = sizeof(SERIAL_COMMPROP);
        pCommProp->PacketVersion = 2;
        pCommProp->ServiceMask = SERIAL_SP_SERIALCOMM;
@@ -233,7 +233,7 @@ SerialGetCommProp(
                | SERIAL_PCF_XONXOFF;
        pCommProp->SettableParams = SERIAL_SP_BAUD | SERIAL_SP_DATABITS | SERIAL_SP_HANDSHAKING
                | SERIAL_SP_PARITY | SERIAL_SP_PARITY_CHECK | SERIAL_SP_STOPBITS;
-       
+
        /* SettableBaud is related to Uart type */
        pCommProp->SettableBaud = SERIAL_BAUD_075 | SERIAL_BAUD_110 | SERIAL_BAUD_134_5
                | SERIAL_BAUD_150 | SERIAL_BAUD_300 | SERIAL_BAUD_600 | SERIAL_BAUD_1200
@@ -250,11 +250,11 @@ SerialGetCommProp(
                pCommProp->SettableBaud |= SERIAL_BAUD_56K | SERIAL_BAUD_57600 | SERIAL_BAUD_115200 | SERIAL_BAUD_128K;
                pCommProp->MaxBaud = SERIAL_BAUD_115200;
        }
-       
+
        pCommProp->SettableData = SERIAL_DATABITS_5 | SERIAL_DATABITS_6 | SERIAL_DATABITS_7 | SERIAL_DATABITS_8;
        pCommProp->SettableStopParity = SERIAL_STOPBITS_10 | SERIAL_STOPBITS_15 | SERIAL_STOPBITS_20
                | SERIAL_PARITY_NONE | SERIAL_PARITY_ODD | SERIAL_PARITY_EVEN | SERIAL_PARITY_MARK | SERIAL_PARITY_SPACE;
-       
+
        return STATUS_SUCCESS;
 }
 
@@ -264,10 +264,10 @@ SerialGetCommStatus(
        IN PSERIAL_DEVICE_EXTENSION DeviceExtension)
 {
        KIRQL Irql;
-       
+
        ASSERT(pSerialStatus);
        RtlZeroMemory(pSerialStatus, sizeof(SERIAL_STATUS));
-       
+
        pSerialStatus->Errors = 0;
        if (DeviceExtension->BreakInterruptErrorCount)
                pSerialStatus->Errors |= SERIAL_ERROR_BREAK;
@@ -279,22 +279,22 @@ SerialGetCommStatus(
                pSerialStatus->Errors |= SERIAL_ERROR_QUEUEOVERRUN;
        if (DeviceExtension->SerialPerfStats.ParityErrorCount)
                pSerialStatus->Errors |= SERIAL_ERROR_PARITY;
-       
+
        pSerialStatus->HoldReasons = 0; /* FIXME */
-       
+
        KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql);
        pSerialStatus->AmountInInQueue = (DeviceExtension->InputBuffer.WritePosition + DeviceExtension->InputBuffer.Length
                - DeviceExtension->InputBuffer.ReadPosition) % DeviceExtension->InputBuffer.Length;
        KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);
-       
+
        KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql);
        pSerialStatus->AmountInOutQueue = (DeviceExtension->OutputBuffer.WritePosition + DeviceExtension->OutputBuffer.Length
                - DeviceExtension->OutputBuffer.ReadPosition) % DeviceExtension->OutputBuffer.Length;
        KeReleaseSpinLock(&DeviceExtension->OutputBufferLock, Irql);
-       
+
        pSerialStatus->EofReceived = FALSE; /* always FALSE */
        pSerialStatus->WaitForImmediate = FALSE; /* always FALSE */
-       
+
        return STATUS_SUCCESS;
 }
 
@@ -311,9 +311,9 @@ SerialDeviceControl(
        PVOID BufferIn, BufferOut;
        PUCHAR ComPortBase;
        NTSTATUS Status;
-       
+
        DPRINT("Serial: IRP_MJ_DEVICE_CONTROL dispatch\n");
-       
+
        Stack = IoGetCurrentIrpStackLocation(Irp);
        LengthIn = Stack->Parameters.DeviceIoControl.InputBufferLength;
        LengthOut = Stack->Parameters.DeviceIoControl.OutputBufferLength;
@@ -321,7 +321,7 @@ SerialDeviceControl(
        ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
        IoControlCode = Stack->Parameters.DeviceIoControl.IoControlCode;
        SerialGetUserBuffers(Irp, IoControlCode, &BufferIn, &BufferOut);
-       
+
        /* FIXME: need to probe buffers */
        /* FIXME: see http://www.osronline.com/ddkx/serial/serref_61bm.htm */
        switch (IoControlCode)
@@ -339,7 +339,7 @@ SerialDeviceControl(
                case IOCTL_SERIAL_CLR_DTR:
                {
                        DPRINT("Serial: IOCTL_SERIAL_CLR_DTR\n");
-                       /* FIXME: If the handshake flow control of the device is configured to 
+                       /* FIXME: If the handshake flow control of the device is configured to
                         * automatically use DTR, return STATUS_INVALID_PARAMETER */
                        Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
                        if (NT_SUCCESS(Status))
@@ -353,7 +353,7 @@ SerialDeviceControl(
                case IOCTL_SERIAL_CLR_RTS:
                {
                        DPRINT("Serial: IOCTL_SERIAL_CLR_RTS\n");
-                       /* FIXME: If the handshake flow control of the device is configured to 
+                       /* FIXME: If the handshake flow control of the device is configured to
                         * automatically use RTS, return STATUS_INVALID_PARAMETER */
                        Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
                        if (NT_SUCCESS(Status))
@@ -582,7 +582,7 @@ SerialDeviceControl(
                        else
                        {
                                ULONG PurgeMask = *(PULONG)BufferIn;
-                               
+
                                Status = STATUS_SUCCESS;
                                /* FIXME: use SERIAL_PURGE_RXABORT and SERIAL_PURGE_TXABORT flags */
                                if (PurgeMask & SERIAL_PURGE_RXCLEAR)
@@ -601,7 +601,7 @@ SerialDeviceControl(
                                        }
                                        KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);
                                }
-                               
+
                                if (PurgeMask & SERIAL_PURGE_TXCLEAR)
                                {
                                        KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql);
@@ -664,7 +664,7 @@ SerialDeviceControl(
                }
                case IOCTL_SERIAL_SET_DTR:
                {
-                       /* FIXME: If the handshake flow control of the device is configured to 
+                       /* FIXME: If the handshake flow control of the device is configured to
                         * automatically use DTR, return STATUS_INVALID_PARAMETER */
                        DPRINT("Serial: IOCTL_SERIAL_SET_DTR\n");
                        if (!(DeviceExtension->MCR & SR_MCR_DTR))
@@ -762,7 +762,7 @@ SerialDeviceControl(
                }
                case IOCTL_SERIAL_SET_RTS:
                {
-                       /* FIXME: If the handshake flow control of the device is configured to 
+                       /* FIXME: If the handshake flow control of the device is configured to
                         * automatically use DTR, return STATUS_INVALID_PARAMETER */
                        DPRINT("Serial: IOCTL_SERIAL_SET_RTS\n");
                        if (!(DeviceExtension->MCR & SR_MCR_RTS))
@@ -841,7 +841,7 @@ SerialDeviceControl(
                        return IoCallDriver(DeviceExtension->LowerDevice, Irp);
                }
        }
-       
+
        Irp->IoStatus.Information = Information;
        Irp->IoStatus.Status = Status;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
index 85fcee4..2a7f016 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/info.c
  * PURPOSE:         Serial IRP_MJ_QUERY_INFORMATION operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 
@@ -22,18 +22,18 @@ SerialQueryInformation(
        ULONG BufferLength;
        ULONG_PTR Information = 0;
        NTSTATUS Status;
-       
+
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        Stack = IoGetCurrentIrpStackLocation(Irp);
        SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
        BufferLength = Stack->Parameters.QueryFile.Length;
-       
+
        switch (Stack->Parameters.QueryFile.FileInformationClass)
        {
                case FileStandardInformation:
                {
                        PFILE_STANDARD_INFORMATION StandardInfo = (PFILE_STANDARD_INFORMATION)SystemBuffer;
-                       
+
                        DPRINT("Serial: IRP_MJ_QUERY_INFORMATION / FileStandardInformation\n");
                        if (BufferLength < sizeof(FILE_STANDARD_INFORMATION))
                                Status = STATUS_BUFFER_OVERFLOW;
@@ -52,9 +52,9 @@ SerialQueryInformation(
                case FilePositionInformation:
                {
                        PFILE_POSITION_INFORMATION PositionInfo = (PFILE_POSITION_INFORMATION)SystemBuffer;
-                       
+
                        ASSERT(PositionInfo);
-                       
+
                        DPRINT("Serial: IRP_MJ_QUERY_INFORMATION / FilePositionInformation\n");
                        if (BufferLength < sizeof(PFILE_POSITION_INFORMATION))
                                Status = STATUS_BUFFER_OVERFLOW;
@@ -73,7 +73,7 @@ SerialQueryInformation(
                        return ForwardIrpAndForget(DeviceObject, Irp);
                }
        }
-       
+
        Irp->IoStatus.Information = Information;
        Irp->IoStatus.Status = Status;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
index f47c9dd..6702291 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/bus/serial/legacy.c
  * PURPOSE:         Legacy serial port enumeration
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  *                  Mark Junker (mjscod@gmx.de)
  */
@@ -20,16 +20,16 @@ SerialDetectUartType(
        UCHAR OldScr, Scr5A, ScrA5;
        BOOLEAN FifoEnabled;
        UCHAR NewFifoStatus;
-       
+
        Lcr = READ_PORT_UCHAR(SER_LCR(BaseAddress));
        WRITE_PORT_UCHAR(SER_LCR(BaseAddress), Lcr ^ 0xFF);
        TestLcr = READ_PORT_UCHAR(SER_LCR(BaseAddress)) ^ 0xFF;
        WRITE_PORT_UCHAR(SER_LCR(BaseAddress), Lcr);
-       
+
        /* Accessing the LCR must work for a usable serial port */
        if (TestLcr != Lcr)
                return UartUnknown;
-       
+
        /* Ensure that all following accesses are done as required */
        READ_PORT_UCHAR(SER_RBR(BaseAddress));
        READ_PORT_UCHAR(SER_IER(BaseAddress));
@@ -39,7 +39,7 @@ SerialDetectUartType(
        READ_PORT_UCHAR(SER_LSR(BaseAddress));
        READ_PORT_UCHAR(SER_MSR(BaseAddress));
        READ_PORT_UCHAR(SER_SCR(BaseAddress));
-       
+
        /* Test scratch pad */
        OldScr = READ_PORT_UCHAR(SER_SCR(BaseAddress));
        WRITE_PORT_UCHAR(SER_SCR(BaseAddress), 0x5A);
@@ -47,11 +47,11 @@ SerialDetectUartType(
        WRITE_PORT_UCHAR(SER_SCR(BaseAddress), 0xA5);
        ScrA5 = READ_PORT_UCHAR(SER_SCR(BaseAddress));
        WRITE_PORT_UCHAR(SER_SCR(BaseAddress), OldScr);
-       
+
        /* When non-functional, we have a 8250 */
        if (Scr5A != 0x5A || ScrA5 != 0xA5)
                return Uart8250;
-       
+
        /* Test FIFO type */
        FifoEnabled = (READ_PORT_UCHAR(SER_IIR(BaseAddress)) & 0x80) != 0;
        WRITE_PORT_UCHAR(SER_FCR(BaseAddress), SR_FCR_ENABLE_FIFO);
@@ -69,7 +69,7 @@ SerialDetectUartType(
                         * with 0x80 */
                        return Uart16550;
        }
-       
+
        /* FIFO is only functional for 16550A+ */
        return Uart16550A;
 }
@@ -90,7 +90,7 @@ DetectLegacyDevice(
        PDEVICE_OBJECT Fdo;
        KIRQL Dirql;
        NTSTATUS Status;
-       
+
        /* Create resource list */
        ResourceListSize = sizeof(CM_RESOURCE_LIST) + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
        ResourceList = (PCM_RESOURCE_LIST)ExAllocatePoolWithTag(PagedPool, ResourceListSize, SERIAL_TAG);
@@ -109,7 +109,7 @@ DetectLegacyDevice(
        ResourceDescriptor->u.Port.Start.u.HighPart = 0;
        ResourceDescriptor->u.Port.Start.u.LowPart = ComPortBase;
        ResourceDescriptor->u.Port.Length = 8;
-       
+
        ResourceDescriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[1];
        ResourceDescriptor->Type = CmResourceTypeInterrupt;
        ResourceDescriptor->ShareDisposition = CmResourceShareShared;
@@ -119,7 +119,7 @@ DetectLegacyDevice(
                &Dirql,
                &ResourceDescriptor->u.Interrupt.Affinity);
        ResourceDescriptor->u.Interrupt.Level = (ULONG)Dirql;
-       
+
        /* Report resource list */
        Status = IoReportResourceForDetection(
                DriverObject, ResourceList, ResourceListSize,
@@ -136,10 +136,10 @@ DetectLegacyDevice(
                ExFreePoolWithTag(ResourceList, SERIAL_TAG);
                return Status;
        }
-       
+
        /* Test if port exists */
        UartType = SerialDetectUartType((PUCHAR)ComPortBase);
-       
+
        /* Report device if detected... */
        if (UartType != UartUnknown)
        {
@@ -181,7 +181,7 @@ DetectLegacyDevices(
        ULONG i;
        NTSTATUS Status;
        NTSTATUS ReturnedStatus = STATUS_SUCCESS;
-       
+
        for (i = 0; i < sizeof(ComPortBase)/sizeof(ComPortBase[0]); i++)
        {
                Status = DetectLegacyDevice(DriverObject, ComPortBase[i], Irq[i], &ComPortNumber[i]);
@@ -189,6 +189,6 @@ DetectLegacyDevices(
                        ReturnedStatus = Status;
                DPRINT("Serial: Legacy device at 0x%x (IRQ %lu): status = 0x%08lx\n", ComPortBase[i], Irq[i], Status);
        }
-       
+
        return ReturnedStatus;
 }
index 8e730bc..9616286 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/misc.c
  * PURPOSE:         Misceallenous operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 /* FIXME: call IoAcquireRemoveLock/IoReleaseRemoveLock around each I/O operation */
@@ -31,15 +31,15 @@ ForwardIrpAndWait(
        PDEVICE_OBJECT LowerDevice = ((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
        KEVENT Event;
        NTSTATUS Status;
-       
+
        ASSERT(LowerDevice);
-       
+
        KeInitializeEvent(&Event, NotificationEvent, FALSE);
        IoCopyCurrentIrpStackLocationToNext(Irp);
-       
+
        DPRINT("Serial: Calling lower device %p [%wZ]\n", LowerDevice, &LowerDevice->DriverObject->DriverName);
        IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
-       
+
        Status = IoCallDriver(LowerDevice, Irp);
        if (Status == STATUS_PENDING)
        {
@@ -47,7 +47,7 @@ ForwardIrpAndWait(
                if (NT_SUCCESS(Status))
                        Status = Irp->IoStatus.Status;
        }
-       
+
        return Status;
 }
 
@@ -57,9 +57,9 @@ ForwardIrpAndForget(
        IN PIRP Irp)
 {
        PDEVICE_OBJECT LowerDevice = ((PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
-       
+
        ASSERT(LowerDevice);
-       
+
        IoSkipCurrentIrpStackLocation(Irp);
        return IoCallDriver(LowerDevice, Irp);
 }
@@ -77,10 +77,10 @@ SerialReceiveByte(
        KIRQL Irql;
        UCHAR IER;
        NTSTATUS Status;
-       
+
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)pDeviceExtension;
        ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
-       
+
        KeAcquireSpinLock(&DeviceExtension->InputBufferLock, &Irql);
        while (READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_DATA_RECEIVED)
        {
@@ -95,7 +95,7 @@ SerialReceiveByte(
        }
        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);
@@ -114,10 +114,10 @@ SerialSendByte(
        KIRQL Irql;
        UCHAR IER;
        NTSTATUS Status;
-       
+
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)pDeviceExtension;
        ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
-       
+
        KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql);
        while (!IsCircularBufferEmpty(&DeviceExtension->OutputBuffer)
                && READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_THR_EMPTY)
@@ -148,24 +148,24 @@ SerialInterruptService(
        PSERIAL_DEVICE_EXTENSION DeviceExtension;
        PUCHAR ComPortBase;
        UCHAR Iir;
-       
+
        DeviceObject = (PDEVICE_OBJECT)ServiceContext;
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
-       
+
        Iir = READ_PORT_UCHAR(SER_IIR(ComPortBase));
        if (Iir == 0xff)
                return TRUE;
        Iir &= SR_IIR_ID_MASK;
        if ((Iir & SR_IIR_SELF) != 0) { return FALSE; }
-       
+
        switch (Iir)
        {
                case SR_IIR_MSR_CHANGE:
                {
                        UCHAR MSR, IER;
                        DPRINT("Serial: SR_IIR_MSR_CHANGE\n");
-                       
+
                        MSR = READ_PORT_UCHAR(SER_MSR(ComPortBase));
                        if (MSR & SR_MSR_CTS_CHANGED)
                        {
@@ -188,14 +188,14 @@ SerialInterruptService(
                case SR_IIR_THR_EMPTY:
                {
                        DPRINT("Serial: SR_IIR_THR_EMPTY\n");
-                       
+
                        KeInsertQueueDpc(&DeviceExtension->SendByteDpc, NULL, NULL);
                        return TRUE;
                }
                case SR_IIR_DATA_RECEIVED:
                {
                        DPRINT("Serial: SR_IIR_DATA_RECEIVED\n");
-                       
+
                        KeInsertQueueDpc(&DeviceExtension->ReceivedByteDpc, NULL, NULL);
                        return TRUE;
                }
@@ -203,7 +203,7 @@ SerialInterruptService(
                {
                        UCHAR LSR;
                        DPRINT("Serial: SR_IIR_ERROR\n");
-                       
+
                        LSR = READ_PORT_UCHAR(SER_LSR(ComPortBase));
                        if (LSR & SR_LSR_OVERRUN_ERROR)
                                InterlockedIncrement(&DeviceExtension->SerialPerfStats.SerialOverrunErrorCount);
@@ -213,7 +213,7 @@ SerialInterruptService(
                                InterlockedIncrement(&DeviceExtension->SerialPerfStats.FrameErrorCount);
                        if (LSR & SR_LSR_BREAK_INT)
                                InterlockedIncrement(&DeviceExtension->BreakInterruptErrorCount);
-                       
+
                        return TRUE;
                }
        }
index d990b68..70417d6 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/pnp.c
  * PURPOSE:         Serial IRP_MJ_PNP operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 /* FIXME: call IoAcquireRemoveLock/IoReleaseRemoveLock around each I/O operation */
@@ -28,12 +28,12 @@ SerialAddDeviceInternal(
        UNICODE_STRING DeviceName;
        static ULONG DeviceNumber = 0;
        static ULONG ComPortNumber = 1;
-       
+
        DPRINT("Serial: SerialAddDeviceInternal called\n");
-       
+
        ASSERT(DeviceObject);
        ASSERT(Pdo);
-       
+
        /* Create new device object */
        swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", DeviceNumber);
        RtlInitUnicodeString(&DeviceName, DeviceNameBuffer);
@@ -52,7 +52,7 @@ SerialAddDeviceInternal(
        }
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)Fdo->DeviceExtension;
        RtlZeroMemory(DeviceExtension, sizeof(SERIAL_DEVICE_EXTENSION));
-       
+
        /* Register device interface */
        Status = IoRegisterDeviceInterface(Pdo, &GUID_DEVINTERFACE_COMPORT, NULL, &DeviceExtension->SerialInterfaceName);
        if (!NT_SUCCESS(Status))
@@ -60,7 +60,7 @@ SerialAddDeviceInternal(
                DPRINT("Serial: IoRegisterDeviceInterface() failed with status 0x%08x\n", Status);
                goto ByeBye;
        }
-       
+
        DeviceExtension->SerialPortNumber = DeviceNumber++;
        if (pComPortNumber == NULL)
                DeviceExtension->ComPort = ComPortNumber++;
@@ -92,7 +92,7 @@ SerialAddDeviceInternal(
        {
                *pFdo = Fdo;
        }
-       
+
        return STATUS_SUCCESS;
 
 ByeBye:
@@ -116,7 +116,7 @@ SerialAddDevice(
         */
        if (Pdo == NULL)
                return STATUS_SUCCESS;
-       
+
        /* We have here a PDO not null. It represents a real serial
         * port. So call the internal AddDevice function.
         */
@@ -147,13 +147,13 @@ SerialPnpStartDevice(
        UNICODE_STRING KeyName;
        HANDLE hKey;
        NTSTATUS Status;
-       
+
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-       
+
        ASSERT(ResourceList);
        ASSERT(DeviceExtension);
        ASSERT(DeviceExtension->PnpState == dsStopped);
-       
+
        DeviceExtension->BaudRate = 19200 | SERIAL_BAUD_USER;
        DeviceExtension->BaseAddress = 0;
        Dirql = 0;
@@ -193,15 +193,15 @@ SerialPnpStartDevice(
        if (!Dirql)
                return STATUS_INSUFFICIENT_RESOURCES;
        ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
-       
+
        if (DeviceExtension->UartType == UartUnknown)
                DeviceExtension->UartType = SerialDetectUartType(ComPortBase);
-       
+
        /* Get current settings */
        DeviceExtension->MCR = READ_PORT_UCHAR(SER_MCR(ComPortBase));
        DeviceExtension->MSR = READ_PORT_UCHAR(SER_MSR(ComPortBase));
        DeviceExtension->WaitMask = 0;
-       
+
        /* Set baud rate */
        Status = SerialSetBaudRate(DeviceExtension, DeviceExtension->BaudRate);
        if (!NT_SUCCESS(Status))
@@ -209,7 +209,7 @@ SerialPnpStartDevice(
                DPRINT("Serial: SerialSetBaudRate() failed with status 0x%08x\n", Status);
                return Status;
        }
-       
+
        /* Set line control */
        DeviceExtension->SerialLineControl.StopBits = STOP_BIT_1;
        DeviceExtension->SerialLineControl.Parity = NO_PARITY;
@@ -220,7 +220,7 @@ SerialPnpStartDevice(
                DPRINT("Serial: SerialSetLineControl() failed with status 0x%08x\n", Status);
                return Status;
        }
-       
+
        /* Clear receive/transmit buffers */
        if (DeviceExtension->UartType >= Uart16550A)
        {
@@ -228,7 +228,7 @@ SerialPnpStartDevice(
                WRITE_PORT_UCHAR(SER_FCR(ComPortBase),
                        SR_FCR_CLEAR_RCVR | SR_FCR_CLEAR_XMIT);
        }
-       
+
        /* Create link \DosDevices\COMX -> \Device\SerialX */
        swprintf(DeviceNameBuffer, L"\\Device\\Serial%lu", DeviceExtension->SerialPortNumber);
        swprintf(LinkNameBuffer, L"\\DosDevices\\COM%lu", DeviceExtension->ComPort);
@@ -242,7 +242,7 @@ SerialPnpStartDevice(
                DPRINT("Serial: IoCreateSymbolicLink() failed with status 0x%08x\n", Status);
                return Status;
        }
-       
+
        /* Activate serial interface */
        Status = IoSetDeviceInterfaceState(&DeviceExtension->SerialInterfaceName, TRUE);
        if (!NT_SUCCESS(Status))
@@ -251,7 +251,7 @@ SerialPnpStartDevice(
                IoDeleteSymbolicLink(&LinkName);
                return Status;
        }
-       
+
        /* Connect interrupt and enable them */
        Status = IoConnectInterrupt(
                &DeviceExtension->Interrupt, SerialInterruptService,
@@ -266,7 +266,7 @@ SerialPnpStartDevice(
                IoDeleteSymbolicLink(&LinkName);
                return Status;
        }
-       
+
        /* Write an entry value under HKLM\HARDWARE\DeviceMap\SERIALCOMM */
        /* This step is not mandatory, so don't exit in case of error */
        RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\HARDWARE\\DeviceMap\\SERIALCOMM");
@@ -278,18 +278,18 @@ SerialPnpStartDevice(
                ZwSetValueKey(hKey, &DeviceName, 0, REG_SZ, &ComPortBuffer, ComPort.Length + sizeof(WCHAR));
                ZwClose(hKey);
        }
-       
+
        DeviceExtension->PnpState = dsStarted;
-       
+
        /* Activate interrupt modes */
        IER = READ_PORT_UCHAR(SER_IER(ComPortBase));
        IER |= SR_IER_DATA_RECEIVED | SR_IER_THR_EMPTY | SR_IER_LSR_CHANGE | SR_IER_MSR_CHANGE;
        WRITE_PORT_UCHAR(SER_IER(ComPortBase), IER);
-       
+
        /* Activate DTR, RTS */
        DeviceExtension->MCR |= SR_MCR_DTR | SR_MCR_RTS;
        WRITE_PORT_UCHAR(SER_MCR(ComPortBase), DeviceExtension->MCR);
-       
+
        return STATUS_SUCCESS;
 }
 
@@ -302,17 +302,17 @@ SerialPnp(
        PIO_STACK_LOCATION Stack;
        ULONG_PTR Information = 0;
        NTSTATUS Status;
-       
+
        Stack = IoGetCurrentIrpStackLocation(Irp);
        MinorFunction = Stack->MinorFunction;
-       
+
        switch (MinorFunction)
        {
                case IRP_MN_START_DEVICE:
                {
                        BOOLEAN ConflictDetected;
                        DPRINT("Serial: IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
-                       
+
                        /* FIXME: first HACK: PnP manager can send multiple
                         * IRP_MN_START_DEVICE for one device
                         */
@@ -346,7 +346,7 @@ SerialPnp(
                                IoCompleteRequest(Irp, IO_NO_INCREMENT);
                                return Status;
                        }
-                       
+
                        /* Call lower driver */
                        Status = ForwardIrpAndWait(DeviceObject, Irp);
                        if (NT_SUCCESS(Status))
@@ -384,7 +384,7 @@ SerialPnp(
                        return ForwardIrpAndForget(DeviceObject, Irp);
                }
        }
-       
+
        Irp->IoStatus.Information = Information;
        Irp->IoStatus.Status = Status;
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
index 75249ce..d185293 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/power.c
  * PURPOSE:         Serial IRP_MJ_POWER operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 
index 38c1735..0d82a7c 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/create.c
  * PURPOSE:         Serial IRP_MJ_READ/IRP_MJ_WRITE operations
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 
@@ -15,7 +15,7 @@ static PVOID
 SerialGetUserBuffer(IN PIRP Irp)
 {
        ASSERT(Irp);
-       
+
        return Irp->AssociatedIrp.SystemBuffer;
 }
 
@@ -36,21 +36,21 @@ ReadBytes(
        PVOID ObjectsArray[2];
        ULONG_PTR Information = 0;
        NTSTATUS Status;
-       
+
        ASSERT(DeviceObject);
        ASSERT(WorkItemData);
-       
+
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
        Length = IoGetCurrentIrpStackLocation(Irp)->Parameters.Read.Length;
        Buffer = SerialGetUserBuffer(Irp);
-       
+
        DPRINT("Serial: UseIntervalTimeout = %s, IntervalTimeout = %lu\n",
                WorkItemData->UseIntervalTimeout ? "YES" : "NO",
                WorkItemData->UseIntervalTimeout ? WorkItemData->IntervalTimeout.QuadPart : 0);
        DPRINT("Serial: UseTotalTimeout = %s\n",
                WorkItemData->UseTotalTimeout ? "YES" : "NO");
-       
+
        ObjectCount = 1;
        ObjectsArray[0] = &DeviceExtension->InputBufferNotEmpty;
        if (WorkItemData->UseTotalTimeout)
@@ -60,7 +60,7 @@ ReadBytes(
                ObjectsArray[ObjectCount] = &TotalTimeoutTimer;
                ObjectCount++;
        }
-       
+
        /* while buffer is not fully filled */
        while (Length > 0)
        {
@@ -71,20 +71,20 @@ ReadBytes(
                {
                        PopCircularBufferEntry(&DeviceExtension->InputBuffer, &ReceivedByte);
                        DPRINT("Serial: reading byte from buffer: 0x%02x\n", ReceivedByte);
-                       
+
                        Buffer[Information++] = ReceivedByte;
                        Length--;
                }
                KeClearEvent(&DeviceExtension->InputBufferNotEmpty);
                KeReleaseSpinLock(&DeviceExtension->InputBufferLock, Irql);
-               
+
                if (WorkItemData->DontWait
                        && !(WorkItemData->ReadAtLeastOneByte && Information == 0))
                {
                        DPRINT("Serial: buffer empty. Don't wait more bytes\n");
                        break;
                }
-               
+
                Status = KeWaitForMultipleObjects(
                        ObjectCount,
                        ObjectsArray,
@@ -94,7 +94,7 @@ ReadBytes(
                        FALSE,
                        (WorkItemData->UseIntervalTimeout && Information > 0) ? &WorkItemData->IntervalTimeout : NULL,
                        NULL);
-               
+
                if (Status == STATUS_TIMEOUT /* interval timeout */
                        || Status == STATUS_WAIT_1) /* total timeout */
                {
@@ -102,11 +102,11 @@ ReadBytes(
                        break;
                }
        }
-       
+
        /* stop total timeout timer */
        if (WorkItemData->UseTotalTimeout)
                KeCancelTimer(&TotalTimeoutTimer);
-       
+
        Irp->IoStatus.Information = Information;
        if (Information == 0)
                Irp->IoStatus.Status = STATUS_TIMEOUT;
@@ -121,16 +121,16 @@ SerialReadWorkItem(
 {
        PWORKITEM_DATA WorkItemData;
        PIRP Irp;
-       
+
        DPRINT("Serial: SerialReadWorkItem() called\n");
-       
+
        WorkItemData = (PWORKITEM_DATA)pWorkItemData;
        Irp = WorkItemData->Irp;
-       
+
        ReadBytes(DeviceObject, Irp, WorkItemData);
-       
+
        IoCompleteRequest(Irp, IO_NO_INCREMENT);
-       
+
        IoFreeWorkItem(WorkItemData->IoWorkItem);
        ExFreePoolWithTag(pWorkItemData, SERIAL_TAG);
 }
@@ -147,26 +147,26 @@ SerialRead(
        PWORKITEM_DATA WorkItemData;
        PIO_WORKITEM WorkItem;
        NTSTATUS Status;
-       
+
        DPRINT("Serial: IRP_MJ_READ\n");
-       
+
        Stack = IoGetCurrentIrpStackLocation(Irp);
        Length = Stack->Parameters.Read.Length;
        Buffer = SerialGetUserBuffer(Irp);
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
-       
+
        if (Stack->Parameters.Read.ByteOffset.QuadPart != 0 || Buffer == NULL)
        {
                Status = STATUS_INVALID_PARAMETER;
                goto ByeBye;
        }
-       
+
        if (Length == 0)
        {
                Status = STATUS_SUCCESS;
                goto ByeBye;
        }
-       
+
        /* Allocate memory for parameters */
        WorkItemData = ExAllocatePoolWithTag(PagedPool, sizeof(WORKITEM_DATA), SERIAL_TAG);
        if (!WorkItemData)
@@ -176,7 +176,7 @@ SerialRead(
        }
        RtlZeroMemory(WorkItemData, sizeof(WORKITEM_DATA));
        WorkItemData->Irp = Irp;
-       
+
        /* Calculate time outs */
        if (DeviceExtension->SerialTimeOuts.ReadIntervalTimeout == INFINITE &&
                 DeviceExtension->SerialTimeOuts.ReadTotalTimeoutMultiplier == INFINITE &&
@@ -207,7 +207,7 @@ SerialRead(
                {
                        ULONG TotalTimeout;
                        LARGE_INTEGER SystemTime;
-                       
+
                        WorkItemData->UseTotalTimeout = TRUE;
                        TotalTimeout = DeviceExtension->SerialTimeOuts.ReadTotalTimeoutConstant +
                                DeviceExtension->SerialTimeOuts.ReadTotalTimeoutMultiplier * Length;
@@ -216,7 +216,7 @@ SerialRead(
                                TotalTimeout * 10000;
                }
        }
-       
+
        /* Pend IRP */
        WorkItem = IoAllocateWorkItem(DeviceObject);
        if (WorkItem)
@@ -226,7 +226,7 @@ SerialRead(
                IoMarkIrpPending(Irp);
                return STATUS_PENDING;
        }
-       
+
        /* insufficient resources, we can't pend the Irp */
        CHECKPOINT;
        Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
@@ -237,7 +237,7 @@ SerialRead(
        }
        ReadBytes(DeviceObject, Irp, WorkItemData);
        Status = Irp->IoStatus.Status;
-       
+
        IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
 
 ByeBye:
@@ -259,28 +259,28 @@ SerialWrite(
        PUCHAR ComPortBase;
        KIRQL Irql;
        NTSTATUS Status = STATUS_SUCCESS;
-       
+
        DPRINT("Serial: IRP_MJ_WRITE\n");
-       
+
        /* FIXME: pend operation if possible */
        /* FIXME: use write timeouts */
-       
+
        Stack = IoGetCurrentIrpStackLocation(Irp);
        Length = Stack->Parameters.Write.Length;
        Buffer = SerialGetUserBuffer(Irp);
        DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
        ComPortBase = (PUCHAR)DeviceExtension->BaseAddress;
-       
+
        if (Stack->Parameters.Write.ByteOffset.QuadPart != 0 || Buffer == NULL)
        {
                Status = STATUS_INVALID_PARAMETER;
                goto ByeBye;
        }
-       
+
        Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
        if (!NT_SUCCESS(Status))
                goto ByeBye;
-       
+
        /* push  bytes into output buffer */
        KeAcquireSpinLock(&DeviceExtension->OutputBufferLock, &Irql);
        while (Information < Length)
@@ -306,7 +306,7 @@ SerialWrite(
        }
        KeReleaseSpinLock(&DeviceExtension->OutputBufferLock, Irql);
        IoReleaseRemoveLock(&DeviceExtension->RemoveLock, (PVOID)DeviceExtension->ComPort);
-       
+
        /* send bytes */
        SerialSendByte(NULL, DeviceExtension, NULL, NULL);
 
index 937af1b..346cd6b 100644 (file)
@@ -1,10 +1,10 @@
 /* $Id:
- * 
+ *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
  * FILE:            drivers/dd/serial/serial.c
  * PURPOSE:         Serial driver loading/unloading
- * 
+ *
  * PROGRAMMERS:     Hervé Poussineau (poussine@freesurf.fr)
  */
 
@@ -26,10 +26,10 @@ DriverEntry(
        IN PUNICODE_STRING RegPath)
 {
        ULONG i;
-       
+
        DriverObject->DriverUnload = DriverUnload;
        DriverObject->DriverExtension->AddDevice = SerialAddDevice;
-       
+
        for (i = 0; i < IRP_MJ_MAXIMUM_FUNCTION; i++)
                DriverObject->MajorFunction[i] = ForwardIrpAndForget;
        DriverObject->MajorFunction[IRP_MJ_CREATE] = SerialCreate;
@@ -41,6 +41,6 @@ DriverEntry(
        DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = SerialQueryInformation