mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Moved SCSI headers because they are used by usetup.
svn path=/trunk/; revision=3521
This commit is contained in:
parent
af353b6572
commit
f38f607dc4
9 changed files with 179 additions and 28 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: atapi.c,v 1.28 2002/09/04 21:33:26 ekohl Exp $
|
/* $Id: atapi.c,v 1.29 2002/09/19 16:17:35 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS ATAPI miniport driver
|
* PROJECT: ReactOS ATAPI miniport driver
|
||||||
|
@ -46,10 +46,9 @@
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
#include <ddk/srb.h>
|
||||||
#include "../include/srb.h"
|
#include <ddk/scsi.h>
|
||||||
#include "../include/scsi.h"
|
#include <ddk/ntddscsi.h>
|
||||||
#include "../include/ntddscsi.h"
|
|
||||||
|
|
||||||
#include "atapi.h"
|
#include "atapi.h"
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: cdrom.c,v 1.16 2002/09/17 20:35:21 hbirr Exp $
|
/* $Id: cdrom.c,v 1.17 2002/09/19 16:17:48 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -34,10 +34,9 @@
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
#include <ddk/scsi.h>
|
||||||
#include "../include/scsi.h"
|
#include <ddk/class2.h>
|
||||||
#include "../include/class2.h"
|
#include <ddk/ntddscsi.h>
|
||||||
#include "../include/ntddscsi.h"
|
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: class2.c,v 1.24 2002/09/08 10:22:22 chorns Exp $
|
/* $Id: class2.c,v 1.25 2002/09/19 16:18:00 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -33,8 +33,8 @@
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include "../include/scsi.h"
|
#include <ddk/scsi.h>
|
||||||
#include "../include/class2.h"
|
#include <ddk/class2.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: disk.c,v 1.18 2002/09/08 10:22:22 chorns Exp $
|
/* $Id: disk.c,v 1.19 2002/09/19 16:18:14 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -28,10 +28,9 @@
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
#include <ddk/scsi.h>
|
||||||
#include "../include/scsi.h"
|
#include <ddk/class2.h>
|
||||||
#include "../include/class2.h"
|
#include <ddk/ntddscsi.h>
|
||||||
#include "../include/ntddscsi.h"
|
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
@ -840,6 +839,45 @@ DiskClassDeviceControl(IN PDEVICE_OBJECT DeviceObject,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IOCTL_DISK_SET_DRIVE_LAYOUT:
|
case IOCTL_DISK_SET_DRIVE_LAYOUT:
|
||||||
|
if (IrpStack->Parameters.DeviceIoControl.InputBufferLength <
|
||||||
|
sizeof(DRIVE_LAYOUT_INFORMATION))
|
||||||
|
{
|
||||||
|
Status = STATUS_INFO_LENGTH_MISMATCH;
|
||||||
|
}
|
||||||
|
else if (DeviceExtension->PhysicalDevice->DeviceExtension != DeviceExtension)
|
||||||
|
{
|
||||||
|
Status = STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PDRIVE_LAYOUT_INFORMATION PartitionList;
|
||||||
|
ULONG TableSize;
|
||||||
|
|
||||||
|
PartitionList = Irp->AssociatedIrp.SystemBuffer;
|
||||||
|
TableSize = sizeof(DRIVE_LAYOUT_INFORMATION) +
|
||||||
|
((PartitionList->PartitionCount - 1) * sizeof(PARTITION_INFORMATION));
|
||||||
|
|
||||||
|
if (IrpStack->Parameters.DeviceIoControl.InputBufferLength < TableSize)
|
||||||
|
{
|
||||||
|
Status = STATUS_BUFFER_TOO_SMALL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Status = IoWritePartitionTable(DeviceExtension->DeviceObject,
|
||||||
|
DeviceExtension->DiskGeometry->BytesPerSector,
|
||||||
|
DeviceExtension->DiskGeometry->SectorsPerTrack,
|
||||||
|
DeviceExtension->DiskGeometry->TracksPerCylinder,
|
||||||
|
PartitionList);
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
/* FIXME: Update partition device objects */
|
||||||
|
|
||||||
|
Information = TableSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case IOCTL_DISK_VERIFY:
|
case IOCTL_DISK_VERIFY:
|
||||||
case IOCTL_DISK_FORMAT_TRACKS:
|
case IOCTL_DISK_FORMAT_TRACKS:
|
||||||
case IOCTL_DISK_PERFORMANCE:
|
case IOCTL_DISK_PERFORMANCE:
|
||||||
|
@ -851,7 +889,7 @@ DiskClassDeviceControl(IN PDEVICE_OBJECT DeviceObject,
|
||||||
case IOCTL_DISK_HISTOGRAM_RESET:
|
case IOCTL_DISK_HISTOGRAM_RESET:
|
||||||
case IOCTL_DISK_REQUEST_STRUCTURE:
|
case IOCTL_DISK_REQUEST_STRUCTURE:
|
||||||
case IOCTL_DISK_REQUEST_DATA:
|
case IOCTL_DISK_REQUEST_DATA:
|
||||||
/* If we get here, something went wrong. inform the requestor */
|
/* If we get here, something went wrong. Inform the requestor */
|
||||||
DPRINT1("Unhandled control code: %lx\n", ControlCode);
|
DPRINT1("Unhandled control code: %lx\n", ControlCode);
|
||||||
Status = STATUS_INVALID_DEVICE_REQUEST;
|
Status = STATUS_INVALID_DEVICE_REQUEST;
|
||||||
Information = 0;
|
Information = 0;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: scsiport.c,v 1.20 2002/09/08 10:22:23 chorns Exp $
|
/* $Id: scsiport.c,v 1.21 2002/09/19 16:18:50 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -28,9 +28,9 @@
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
#include "../include/srb.h"
|
#include <ddk/srb.h>
|
||||||
#include "../include/scsi.h"
|
#include <ddk/scsi.h>
|
||||||
#include "../include/ntddscsi.h"
|
#include <ddk/ntddscsi.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
@ -64,6 +64,7 @@ typedef struct _SCSI_PORT_DEVICE_EXTENSION
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
ULONG MiniPortExtensionSize;
|
ULONG MiniPortExtensionSize;
|
||||||
PORT_CONFIGURATION_INFORMATION PortConfig;
|
PORT_CONFIGURATION_INFORMATION PortConfig;
|
||||||
|
ULONG PortNumber;
|
||||||
|
|
||||||
KSPIN_LOCK SpinLock;
|
KSPIN_LOCK SpinLock;
|
||||||
PKINTERRUPT Interrupt;
|
PKINTERRUPT Interrupt;
|
||||||
|
@ -1116,7 +1117,7 @@ ScsiPortCreatePortDevice(IN PDRIVER_OBJECT DriverObject,
|
||||||
AccessRangeSize);
|
AccessRangeSize);
|
||||||
|
|
||||||
PortDeviceExtension->DeviceObject = PortDeviceObject;
|
PortDeviceExtension->DeviceObject = PortDeviceObject;
|
||||||
|
PortDeviceExtension->PortNumber = PortNumber;
|
||||||
|
|
||||||
/* Initialize the spin lock in the controller extension */
|
/* Initialize the spin lock in the controller extension */
|
||||||
KeInitializeSpinLock(&PortDeviceExtension->SpinLock);
|
KeInitializeSpinLock(&PortDeviceExtension->SpinLock);
|
||||||
|
@ -1476,4 +1477,118 @@ ScsiPortFreeSenseRequestSrb(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
static NTSTATUS
|
||||||
|
ScsiPortBuildDeviceMap(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension)
|
||||||
|
{
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
UNICODE_STRING KeyName;
|
||||||
|
WCHAR NameBuffer[32];
|
||||||
|
ULONG Disposition;
|
||||||
|
HANDLE ScsiKey;
|
||||||
|
HANDLE ScsiPortKey;
|
||||||
|
HANDLE ScsiBusKey;
|
||||||
|
HANDLE ScsiTargetKey;
|
||||||
|
HANDLE ScsiUnitKey;
|
||||||
|
ULONG BusNumber;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
/* Open or create the 'Scsi' subkey */
|
||||||
|
RtlInitUnicodeStringFromLiteral(&KeyName,
|
||||||
|
L"\\Registry\\Machine\\Hardware\\DeviceMap\\Scsi");
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
&KeyName,
|
||||||
|
OBJ_OPENIF,
|
||||||
|
0,
|
||||||
|
NULL);
|
||||||
|
Status = NtCreateKey(&ScsiKey,
|
||||||
|
KEY_ALL_ACCESS,
|
||||||
|
&ObjectAttributes,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
REG_OPTION_VOLATILE,
|
||||||
|
&Disposition);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
return(Status);
|
||||||
|
|
||||||
|
/* Create new 'Scsi Port X' subkey */
|
||||||
|
swprintf(NameBuffer,
|
||||||
|
L"Scsi Port %lu",
|
||||||
|
DeviceExtension->PortNumber);
|
||||||
|
RtlInitUnicodeString(&KeyName,
|
||||||
|
NameBuffer);
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
&KeyName,
|
||||||
|
0,
|
||||||
|
ScsiKey,
|
||||||
|
NULL);
|
||||||
|
Status = NtCreateKey(&ScsiPortKey,
|
||||||
|
KEY_ALL_ACCESS,
|
||||||
|
&ObjectAttributes,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
REG_OPTION_VOLATILE,
|
||||||
|
&Disposition);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
NtClose(ScsiKey);
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add port-specific values */
|
||||||
|
|
||||||
|
/* 'DMA Enabled' (REG_DWORD) */
|
||||||
|
DPRINT1("DMA Enabled = %s\n",
|
||||||
|
(DeviceExtension->PortCapabilities->AdapterUsesPio)?"TRUE":"FALSE");
|
||||||
|
|
||||||
|
/* 'Driver' (REG_SZ) */
|
||||||
|
|
||||||
|
/* 'Interrupt' (REG_DWORD) (NT4 only) */
|
||||||
|
DPRINT1("Interrupt = %lx\n", DeviceExtension->PortConfig.BusInterruptLevel);
|
||||||
|
|
||||||
|
/* 'IOAddress' (REG_DWORD) (NT4 only) */
|
||||||
|
DPRINT1("IOAddress = %lx\n",
|
||||||
|
ScsiPortConvertPhysicalAddressToUlong(DeviceExtension->PortConfig.AccessRanges[0].RangeStart));
|
||||||
|
|
||||||
|
|
||||||
|
/* Create 'Scsi Bus X' keys */
|
||||||
|
for (BusNumber = 0; BusNumber < DeviceExtension->PortConfig.NumberOfBuses; BusNumber++)
|
||||||
|
{
|
||||||
|
swprintf(NameBuffer,
|
||||||
|
L"Scsi Bus %lu",
|
||||||
|
DeviceExtension->PortNumber);
|
||||||
|
RtlInitUnicodeString(&KeyName,
|
||||||
|
NameBuffer);
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
&KeyName,
|
||||||
|
0,
|
||||||
|
ScsiPortKey,
|
||||||
|
NULL);
|
||||||
|
Status = NtCreateKey(&ScsiBusKey,
|
||||||
|
KEY_ALL_ACCESS,
|
||||||
|
&ObjectAttributes,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
REG_OPTION_VOLATILE,
|
||||||
|
&Disposition);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
NtClose(ScsiPortKey);
|
||||||
|
NtClose(ScsiKey);
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create target keys */
|
||||||
|
|
||||||
|
|
||||||
|
NtClose(ScsiBusKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
NtClose(ScsiPortKey);
|
||||||
|
NtClose(ScsiKey);
|
||||||
|
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: class2.h,v 1.6 2002/09/08 10:22:23 chorns Exp $
|
/* $Id: class2.h,v 1.1 2002/09/19 16:17:13 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: ntddscsi.h,v 1.5 2002/09/08 10:22:23 chorns Exp $
|
/* $Id: ntddscsi.h,v 1.1 2002/09/19 16:17:13 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: scsi.h,v 1.6 2002/09/08 10:22:23 chorns Exp $
|
/* $Id: scsi.h,v 1.1 2002/09/19 16:17:13 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: srb.h,v 1.7 2002/09/08 10:22:23 chorns Exp $
|
/* $Id: srb.h,v 1.1 2002/09/19 16:17:13 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
Loading…
Reference in a new issue