03ec56394913097c28347b5980c13a21dfac3b71
[reactos.git] / drivers / storage / port / storport / storport.c
1 /*
2 * PROJECT: ReactOS Storport Driver
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Storport driver main file
5 * COPYRIGHT: Copyright 2017 Eric Kohl (eric.kohl@reactos.org)
6 */
7
8 /* INCLUDES *******************************************************************/
9
10 #include "precomp.h"
11
12 #define NDEBUG
13 #include <debug.h>
14
15
16 /* GLOBALS ********************************************************************/
17
18 ULONG PortNumber = 0;
19
20
21 /* FUNCTIONS ******************************************************************/
22
23 static
24 NTSTATUS
25 PortAddDriverInitData(
26 PDRIVER_OBJECT_EXTENSION DriverExtension,
27 PHW_INITIALIZATION_DATA HwInitializationData)
28 {
29 PDRIVER_INIT_DATA InitData;
30
31 DPRINT1("PortAddDriverInitData()\n");
32
33 InitData = ExAllocatePoolWithTag(NonPagedPool,
34 sizeof(DRIVER_INIT_DATA),
35 TAG_INIT_DATA);
36 if (InitData == NULL)
37 return STATUS_NO_MEMORY;
38
39 RtlCopyMemory(&InitData->HwInitData,
40 HwInitializationData,
41 sizeof(HW_INITIALIZATION_DATA));
42
43 InsertHeadList(&DriverExtension->InitDataListHead,
44 &InitData->Entry);
45
46 return STATUS_SUCCESS;
47 }
48
49
50 static
51 VOID
52 PortDeleteDriverInitData(
53 PDRIVER_OBJECT_EXTENSION DriverExtension)
54 {
55 PDRIVER_INIT_DATA InitData;
56 PLIST_ENTRY ListEntry;
57
58 DPRINT1("PortDeleteDriverInitData()\n");
59
60 ListEntry = DriverExtension->InitDataListHead.Flink;
61 while (ListEntry != &DriverExtension->InitDataListHead)
62 {
63 InitData = CONTAINING_RECORD(ListEntry,
64 DRIVER_INIT_DATA,
65 Entry);
66
67 RemoveEntryList(&InitData->Entry);
68
69 ExFreePoolWithTag(InitData,
70 TAG_INIT_DATA);
71
72 ListEntry = DriverExtension->InitDataListHead.Flink;
73 }
74 }
75
76
77 PHW_INITIALIZATION_DATA
78 PortGetDriverInitData(
79 PDRIVER_OBJECT_EXTENSION DriverExtension,
80 INTERFACE_TYPE InterfaceType)
81 {
82 PDRIVER_INIT_DATA InitData;
83 PLIST_ENTRY ListEntry;
84
85 DPRINT1("PortGetDriverInitData()\n");
86
87 ListEntry = DriverExtension->InitDataListHead.Flink;
88 while (ListEntry != &DriverExtension->InitDataListHead)
89 {
90 InitData = CONTAINING_RECORD(ListEntry,
91 DRIVER_INIT_DATA,
92 Entry);
93 if (InitData->HwInitData.AdapterInterfaceType == InterfaceType)
94 return &InitData->HwInitData;
95
96 ListEntry = ListEntry->Flink;
97 }
98
99 return NULL;
100 }
101
102
103 static
104 VOID
105 PortAcquireSpinLock(
106 PFDO_DEVICE_EXTENSION DeviceExtension,
107 STOR_SPINLOCK SpinLock,
108 PVOID LockContext,
109 PSTOR_LOCK_HANDLE LockHandle)
110 {
111 DPRINT1("PortAcquireSpinLock(%p %lu %p %p)\n",
112 DeviceExtension, SpinLock, LockContext, LockHandle);
113
114 LockHandle->Lock = SpinLock;
115
116 switch (SpinLock)
117 {
118 case DpcLock: /* 1, */
119 DPRINT1("DpcLock\n");
120 break;
121
122 case StartIoLock: /* 2 */
123 DPRINT1("StartIoLock\n");
124 break;
125
126 case InterruptLock: /* 3 */
127 DPRINT1("InterruptLock\n");
128 if (DeviceExtension->Interrupt == NULL)
129 LockHandle->Context.OldIrql = 0;
130 else
131 LockHandle->Context.OldIrql = KeAcquireInterruptSpinLock(DeviceExtension->Interrupt);
132 break;
133 }
134 }
135
136
137 static
138 VOID
139 PortReleaseSpinLock(
140 PFDO_DEVICE_EXTENSION DeviceExtension,
141 PSTOR_LOCK_HANDLE LockHandle)
142 {
143 DPRINT1("PortReleaseSpinLock(%p %p)\n",
144 DeviceExtension, LockHandle);
145
146 switch (LockHandle->Lock)
147 {
148 case DpcLock: /* 1, */
149 DPRINT1("DpcLock\n");
150 break;
151
152 case StartIoLock: /* 2 */
153 DPRINT1("StartIoLock\n");
154 break;
155
156 case InterruptLock: /* 3 */
157 DPRINT1("InterruptLock\n");
158 if (DeviceExtension->Interrupt != NULL)
159 KeReleaseInterruptSpinLock(DeviceExtension->Interrupt,
160 LockHandle->Context.OldIrql);
161 break;
162 }
163 }
164
165
166 static
167 NTSTATUS
168 NTAPI
169 PortAddDevice(
170 _In_ PDRIVER_OBJECT DriverObject,
171 _In_ PDEVICE_OBJECT PhysicalDeviceObject)
172 {
173 PDRIVER_OBJECT_EXTENSION DriverObjectExtension;
174 PFDO_DEVICE_EXTENSION DeviceExtension = NULL;
175 WCHAR NameBuffer[80];
176 UNICODE_STRING DeviceName;
177 PDEVICE_OBJECT Fdo = NULL;
178 KLOCK_QUEUE_HANDLE LockHandle;
179 NTSTATUS Status;
180
181 DPRINT1("PortAddDevice(%p %p)\n",
182 DriverObject, PhysicalDeviceObject);
183
184 ASSERT(DriverObject);
185 ASSERT(PhysicalDeviceObject);
186
187 swprintf(NameBuffer,
188 L"\\Device\\RaidPort%lu",
189 PortNumber);
190 RtlInitUnicodeString(&DeviceName, NameBuffer);
191 PortNumber++;
192
193 DPRINT1("Creating device: %wZ\n", &DeviceName);
194
195 /* Create the port device */
196 Status = IoCreateDevice(DriverObject,
197 sizeof(FDO_DEVICE_EXTENSION),
198 &DeviceName,
199 FILE_DEVICE_CONTROLLER,
200 FILE_DEVICE_SECURE_OPEN,
201 FALSE,
202 &Fdo);
203 if (!NT_SUCCESS(Status))
204 {
205 DPRINT1("IoCreateDevice() failed (Status 0x%08lx)\n", Status);
206 return Status;
207 }
208
209 DPRINT1("Created device: %wZ (%p)\n", &DeviceName, Fdo);
210
211 /* Initialize the device */
212 Fdo->Flags |= DO_DIRECT_IO;
213 Fdo->Flags |= DO_POWER_PAGABLE;
214
215 /* Initialize the device extension */
216 DeviceExtension = (PFDO_DEVICE_EXTENSION)Fdo->DeviceExtension;
217 RtlZeroMemory(DeviceExtension, sizeof(FDO_DEVICE_EXTENSION));
218
219 DeviceExtension->ExtensionType = FdoExtension;
220
221 DeviceExtension->Device = Fdo;
222 DeviceExtension->PhysicalDevice = PhysicalDeviceObject;
223
224 DeviceExtension->PnpState = dsStopped;
225
226 /* Attach the FDO to the device stack */
227 Status = IoAttachDeviceToDeviceStackSafe(Fdo,
228 PhysicalDeviceObject,
229 &DeviceExtension->LowerDevice);
230 if (!NT_SUCCESS(Status))
231 {
232 DPRINT1("IoAttachDeviceToDeviceStackSafe() failed (Status 0x%08lx)\n", Status);
233 IoDeleteDevice(Fdo);
234 return Status;
235 }
236
237 /* Insert the FDO to the drivers FDO list */
238 DriverObjectExtension = IoGetDriverObjectExtension(DriverObject,
239 (PVOID)DriverEntry);
240 ASSERT(DriverObjectExtension->ExtensionType == DriverExtension);
241
242 DeviceExtension->DriverExtension = DriverObjectExtension;
243
244 KeAcquireInStackQueuedSpinLock(&DriverObjectExtension->AdapterListLock,
245 &LockHandle);
246
247 InsertHeadList(&DriverObjectExtension->AdapterListHead,
248 &DeviceExtension->AdapterListEntry);
249 DriverObjectExtension->AdapterCount++;
250
251 KeReleaseInStackQueuedSpinLock(&LockHandle);
252
253 /* The device has been initialized */
254 Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
255
256 DPRINT1("PortAddDevice() done (Status 0x%08lx)\n", Status);
257
258 return Status;
259 }
260
261
262 static
263 VOID
264 NTAPI
265 PortUnload(
266 _In_ PDRIVER_OBJECT DriverObject)
267 {
268 PDRIVER_OBJECT_EXTENSION DriverExtension;
269
270 DPRINT1("PortUnload(%p)\n",
271 DriverObject);
272
273 DriverExtension = IoGetDriverObjectExtension(DriverObject,
274 (PVOID)DriverEntry);
275 if (DriverExtension != NULL)
276 {
277 PortDeleteDriverInitData(DriverExtension);
278 }
279 }
280
281
282 static
283 NTSTATUS
284 NTAPI
285 PortDispatchCreate(
286 IN PDEVICE_OBJECT DeviceObject,
287 IN PIRP Irp)
288 {
289 DPRINT1("PortDispatchCreate(%p %p)\n",
290 DeviceObject, Irp);
291
292 Irp->IoStatus.Status = STATUS_SUCCESS;
293 Irp->IoStatus.Information = FILE_OPENED;
294
295 IoCompleteRequest(Irp, IO_NO_INCREMENT);
296
297 return STATUS_SUCCESS;
298 }
299
300
301 static
302 NTSTATUS
303 NTAPI
304 PortDispatchClose(
305 IN PDEVICE_OBJECT DeviceObject,
306 IN PIRP Irp)
307 {
308 DPRINT1("PortDispatchClose(%p %p)\n",
309 DeviceObject, Irp);
310
311 Irp->IoStatus.Status = STATUS_SUCCESS;
312 Irp->IoStatus.Information = 0;
313
314 IoCompleteRequest(Irp, IO_NO_INCREMENT);
315
316 return STATUS_SUCCESS;
317 }
318
319
320 static
321 NTSTATUS
322 NTAPI
323 PortDispatchDeviceControl(
324 IN PDEVICE_OBJECT DeviceObject,
325 IN PIRP Irp)
326 {
327 DPRINT1("PortDispatchDeviceControl(%p %p)\n",
328 DeviceObject, Irp);
329
330 Irp->IoStatus.Status = STATUS_SUCCESS;
331 Irp->IoStatus.Information = 0;
332
333 IoCompleteRequest(Irp, IO_NO_INCREMENT);
334
335 return STATUS_SUCCESS;
336 }
337
338
339 static
340 NTSTATUS
341 NTAPI
342 PortDispatchScsi(
343 IN PDEVICE_OBJECT DeviceObject,
344 IN PIRP Irp)
345 {
346 PFDO_DEVICE_EXTENSION DeviceExtension;
347
348 DPRINT1("PortDispatchScsi(%p %p)\n",
349 DeviceObject, Irp);
350
351 DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
352 DPRINT1("ExtensionType: %u\n", DeviceExtension->ExtensionType);
353
354 switch (DeviceExtension->ExtensionType)
355 {
356 case FdoExtension:
357 return PortFdoScsi(DeviceObject,
358 Irp);
359
360 case PdoExtension:
361 return PortPdoScsi(DeviceObject,
362 Irp);
363
364 default:
365 Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
366 Irp->IoStatus.Information = 0;
367 IoCompleteRequest(Irp, IO_NO_INCREMENT);
368 return STATUS_UNSUCCESSFUL;
369 }
370
371 return STATUS_SUCCESS;
372 }
373
374
375 static
376 NTSTATUS
377 NTAPI
378 PortDispatchSystemControl(
379 IN PDEVICE_OBJECT DeviceObject,
380 IN PIRP Irp)
381 {
382 DPRINT1("PortDispatchSystemControl(%p %p)\n",
383 DeviceObject, Irp);
384
385 Irp->IoStatus.Status = STATUS_SUCCESS;
386 Irp->IoStatus.Information = 0;
387
388 IoCompleteRequest(Irp, IO_NO_INCREMENT);
389
390 return STATUS_SUCCESS;
391 }
392
393
394 static
395 NTSTATUS
396 NTAPI
397 PortDispatchPnp(
398 IN PDEVICE_OBJECT DeviceObject,
399 IN PIRP Irp)
400 {
401 PFDO_DEVICE_EXTENSION DeviceExtension;
402
403 DPRINT1("PortDispatchPnp(%p %p)\n",
404 DeviceObject, Irp);
405
406 DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
407 DPRINT1("ExtensionType: %u\n", DeviceExtension->ExtensionType);
408
409 switch (DeviceExtension->ExtensionType)
410 {
411 case FdoExtension:
412 return PortFdoPnp(DeviceObject,
413 Irp);
414
415 case PdoExtension:
416 return PortPdoPnp(DeviceObject,
417 Irp);
418
419 default:
420 Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
421 Irp->IoStatus.Information = 0;
422 IoCompleteRequest(Irp, IO_NO_INCREMENT);
423 return STATUS_UNSUCCESSFUL;
424 }
425 }
426
427
428 static
429 NTSTATUS
430 NTAPI
431 PortDispatchPower(
432 IN PDEVICE_OBJECT DeviceObject,
433 IN PIRP Irp)
434 {
435 DPRINT1("PortDispatchPower(%p %p)\n",
436 DeviceObject, Irp);
437
438 Irp->IoStatus.Status = STATUS_SUCCESS;
439 Irp->IoStatus.Information = 0;
440
441 IoCompleteRequest(Irp, IO_NO_INCREMENT);
442
443 return STATUS_SUCCESS;
444 }
445
446
447 /* PUBLIC FUNCTIONS ***********************************************************/
448
449 /*
450 * @implemented
451 */
452 NTSTATUS
453 NTAPI
454 DriverEntry(
455 _In_ PDRIVER_OBJECT DriverObject,
456 _In_ PUNICODE_STRING RegistryPath)
457 {
458 DPRINT1("DriverEntry(%p %p)\n", DriverObject, RegistryPath);
459 return STATUS_SUCCESS;
460 }
461
462
463 /*
464 * @unimplemented
465 */
466 STORPORT_API
467 PUCHAR
468 NTAPI
469 StorPortAllocateRegistryBuffer(
470 _In_ PVOID HwDeviceExtension,
471 _In_ PULONG Length)
472 {
473 DPRINT1("StorPortAllocateRegistryBuffer()\n");
474 UNIMPLEMENTED;
475 return NULL;
476 }
477
478
479 /*
480 * @unimplemented
481 */
482 STORPORT_API
483 BOOLEAN
484 NTAPI
485 StorPortBusy(
486 _In_ PVOID HwDeviceExtension,
487 _In_ ULONG RequestsToComplete)
488 {
489 DPRINT1("StorPortBuzy()\n");
490 UNIMPLEMENTED;
491 return FALSE;
492 }
493
494
495 /*
496 * @unimplemented
497 */
498 STORPORT_API
499 VOID
500 NTAPI
501 StorPortCompleteRequest(
502 _In_ PVOID HwDeviceExtension,
503 _In_ UCHAR PathId,
504 _In_ UCHAR TargetId,
505 _In_ UCHAR Lun,
506 _In_ UCHAR SrbStatus)
507 {
508 DPRINT1("StorPortCompleteRequest()\n");
509 UNIMPLEMENTED;
510 }
511
512
513 /*
514 * @implemented
515 */
516 STORPORT_API
517 ULONG
518 NTAPI
519 StorPortConvertPhysicalAddressToUlong(
520 _In_ STOR_PHYSICAL_ADDRESS Address)
521 {
522 DPRINT1("StorPortConvertPhysicalAddressToUlong()\n");
523
524 return Address.u.LowPart;
525 }
526
527
528 /*
529 * @implemented
530 */
531 STORPORT_API
532 STOR_PHYSICAL_ADDRESS
533 NTAPI
534 StorPortConvertUlongToPhysicalAddress(
535 _In_ ULONG_PTR UlongAddress)
536 {
537 STOR_PHYSICAL_ADDRESS Address;
538
539 DPRINT1("StorPortConvertUlongToPhysicalAddress()\n");
540
541 Address.QuadPart = UlongAddress;
542 return Address;
543 }
544
545
546 /*
547 * @implemented
548 */
549 STORPORT_API
550 VOID
551 StorPortDebugPrint(
552 _In_ ULONG DebugPrintLevel,
553 _In_ PCHAR DebugMessage,
554 ...)
555 {
556 va_list ap;
557
558 va_start(ap, DebugMessage);
559 vDbgPrintExWithPrefix("STORMINI: ", 0x58, DebugPrintLevel, DebugMessage, ap);
560 va_end(ap);
561 }
562
563
564 /*
565 * @unimplemented
566 */
567 STORPORT_API
568 BOOLEAN
569 NTAPI
570 StorPortDeviceBusy(
571 _In_ PVOID HwDeviceExtension,
572 _In_ UCHAR PathId,
573 _In_ UCHAR TargetId,
574 _In_ UCHAR Lun,
575 _In_ ULONG RequestsToComplete)
576 {
577 DPRINT1("StorPortDeviceBusy()\n");
578 UNIMPLEMENTED;
579 return FALSE;
580 }
581
582
583 /*
584 * @unimplemented
585 */
586 STORPORT_API
587 BOOLEAN
588 NTAPI
589 StorPortDeviceReady(
590 _In_ PVOID HwDeviceExtension,
591 _In_ UCHAR PathId,
592 _In_ UCHAR TargetId,
593 _In_ UCHAR Lun)
594 {
595 DPRINT1("StorPortDeviceReady()\n");
596 UNIMPLEMENTED;
597 return FALSE;
598 }
599
600
601 /*
602 * @unimplemented
603 */
604 STORPORT_API
605 ULONG
606 StorPortExtendedFunction(
607 _In_ STORPORT_FUNCTION_CODE FunctionCode,
608 _In_ PVOID HwDeviceExtension,
609 ...)
610 {
611 DPRINT1("StorPortExtendedFunction(%d %p ...)\n",
612 FunctionCode, HwDeviceExtension);
613 UNIMPLEMENTED;
614 return STATUS_NOT_IMPLEMENTED;
615 }
616
617
618 /*
619 * @implemented
620 */
621 STORPORT_API
622 VOID
623 NTAPI
624 StorPortFreeDeviceBase(
625 _In_ PVOID HwDeviceExtension,
626 _In_ PVOID MappedAddress)
627 {
628 DPRINT1("StorPortFreeDeviceBase(%p %p)\n",
629 HwDeviceExtension, MappedAddress);
630 }
631
632
633 /*
634 * @unimplemented
635 */
636 STORPORT_API
637 VOID
638 NTAPI
639 StorPortFreeRegistryBuffer(
640 _In_ PVOID HwDeviceExtension,
641 _In_ PUCHAR Buffer)
642 {
643 DPRINT1("StorPortFreeRegistryBuffer()\n");
644 UNIMPLEMENTED;
645 }
646
647
648 /*
649 * @implemented
650 */
651 STORPORT_API
652 ULONG
653 NTAPI
654 StorPortGetBusData(
655 _In_ PVOID DeviceExtension,
656 _In_ ULONG BusDataType,
657 _In_ ULONG SystemIoBusNumber,
658 _In_ ULONG SlotNumber,
659 _Out_ _When_(Length != 0, _Out_writes_bytes_(Length)) PVOID Buffer,
660 _In_ ULONG Length)
661 {
662 PMINIPORT_DEVICE_EXTENSION MiniportExtension;
663 PBUS_INTERFACE_STANDARD Interface;
664 ULONG ReturnLength;
665
666 DPRINT1("StorPortGetBusData(%p %lu %lu %lu %p %lu)\n",
667 DeviceExtension, BusDataType, SystemIoBusNumber, SlotNumber, Buffer, Length);
668
669 /* Get the miniport extension */
670 MiniportExtension = CONTAINING_RECORD(DeviceExtension,
671 MINIPORT_DEVICE_EXTENSION,
672 HwDeviceExtension);
673 DPRINT1("DeviceExtension %p MiniportExtension %p\n",
674 DeviceExtension, MiniportExtension);
675
676 Interface = &MiniportExtension->Miniport->DeviceExtension->BusInterface;
677
678 if (BusDataType == 4)
679 BusDataType = 0;
680
681 ReturnLength = Interface->GetBusData(Interface->Context,
682 BusDataType,
683 Buffer,
684 0,
685 Length);
686 DPRINT1("ReturnLength: %lu\n", ReturnLength);
687
688 return ReturnLength;
689 }
690
691
692 /*
693 * @implemented
694 */
695 STORPORT_API
696 PVOID
697 NTAPI
698 StorPortGetDeviceBase(
699 _In_ PVOID HwDeviceExtension,
700 _In_ INTERFACE_TYPE BusType,
701 _In_ ULONG SystemIoBusNumber,
702 _In_ STOR_PHYSICAL_ADDRESS IoAddress,
703 _In_ ULONG NumberOfBytes,
704 _In_ BOOLEAN InIoSpace)
705 {
706 PMINIPORT_DEVICE_EXTENSION MiniportExtension;
707 PHYSICAL_ADDRESS TranslatedAddress;
708 PVOID MappedAddress;
709 NTSTATUS Status;
710
711 DPRINT1("StorPortGetDeviceBase(%p %lu %lu 0x%I64x %lu %u)\n",
712 HwDeviceExtension, BusType, SystemIoBusNumber, IoAddress.QuadPart, NumberOfBytes, InIoSpace);
713
714 /* Get the miniport extension */
715 MiniportExtension = CONTAINING_RECORD(HwDeviceExtension,
716 MINIPORT_DEVICE_EXTENSION,
717 HwDeviceExtension);
718 DPRINT1("HwDeviceExtension %p MiniportExtension %p\n",
719 HwDeviceExtension, MiniportExtension);
720
721 if (!TranslateResourceListAddress(MiniportExtension->Miniport->DeviceExtension,
722 BusType,
723 SystemIoBusNumber,
724 IoAddress,
725 NumberOfBytes,
726 InIoSpace,
727 &TranslatedAddress))
728 {
729 DPRINT1("Checkpoint!\n");
730 return NULL;
731 }
732
733 DPRINT1("Translated Address: 0x%I64x\n", TranslatedAddress.QuadPart);
734
735 /* In I/O space */
736 if (InIoSpace)
737 {
738 DPRINT1("Translated Address: %p\n", (PVOID)(ULONG_PTR)TranslatedAddress.QuadPart);
739 return (PVOID)(ULONG_PTR)TranslatedAddress.QuadPart;
740 }
741
742 /* In memory space */
743 MappedAddress = MmMapIoSpace(TranslatedAddress,
744 NumberOfBytes,
745 FALSE);
746 DPRINT1("Mapped Address: %p\n", MappedAddress);
747
748 Status = AllocateAddressMapping(&MiniportExtension->Miniport->DeviceExtension->MappedAddressList,
749 IoAddress,
750 MappedAddress,
751 NumberOfBytes,
752 SystemIoBusNumber);
753 if (!NT_SUCCESS(Status))
754 {
755 DPRINT1("Checkpoint!\n");
756 MappedAddress = NULL;
757 }
758
759 DPRINT1("Mapped Address: %p\n", MappedAddress);
760 return MappedAddress;
761 }
762
763
764 /*
765 * @unimplemented
766 */
767 STORPORT_API
768 PVOID
769 NTAPI
770 StorPortGetLogicalUnit(
771 _In_ PVOID HwDeviceExtension,
772 _In_ UCHAR PathId,
773 _In_ UCHAR TargetId,
774 _In_ UCHAR Lun)
775 {
776 DPRINT1("StorPortGetLogicalUnit()\n");
777 UNIMPLEMENTED;
778 return NULL;
779 }
780
781
782 /*
783 * @implemented
784 */
785 STORPORT_API
786 STOR_PHYSICAL_ADDRESS
787 NTAPI
788 StorPortGetPhysicalAddress(
789 _In_ PVOID HwDeviceExtension,
790 _In_opt_ PSCSI_REQUEST_BLOCK Srb,
791 _In_ PVOID VirtualAddress,
792 _Out_ ULONG *Length)
793 {
794 PMINIPORT_DEVICE_EXTENSION MiniportExtension;
795 PFDO_DEVICE_EXTENSION DeviceExtension;
796 STOR_PHYSICAL_ADDRESS PhysicalAddress;
797 ULONG_PTR Offset;
798
799 DPRINT1("StorPortGetPhysicalAddress(%p %p %p %p)\n",
800 HwDeviceExtension, Srb, VirtualAddress, Length);
801
802 /* Get the miniport extension */
803 MiniportExtension = CONTAINING_RECORD(HwDeviceExtension,
804 MINIPORT_DEVICE_EXTENSION,
805 HwDeviceExtension);
806 DPRINT1("HwDeviceExtension %p MiniportExtension %p\n",
807 HwDeviceExtension, MiniportExtension);
808
809 DeviceExtension = MiniportExtension->Miniport->DeviceExtension;
810
811 /* Inside of the uncached extension? */
812 if (((ULONG_PTR)VirtualAddress >= (ULONG_PTR)DeviceExtension->UncachedExtensionVirtualBase) &&
813 ((ULONG_PTR)VirtualAddress <= (ULONG_PTR)DeviceExtension->UncachedExtensionVirtualBase + DeviceExtension->UncachedExtensionSize))
814 {
815 Offset = (ULONG_PTR)VirtualAddress - (ULONG_PTR)DeviceExtension->UncachedExtensionVirtualBase;
816
817 PhysicalAddress.QuadPart = DeviceExtension->UncachedExtensionPhysicalBase.QuadPart + Offset;
818 *Length = DeviceExtension->UncachedExtensionSize - Offset;
819
820 return PhysicalAddress;
821 }
822
823 // FIXME
824
825
826 PhysicalAddress = MmGetPhysicalAddress(VirtualAddress);
827 *Length = 1;
828 // UNIMPLEMENTED;
829
830 // *Length = 0;
831 // PhysicalAddress.QuadPart = (LONGLONG)0;
832
833 return PhysicalAddress;
834 }
835
836
837 /*
838 * @unimplemented
839 */
840 STORPORT_API
841 PSTOR_SCATTER_GATHER_LIST
842 NTAPI
843 StorPortGetScatterGatherList(
844 _In_ PVOID DeviceExtension,
845 _In_ PSCSI_REQUEST_BLOCK Srb)
846 {
847 DPRINT1("StorPortGetScatterGatherList()\n");
848 UNIMPLEMENTED;
849 return NULL;
850 }
851
852
853 /*
854 * @implemented
855 */
856 STORPORT_API
857 PSCSI_REQUEST_BLOCK
858 NTAPI
859 StorPortGetSrb(
860 _In_ PVOID DeviceExtension,
861 _In_ UCHAR PathId,
862 _In_ UCHAR TargetId,
863 _In_ UCHAR Lun,
864 _In_ LONG QueueTag)
865 {
866 DPRINT("StorPortGetSrb()\n");
867 return NULL;
868 }
869
870
871 /*
872 * @implemented
873 */
874 STORPORT_API
875 PVOID
876 NTAPI
877 StorPortGetUncachedExtension(
878 _In_ PVOID HwDeviceExtension,
879 _In_ PPORT_CONFIGURATION_INFORMATION ConfigInfo,
880 _In_ ULONG NumberOfBytes)
881 {
882 PMINIPORT_DEVICE_EXTENSION MiniportExtension;
883 PFDO_DEVICE_EXTENSION DeviceExtension;
884 PHYSICAL_ADDRESS LowestAddress, HighestAddress, Alignment;
885
886 DPRINT1("StorPortGetUncachedExtension(%p %p %lu)\n",
887 HwDeviceExtension, ConfigInfo, NumberOfBytes);
888
889 /* Get the miniport extension */
890 MiniportExtension = CONTAINING_RECORD(HwDeviceExtension,
891 MINIPORT_DEVICE_EXTENSION,
892 HwDeviceExtension);
893 DPRINT1("HwDeviceExtension %p MiniportExtension %p\n",
894 HwDeviceExtension, MiniportExtension);
895
896 DeviceExtension = MiniportExtension->Miniport->DeviceExtension;
897
898 /* Return the uncached extension base address if we already have one */
899 if (DeviceExtension->UncachedExtensionVirtualBase != NULL)
900 return DeviceExtension->UncachedExtensionVirtualBase;
901
902 // FIXME: Set DMA stuff here?
903
904 /* Allocate the uncached extension */
905 Alignment.QuadPart = 0;
906 LowestAddress.QuadPart = 0;
907 HighestAddress.QuadPart = 0x00000000FFFFFFFF;
908 DeviceExtension->UncachedExtensionVirtualBase = MmAllocateContiguousMemorySpecifyCache(NumberOfBytes,
909 LowestAddress,
910 HighestAddress,
911 Alignment,
912 MmCached);
913 if (DeviceExtension->UncachedExtensionVirtualBase == NULL)
914 return NULL;
915
916 DeviceExtension->UncachedExtensionPhysicalBase = MmGetPhysicalAddress(DeviceExtension->UncachedExtensionVirtualBase);
917 DeviceExtension->UncachedExtensionSize = NumberOfBytes;
918
919 return DeviceExtension->UncachedExtensionVirtualBase;
920 }
921
922
923 /*
924 * @unimplemented
925 */
926 STORPORT_API
927 PVOID
928 NTAPI
929 StorPortGetVirtualAddress(
930 _In_ PVOID HwDeviceExtension,
931 _In_ STOR_PHYSICAL_ADDRESS PhysicalAddress)
932 {
933 DPRINT1("StorPortGetVirtualAddress(%p %I64x)\n",
934 HwDeviceExtension, PhysicalAddress.QuadPart);
935 UNIMPLEMENTED;
936 return NULL;
937 }
938
939
940 /*
941 * @implemented
942 */
943 STORPORT_API
944 ULONG
945 NTAPI
946 StorPortInitialize(
947 _In_ PVOID Argument1,
948 _In_ PVOID Argument2,
949 _In_ struct _HW_INITIALIZATION_DATA *HwInitializationData,
950 _In_opt_ PVOID HwContext)
951 {
952 PDRIVER_OBJECT DriverObject = (PDRIVER_OBJECT)Argument1;
953 PUNICODE_STRING RegistryPath = (PUNICODE_STRING)Argument2;
954 PDRIVER_OBJECT_EXTENSION DriverObjectExtension;
955 NTSTATUS Status = STATUS_SUCCESS;
956
957 DPRINT1("StorPortInitialize(%p %p %p %p)\n",
958 Argument1, Argument2, HwInitializationData, HwContext);
959
960 DPRINT1("HwInitializationDataSize: %lu\n", HwInitializationData->HwInitializationDataSize);
961 DPRINT1("AdapterInterfaceType: %u\n", HwInitializationData->AdapterInterfaceType);
962 DPRINT1("HwInitialize: %p\n", HwInitializationData->HwInitialize);
963 DPRINT1("HwStartIo: %p\n", HwInitializationData->HwStartIo);
964 DPRINT1("HwInterrupt: %p\n", HwInitializationData->HwInterrupt);
965 DPRINT1("HwFindAdapter: %p\n", HwInitializationData->HwFindAdapter);
966 DPRINT1("HwResetBus: %p\n", HwInitializationData->HwResetBus);
967 DPRINT1("HwDmaStarted: %p\n", HwInitializationData->HwDmaStarted);
968 DPRINT1("HwAdapterState: %p\n", HwInitializationData->HwAdapterState);
969 DPRINT1("DeviceExtensionSize: %lu\n", HwInitializationData->DeviceExtensionSize);
970 DPRINT1("SpecificLuExtensionSize: %lu\n", HwInitializationData->SpecificLuExtensionSize);
971 DPRINT1("SrbExtensionSize: %lu\n", HwInitializationData->SrbExtensionSize);
972 DPRINT1("NumberOfAccessRanges: %lu\n", HwInitializationData->NumberOfAccessRanges);
973
974 /* Check parameters */
975 if ((DriverObject == NULL) ||
976 (RegistryPath == NULL) ||
977 (HwInitializationData == NULL))
978 {
979 DPRINT1("Invalid parameter!\n");
980 return STATUS_INVALID_PARAMETER;
981 }
982
983 /* Check initialization data */
984 if ((HwInitializationData->HwInitializationDataSize < sizeof(HW_INITIALIZATION_DATA)) ||
985 (HwInitializationData->HwInitialize == NULL) ||
986 (HwInitializationData->HwStartIo == NULL) ||
987 (HwInitializationData->HwFindAdapter == NULL) ||
988 (HwInitializationData->HwResetBus == NULL))
989 {
990 DPRINT1("Revision mismatch!\n");
991 return STATUS_REVISION_MISMATCH;
992 }
993
994 DriverObjectExtension = IoGetDriverObjectExtension(DriverObject,
995 (PVOID)DriverEntry);
996 if (DriverObjectExtension == NULL)
997 {
998 DPRINT1("No driver object extension!\n");
999
1000 Status = IoAllocateDriverObjectExtension(DriverObject,
1001 (PVOID)DriverEntry,
1002 sizeof(DRIVER_OBJECT_EXTENSION),
1003 (PVOID *)&DriverObjectExtension);
1004 if (!NT_SUCCESS(Status))
1005 {
1006 DPRINT1("IoAllocateDriverObjectExtension() failed (Status 0x%08lx)\n", Status);
1007 return Status;
1008 }
1009
1010 DPRINT1("Driver object extension created!\n");
1011
1012 /* Initialize the driver object extension */
1013 RtlZeroMemory(DriverObjectExtension,
1014 sizeof(DRIVER_OBJECT_EXTENSION));
1015
1016 DriverObjectExtension->ExtensionType = DriverExtension;
1017 DriverObjectExtension->DriverObject = DriverObject;
1018
1019 InitializeListHead(&DriverObjectExtension->AdapterListHead);
1020 KeInitializeSpinLock(&DriverObjectExtension->AdapterListLock);
1021
1022 InitializeListHead(&DriverObjectExtension->InitDataListHead);
1023
1024 /* Set handlers */
1025 DriverObject->DriverExtension->AddDevice = PortAddDevice;
1026 // DriverObject->DriverStartIo = PortStartIo;
1027 DriverObject->DriverUnload = PortUnload;
1028 DriverObject->MajorFunction[IRP_MJ_CREATE] = PortDispatchCreate;
1029 DriverObject->MajorFunction[IRP_MJ_CLOSE] = PortDispatchClose;
1030 DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = PortDispatchDeviceControl;
1031 DriverObject->MajorFunction[IRP_MJ_SCSI] = PortDispatchScsi;
1032 DriverObject->MajorFunction[IRP_MJ_POWER] = PortDispatchPower;
1033 DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = PortDispatchSystemControl;
1034 DriverObject->MajorFunction[IRP_MJ_PNP] = PortDispatchPnp;
1035 }
1036
1037 /* Add the initialzation data to the driver extension */
1038 Status = PortAddDriverInitData(DriverObjectExtension,
1039 HwInitializationData);
1040
1041 DPRINT1("StorPortInitialize() done (Status 0x%08lx)\n", Status);
1042
1043 return Status;
1044 }
1045
1046
1047 /*
1048 * @unimplemented
1049 */
1050 STORPORT_API
1051 VOID
1052 NTAPI
1053 StorPortLogError(
1054 _In_ PVOID HwDeviceExtension,
1055 _In_opt_ PSCSI_REQUEST_BLOCK Srb,
1056 _In_ UCHAR PathId,
1057 _In_ UCHAR TargetId,
1058 _In_ UCHAR Lun,
1059 _In_ ULONG ErrorCode,
1060 _In_ ULONG UniqueId)
1061 {
1062 DPRINT1("ScsiPortLogError() called\n");
1063 DPRINT1("PathId: 0x%02x TargetId: 0x%02x Lun: 0x%02x ErrorCode: 0x%08lx UniqueId: 0x%08lx\n",
1064 PathId, TargetId, Lun, ErrorCode, UniqueId);
1065
1066 DPRINT1("ScsiPortLogError() done\n");
1067 }
1068
1069
1070 /*
1071 * @implemented
1072 */
1073 STORPORT_API
1074 VOID
1075 NTAPI
1076 StorPortMoveMemory(
1077 _Out_writes_bytes_(Length) PVOID Destination,
1078 _In_reads_bytes_(Length) PVOID Source,
1079 _In_ ULONG Length)
1080 {
1081 RtlMoveMemory(Destination, Source, Length);
1082 }
1083
1084
1085 /*
1086 * @unimplemented
1087 */
1088 STORPORT_API
1089 VOID
1090 StorPortNotification(
1091 _In_ SCSI_NOTIFICATION_TYPE NotificationType,
1092 _In_ PVOID HwDeviceExtension,
1093 ...)
1094 {
1095 PMINIPORT_DEVICE_EXTENSION MiniportExtension = NULL;
1096 PFDO_DEVICE_EXTENSION DeviceExtension = NULL;
1097 PHW_PASSIVE_INITIALIZE_ROUTINE HwPassiveInitRoutine;
1098 PSTORPORT_EXTENDED_FUNCTIONS *ppExtendedFunctions;
1099 PBOOLEAN Result;
1100 PSTOR_DPC Dpc;
1101 PHW_DPC_ROUTINE HwDpcRoutine;
1102 va_list ap;
1103
1104 STOR_SPINLOCK SpinLock;
1105 PVOID LockContext;
1106 PSTOR_LOCK_HANDLE LockHandle;
1107
1108 DPRINT1("StorPortNotification(%x %p)\n",
1109 NotificationType, HwDeviceExtension);
1110
1111 /* Get the miniport extension */
1112 if (HwDeviceExtension != NULL)
1113 {
1114 MiniportExtension = CONTAINING_RECORD(HwDeviceExtension,
1115 MINIPORT_DEVICE_EXTENSION,
1116 HwDeviceExtension);
1117 DPRINT1("HwDeviceExtension %p MiniportExtension %p\n",
1118 HwDeviceExtension, MiniportExtension);
1119
1120 DeviceExtension = MiniportExtension->Miniport->DeviceExtension;
1121 }
1122
1123 va_start(ap, HwDeviceExtension);
1124
1125 switch (NotificationType)
1126 {
1127 case GetExtendedFunctionTable:
1128 DPRINT1("GetExtendedFunctionTable\n");
1129 ppExtendedFunctions = (PSTORPORT_EXTENDED_FUNCTIONS*)va_arg(ap, PSTORPORT_EXTENDED_FUNCTIONS*);
1130 if (ppExtendedFunctions != NULL)
1131 *ppExtendedFunctions = NULL; /* FIXME */
1132 break;
1133
1134 case EnablePassiveInitialization:
1135 DPRINT1("EnablePassiveInitialization\n");
1136 HwPassiveInitRoutine = (PHW_PASSIVE_INITIALIZE_ROUTINE)va_arg(ap, PHW_PASSIVE_INITIALIZE_ROUTINE);
1137 DPRINT1("HwPassiveInitRoutine %p\n", HwPassiveInitRoutine);
1138 Result = (PBOOLEAN)va_arg(ap, PBOOLEAN);
1139
1140 *Result = FALSE;
1141
1142 if ((DeviceExtension != NULL) &&
1143 (DeviceExtension->HwPassiveInitRoutine == NULL))
1144 {
1145 DeviceExtension->HwPassiveInitRoutine = HwPassiveInitRoutine;
1146 *Result = TRUE;
1147 }
1148 break;
1149
1150 case InitializeDpc:
1151 DPRINT1("InitializeDpc\n");
1152 Dpc = (PSTOR_DPC)va_arg(ap, PSTOR_DPC);
1153 DPRINT1("Dpc %p\n", Dpc);
1154 HwDpcRoutine = (PHW_DPC_ROUTINE)va_arg(ap, PHW_DPC_ROUTINE);
1155 DPRINT1("HwDpcRoutine %p\n", HwDpcRoutine);
1156
1157 KeInitializeDpc((PRKDPC)&Dpc->Dpc,
1158 (PKDEFERRED_ROUTINE)HwDpcRoutine,
1159 (PVOID)DeviceExtension);
1160 KeInitializeSpinLock(&Dpc->Lock);
1161 break;
1162
1163 case AcquireSpinLock:
1164 DPRINT1("AcquireSpinLock\n");
1165 SpinLock = (STOR_SPINLOCK)va_arg(ap, STOR_SPINLOCK);
1166 DPRINT1("SpinLock %lu\n", SpinLock);
1167 LockContext = (PVOID)va_arg(ap, PVOID);
1168 DPRINT1("LockContext %p\n", LockContext);
1169 LockHandle = (PSTOR_LOCK_HANDLE)va_arg(ap, PSTOR_LOCK_HANDLE);
1170 DPRINT1("LockHandle %p\n", LockHandle);
1171 PortAcquireSpinLock(DeviceExtension,
1172 SpinLock,
1173 LockContext,
1174 LockHandle);
1175 break;
1176
1177 case ReleaseSpinLock:
1178 DPRINT1("ReleaseSpinLock\n");
1179 LockHandle = (PSTOR_LOCK_HANDLE)va_arg(ap, PSTOR_LOCK_HANDLE);
1180 DPRINT1("LockHandle %p\n", LockHandle);
1181 PortReleaseSpinLock(DeviceExtension,
1182 LockHandle);
1183 break;
1184
1185 default:
1186 DPRINT1("Unsupported Notification %lx\n", NotificationType);
1187 break;
1188 }
1189
1190 va_end(ap);
1191 }
1192
1193
1194 /*
1195 * @unimplemented
1196 */
1197 STORPORT_API
1198 BOOLEAN
1199 NTAPI
1200 StorPortPause(
1201 _In_ PVOID HwDeviceExtension,
1202 _In_ ULONG TimeOut)
1203 {
1204 DPRINT1("StorPortPause()\n");
1205 UNIMPLEMENTED;
1206 return FALSE;
1207 }
1208
1209
1210 /*
1211 * @unimplemented
1212 */
1213 STORPORT_API
1214 BOOLEAN
1215 NTAPI
1216 StorPortPauseDevice(
1217 _In_ PVOID HwDeviceExtension,
1218 _In_ UCHAR PathId,
1219 _In_ UCHAR TargetId,
1220 _In_ UCHAR Lun,
1221 _In_ ULONG TimeOut)
1222 {
1223 DPRINT1("StorPortPauseDevice()\n");
1224 UNIMPLEMENTED;
1225 return FALSE;
1226 }
1227
1228
1229 #if defined(_M_AMD64)
1230 /*
1231 * @implemented
1232 */
1233 /* KeQuerySystemTime is an inline function,
1234 so we cannot forward the export to ntoskrnl */
1235 STORPORT_API
1236 VOID
1237 NTAPI
1238 StorPortQuerySystemTime(
1239 _Out_ PLARGE_INTEGER CurrentTime)
1240 {
1241 DPRINT1("StorPortQuerySystemTime(%p)\n", CurrentTime);
1242
1243 KeQuerySystemTime(CurrentTime);
1244 }
1245 #endif /* defined(_M_AMD64) */
1246
1247
1248 /*
1249 * @unimplemented
1250 */
1251 STORPORT_API
1252 BOOLEAN
1253 NTAPI
1254 StorPortReady(
1255 _In_ PVOID HwDeviceExtension)
1256 {
1257 DPRINT1("StorPortReady()\n");
1258 UNIMPLEMENTED;
1259 return FALSE;
1260 }
1261
1262
1263 /*
1264 * @unimplemented
1265 */
1266 STORPORT_API
1267 BOOLEAN
1268 NTAPI
1269 StorPortRegistryRead(
1270 _In_ PVOID HwDeviceExtension,
1271 _In_ PUCHAR ValueName,
1272 _In_ ULONG Global,
1273 _In_ ULONG Type,
1274 _In_ PUCHAR Buffer,
1275 _In_ PULONG BufferLength)
1276 {
1277 DPRINT1("StorPortRegistryRead()\n");
1278 UNIMPLEMENTED;
1279 return FALSE;
1280 }
1281
1282
1283 /*
1284 * @unimplemented
1285 */
1286 STORPORT_API
1287 BOOLEAN
1288 NTAPI
1289 StorPortRegistryWrite(
1290 _In_ PVOID HwDeviceExtension,
1291 _In_ PUCHAR ValueName,
1292 _In_ ULONG Global,
1293 _In_ ULONG Type,
1294 _In_ PUCHAR Buffer,
1295 _In_ ULONG BufferLength)
1296 {
1297 DPRINT1("StorPortRegistryWrite()\n");
1298 UNIMPLEMENTED;
1299 return FALSE;
1300 }
1301
1302
1303 /*
1304 * @unimplemented
1305 */
1306 STORPORT_API
1307 BOOLEAN
1308 NTAPI
1309 StorPortResume(
1310 _In_ PVOID HwDeviceExtension)
1311 {
1312 DPRINT1("StorPortResume()\n");
1313 UNIMPLEMENTED;
1314 return FALSE;
1315 }
1316
1317
1318 /*
1319 * @unimplemented
1320 */
1321 STORPORT_API
1322 BOOLEAN
1323 NTAPI
1324 StorPortResumeDevice(
1325 _In_ PVOID HwDeviceExtension,
1326 _In_ UCHAR PathId,
1327 _In_ UCHAR TargetId,
1328 _In_ UCHAR Lun)
1329 {
1330 DPRINT1("StorPortResumeDevice()\n");
1331 UNIMPLEMENTED;
1332 return FALSE;
1333 }
1334
1335
1336 /*
1337 * @implemented
1338 */
1339 STORPORT_API
1340 ULONG
1341 NTAPI
1342 StorPortSetBusDataByOffset(
1343 _In_ PVOID DeviceExtension,
1344 _In_ ULONG BusDataType,
1345 _In_ ULONG SystemIoBusNumber,
1346 _In_ ULONG SlotNumber,
1347 _In_reads_bytes_(Length) PVOID Buffer,
1348 _In_ ULONG Offset,
1349 _In_ ULONG Length)
1350 {
1351 PMINIPORT_DEVICE_EXTENSION MiniportExtension;
1352 PBUS_INTERFACE_STANDARD Interface;
1353 ULONG ReturnLength;
1354
1355 DPRINT1("StorPortSetBusData(%p %lu %lu %lu %p %lu %lu)\n",
1356 DeviceExtension, BusDataType, SystemIoBusNumber, SlotNumber, Buffer, Offset, Length);
1357
1358 MiniportExtension = CONTAINING_RECORD(DeviceExtension,
1359 MINIPORT_DEVICE_EXTENSION,
1360 HwDeviceExtension);
1361 DPRINT1("DeviceExtension %p MiniportExtension %p\n",
1362 DeviceExtension, MiniportExtension);
1363
1364 Interface = &MiniportExtension->Miniport->DeviceExtension->BusInterface;
1365
1366 ReturnLength = Interface->SetBusData(Interface->Context,
1367 BusDataType,
1368 Buffer,
1369 Offset,
1370 Length);
1371 DPRINT1("ReturnLength: %lu\n", ReturnLength);
1372
1373 return ReturnLength;
1374 }
1375
1376
1377 /*
1378 * @unimplemented
1379 */
1380 STORPORT_API
1381 BOOLEAN
1382 NTAPI
1383 StorPortSetDeviceQueueDepth(
1384 _In_ PVOID HwDeviceExtension,
1385 _In_ UCHAR PathId,
1386 _In_ UCHAR TargetId,
1387 _In_ UCHAR Lun,
1388 _In_ ULONG Depth)
1389 {
1390 DPRINT1("StorPortSetDeviceQueueDepth()\n");
1391 UNIMPLEMENTED;
1392 return FALSE;
1393 }
1394
1395
1396 /*
1397 * @implemented
1398 */
1399 STORPORT_API
1400 VOID
1401 NTAPI
1402 StorPortStallExecution(
1403 _In_ ULONG Delay)
1404 {
1405 KeStallExecutionProcessor(Delay);
1406 }
1407
1408
1409 /*
1410 * @unimplemented
1411 */
1412 STORPORT_API
1413 VOID
1414 NTAPI
1415 StorPortSynchronizeAccess(
1416 _In_ PVOID HwDeviceExtension,
1417 _In_ PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine,
1418 _In_opt_ PVOID Context)
1419 {
1420 DPRINT1("StorPortSynchronizeAccess()\n");
1421 UNIMPLEMENTED;
1422 }
1423
1424
1425 /*
1426 * @implemented
1427 */
1428 STORPORT_API
1429 BOOLEAN
1430 NTAPI
1431 StorPortValidateRange(
1432 _In_ PVOID HwDeviceExtension,
1433 _In_ INTERFACE_TYPE BusType,
1434 _In_ ULONG SystemIoBusNumber,
1435 _In_ STOR_PHYSICAL_ADDRESS IoAddress,
1436 _In_ ULONG NumberOfBytes,
1437 _In_ BOOLEAN InIoSpace)
1438 {
1439 DPRINT1("StorPortValidateRange()\n");
1440 return TRUE;
1441 }
1442
1443 /* EOF */