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.

107 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 2000,2001 Microsoft Corporation
  3. Module Name:
  4. smbdev.h
  5. Abstract: Contains SMBus Device definitions.
  6. Environment:
  7. User mode
  8. Author:
  9. Michael Tsang (MikeTs) 25-Jan-2001
  10. Revision History:
  11. --*/
  12. #ifndef _SMBDEV_H
  13. #define _SMBDEV_H
  14. #ifndef SMB_MAX_DATA_SIZE
  15. #define SMB_MAX_DATA_SIZE 32
  16. // SMB Bus Status codes
  17. #define SMB_STATUS_OK 0x00
  18. #define SMB_UNKNOWN_FAILURE 0x07
  19. #define SMB_ADDRESS_NOT_ACKNOWLEDGED 0x10
  20. #define SMB_DEVICE_ERROR 0x11
  21. #define SMB_COMMAND_ACCESS_DENIED 0x12
  22. #define SMB_UNKNOWN_ERROR 0x13
  23. #define SMB_DEVICE_ACCESS_DENIED 0x17
  24. #define SMB_TIMEOUT 0x18
  25. #define SMB_UNSUPPORTED_PROTOCOL 0x19
  26. #define SMB_BUS_BUSY 0x1a
  27. typedef struct _SMB_REQUEST
  28. {
  29. UCHAR Status;
  30. UCHAR Protocol;
  31. UCHAR Address;
  32. UCHAR Command;
  33. UCHAR BlockLength;
  34. UCHAR Data[SMB_MAX_DATA_SIZE];
  35. } SMB_REQUEST, *PSMB_REQUEST;
  36. //
  37. // SMBus protocol values
  38. //
  39. #define SMB_WRITE_QUICK 0x00
  40. #define SMB_READ_QUICK 0x01
  41. #define SMB_SEND_BYTE 0x02
  42. #define SMB_RECEIVE_BYTE 0x03
  43. #define SMB_WRITE_BYTE 0x04
  44. #define SMB_READ_BYTE 0x05
  45. #define SMB_WRITE_WORD 0x06
  46. #define SMB_READ_WORD 0x07
  47. #define SMB_WRITE_BLOCK 0x08
  48. #define SMB_READ_BLOCK 0x09
  49. #define SMB_PROCESS_CALL 0x0a
  50. #define SMB_MAXIMUM_PROTOCOL 0x0a
  51. #endif //ifndef SMB_MAX_DATA_SIZE
  52. #include <pshpack1.h>
  53. typedef struct _BLOCK_DATA
  54. {
  55. UCHAR bBlockLen;
  56. UCHAR BlockData[SMB_MAX_DATA_SIZE];
  57. } BLOCK_DATA, *PBLOCK_DATA;
  58. #include <poppack.h>
  59. //wfType flags
  60. #define TYPEF_BYTE_HEX 0x00
  61. #define TYPEF_BYTE_DEC 0x01
  62. #define TYPEF_BYTE_INT 0x02
  63. #define TYPEF_BYTE_BITS 0x03
  64. #define TYPEF_WORD_HEX 0x04
  65. #define TYPEF_WORD_DEC 0x05
  66. #define TYPEF_WORD_INT 0x06
  67. #define TYPEF_WORD_BITS 0x07
  68. #define TYPEF_BLOCK_STRING 0x08
  69. #define TYPEF_BLOCK_BUFFER 0x09
  70. #define TYPEF_USER 0x80
  71. #define BHX TYPEF_BYTE_HEX
  72. #define BDC TYPEF_BYTE_DEC
  73. #define BSN TYPEF_BYTE_INT
  74. #define BBT TYPEF_BYTE_BITS
  75. #define WHX TYPEF_WORD_HEX
  76. #define WDC TYPEF_WORD_DEC
  77. #define WSN TYPEF_WORD_INT
  78. #define WBT TYPEF_WORD_BITS
  79. #define STR TYPEF_BLOCK_STRING
  80. #define BUF TYPEF_BLOCK_BUFFER
  81. typedef struct _SMBCMD_INFO
  82. {
  83. UCHAR bCmd;
  84. UCHAR bProtocol;
  85. UCHAR bType;
  86. int iDataSize;
  87. PSZ pszLabel;
  88. PSZ pszUnit;
  89. ULONG dwData;
  90. PVOID pvData;
  91. } SMBCMD_INFO, *PSMBCMD_INFO;
  92. #endif //ifndef _SMBDEV_H