ath9k: remove unneeded calculation of minimal calibration power
[linux-2.6/next.git] / drivers / scsi / bfa / bfa_callback_priv.h
blob1e3265c9f7d4a8002dfcec5608c31d3b8faa3ee7
1 /*
2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
3 * All rights reserved
4 * www.brocade.com
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
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
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.
18 #ifndef __BFA_CALLBACK_PRIV_H__
19 #define __BFA_CALLBACK_PRIV_H__
21 #include <cs/bfa_q.h>
23 typedef void (*bfa_cb_cbfn_t) (void *cbarg, bfa_boolean_t complete);
25 /**
26 * Generic BFA callback element.
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;
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)
42 #define bfa_cb_dequeue(__hcb_qe) list_del(&(__hcb_qe)->qe)
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)
53 #define bfa_cb_queue_done(__hcb_qe) do { \
54 (__hcb_qe)->once = BFA_FALSE; \
55 } while (0)
57 #endif /* __BFA_CALLBACK_PRIV_H__ */