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.

103 lines
2.7 KiB

  1. /*++
  2. Copyright(c) 1999-2000 Microsoft Corporation
  3. Module Name:
  4. brdgtimr.h
  5. Abstract:
  6. Ethernet MAC level bridge.
  7. Timer implementation header
  8. Author:
  9. Mark Aiken
  10. Environment:
  11. Kernel mode driver
  12. Revision History:
  13. November 2000 - Original version
  14. --*/
  15. // ===========================================================================
  16. //
  17. // DECLARATIONS
  18. //
  19. // ===========================================================================
  20. // Bridge timer function definition
  21. typedef VOID (*PBRIDGE_TIMER_FUNC)(PVOID);
  22. typedef struct _BRIDGE_TIMER
  23. {
  24. NDIS_TIMER Timer; // The actual timer
  25. NDIS_EVENT Event; // Only used during final shutdown, and even then,
  26. // only if normal cancellation of the timer fails.
  27. // Lock protects bShuttingDown, bRunning, bCanceled, bRecurring and bInterval.
  28. NDIS_SPIN_LOCK Lock;
  29. BOOLEAN bShuttingDown; // TRUE if the timer is being shut down for good
  30. BOOLEAN bRunning; // Whether the timer is currently running
  31. BOOLEAN bCancelPending; // Whether the timer is being canceled
  32. BOOLEAN bRecurring; // Whether the timer is recurrant
  33. UINT Interval; // Timer interval (for use if bRecurring == TRUE)
  34. // These fields do not change once the timer is initialized
  35. PBRIDGE_TIMER_FUNC pFunc; // The timer function
  36. PVOID data; // Data to pass to pFunc
  37. } BRIDGE_TIMER, *PBRIDGE_TIMER;
  38. // ===========================================================================
  39. //
  40. // PROTOTYPES
  41. //
  42. // ===========================================================================
  43. VOID
  44. BrdgInitializeTimer(
  45. IN PBRIDGE_TIMER pTimer,
  46. IN PBRIDGE_TIMER_FUNC pFunc,
  47. IN PVOID data
  48. );
  49. VOID
  50. BrdgSetTimer(
  51. IN PBRIDGE_TIMER pTimer,
  52. IN UINT interval,
  53. IN BOOLEAN bRecurring
  54. );
  55. VOID
  56. BrdgShutdownTimer(
  57. IN PBRIDGE_TIMER pTimer
  58. );
  59. VOID
  60. BrdgCancelTimer(
  61. IN PBRIDGE_TIMER pTimer
  62. );
  63. // ===========================================================================
  64. //
  65. // INLINES
  66. //
  67. // ===========================================================================
  68. //
  69. // Returns whether a timer is currently running
  70. //
  71. __forceinline
  72. BOOLEAN
  73. BrdgTimerIsRunning(
  74. IN PBRIDGE_TIMER pTimer
  75. )
  76. {
  77. return pTimer->bRunning;
  78. }