aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_ioc.h
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-06-13 18:42:10 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 16:25:57 -0400
commitd37779f8d98a1d7c5ba904982958167d988f01dd (patch)
tree8d73314ba2894c322494d3cfa06f3273b7ff1c35 /drivers/scsi/bfa/bfa_ioc.h
parent85ce928dbb87585042e7dfebe513f724eadebd5e (diff)
[SCSI] bfa: Introduce IOC event notification mechanism.
Introduced a generic event notification callback function that receives IOC_ENABLED, IOC_DISABLED, IOC_FAILED events and notifies the modules registered for these events. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc.h')
-rw-r--r--drivers/scsi/bfa/bfa_ioc.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
index 62318d24f85e..ff8e21d579df 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -197,18 +197,26 @@ struct bfa_ioc_cbfn_s {
197}; 197};
198 198
199/* 199/*
200 * Heartbeat failure notification queue element. 200 * IOC event notification mechanism.
201 */ 201 */
202struct bfa_ioc_hbfail_notify_s { 202enum bfa_ioc_event_e {
203 BFA_IOC_E_ENABLED = 1,
204 BFA_IOC_E_DISABLED = 2,
205 BFA_IOC_E_FAILED = 3,
206};
207
208typedef void (*bfa_ioc_notify_cbfn_t)(void *, enum bfa_ioc_event_e);
209
210struct bfa_ioc_notify_s {
203 struct list_head qe; 211 struct list_head qe;
204 bfa_ioc_hbfail_cbfn_t cbfn; 212 bfa_ioc_notify_cbfn_t cbfn;
205 void *cbarg; 213 void *cbarg;
206}; 214};
207 215
208/* 216/*
209 * Initialize a heartbeat failure notification structure 217 * Initialize a IOC event notification structure
210 */ 218 */
211#define bfa_ioc_hbfail_init(__notify, __cbfn, __cbarg) do { \ 219#define bfa_ioc_notify_init(__notify, __cbfn, __cbarg) do { \
212 (__notify)->cbfn = (__cbfn); \ 220 (__notify)->cbfn = (__cbfn); \
213 (__notify)->cbarg = (__cbarg); \ 221 (__notify)->cbarg = (__cbarg); \
214} while (0) 222} while (0)
@@ -229,11 +237,11 @@ struct bfa_ioc_s {
229 struct bfa_timer_s sem_timer; 237 struct bfa_timer_s sem_timer;
230 struct bfa_timer_s hb_timer; 238 struct bfa_timer_s hb_timer;
231 u32 hb_count; 239 u32 hb_count;
232 struct list_head hb_notify_q; 240 struct list_head notify_q;
233 void *dbg_fwsave; 241 void *dbg_fwsave;
234 int dbg_fwsave_len; 242 int dbg_fwsave_len;
235 bfa_boolean_t dbg_fwsave_once; 243 bfa_boolean_t dbg_fwsave_once;
236 enum bfi_mclass ioc_mc; 244 enum bfi_pcifn_class clscode;
237 struct bfa_ioc_regs_s ioc_regs; 245 struct bfa_ioc_regs_s ioc_regs;
238 struct bfa_trc_mod_s *trcmod; 246 struct bfa_trc_mod_s *trcmod;
239 struct bfa_ioc_drv_stats_s stats; 247 struct bfa_ioc_drv_stats_s stats;
@@ -334,7 +342,7 @@ void bfa_ioc_attach(struct bfa_ioc_s *ioc, void *bfa,
334void bfa_ioc_auto_recover(bfa_boolean_t auto_recover); 342void bfa_ioc_auto_recover(bfa_boolean_t auto_recover);
335void bfa_ioc_detach(struct bfa_ioc_s *ioc); 343void bfa_ioc_detach(struct bfa_ioc_s *ioc);
336void bfa_ioc_pci_init(struct bfa_ioc_s *ioc, struct bfa_pcidev_s *pcidev, 344void bfa_ioc_pci_init(struct bfa_ioc_s *ioc, struct bfa_pcidev_s *pcidev,
337 enum bfi_mclass mc); 345 enum bfi_pcifn_class clscode);
338void bfa_ioc_mem_claim(struct bfa_ioc_s *ioc, u8 *dm_kva, u64 dm_pa); 346void bfa_ioc_mem_claim(struct bfa_ioc_s *ioc, u8 *dm_kva, u64 dm_pa);
339void bfa_ioc_enable(struct bfa_ioc_s *ioc); 347void bfa_ioc_enable(struct bfa_ioc_s *ioc);
340void bfa_ioc_disable(struct bfa_ioc_s *ioc); 348void bfa_ioc_disable(struct bfa_ioc_s *ioc);