Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1991 - 2001 Microsoft Corporation
  3. Module Name:
  4. ### ## # ## ## # ## ## ##### ### ## ## ## ##
  5. ## # ## ### ## ### # ## ## ## ## ### ### ### ## ##
  6. ### ## ### ## #### # ## ## ## ## ## ## ######## ## ##
  7. ### ## # # ## # #### #### ##### ## ## # ### ## #######
  8. ### ### ### # ### #### #### ####### # # ## ## ##
  9. # ## ### ### # ## ## ## ## ## ## # ## ## ## ##
  10. ### ## ## # # ## ## ## ## ## # ## ## ## ##
  11. Abstract:
  12. This header file contains the definitions for the
  13. ServerWorks NVRAM miniport driver.
  14. Author:
  15. Wesley Witt (wesw) 1-Oct-2001
  16. Environment:
  17. Kernel mode only.
  18. Notes:
  19. --*/
  20. extern "C" {
  21. #include <ntddk.h>
  22. #include <stdio.h>
  23. }
  24. #define MINIPORT_DEVICE_TYPE SA_DEVICE_NVRAM
  25. #include "saport.h"
  26. //
  27. // Control Register Bits
  28. //
  29. #define NVRAM_CONTROL_INTERRUPT_ENABLE 0x0200
  30. #define NVRAM_CONTROL_DONE 0x0100
  31. #define NVRAM_CONTROL_BUSY 0x0080
  32. #define NVRAM_CONTROL_FUNCTION_CODE 0x0060
  33. #define NVRAM_CONTROL_ADDRESS 0x001F
  34. #define NVRAM_CONTROL_FUNCTION_WRITE 0x0020
  35. #define NVRAM_CONTROL_FUNCTION_READ 0x0040
  36. #define MAX_NVRAM_SIZE (32)
  37. typedef struct _DEVICE_EXTENSION {
  38. PUCHAR NvramMemBase; // Memory mapped register base address
  39. PULONG IoBuffer; // Buffer passed in StartIo
  40. ULONG IoLength; // Length of IoBuffer in dwords
  41. ULONG IoOffset; // Starting offset for the I/O in dwords
  42. ULONG IoFunction; // Function code; IRP_MJ_WRITE, IRP_MJ_READ
  43. ULONG IoIndex; // Current index info IoBuffer
  44. ULONG CompletedIoSize; //
  45. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  46. //
  47. // prototypes
  48. //
  49. extern "C" {
  50. NTSTATUS
  51. DriverEntry(
  52. IN PDRIVER_OBJECT DriverObject,
  53. IN PUNICODE_STRING RegistryPath
  54. );
  55. } // extern "C"