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.

132 lines
3.7 KiB

  1. //////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // File: SPX.H
  4. //
  5. // Contains: Prototypes of functions to be supplied by a specific
  6. // driver to integrate into NT generic PnP code.
  7. //
  8. // Note: All generic NT PnP code is prefixed by Spx_.
  9. // All funcions that are required to integrate into the generic
  10. // code are prefixed by XXX_.
  11. //
  12. //
  13. //////////////////////////////////////////////////////////////////////////////////////////
  14. #ifndef SPX_H
  15. #define SPX_H
  16. // Purpose: Interpret resources given to card by PnP Manager.
  17. //
  18. // Must: Store resource details in card extension.
  19. NTSTATUS
  20. XXX_CardGetResources(
  21. IN PDEVICE_OBJECT pDevObject,
  22. IN PCM_RESOURCE_LIST PResList,
  23. IN PCM_RESOURCE_LIST PTrResList
  24. );
  25. // Purpose: Initialise card.
  26. // Find out how many ports are attached.
  27. //
  28. // Must: Fill in NumberOfPorts field in card extension.
  29. NTSTATUS
  30. XXX_CardInit(IN PCARD_DEVICE_EXTENSION pCard);
  31. // Purpose: Start up the card.
  32. //
  33. // Must: Connect up any interrupts.
  34. NTSTATUS
  35. XXX_CardStart(IN PCARD_DEVICE_EXTENSION pCard);
  36. // Purpose: Stop the card.
  37. //
  38. // Must: Stop Card from interrupting.
  39. NTSTATUS
  40. XXX_CardStop(IN PCARD_DEVICE_EXTENSION pCard);
  41. // Purpose: Deinitialise the card.
  42. //
  43. // Must: Disconnect any interrupts.
  44. NTSTATUS
  45. XXX_CardDeInit(IN PCARD_DEVICE_EXTENSION pCard);
  46. // Purpose: Initialise the port extension.
  47. //
  48. // Must: Store DeviceID, HardwareIDs, DevDesc into the port extension.
  49. //
  50. NTSTATUS
  51. XXX_PortInit(PPORT_DEVICE_EXTENSION pPort);
  52. // Purpose: Start up the port.
  53. //
  54. // Must: Get port ready to receive read and write commands.
  55. NTSTATUS
  56. XXX_PortStart(IN PPORT_DEVICE_EXTENSION pPort);
  57. // Purpose: Stop the port.
  58. //
  59. // Must: Disconnect any resources and stop DPCs.
  60. // Do not delete the device object or symbolic link.
  61. NTSTATUS
  62. XXX_PortStop(IN PPORT_DEVICE_EXTENSION pPort);
  63. // Purpose: Deinitialise the port.
  64. //
  65. // Must: Delete the device object & symbolic link.
  66. NTSTATUS
  67. XXX_PortDeInit(IN PPORT_DEVICE_EXTENSION pPort);
  68. // Purpose: Save the state of the card hardware.
  69. //
  70. // Must: Save enough info to restore the hardware to exactly the
  71. // same state when full power resumes.
  72. NTSTATUS
  73. XXX_CardPowerDown(IN PCARD_DEVICE_EXTENSION pCard);
  74. // Purpose: Restore the state of the card hardware.
  75. //
  76. // Must: Restore the hardware when full power resumes.
  77. NTSTATUS
  78. XXX_CardPowerUp(IN PCARD_DEVICE_EXTENSION pCard);
  79. // Purpose: Save the state of the port hardware.
  80. //
  81. // Must: Save enough info to restore the hardware to exactly the
  82. // same state when full power resumes.
  83. NTSTATUS
  84. XXX_PortPowerDown(IN PPORT_DEVICE_EXTENSION pPort);
  85. // Purpose: Restore the state of the port hardware.
  86. //
  87. // Must: Restore the hardware when full power resumes.
  88. NTSTATUS
  89. XXX_PortPowerUp(IN PPORT_DEVICE_EXTENSION pPort);
  90. // Purpose: Queries whether it is safe for the port to power down.
  91. //
  92. // Must: Return STATUS_SUCCESS if OK to power down.
  93. NTSTATUS
  94. XXX_PortQueryPowerDown(IN PPORT_DEVICE_EXTENSION pPort);
  95. // Purpose: Set hand shaking and flow control on a port.
  96. VOID
  97. XXX_SetHandFlow(IN PPORT_DEVICE_EXTENSION pPort, IN PSERIAL_IOCTL_SYNC pS);
  98. // Paging
  99. #ifdef ALLOC_PRAGMA
  100. #pragma alloc_text (PAGE, XXX_CardGetResources)
  101. #pragma alloc_text (PAGE, XXX_CardInit)
  102. #pragma alloc_text (PAGE, XXX_CardDeInit)
  103. #pragma alloc_text (PAGE, XXX_CardStart)
  104. #pragma alloc_text (PAGE, XXX_CardStop)
  105. #pragma alloc_text (PAGE, XXX_PortInit)
  106. #pragma alloc_text (PAGE, XXX_PortDeInit)
  107. #pragma alloc_text (PAGE, XXX_PortStart)
  108. #pragma alloc_text (PAGE, XXX_PortStop)
  109. #endif
  110. #endif // End of SPX.H