ReactOS 0.4.15-dev-7677-g8209aa5
smbus.h
Go to the documentation of this file.
1/*
2 * smbus.h
3 *
4 * System Management Bus driver interface
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23#ifndef __SMBUS_H
24#define __SMBUS_H
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#if !defined(SMBCLASS)
31#define SMBCLASSAPI DECLSPEC_IMPORT
32#else
33#define SMBCLASSAPI
34#endif
35
36#define SMB_BUS_REQUEST \
37 CTL_CODE(FILE_DEVICE_UNKNOWN, 0, METHOD_NEITHER, FILE_ANY_ACCESS)
38
39#define SMB_DEREGISTER_ALARM_NOTIFY \
40 CTL_CODE(FILE_DEVICE_UNKNOWN, 2, METHOD_NEITHER, FILE_ANY_ACCESS)
41
42#define SMB_REGISTER_ALARM_NOTIFY \
43 CTL_CODE(FILE_DEVICE_UNKNOWN, 1, METHOD_NEITHER, FILE_ANY_ACCESS)
44
45
46struct _SMB_CLASS;
47
48#define SMB_MAX_DATA_SIZE 32
49
50/* SMB_REQUEST.Status constants */
51#define SMB_STATUS_OK 0x00
52#define SMB_UNKNOWN_FAILURE 0x07
53#define SMB_ADDRESS_NOT_ACKNOWLEDGED 0x10
54#define SMB_DEVICE_ERROR 0x11
55#define SMB_COMMAND_ACCESS_DENIED 0x12
56#define SMB_UNKNOWN_ERROR 0x13
57#define SMB_DEVICE_ACCESS_DENIED 0x17
58#define SMB_TIMEOUT 0x18
59#define SMB_UNSUPPORTED_PROTOCOL 0x19
60#define SMB_BUS_BUSY 0x1A
61
62/* SMB_REQUEST.Protocol constants */
63#define SMB_WRITE_QUICK 0x00
64#define SMB_READ_QUICK 0x01
65#define SMB_SEND_BYTE 0x02
66#define SMB_RECEIVE_BYTE 0x03
67#define SMB_WRITE_BYTE 0x04
68#define SMB_READ_BYTE 0x05
69#define SMB_WRITE_WORD 0x06
70#define SMB_READ_WORD 0x07
71#define SMB_WRITE_BLOCK 0x08
72#define SMB_READ_BLOCK 0x09
73#define SMB_PROCESS_CALL 0x0A
74#define SMB_MAXIMUM_PROTOCOL 0x0A
75
76typedef struct _SMB_REQUEST {
84
85typedef VOID
89 USHORT Data);
90
91typedef struct _SMB_REGISTER_ALARM {
97
98/* SMB_CLASS.XxxVersion constants */
99#define SMB_CLASS_MAJOR_VERSION 0x0001
100#define SMB_CLASS_MINOR_VERSION 0x0000
101
102typedef NTSTATUS
104 IN struct _SMB_CLASS *SmbClass,
105 IN PVOID SmbMiniport);
106
107typedef VOID
109 IN struct _SMB_CLASS *SmbClass,
110 IN PVOID SmbMiniport);
111
112typedef NTSTATUS
114 IN struct _SMB_CLASS *SmbClass,
115 IN PVOID SmbMiniport);
116
117typedef struct _SMB_CLASS {
130
132VOID
133NTAPI
135 IN PSMB_CLASS SmbClass,
137 IN USHORT Data);
138
140VOID
141NTAPI
143 IN PSMB_CLASS SmbClass);
144
145typedef NTSTATUS
147 IN PSMB_CLASS SmbClass,
148 IN PVOID MiniportExtension,
149 IN PVOID MiniportContext);
150
153NTAPI
156 IN PDEVICE_OBJECT PDO,
157 IN ULONG MiniportExtensionSize,
159 IN PVOID MiniportContext,
160 OUT PDEVICE_OBJECT *FDO);
161
164NTAPI
169
171VOID
172NTAPI
174 IN PSMB_CLASS SmbClass);
175
177VOID
178NTAPI
180 IN PSMB_CLASS SmbClass);
181
182#ifdef __cplusplus
183}
184#endif
185
186#endif /* __SMBUS_H */
#define VOID
Definition: acefi.h:82
LONG NTSTATUS
Definition: precomp.h:26
#define NTSTATUS
Definition: precomp.h:21
NDIS_STATUS NTAPI MiniportInitialize(OUT PNDIS_STATUS OpenErrorStatus, OUT PUINT SelectedMediumIndex, IN PNDIS_MEDIUM MediumArray, IN UINT MediumArraySize, IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE WrapperConfigurationContext)
Definition: ndis.c:50
ULONG MajorVersion
Definition: ros_glue.cpp:4
ULONG MinorVersion
Definition: ros_glue.cpp:5
unsigned short USHORT
Definition: pedump.c:61
static WCHAR Address[46]
Definition: ping.c:68
NTSTATUS(NTAPI * PSMB_INITIALIZE_MINIPORT)(IN PSMB_CLASS SmbClass, IN PVOID MiniportExtension, IN PVOID MiniportContext)
Definition: smbus.h:146
SMBCLASSAPI VOID NTAPI SmbClassAlarm(IN PSMB_CLASS SmbClass, IN UCHAR Address, IN USHORT Data)
struct _SMB_REQUEST SMB_REQUEST
struct _SMB_REGISTER_ALARM * PSMB_REGISTER_ALARM
VOID(NTAPI * SMB_START_IO)(IN struct _SMB_CLASS *SmbClass, IN PVOID SmbMiniport)
Definition: smbus.h:108
struct _SMB_CLASS SMB_CLASS
struct _SMB_REQUEST * PSMB_REQUEST
NTSTATUS(NTAPI * SMB_RESET_DEVICE)(IN struct _SMB_CLASS *SmbClass, IN PVOID SmbMiniport)
Definition: smbus.h:103
SMBCLASSAPI VOID NTAPI SmbClassUnlockDevice(IN PSMB_CLASS SmbClass)
#define SMB_MAX_DATA_SIZE
Definition: smbus.h:48
SMBCLASSAPI NTSTATUS NTAPI SmbClassInitializeDevice(IN ULONG MajorVersion, IN ULONG MinorVersion, IN PDRIVER_OBJECT DriverObject)
SMBCLASSAPI NTSTATUS NTAPI SmbClassCreateFdo(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PDO, IN ULONG MiniportExtensionSize, IN PSMB_INITIALIZE_MINIPORT MiniportInitialize, IN PVOID MiniportContext, OUT PDEVICE_OBJECT *FDO)
struct _SMB_CLASS * PSMB_CLASS
VOID(NTAPI * SMB_ALARM_NOTIFY)(PVOID Context, UCHAR Address, USHORT Data)
Definition: smbus.h:86
struct _SMB_REGISTER_ALARM SMB_REGISTER_ALARM
NTSTATUS(NTAPI * SMB_STOP_DEVICE)(IN struct _SMB_CLASS *SmbClass, IN PVOID SmbMiniport)
Definition: smbus.h:113
SMBCLASSAPI VOID NTAPI SmbClassCompleteRequest(IN PSMB_CLASS SmbClass)
SMBCLASSAPI VOID NTAPI SmbClassLockDevice(IN PSMB_CLASS SmbClass)
#define SMBCLASSAPI
Definition: smbus.h:31
USHORT MinorVersion
Definition: smbus.h:119
SMB_START_IO StartIo
Definition: smbus.h:127
PDEVICE_OBJECT LowerDeviceObject
Definition: smbus.h:123
PSMB_REQUEST CurrentSmb
Definition: smbus.h:125
PDEVICE_OBJECT DeviceObject
Definition: smbus.h:121
SMB_STOP_DEVICE StopDevice
Definition: smbus.h:128
PIRP CurrentIrp
Definition: smbus.h:124
USHORT MajorVersion
Definition: smbus.h:118
PDEVICE_OBJECT PDO
Definition: smbus.h:122
PVOID Miniport
Definition: smbus.h:120
SMB_RESET_DEVICE ResetDevice
Definition: smbus.h:126
SMB_ALARM_NOTIFY NotifyFunction
Definition: smbus.h:94
PVOID NotifyContext
Definition: smbus.h:95
UCHAR MinAddress
Definition: smbus.h:92
UCHAR MaxAddress
Definition: smbus.h:93
UCHAR Address
Definition: smbus.h:79
UCHAR Command
Definition: smbus.h:80
UCHAR Protocol
Definition: smbus.h:78
UCHAR BlockLength
Definition: smbus.h:81
UCHAR Status
Definition: smbus.h:77
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
unsigned char UCHAR
Definition: xmlstorage.h:181