ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

smbus.h
Go to the documentation of this file.
00001 /*
00002  * smbus.h
00003  *
00004  * System Management Bus driver interface
00005  *
00006  * This file is part of the w32api package.
00007  *
00008  * Contributors:
00009  *   Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
00010  *
00011  * THIS SOFTWARE IS NOT COPYRIGHTED
00012  *
00013  * This source code is offered for use in the public domain. You may
00014  * use, modify or distribute it freely.
00015  *
00016  * This code is distributed in the hope that it will be useful but
00017  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
00018  * DISCLAIMED. This includes but is not limited to warranties of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00020  *
00021  */
00022 
00023 #ifndef __SMBUS_H
00024 #define __SMBUS_H
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00030 #if !defined(SMBCLASS)
00031 #define SMBCLASSAPI DECLSPEC_IMPORT
00032 #else
00033 #define SMBCLASSAPI
00034 #endif
00035 
00036 #define SMB_BUS_REQUEST \
00037   CTL_CODE(FILE_DEVICE_UNKNOWN, 0, METHOD_NEITHER, FILE_ANY_ACCESS)
00038 
00039 #define SMB_DEREGISTER_ALARM_NOTIFY \
00040   CTL_CODE(FILE_DEVICE_UNKNOWN, 2, METHOD_NEITHER, FILE_ANY_ACCESS)
00041 
00042 #define SMB_REGISTER_ALARM_NOTIFY \
00043   CTL_CODE(FILE_DEVICE_UNKNOWN, 1, METHOD_NEITHER, FILE_ANY_ACCESS)
00044 
00045 
00046 struct _SMB_CLASS;
00047 
00048 #define SMB_MAX_DATA_SIZE                 32
00049 
00050 /* SMB_REQUEST.Status constants */
00051 #define SMB_STATUS_OK                     0x00
00052 #define SMB_UNKNOWN_FAILURE               0x07
00053 #define SMB_ADDRESS_NOT_ACKNOWLEDGED      0x10
00054 #define SMB_DEVICE_ERROR                  0x11
00055 #define SMB_COMMAND_ACCESS_DENIED         0x12
00056 #define SMB_UNKNOWN_ERROR                 0x13
00057 #define SMB_DEVICE_ACCESS_DENIED          0x17
00058 #define SMB_TIMEOUT                       0x18
00059 #define SMB_UNSUPPORTED_PROTOCOL          0x19
00060 #define SMB_BUS_BUSY                      0x1A
00061 
00062 /* SMB_REQUEST.Protocol constants */
00063 #define SMB_WRITE_QUICK                   0x00
00064 #define SMB_READ_QUICK                    0x01
00065 #define SMB_SEND_BYTE                     0x02
00066 #define SMB_RECEIVE_BYTE                  0x03
00067 #define SMB_WRITE_BYTE                    0x04
00068 #define SMB_READ_BYTE                     0x05
00069 #define SMB_WRITE_WORD                    0x06
00070 #define SMB_READ_WORD                     0x07
00071 #define SMB_WRITE_BLOCK                   0x08
00072 #define SMB_READ_BLOCK                    0x09
00073 #define SMB_PROCESS_CALL                  0x0A
00074 #define SMB_MAXIMUM_PROTOCOL              0x0A
00075 
00076 typedef struct _SMB_REQUEST {
00077   UCHAR Status;
00078   UCHAR Protocol;
00079   UCHAR Address;
00080   UCHAR Command;
00081   UCHAR BlockLength;
00082   UCHAR Data[SMB_MAX_DATA_SIZE];
00083 } SMB_REQUEST, *PSMB_REQUEST;
00084 
00085 typedef VOID
00086 (NTAPI *SMB_ALARM_NOTIFY)(
00087   PVOID Context,
00088   UCHAR Address,
00089   USHORT Data);
00090 
00091 typedef struct _SMB_REGISTER_ALARM {
00092   UCHAR MinAddress;
00093   UCHAR MaxAddress;
00094   SMB_ALARM_NOTIFY NotifyFunction;
00095   PVOID NotifyContext;
00096 } SMB_REGISTER_ALARM, *PSMB_REGISTER_ALARM;
00097 
00098 /* SMB_CLASS.XxxVersion constants */
00099 #define SMB_CLASS_MAJOR_VERSION           0x0001
00100 #define SMB_CLASS_MINOR_VERSION           0x0000
00101 
00102 typedef NTSTATUS
00103 (NTAPI *SMB_RESET_DEVICE)(
00104   IN struct _SMB_CLASS *SmbClass,
00105   IN PVOID SmbMiniport);
00106 
00107 typedef VOID
00108 (NTAPI *SMB_START_IO)(
00109   IN struct _SMB_CLASS *SmbClass,
00110   IN PVOID SmbMiniport);
00111 
00112 typedef NTSTATUS
00113 (NTAPI *SMB_STOP_DEVICE)(
00114   IN struct _SMB_CLASS *SmbClass,
00115   IN PVOID SmbMiniport);
00116 
00117 typedef struct _SMB_CLASS {
00118   USHORT MajorVersion;
00119   USHORT MinorVersion;
00120   PVOID Miniport;
00121   PDEVICE_OBJECT DeviceObject;
00122   PDEVICE_OBJECT PDO;
00123   PDEVICE_OBJECT LowerDeviceObject;
00124   PIRP CurrentIrp;
00125   PSMB_REQUEST CurrentSmb;
00126   SMB_RESET_DEVICE ResetDevice;
00127   SMB_START_IO StartIo;
00128   SMB_STOP_DEVICE StopDevice;
00129 } SMB_CLASS, *PSMB_CLASS;
00130 
00131 SMBCLASSAPI
00132 VOID
00133 NTAPI
00134 SmbClassAlarm(
00135   IN PSMB_CLASS SmbClass,
00136   IN UCHAR Address,
00137   IN USHORT Data);
00138 
00139 SMBCLASSAPI
00140 VOID
00141 NTAPI
00142 SmbClassCompleteRequest(
00143   IN PSMB_CLASS SmbClass);
00144 
00145 typedef NTSTATUS
00146 (NTAPI *PSMB_INITIALIZE_MINIPORT)(
00147   IN PSMB_CLASS SmbClass,
00148   IN PVOID MiniportExtension,
00149   IN PVOID MiniportContext);
00150 
00151 SMBCLASSAPI
00152 NTSTATUS
00153 NTAPI
00154 SmbClassCreateFdo(
00155   IN PDRIVER_OBJECT DriverObject,
00156   IN PDEVICE_OBJECT PDO,
00157   IN ULONG MiniportExtensionSize,
00158   IN PSMB_INITIALIZE_MINIPORT MiniportInitialize,
00159   IN PVOID MiniportContext,
00160   OUT PDEVICE_OBJECT *FDO);
00161 
00162 SMBCLASSAPI
00163 NTSTATUS
00164 NTAPI
00165 SmbClassInitializeDevice(
00166   IN ULONG MajorVersion,
00167   IN ULONG MinorVersion,
00168   IN PDRIVER_OBJECT DriverObject);
00169 
00170 SMBCLASSAPI
00171 VOID
00172 NTAPI
00173 SmbClassLockDevice(
00174   IN PSMB_CLASS SmbClass);
00175 
00176 SMBCLASSAPI
00177 VOID
00178 NTAPI
00179 SmbClassUnlockDevice(
00180   IN PSMB_CLASS SmbClass);
00181 
00182 #ifdef __cplusplus
00183 }
00184 #endif
00185 
00186 #endif /* __SMBUS_H */

Generated on Sun May 27 2012 04:30:16 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.