Calls HwInitialize routine of the miniport and sets up interrupts Should be called inside ScsiPortInitialize (for legacy drivers) or inside IRP_MN_START_DEVICE for pnp drivers.
368{
372
373
374 if (DeviceExtension->HwInterrupt ==
NULL ||
376 {
377
378 DeviceExtension->InterruptCount = 0;
379
380 DPRINT1(
"Interrupt Count: 0\n");
381
383
384
386 }
387 else
388 {
391 ULONG InterruptVector[2],
i, MappedIrq[2];
392 KIRQL Dirql[2], MaxDirql;
394
397
400
403
404 DeviceExtension->InterruptCount =
407
408 for (
i = 0;
i < DeviceExtension->InterruptCount;
i++)
409 {
410
413 DeviceExtension->InterruptLevel[
i], InterruptVector[
i], &Dirql[
i],
415 }
416
417 if (DeviceExtension->InterruptCount == 1 || Dirql[0] > Dirql[1])
418 {
419 MaxDirql = Dirql[0];
420 }
421 else
422 {
423 MaxDirql = Dirql[1];
424 }
425
426 for (
i = 0;
i < DeviceExtension->InterruptCount;
i++)
427 {
428
431 {
432 InterruptShareable =
TRUE;
433 }
434 else
435 {
436 InterruptShareable =
FALSE;
437 }
438
441 DeviceExtension,
442 &DeviceExtension->IrqLock,
443 MappedIrq[
i], Dirql[
i],
444 MaxDirql,
446 InterruptShareable,
449
451 {
452 DPRINT1(
"Could not connect interrupt %d\n", InterruptVector[
i]);
453 DeviceExtension->Interrupt[
i] =
NULL;
455 }
456 }
457 }
458
459
461 {
462 DeviceExtension->IoAddress = ((*(PortConfig->
AccessRanges))[0]).RangeStart.LowPart;
463
464 DPRINT(
"Io Address %x\n", DeviceExtension->IoAddress);
465 }
466
467
469
470
471 DeviceExtension->ActiveRequestCounter = -1;
472
473
474 if (DeviceExtension->AdapterObject !=
NULL && PortConfig->
Master &&
476 {
477 DeviceExtension->MapRegisters =
TRUE;
478 }
479 else
480 {
481 DeviceExtension->MapRegisters =
FALSE;
482 }
483
484
486
488 DeviceExtension->Interrupt[0], DeviceExtension->HwInitialize,
489 DeviceExtension->MiniPortDeviceExtension))
490 {
491 DPRINT1(
"HwInitialize() failed!\n");
494 }
495
496
498 {
499
501 }
502
503
505
507}
#define NT_SUCCESS(StatCode)
NTHALAPI ULONG NTAPI HalGetInterruptVector(INTERFACE_TYPE, ULONG, ULONG, ULONG, PKIRQL, PKAFFINITY)
#define KeRaiseIrql(irql, oldIrql)
#define KeLowerIrql(oldIrql)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
void __cdecl __debugbreak(void)
NTSTATUS NTAPI IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject, IN PKSERVICE_ROUTINE ServiceRoutine, IN PVOID ServiceContext, IN PKSPIN_LOCK SpinLock, IN ULONG Vector, IN KIRQL Irql, IN KIRQL SynchronizeIrql, IN KINTERRUPT_MODE InterruptMode, IN BOOLEAN ShareVector, IN KAFFINITY ProcessorEnableMask, IN BOOLEAN FloatingSave)
BOOLEAN NTAPI KeSynchronizeExecution(IN OUT PKINTERRUPT Interrupt, IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, IN PVOID SynchronizeContext OPTIONAL)
#define STATUS_ADAPTER_HARDWARE_ERROR
#define SCSI_PORT_DISCONNECT_ALLOWED
#define SCSI_PORT_NOTIFICATION_NEEDED
KSERVICE_ROUTINE ScsiPortIsr
IO_DPC_ROUTINE ScsiPortDpcForIsr
enum _KINTERRUPT_MODE KINTERRUPT_MODE
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE InterruptMode
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql