* along with this program; if not, write to the Free Software
* 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
* PROJECT: ReactOS ATAPI miniport driver
// -------------------------------------------------------------------------
#include <ddk/ntddk.h>
-
-#include "../include/srb.h"
-#include "../include/scsi.h"
-#include "../include/ntddscsi.h"
+#include <ddk/srb.h>
+#include <ddk/scsi.h>
+#include <ddk/ntddscsi.h>
#include "atapi.h"
* along with this program; if not, write to the Free Software
* 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
* PROJECT: ReactOS kernel
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
-
-#include "../include/scsi.h"
-#include "../include/class2.h"
-#include "../include/ntddscsi.h"
+#include <ddk/scsi.h>
+#include <ddk/class2.h>
+#include <ddk/ntddscsi.h>
#define NDEBUG
#include <debug.h>
* along with this program; if not, write to the Free Software
* 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
* PROJECT: ReactOS kernel
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
-#include "../include/scsi.h"
-#include "../include/class2.h"
+#include <ddk/scsi.h>
+#include <ddk/class2.h>
#define NDEBUG
#include <debug.h>
* along with this program; if not, write to the Free Software
* 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
* PROJECT: ReactOS kernel
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
-
-#include "../include/scsi.h"
-#include "../include/class2.h"
-#include "../include/ntddscsi.h"
+#include <ddk/scsi.h>
+#include <ddk/class2.h>
+#include <ddk/ntddscsi.h>
#define NDEBUG
#include <debug.h>
break;
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_FORMAT_TRACKS:
case IOCTL_DISK_PERFORMANCE:
case IOCTL_DISK_HISTOGRAM_RESET:
case IOCTL_DISK_REQUEST_STRUCTURE:
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);
Status = STATUS_INVALID_DEVICE_REQUEST;
Information = 0;
* along with this program; if not, write to the Free Software
* 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
* PROJECT: ReactOS kernel
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
-#include "../include/srb.h"
-#include "../include/scsi.h"
-#include "../include/ntddscsi.h"
+#include <ddk/srb.h>
+#include <ddk/scsi.h>
+#include <ddk/ntddscsi.h>
#define NDEBUG
#include <debug.h>
ULONG Length;
ULONG MiniPortExtensionSize;
PORT_CONFIGURATION_INFORMATION PortConfig;
+ ULONG PortNumber;
KSPIN_LOCK SpinLock;
PKINTERRUPT Interrupt;
AccessRangeSize);
PortDeviceExtension->DeviceObject = PortDeviceObject;
-
+ PortDeviceExtension->PortNumber = PortNumber;
/* Initialize the spin lock in the controller extension */
KeInitializeSpinLock(&PortDeviceExtension->SpinLock);
}
+#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 */
-/* $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
* PROJECT: ReactOS kernel
-/* $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
* PROJECT: ReactOS kernel
-/* $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
* PROJECT: ReactOS kernel
-/* $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
* PROJECT: ReactOS kernel