diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-10-15 02:07:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-15 02:07:30 -0400 |
commit | a0738a688d1105cbf8d71868a1e020c6cdf42d4c (patch) | |
tree | 2cad553a9def773ce79b8fc793f89c0634187109 /drivers/scsi/bfa/bfa_callback_priv.h | |
parent | 89ccf465abe6b20d804a63ae20307970c441369d (diff) | |
parent | a3ccf63ee643ef243cbf8918da8b3f9238f10029 (diff) |
Merge branch 'linus' into x86/urgent
Merge reason: pull in latest, to be able to revert a patch there.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/scsi/bfa/bfa_callback_priv.h')
-rw-r--r-- | drivers/scsi/bfa/bfa_callback_priv.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/bfa_callback_priv.h b/drivers/scsi/bfa/bfa_callback_priv.h new file mode 100644 index 000000000000..1e3265c9f7d4 --- /dev/null +++ b/drivers/scsi/bfa/bfa_callback_priv.h | |||
@@ -0,0 +1,57 @@ | |||
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 | |||
18 | #ifndef __BFA_CALLBACK_PRIV_H__ | ||
19 | #define __BFA_CALLBACK_PRIV_H__ | ||
20 | |||
21 | #include <cs/bfa_q.h> | ||
22 | |||
23 | typedef void (*bfa_cb_cbfn_t) (void *cbarg, bfa_boolean_t complete); | ||
24 | |||
25 | /** | ||
26 | * Generic BFA callback element. | ||
27 | */ | ||
28 | struct bfa_cb_qe_s { | ||
29 | struct list_head qe; | ||
30 | bfa_cb_cbfn_t cbfn; | ||
31 | bfa_boolean_t once; | ||
32 | u32 rsvd; | ||
33 | void *cbarg; | ||
34 | }; | ||
35 | |||
36 | #define bfa_cb_queue(__bfa, __hcb_qe, __cbfn, __cbarg) do { \ | ||
37 | (__hcb_qe)->cbfn = (__cbfn); \ | ||
38 | (__hcb_qe)->cbarg = (__cbarg); \ | ||
39 | list_add_tail(&(__hcb_qe)->qe, &(__bfa)->comp_q); \ | ||
40 | } while (0) | ||
41 | |||
42 | #define bfa_cb_dequeue(__hcb_qe) list_del(&(__hcb_qe)->qe) | ||
43 | |||
44 | #define bfa_cb_queue_once(__bfa, __hcb_qe, __cbfn, __cbarg) do { \ | ||
45 | (__hcb_qe)->cbfn = (__cbfn); \ | ||
46 | (__hcb_qe)->cbarg = (__cbarg); \ | ||
47 | if (!(__hcb_qe)->once) { \ | ||
48 | list_add_tail((__hcb_qe), &(__bfa)->comp_q); \ | ||
49 | (__hcb_qe)->once = BFA_TRUE; \ | ||
50 | } \ | ||
51 | } while (0) | ||
52 | |||
53 | #define bfa_cb_queue_done(__hcb_qe) do { \ | ||
54 | (__hcb_qe)->once = BFA_FALSE; \ | ||
55 | } while (0) | ||
56 | |||
57 | #endif /* __BFA_CALLBACK_PRIV_H__ */ | ||