sktimer.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /******************************************************************************
  2. *
  3. * Name: sktimer.h
  4. * Project: Gigabit Ethernet Adapters, Event Scheduler Module
  5. * Version: $Revision: 1.11 $
  6. * Date: $Date: 2003/09/16 12:58:18 $
  7. * Purpose: Defines for the timer functions
  8. *
  9. ******************************************************************************/
  10. /******************************************************************************
  11. *
  12. * (C)Copyright 1998-2002 SysKonnect GmbH.
  13. * (C)Copyright 2002-2003 Marvell.
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License as published by
  17. * the Free Software Foundation; either version 2 of the License, or
  18. * (at your option) any later version.
  19. *
  20. * The information in this file is provided "AS IS" without warranty.
  21. *
  22. ******************************************************************************/
  23. /*
  24. * SKTIMER.H contains all defines and types for the timer functions
  25. */
  26. #ifndef _SKTIMER_H_
  27. #define _SKTIMER_H_
  28. #include "h/skqueue.h"
  29. /*
  30. * SK timer
  31. * - needed wherever a timer is used. Put this in your data structure
  32. * wherever you want.
  33. */
  34. typedef struct s_Timer SK_TIMER;
  35. struct s_Timer {
  36. SK_TIMER *TmNext; /* linked list */
  37. SK_U32 TmClass; /* Timer Event class */
  38. SK_U32 TmEvent; /* Timer Event value */
  39. SK_EVPARA TmPara; /* Timer Event parameter */
  40. SK_U32 TmDelta; /* delta time */
  41. int TmActive; /* flag: active/inactive */
  42. };
  43. /*
  44. * Timer control struct.
  45. * - use in Adapters context name pAC->Tim
  46. */
  47. typedef struct s_TimCtrl {
  48. SK_TIMER *StQueue; /* Head of Timer queue */
  49. } SK_TIMCTRL;
  50. extern void SkTimerInit(SK_AC *pAC, SK_IOC Ioc, int Level);
  51. extern void SkTimerStop(SK_AC *pAC, SK_IOC Ioc, SK_TIMER *pTimer);
  52. extern void SkTimerStart(SK_AC *pAC, SK_IOC Ioc, SK_TIMER *pTimer,
  53. SK_U32 Time, SK_U32 Class, SK_U32 Event, SK_EVPARA Para);
  54. extern void SkTimerDone(SK_AC *pAC, SK_IOC Ioc);
  55. #endif /* _SKTIMER_H_ */