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

class.h
Go to the documentation of this file.
00001 /*++
00002 
00003 Copyright (c) 1991  Microsoft Corporation
00004 
00005 Module Name:
00006 
00007     class.h
00008 
00009 Abstract:
00010 
00011     These are the structures and defines that are used in the
00012     SCSI class drivers.
00013 
00014 Author:
00015 
00016     Mike Glass (mglass)
00017     Jeff Havens (jhavens)
00018 
00019 Revision History:
00020 
00021 --*/
00022 
00023 #ifndef _CLASS_
00024 
00025 #include <ntdddisk.h>
00026 #include <ntddcdrm.h>
00027 #include <ntddtape.h>
00028 #include <ntddchgr.h>
00029 #include <ntddstor.h>
00030 #include "ntddscsi.h"
00031 #include <stdio.h>
00032 
00033 // begin_ntminitape
00034 
00035 #if DBG
00036 
00037 #define DebugPrint(x) ScsiDebugPrint x
00038 
00039 #else
00040 
00041 #define DebugPrint(x)
00042 
00043 #endif // DBG
00044 
00045 // end_ntminitape
00046 
00047 #ifdef POOL_TAGGING
00048 #undef ExAllocatePool
00049 #undef ExAllocatePoolWithQuota
00050 #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,'HscS')
00051 #define ExAllocatePoolWithQuota(a,b) ExAllocatePoolWithQuotaTag(a,b,'HscS')
00052 #endif
00053 
00054 #define MAXIMUM_RETRIES 4
00055 
00056 typedef
00057 VOID
00058 (*PCLASS_ERROR) (
00059     IN PDEVICE_OBJECT DeviceObject,
00060     IN PSCSI_REQUEST_BLOCK Srb,
00061     IN OUT NTSTATUS *Status,
00062     IN OUT BOOLEAN *Retry
00063     );
00064 
00065 typedef struct _DEVICE_EXTENSION {
00066 
00067     //
00068     // Back pointer to device object
00069     //
00070 
00071     PDEVICE_OBJECT DeviceObject;
00072 
00073     //
00074     // Pointer to port device object
00075     //
00076 
00077     PDEVICE_OBJECT PortDeviceObject;
00078 
00079     //
00080     // Length of partition in bytes
00081     //
00082 
00083     LARGE_INTEGER PartitionLength;
00084 
00085     //
00086     // Number of bytes before start of partition
00087     //
00088 
00089     LARGE_INTEGER StartingOffset;
00090 
00091     //
00092     // Bytes to skew all requests, since DM Driver has been placed on an IDE drive.
00093     //
00094 
00095     ULONG DMByteSkew;
00096 
00097     //
00098     // Sectors to skew all requests.
00099     //
00100 
00101     ULONG DMSkew;
00102 
00103     //
00104     // Flag to indicate whether DM driver has been located on an IDE drive.
00105     //
00106 
00107     BOOLEAN DMActive;
00108 
00109     //
00110     // Pointer to the specific class error routine.
00111     //
00112 
00113     PCLASS_ERROR ClassError;
00114 
00115     //
00116     // SCSI port driver capabilities
00117     //
00118 
00119     PIO_SCSI_CAPABILITIES PortCapabilities;
00120 
00121     //
00122     // Buffer for drive parameters returned in IO device control.
00123     //
00124 
00125     PDISK_GEOMETRY DiskGeometry;
00126 
00127     //
00128     // Back pointer to device object of physical device
00129     //
00130 
00131     PDEVICE_OBJECT PhysicalDevice;
00132 
00133     //
00134     // Request Sense Buffer
00135     //
00136 
00137     PSENSE_DATA SenseData;
00138 
00139     //
00140     // Request timeout in seconds;
00141     //
00142 
00143     ULONG TimeOutValue;
00144 
00145     //
00146     // System device number
00147     //
00148 
00149     ULONG DeviceNumber;
00150 
00151     //
00152     // Add default Srb Flags.
00153     //
00154 
00155     ULONG SrbFlags;
00156 
00157     //
00158     // Total number of SCSI protocol errors on the device.
00159     //
00160 
00161     ULONG ErrorCount;
00162 
00163     //
00164     // Spinlock for split requests
00165     //
00166 
00167     KSPIN_LOCK SplitRequestSpinLock;
00168 
00169     //
00170     // Zone header and spin lock for zoned SRB requests.
00171     //
00172 
00173     PZONE_HEADER SrbZone;
00174 
00175     PKSPIN_LOCK SrbZoneSpinLock;
00176 
00177     //
00178     // Lock count for removable media.
00179     //
00180 
00181     LONG LockCount;
00182 
00183     //
00184     // Scsi port number
00185     //
00186 
00187     UCHAR PortNumber;
00188 
00189     //
00190     // SCSI path id
00191     //
00192 
00193     UCHAR PathId;
00194 
00195     //
00196     // SCSI bus target id
00197     //
00198 
00199     UCHAR TargetId;
00200 
00201     //
00202     // SCSI bus logical unit number
00203     //
00204 
00205     UCHAR Lun;
00206 
00207     //
00208     // Log2 of sector size
00209     //
00210 
00211     UCHAR SectorShift;
00212 
00213     //
00214     // Flag to indicate that the device has write caching enabled.
00215     //
00216 
00217     BOOLEAN WriteCache;
00218 
00219     //
00220     // Build SCSI 1 or SCSI 2 CDBs
00221     //
00222 
00223     BOOLEAN UseScsi1;
00224 
00225 } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
00226 
00227 //
00228 // Define context structure for asynchronous completions.
00229 //
00230 
00231 typedef struct _COMPLETION_CONTEXT {
00232     PDEVICE_OBJECT DeviceObject;
00233     SCSI_REQUEST_BLOCK Srb;
00234 }COMPLETION_CONTEXT, *PCOMPLETION_CONTEXT;
00235 
00236 
00237 NTSTATUS
00238 ScsiClassGetCapabilities(
00239     IN PDEVICE_OBJECT PortDeviceObject,
00240     OUT PIO_SCSI_CAPABILITIES *PortCapabilities
00241     );
00242 
00243 NTSTATUS
00244 ScsiClassGetInquiryData(
00245     IN PDEVICE_OBJECT PortDeviceObject,
00246     IN PSCSI_ADAPTER_BUS_INFO *ConfigInfo
00247     );
00248 
00249 NTSTATUS
00250 ScsiClassReadDriveCapacity(
00251     IN PDEVICE_OBJECT DeviceObject
00252     );
00253 
00254 VOID
00255 ScsiClassReleaseQueue(
00256     IN PDEVICE_OBJECT DeviceObject
00257     );
00258 
00259 NTSTATUS
00260 ScsiClassRemoveDevice(
00261     IN PDEVICE_OBJECT PortDeviceObject,
00262     IN UCHAR PathId,
00263     IN UCHAR TargetId,
00264     IN UCHAR Lun
00265     );
00266 
00267 NTSTATUS
00268 ScsiClassAsynchronousCompletion(
00269     PDEVICE_OBJECT DeviceObject,
00270     PIRP Irp,
00271     PVOID Context
00272     );
00273 
00274 VOID
00275 ScsiClassSplitRequest(
00276     IN PDEVICE_OBJECT DeviceObject,
00277     IN PIRP Irp,
00278     IN ULONG MaximumBytes
00279     );
00280 
00281 NTSTATUS
00282 ScsiClassDeviceControl(
00283     PDEVICE_OBJECT DeviceObject,
00284     PIRP Irp
00285     );
00286 
00287 NTSTATUS
00288 ScsiClassIoComplete(
00289     IN PDEVICE_OBJECT DeviceObject,
00290     IN PIRP Irp,
00291     IN PVOID Context
00292     );
00293 
00294 NTSTATUS
00295 ScsiClassIoCompleteAssociated(
00296     IN PDEVICE_OBJECT DeviceObject,
00297     IN PIRP Irp,
00298     IN PVOID Context
00299     );
00300 
00301 BOOLEAN
00302 ScsiClassInterpretSenseInfo(
00303     IN PDEVICE_OBJECT DeviceObject,
00304     IN PSCSI_REQUEST_BLOCK Srb,
00305     IN UCHAR MajorFunctionCode,
00306     IN ULONG IoDeviceCode,
00307     IN ULONG RetryCount,
00308     OUT NTSTATUS *Status
00309     );
00310 
00311 NTSTATUS
00312 ScsiClassSendSrbSynchronous(
00313         PDEVICE_OBJECT DeviceObject,
00314         PSCSI_REQUEST_BLOCK Srb,
00315         PVOID BufferAddress,
00316         ULONG BufferLength,
00317         BOOLEAN WriteToDevice
00318         );
00319 
00320 NTSTATUS
00321 ScsiClassSendSrbAsynchronous(
00322         PDEVICE_OBJECT DeviceObject,
00323         PSCSI_REQUEST_BLOCK Srb,
00324         PIRP Irp,
00325         PVOID BufferAddress,
00326         ULONG BufferLength,
00327         BOOLEAN WriteToDevice
00328         );
00329 
00330 VOID
00331 ScsiClassBuildRequest(
00332     PDEVICE_OBJECT DeviceObject,
00333     PIRP Irp
00334     );
00335 
00336 ULONG
00337 ScsiClassModeSense(
00338     IN PDEVICE_OBJECT DeviceObject,
00339     IN PCHAR ModeSenseBuffer,
00340     IN ULONG Length,
00341     IN UCHAR PageMode
00342     );
00343 
00344 BOOLEAN
00345 ScsiClassModeSelect(
00346     IN PDEVICE_OBJECT DeviceObject,
00347     IN PCHAR ModeSelectBuffer,
00348     IN ULONG Length,
00349     IN BOOLEAN SavePage
00350     );
00351 
00352 PVOID
00353 ScsiClassFindModePage(
00354     IN PCHAR ModeSenseBuffer,
00355     IN ULONG Length,
00356     IN UCHAR PageMode
00357     );
00358 
00359 NTSTATUS
00360 ScsiClassClaimDevice(
00361     IN PDEVICE_OBJECT PortDeviceObject,
00362     IN PSCSI_INQUIRY_DATA LunInfo,
00363     IN BOOLEAN Release,
00364     OUT PDEVICE_OBJECT *NewPortDeviceObject OPTIONAL
00365     );
00366 
00367 NTSTATUS
00368 ScsiClassInternalIoControl (
00369     IN PDEVICE_OBJECT DeviceObject,
00370     IN PIRP Irp
00371     );
00372 
00373 #endif /* _CLASS_ */
00374 

Generated on Sat May 26 2012 04:27:00 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.