Source code of Windows XP (NT5)
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.

75 lines
3.1 KiB

  1. /******************************************************************************\
  2. * *
  3. * MpInit.C - Hardware abstraction level library. *
  4. * *
  5. * Copyright (c) C-Cube Microsystems 1998 *
  6. * All Rights Reserved. *
  7. * *
  8. * Use of C-Cube Microsystems code is governed by terms and conditions *
  9. * stated in the accompanying licensing statement. *
  10. * *
  11. \******************************************************************************/
  12. #include "Headers.h"
  13. #pragma hdrstop
  14. /*
  15. ** DriverEntry()
  16. **
  17. ** This routine is called when the mini driver is first loaded. The driver
  18. ** should then call the StreamClassRegisterAdapter function to register with
  19. ** the stream class driver
  20. **
  21. ** Arguments:
  22. **
  23. ** Context1: The context arguments are private plug and play structures
  24. ** used by the stream class driver to find the resources for this
  25. ** adapter
  26. ** Context2:
  27. **
  28. ** Returns:
  29. **
  30. ** This routine returns an NT_STATUS value indicating the result of the
  31. ** registration attempt. If a value other than STATUS_SUCCESS is returned, the
  32. ** minidriver will be unloaded.
  33. **
  34. ** Side Effects: none
  35. */
  36. #pragma alloc_text( init, DriverEntry )
  37. NTSTATUS DriverEntry( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath )
  38. {
  39. HW_INITIALIZATION_DATA HwInitData; // Hardware Initialization data structure
  40. LONG lStatus;
  41. DebugPrint(( DebugLevelVerbose, "ZiVA: Begin DriverEntry\n" ));
  42. RtlZeroMemory( &HwInitData, sizeof( HwInitData ) );
  43. HwInitData.HwInitializationDataSize = sizeof( HwInitData );
  44. HwInitData.HwInterrupt = HwInterrupt; // IRQ handling routine
  45. // data handling routines
  46. HwInitData.HwReceivePacket = AdapterReceivePacket;
  47. HwInitData.HwCancelPacket = AdapterCancelPacket;
  48. HwInitData.HwRequestTimeoutHandler = AdapterTimeoutPacket;
  49. HwInitData.DeviceExtensionSize = sizeof( HW_DEVICE_EXTENSION );
  50. HwInitData.PerRequestExtensionSize = 0;
  51. HwInitData.FilterInstanceExtensionSize = 0;
  52. HwInitData.PerStreamExtensionSize = 16;//sizeof( HW_STREAM_EXTENSION );
  53. HwInitData.BusMasterDMA = TRUE;
  54. HwInitData.Dma24BitAddresses = FALSE;
  55. HwInitData.BufferAlignment = 4;
  56. HwInitData.TurnOffSynchronization = FALSE;
  57. HwInitData.DmaBufferSize = DISC_KEY_SIZE;
  58. // Attempt to register with the streaming class driver. Note, this will
  59. // result in calls to the HW_INITIALIZE routine.
  60. DebugPrint(( DebugLevelVerbose, "ZiVA: call to StreamClassRegisterAdapter()\n" ));
  61. lStatus = StreamClassRegisterAdapter( DriverObject, RegistryPath, &HwInitData );
  62. DebugPrint(( DebugLevelVerbose, "ZiVA: StreamClassRegisterAdapter() returned ::> %lX\n", lStatus ));
  63. DebugPrint(( DebugLevelVerbose, "ZiVA: End DriverEntry\n" ));
  64. return lStatus;
  65. }