Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1990-2000 Microsoft Corporation
  3. Module Name:
  4. translate.c
  5. Abstract:
  6. This is the ISA pnp IRQ translator.
  7. Author:
  8. Andy Thornton (andrewth) 7-June-97
  9. Environment:
  10. Kernel Mode Driver.
  11. Notes:
  12. This should only be temporary and will be replaced by a call into the HAL
  13. to retrieve its translators.
  14. Revision History:
  15. --*/
  16. #include "busp.h"
  17. #include "wdmguid.h"
  18. #include "halpnpp.h"
  19. //
  20. //Prototypes
  21. //
  22. NTSTATUS FindInterruptTranslator (PPI_BUS_EXTENSION BusExtension,PIRP Irp);
  23. #ifdef ALLOC_PRAGMA
  24. #pragma alloc_text(PAGE,PiQueryInterface)
  25. #pragma alloc_text (PAGE,FindInterruptTranslator)
  26. #pragma alloc_text (PAGE,PipReleaseInterfaces)
  27. #pragma alloc_text (PAGE,PipRebuildInterfaces)
  28. #endif
  29. NTSTATUS
  30. PiQueryInterface (
  31. IN PPI_BUS_EXTENSION BusExtension,
  32. IN OUT PIRP Irp
  33. )
  34. {
  35. NTSTATUS status;
  36. PIO_STACK_LOCATION thisIrpSp;
  37. PAGED_CODE();
  38. thisIrpSp = IoGetCurrentIrpStackLocation( Irp );
  39. status = STATUS_NOT_SUPPORTED;
  40. //
  41. // Check if we are requesting a translator interface
  42. //
  43. if (RtlEqualMemory(&GUID_TRANSLATOR_INTERFACE_STANDARD,
  44. thisIrpSp->Parameters.QueryInterface.InterfaceType,
  45. sizeof(GUID))) {
  46. status = FindInterruptTranslator (BusExtension,Irp);
  47. if (NT_SUCCESS (status)) {
  48. //
  49. // Save away the hal interface, so we can unload it...
  50. //
  51. }
  52. }
  53. return status;
  54. }
  55. NTSTATUS
  56. FindInterruptTranslator (PPI_BUS_EXTENSION BusExtension,PIRP Irp)
  57. {
  58. NTSTATUS status;
  59. PIO_STACK_LOCATION thisIrpSp;
  60. PTRANSLATOR_INTERFACE translator;
  61. ULONG busNumber, length;
  62. INTERFACE_TYPE interfaceType;
  63. thisIrpSp = IoGetCurrentIrpStackLocation( Irp );
  64. status = STATUS_NOT_SUPPORTED;
  65. if ((UINT_PTR)(thisIrpSp->Parameters.QueryInterface.InterfaceSpecificData) ==
  66. CmResourceTypeInterrupt) {
  67. //
  68. // Retrieve the bus number and interface type for the bridge
  69. //
  70. status = IoGetDeviceProperty(BusExtension->PhysicalBusDevice,
  71. DevicePropertyLegacyBusType,
  72. sizeof(INTERFACE_TYPE),
  73. &interfaceType,
  74. &length
  75. );
  76. //ASSERT(NT_SUCCESS(status));
  77. status = IoGetDeviceProperty(BusExtension->PhysicalBusDevice,
  78. DevicePropertyBusNumber,
  79. sizeof(ULONG),
  80. &busNumber,
  81. &length
  82. );
  83. //ASSERT(NT_SUCCESS(status));
  84. status = HalGetInterruptTranslator(
  85. interfaceType,
  86. busNumber,
  87. Isa,
  88. thisIrpSp->Parameters.QueryInterface.Size,
  89. thisIrpSp->Parameters.QueryInterface.Version,
  90. (PTRANSLATOR_INTERFACE) thisIrpSp->Parameters.QueryInterface.Interface,
  91. &busNumber
  92. );
  93. }
  94. return status;
  95. }
  96. NTSTATUS
  97. PipReleaseInterfaces(PPI_BUS_EXTENSION PipBusExtension)
  98. {
  99. return STATUS_SUCCESS;
  100. }
  101. NTSTATUS
  102. PipRebuildInterfaces(PPI_BUS_EXTENSION PipBusExtension)
  103. {
  104. return STATUS_SUCCESS;
  105. }