mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 05:52:57 +00:00
Create a branch for network fixes.
svn path=/branches/aicom-network-fixes/; revision=34994
This commit is contained in:
parent
0e213bbc00
commit
c501d8112c
18148 changed files with 0 additions and 860488 deletions
6159
drivers/storage/scsiport/scsiport.c
Normal file
6159
drivers/storage/scsiport/scsiport.c
Normal file
File diff suppressed because it is too large
Load diff
13
drivers/storage/scsiport/scsiport.rbuild
Normal file
13
drivers/storage/scsiport/scsiport.rbuild
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||
<module name="scsiport" type="kernelmodedriver" installbase="system32/drivers" installname="scsiport.sys">
|
||||
<bootstrap installbase="$(CDOUTPUT)" />
|
||||
<define name="_SCSIPORT_" />
|
||||
<importlibrary definition="scsiport.spec.def" />
|
||||
<include base="scsiport">.</include>
|
||||
<library>ntoskrnl</library>
|
||||
<library>hal</library>
|
||||
<file>scsiport.c</file>
|
||||
<file>scsiport.rc</file>
|
||||
<file>scsiport.spec</file>
|
||||
</module>
|
5
drivers/storage/scsiport/scsiport.rc
Normal file
5
drivers/storage/scsiport/scsiport.rc
Normal file
|
@ -0,0 +1,5 @@
|
|||
#define REACTOS_VERSION_DLL
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "SCSI Port Driver\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "scsiport\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "scsiport.sys\0"
|
||||
#include <reactos/version.rc>
|
45
drivers/storage/scsiport/scsiport.spec
Normal file
45
drivers/storage/scsiport/scsiport.spec
Normal file
|
@ -0,0 +1,45 @@
|
|||
@ cdecl ScsiDebugPrint()
|
||||
@ stdcall ScsiPortCompleteRequest(ptr long long long long)
|
||||
@ stdcall ScsiPortConvertPhysicalAddressToUlong(long long)
|
||||
@ stdcall ScsiPortConvertUlongToPhysicalAddress(long) NTOSKRNL.RtlConvertUlongToLargeInteger
|
||||
@ stdcall ScsiPortFlushDma(ptr)
|
||||
@ stdcall ScsiPortFreeDeviceBase(ptr ptr)
|
||||
@ stdcall ScsiPortGetBusData(ptr long long long ptr long)
|
||||
@ stdcall ScsiPortGetDeviceBase(ptr long long long long long long)
|
||||
@ stdcall ScsiPortGetLogicalUnit(ptr long long long)
|
||||
@ stdcall ScsiPortGetPhysicalAddress(ptr ptr ptr long)
|
||||
@ stdcall ScsiPortGetSrb(ptr long long long long)
|
||||
@ stdcall ScsiPortGetUncachedExtension(ptr ptr long)
|
||||
@ stdcall ScsiPortGetVirtualAddress(ptr long long)
|
||||
@ stdcall ScsiPortInitialize(ptr ptr ptr ptr)
|
||||
@ stdcall ScsiPortIoMapTransfer(ptr ptr long long)
|
||||
@ stdcall ScsiPortLogError(ptr ptr long long long long long)
|
||||
@ stdcall ScsiPortMoveMemory(ptr ptr long)
|
||||
@ cdecl ScsiPortNotification()
|
||||
@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) HAL.READ_PORT_BUFFER_UCHAR
|
||||
@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long) HAL.READ_PORT_BUFFER_USHORT
|
||||
@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) HAL.READ_PORT_BUFFER_ULONG
|
||||
@ stdcall ScsiPortReadPortUchar(ptr) HAL.READ_PORT_UCHAR
|
||||
@ stdcall ScsiPortReadPortUshort(ptr) HAL.READ_PORT_USHORT
|
||||
@ stdcall ScsiPortReadPortUlong(ptr) HAL.READ_PORT_ULONG
|
||||
@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_UCHAR
|
||||
@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_USHORT
|
||||
@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long) NTOSKRNL.READ_REGISTER_BUFFER_ULONG
|
||||
@ stdcall ScsiPortReadRegisterUchar(ptr) NTOSKRNL.READ_REGISTER_UCHAR
|
||||
@ stdcall ScsiPortReadRegisterUshort(ptr) NTOSKRNL.READ_REGISTER_USHORT
|
||||
@ stdcall ScsiPortReadRegisterUlong(ptr) NTOSKRNL.READ_REGISTER_ULONG
|
||||
@ stdcall ScsiPortSetBusDataByOffset(ptr long long long ptr long long)
|
||||
@ stdcall ScsiPortStallExecution(long) HAL.KeStallExecutionProcessor
|
||||
@ stdcall ScsiPortValidateRange(ptr long long long long long long)
|
||||
@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long) HAL.WRITE_PORT_BUFFER_UCHAR
|
||||
@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long) HAL.WRITE_PORT_BUFFER_USHORT
|
||||
@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long) HAL.WRITE_PORT_BUFFER_ULONG
|
||||
@ stdcall ScsiPortWritePortUchar(ptr long) HAL.WRITE_PORT_UCHAR
|
||||
@ stdcall ScsiPortWritePortUshort(ptr long) HAL.WRITE_PORT_USHORT
|
||||
@ stdcall ScsiPortWritePortUlong(ptr long) HAL.WRITE_PORT_ULONG
|
||||
@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR
|
||||
@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT
|
||||
@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long) NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG
|
||||
@ stdcall ScsiPortWriteRegisterUchar(ptr long) NTOSKRNL.WRITE_REGISTER_UCHAR
|
||||
@ stdcall ScsiPortWriteRegisterUshort(ptr long) NTOSKRNL.WRITE_REGISTER_USHORT
|
||||
@ stdcall ScsiPortWriteRegisterUlong(ptr long) NTOSKRNL.WRITE_REGISTER_ULONG
|
297
drivers/storage/scsiport/scsiport_int.h
Normal file
297
drivers/storage/scsiport/scsiport_int.h
Normal file
|
@ -0,0 +1,297 @@
|
|||
/*
|
||||
* SCSI_PORT_TIMER_STATES
|
||||
*
|
||||
* DESCRIPTION
|
||||
* An enumeration containing the states in the timer DFA
|
||||
*/
|
||||
|
||||
#define VERSION "0.0.3"
|
||||
|
||||
#ifndef PAGE_ROUND_UP
|
||||
#define PAGE_ROUND_UP(x) ( (((ULONG_PTR)x)%PAGE_SIZE) ? ((((ULONG_PTR)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG_PTR)x) )
|
||||
#endif
|
||||
#ifndef ROUND_UP
|
||||
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
||||
#endif
|
||||
|
||||
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
|
||||
#define TAG_SCSIPORT TAG('S', 'C', 'S', 'I')
|
||||
|
||||
/* Defines how many logical unit arrays will be in a device extension */
|
||||
#define LUS_NUMBER 8
|
||||
|
||||
#define MAX_SG_LIST 17
|
||||
|
||||
/* Flags */
|
||||
#define SCSI_PORT_DEVICE_BUSY 0x0001
|
||||
#define SCSI_PORT_LU_ACTIVE 0x0002
|
||||
#define SCSI_PORT_NOTIFICATION_NEEDED 0x0004
|
||||
#define SCSI_PORT_NEXT_REQUEST_READY 0x0008
|
||||
#define SCSI_PORT_FLUSH_ADAPTERS 0x0010
|
||||
#define SCSI_PORT_MAP_TRANSFER 0x0020
|
||||
#define SCSI_PORT_RESET 0x0080
|
||||
#define SCSI_PORT_RESET_REQUEST 0x0100
|
||||
#define SCSI_PORT_RESET_REPORTED 0x0200
|
||||
#define SCSI_PORT_REQUEST_PENDING 0x0800
|
||||
#define SCSI_PORT_DISCONNECT_ALLOWED 0x1000
|
||||
#define SCSI_PORT_DISABLE_INT_REQUESET 0x2000
|
||||
#define SCSI_PORT_DISABLE_INTERRUPTS 0x4000
|
||||
#define SCSI_PORT_ENABLE_INT_REQUEST 0x8000
|
||||
#define SCIS_PORT_TIMER_NEEDED 0x10000
|
||||
|
||||
/* LUN Extension flags*/
|
||||
#define LUNEX_FROZEN_QUEUE 0x0001
|
||||
#define LUNEX_NEED_REQUEST_SENSE 0x0004
|
||||
#define LUNEX_BUSY 0x0008
|
||||
#define LUNEX_FULL_QUEUE 0x0010
|
||||
#define LUNEX_REQUEST_PENDING 0x0020
|
||||
#define SCSI_PORT_SCAN_IN_PROGRESS 0x8000
|
||||
|
||||
|
||||
typedef enum _SCSI_PORT_TIMER_STATES
|
||||
{
|
||||
IDETimerIdle,
|
||||
IDETimerCmdWait,
|
||||
IDETimerResetWaitForBusyNegate,
|
||||
IDETimerResetWaitForDrdyAssert
|
||||
} SCSI_PORT_TIMER_STATES;
|
||||
|
||||
typedef struct _CONFIGURATION_INFO
|
||||
{
|
||||
/* Identify info */
|
||||
ULONG AdapterNumber;
|
||||
ULONG LastAdapterNumber;
|
||||
ULONG BusNumber;
|
||||
|
||||
/* Registry related */
|
||||
HANDLE BusKey;
|
||||
HANDLE ServiceKey;
|
||||
HANDLE DeviceKey;
|
||||
|
||||
/* Features */
|
||||
BOOLEAN DisableTaggedQueueing;
|
||||
BOOLEAN DisableMultipleLun;
|
||||
|
||||
/* Parameters */
|
||||
PVOID Parameter;
|
||||
PACCESS_RANGE AccessRanges;
|
||||
} CONFIGURATION_INFO, *PCONFIGURATION_INFO;
|
||||
|
||||
typedef struct _SCSI_PORT_DEVICE_BASE
|
||||
{
|
||||
LIST_ENTRY List;
|
||||
|
||||
PVOID MappedAddress;
|
||||
ULONG NumberOfBytes;
|
||||
SCSI_PHYSICAL_ADDRESS IoAddress;
|
||||
ULONG SystemIoBusNumber;
|
||||
} SCSI_PORT_DEVICE_BASE, *PSCSI_PORT_DEVICE_BASE;
|
||||
|
||||
typedef struct _SCSI_SG_ADDRESS
|
||||
{
|
||||
PHYSICAL_ADDRESS PhysicalAddress;
|
||||
ULONG Length;
|
||||
} SCSI_SG_ADDRESS, *PSCSI_SG_ADDRESS;
|
||||
|
||||
typedef struct _SCSI_REQUEST_BLOCK_INFO
|
||||
{
|
||||
LIST_ENTRY Requests;
|
||||
PSCSI_REQUEST_BLOCK Srb;
|
||||
PCHAR DataOffset;
|
||||
PVOID SaveSenseRequest;
|
||||
|
||||
ULONG SequenceNumber;
|
||||
|
||||
/* DMA stuff */
|
||||
PVOID BaseOfMapRegister;
|
||||
ULONG NumberOfMapRegisters;
|
||||
|
||||
struct _SCSI_REQUEST_BLOCK_INFO *CompletedRequests;
|
||||
|
||||
/* Scatter-gather list */
|
||||
PSCSI_SG_ADDRESS ScatterGather;
|
||||
SCSI_SG_ADDRESS ScatterGatherList[MAX_SG_LIST];
|
||||
} SCSI_REQUEST_BLOCK_INFO, *PSCSI_REQUEST_BLOCK_INFO;
|
||||
|
||||
typedef struct _SCSI_PORT_LUN_EXTENSION
|
||||
{
|
||||
UCHAR PathId;
|
||||
UCHAR TargetId;
|
||||
UCHAR Lun;
|
||||
|
||||
ULONG Flags;
|
||||
|
||||
struct _SCSI_PORT_LUN_EXTENSION *Next;
|
||||
|
||||
BOOLEAN DeviceClaimed;
|
||||
PDEVICE_OBJECT DeviceObject;
|
||||
|
||||
INQUIRYDATA InquiryData;
|
||||
|
||||
KDEVICE_QUEUE DeviceQueue;
|
||||
ULONG SortKey;
|
||||
ULONG QueueCount;
|
||||
ULONG MaxQueueCount;
|
||||
|
||||
ULONG AttemptCount;
|
||||
LONG RequestTimeout;
|
||||
|
||||
PIRP BusyRequest;
|
||||
PIRP PendingRequest;
|
||||
|
||||
struct _SCSI_PORT_LUN_EXTENSION *ReadyLun;
|
||||
struct _SCSI_PORT_LUN_EXTENSION *CompletedAbortRequests;
|
||||
|
||||
SCSI_REQUEST_BLOCK_INFO SrbInfo;
|
||||
|
||||
/* More data? */
|
||||
|
||||
UCHAR MiniportLunExtension[1]; /* must be the last entry */
|
||||
} SCSI_PORT_LUN_EXTENSION, *PSCSI_PORT_LUN_EXTENSION;
|
||||
|
||||
/* Structures for inquiries support */
|
||||
|
||||
typedef struct _SCSI_LUN_INFO
|
||||
{
|
||||
UCHAR PathId;
|
||||
UCHAR TargetId;
|
||||
UCHAR Lun;
|
||||
BOOLEAN DeviceClaimed;
|
||||
PVOID DeviceObject;
|
||||
struct _SCSI_LUN_INFO *Next;
|
||||
UCHAR InquiryData[INQUIRYDATABUFFERSIZE];
|
||||
} SCSI_LUN_INFO, *PSCSI_LUN_INFO;
|
||||
|
||||
typedef struct _SCSI_BUS_SCAN_INFO
|
||||
{
|
||||
USHORT Length;
|
||||
UCHAR LogicalUnitsCount;
|
||||
UCHAR BusIdentifier;
|
||||
PSCSI_LUN_INFO LunInfo;
|
||||
} SCSI_BUS_SCAN_INFO, *PSCSI_BUS_SCAN_INFO;
|
||||
|
||||
typedef struct _BUSES_CONFIGURATION_INFORMATION
|
||||
{
|
||||
UCHAR NumberOfBuses;
|
||||
PSCSI_BUS_SCAN_INFO BusScanInfo[1];
|
||||
} BUSES_CONFIGURATION_INFORMATION, *PBUSES_CONFIGURATION_INFORMATION;
|
||||
|
||||
|
||||
typedef struct _SCSI_PORT_INTERRUPT_DATA
|
||||
{
|
||||
ULONG Flags; /* Interrupt-time flags */
|
||||
PSCSI_REQUEST_BLOCK_INFO CompletedRequests; /* Linked list of Srb info data */
|
||||
PSCSI_PORT_LUN_EXTENSION CompletedAbort;
|
||||
PSCSI_PORT_LUN_EXTENSION ReadyLun;
|
||||
} SCSI_PORT_INTERRUPT_DATA, *PSCSI_PORT_INTERRUPT_DATA;
|
||||
|
||||
|
||||
/* Only for interrupt data saving function */
|
||||
typedef struct _SCSI_PORT_SAVE_INTERRUPT
|
||||
{
|
||||
PSCSI_PORT_INTERRUPT_DATA InterruptData;
|
||||
struct _SCSI_PORT_DEVICE_EXTENSION *DeviceExtension;
|
||||
} SCSI_PORT_SAVE_INTERRUPT, *PSCSI_PORT_SAVE_INTERRUPT;
|
||||
|
||||
/*
|
||||
* SCSI_PORT_DEVICE_EXTENSION
|
||||
*
|
||||
* DESCRIPTION
|
||||
* First part of the port objects device extension. The second
|
||||
* part is the miniport-specific device extension.
|
||||
*/
|
||||
|
||||
typedef struct _SCSI_PORT_DEVICE_EXTENSION
|
||||
{
|
||||
ULONG Length;
|
||||
ULONG MiniPortExtensionSize;
|
||||
PPORT_CONFIGURATION_INFORMATION PortConfig;
|
||||
PBUSES_CONFIGURATION_INFORMATION BusesConfig;
|
||||
PVOID NonCachedExtension;
|
||||
ULONG PortNumber;
|
||||
|
||||
LONG ActiveRequestCounter;
|
||||
ULONG SrbFlags;
|
||||
ULONG Flags;
|
||||
|
||||
ULONG BusNum;
|
||||
ULONG MaxTargedIds;
|
||||
ULONG MaxLunCount;
|
||||
|
||||
KSPIN_LOCK IrqLock; /* Used when there are 2 irqs */
|
||||
ULONG SequenceNumber; /* Global sequence number for packets */
|
||||
KSPIN_LOCK SpinLock;
|
||||
PKINTERRUPT Interrupt;
|
||||
PIRP CurrentIrp;
|
||||
ULONG IrpFlags;
|
||||
|
||||
SCSI_PORT_TIMER_STATES TimerState;
|
||||
LONG TimerCount;
|
||||
|
||||
KTIMER MiniportTimer;
|
||||
KDPC MiniportTimerDpc;
|
||||
|
||||
PMAPPED_ADDRESS MappedAddressList;
|
||||
|
||||
ULONG LunExtensionSize;
|
||||
PSCSI_PORT_LUN_EXTENSION LunExtensionList[LUS_NUMBER];
|
||||
|
||||
SCSI_PORT_INTERRUPT_DATA InterruptData;
|
||||
|
||||
/* SRB extension stuff*/
|
||||
ULONG SrbExtensionSize;
|
||||
PVOID SrbExtensionBuffer;
|
||||
PVOID FreeSrbExtensions;
|
||||
|
||||
/* SRB information */
|
||||
PSCSI_REQUEST_BLOCK_INFO SrbInfo;
|
||||
PSCSI_REQUEST_BLOCK_INFO FreeSrbInfo;
|
||||
ULONG SrbDataCount;
|
||||
|
||||
IO_SCSI_CAPABILITIES PortCapabilities;
|
||||
|
||||
PDEVICE_OBJECT DeviceObject;
|
||||
PCONTROLLER_OBJECT ControllerObject;
|
||||
|
||||
PHW_INITIALIZE HwInitialize;
|
||||
PHW_STARTIO HwStartIo;
|
||||
PHW_INTERRUPT HwInterrupt;
|
||||
PHW_RESET_BUS HwResetBus;
|
||||
PHW_DMA_STARTED HwDmaStarted;
|
||||
|
||||
PSCSI_REQUEST_BLOCK OriginalSrb;
|
||||
SCSI_REQUEST_BLOCK InternalSrb;
|
||||
SENSE_DATA InternalSenseData;
|
||||
|
||||
/* DMA related stuff */
|
||||
PADAPTER_OBJECT AdapterObject;
|
||||
ULONG MapRegisterCount;
|
||||
BOOLEAN MapBuffers;
|
||||
BOOLEAN MapRegisters;
|
||||
PVOID MapRegisterBase;
|
||||
|
||||
/* Features */
|
||||
BOOLEAN CachesData;
|
||||
BOOLEAN SupportsTaggedQueuing;
|
||||
BOOLEAN SupportsAutoSense;
|
||||
BOOLEAN MultipleReqsPerLun;
|
||||
BOOLEAN ReceiveEvent;
|
||||
|
||||
PHYSICAL_ADDRESS PhysicalAddress;
|
||||
ULONG CommonBufferLength;
|
||||
ULONG InterruptLevel;
|
||||
ULONG IoAddress;
|
||||
|
||||
BOOLEAN NeedSrbExtensionAlloc;
|
||||
BOOLEAN NeedSrbDataAlloc;
|
||||
|
||||
ULONG RequestsNumber;
|
||||
|
||||
UCHAR MiniPortDeviceExtension[1]; /* must be the last entry */
|
||||
} SCSI_PORT_DEVICE_EXTENSION, *PSCSI_PORT_DEVICE_EXTENSION;
|
||||
|
||||
typedef struct _RESETBUS_PARAMS
|
||||
{
|
||||
ULONG PathId;
|
||||
PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||
} RESETBUS_PARAMS, *PRESETBUS_PARAMS;
|
Loading…
Add table
Add a link
Reference in a new issue