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