Source code of Windows XP (NT5)
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.

154 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. smblitep.h
  5. Abstract: Contains SMBus Back Light specific definitions.
  6. Environment:
  7. Kernel mode
  8. Author:
  9. Michael Tsang (MikeTs) 20-Nov-2000
  10. Revision History:
  11. --*/
  12. #ifndef _SMBLITEP_H
  13. #define _SMBLITEP_H
  14. //
  15. // Constants
  16. //
  17. #define SMBLITEF_DEVICE_STARTED 0x00000001
  18. #define SMBLITEF_DEVICE_REMOVED 0x00000002
  19. #define SMBLITEF_SYM_LINK_CREATED 0x00000004
  20. #define SMBLITEF_SYSTEM_ON_AC 0x00000008
  21. #define SMBLITE_POOLTAG 'LbmS'
  22. #define SMBADDR_BACKLIGHT 0x2c //Addr on bus==0x58
  23. #define SMBCMD_BACKLIGHT_NORMAL 0x00
  24. #define SMBCMD_BACKLIGHT_SHUTDOWN 0x80
  25. #define DEF_ACBRIGHTNESS 32
  26. #define DEF_DCBRIGHTNESS 16
  27. typedef struct _SMBLITE_DEVEXT
  28. {
  29. ULONG dwfSmbLite;
  30. SMBLITE_BRIGHTNESS BackLightBrightness;
  31. PDEVICE_OBJECT FDO;
  32. PDEVICE_OBJECT PDO;
  33. PDEVICE_OBJECT LowerDevice;
  34. PVOID hPowerStateCallback;
  35. UNICODE_STRING SymbolicName;
  36. IO_REMOVE_LOCK RemoveLock;
  37. } SMBLITE_DEVEXT, *PSMBLITE_DEVEXT;
  38. //
  39. // Global Data
  40. //
  41. extern const WCHAR gcwstrACBrightness[];
  42. extern const WCHAR gcwstrDCBrightness[];
  43. //
  44. // Function prototypes
  45. //
  46. // smblite.c
  47. NTSTATUS EXTERNAL
  48. DriverEntry(
  49. IN PDRIVER_OBJECT DrvObj,
  50. IN PUNICODE_STRING RegPath
  51. );
  52. NTSTATUS EXTERNAL
  53. SmbLiteAddDevice(
  54. IN PDRIVER_OBJECT DrvObj,
  55. IN PDEVICE_OBJECT DevObj
  56. );
  57. VOID INTERNAL
  58. RemoveDevice(
  59. IN PSMBLITE_DEVEXT devext
  60. );
  61. VOID EXTERNAL
  62. SmbLiteUnload(
  63. IN PDRIVER_OBJECT DrvObj
  64. );
  65. NTSTATUS EXTERNAL
  66. SmbLiteCreateClose(
  67. IN PDEVICE_OBJECT DevObj,
  68. IN PIRP Irp
  69. );
  70. NTSTATUS INTERNAL
  71. HookPowerStateCallback(
  72. IN PSMBLITE_DEVEXT devext
  73. );
  74. VOID
  75. PowerStateCallbackProc(
  76. IN PVOID CallbackContext,
  77. IN PVOID Arg1,
  78. IN PVOID Arg2
  79. );
  80. // pnp.c
  81. NTSTATUS EXTERNAL
  82. SmbLitePnp(
  83. IN PDEVICE_OBJECT DevObj,
  84. IN PIRP Irp
  85. );
  86. NTSTATUS EXTERNAL
  87. SmbLitePower(
  88. IN PDEVICE_OBJECT DevObj,
  89. IN PIRP Irp
  90. );
  91. // ioctl.c
  92. NTSTATUS EXTERNAL
  93. SmbLiteIoctl(
  94. IN PDEVICE_OBJECT DevObj,
  95. IN PIRP Irp
  96. );
  97. NTSTATUS INTERNAL
  98. GetBackLightBrightness(
  99. IN PSMBLITE_DEVEXT devext,
  100. OUT PSMBLITE_BRIGHTNESS Brightness
  101. );
  102. NTSTATUS INTERNAL
  103. SetBackLightBrightness(
  104. IN PSMBLITE_DEVEXT devext,
  105. IN PSMBLITE_BRIGHTNESS Brightness,
  106. IN BOOLEAN fSaveSettings
  107. );
  108. NTSTATUS INTERNAL
  109. SMBRequest(
  110. IN PSMBLITE_DEVEXT devext,
  111. IN OUT PSMB_REQUEST SmbReq
  112. );
  113. NTSTATUS INTERNAL
  114. RegQueryDeviceParam(
  115. IN PDEVICE_OBJECT DevObj,
  116. IN PCWSTR pwstrParamName,
  117. OUT PVOID pbBuff,
  118. IN ULONG dwcbLen
  119. );
  120. NTSTATUS INTERNAL
  121. RegSetDeviceParam(
  122. IN PDEVICE_OBJECT DevObj,
  123. IN PCWSTR pwstrParamName,
  124. IN PVOID pbBuff,
  125. IN ULONG dwcbLen
  126. );
  127. #endif //ifndef _SMBLITEP_H