diff options
Diffstat (limited to 'drivers/scsi/bfa/include/bfa_timer.h')
-rw-r--r-- | drivers/scsi/bfa/include/bfa_timer.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/include/bfa_timer.h b/drivers/scsi/bfa/include/bfa_timer.h new file mode 100644 index 000000000000..e407103fa565 --- /dev/null +++ b/drivers/scsi/bfa/include/bfa_timer.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005-2009 Brocade Communications Systems, Inc. | ||
3 | * All rights reserved | ||
4 | * www.brocade.com | ||
5 | * | ||
6 | * Linux driver for Brocade Fibre Channel Host Bus Adapter. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (GPL) Version 2 as | ||
10 | * published by the Free Software Foundation | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | */ | ||
17 | #ifndef __BFA_TIMER_H__ | ||
18 | #define __BFA_TIMER_H__ | ||
19 | |||
20 | #include <bfa_os_inc.h> | ||
21 | #include <cs/bfa_q.h> | ||
22 | |||
23 | struct bfa_s; | ||
24 | |||
25 | typedef void (*bfa_timer_cbfn_t)(void *); | ||
26 | |||
27 | /** | ||
28 | * BFA timer data structure | ||
29 | */ | ||
30 | struct bfa_timer_s { | ||
31 | struct list_head qe; | ||
32 | bfa_timer_cbfn_t timercb; | ||
33 | void *arg; | ||
34 | int timeout; /**< in millisecs. */ | ||
35 | }; | ||
36 | |||
37 | /** | ||
38 | * Timer module structure | ||
39 | */ | ||
40 | struct bfa_timer_mod_s { | ||
41 | struct list_head timer_q; | ||
42 | }; | ||
43 | |||
44 | #define BFA_TIMER_FREQ 500 /**< specified in millisecs */ | ||
45 | |||
46 | void bfa_timer_beat(struct bfa_timer_mod_s *mod); | ||
47 | void bfa_timer_init(struct bfa_timer_mod_s *mod); | ||
48 | void bfa_timer_begin(struct bfa_timer_mod_s *mod, struct bfa_timer_s *timer, | ||
49 | bfa_timer_cbfn_t timercb, void *arg, | ||
50 | unsigned int timeout); | ||
51 | void bfa_timer_stop(struct bfa_timer_s *timer); | ||
52 | |||
53 | #endif /* __BFA_TIMER_H__ */ | ||