aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_modules.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 20:34:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 20:34:15 -0400
commitc70b5296e775cde46cfcb2d860ba160108a5ec7a (patch)
tree30419cb982acca44499236adcca65f2f87698c74 /drivers/scsi/bfa/bfa_modules.h
parent80c226fbef56576946c9655fcb2ab62e63404d12 (diff)
parent58ff4bd042adf8013c8f70fd03c2c0f8d022e387 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (84 commits) [SCSI] be2iscsi: SGE Len == 64K [SCSI] be2iscsi: Remove premature free of cid [SCSI] be2iscsi: More time for FW [SCSI] libsas: fix bug for vacant phy [SCSI] sd: Fix overflow with big physical blocks [SCSI] st: add MTWEOFI to write filemarks without flushing drive buffer [SCSI] libsas: Don't issue commands to devices that have been hot-removed [SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive [SCSI] lpfc 8.3.17: Update lpfc driver version to 8.3.17 [SCSI] lpfc 8.3.17: Replace function reset methodology [SCSI] lpfc 8.3.17: SCSI fixes [SCSI] lpfc 8.3.17: BSG fixes [SCSI] lpfc 8.3.17: SLI Additions and Fixes [SCSI] lpfc 8.3.17: Code Cleanup and Locking fixes [SCSI] zfcp: Remove scsi_cmnd->serial_number from debug traces [SCSI] ipr: fix array error logging [SCSI] aha152x: enable PCMCIA on 64bit [SCSI] scsi_dh_alua: Handle all states correctly [SCSI] cxgb4i: connection and ddp setting update [SCSI] cxgb3i: fixed connection over vlan ...
Diffstat (limited to 'drivers/scsi/bfa/bfa_modules.h')
-rw-r--r--drivers/scsi/bfa/bfa_modules.h130
1 files changed, 130 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
new file mode 100644
index 000000000000..2cd527338677
--- /dev/null
+++ b/drivers/scsi/bfa/bfa_modules.h
@@ -0,0 +1,130 @@
1/*
2 * Copyright (c) 2005-2010 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/**
19 * bfa_modules.h BFA modules
20 */
21
22#ifndef __BFA_MODULES_H__
23#define __BFA_MODULES_H__
24
25#include "bfa_cs.h"
26#include "bfa.h"
27#include "bfa_svc.h"
28#include "bfa_fcpim.h"
29#include "bfa_port.h"
30
31struct bfa_modules_s {
32 struct bfa_fcport_s fcport; /* fc port module */
33 struct bfa_fcxp_mod_s fcxp_mod; /* fcxp module */
34 struct bfa_lps_mod_s lps_mod; /* fcxp module */
35 struct bfa_uf_mod_s uf_mod; /* unsolicited frame module */
36 struct bfa_rport_mod_s rport_mod; /* remote port module */
37 struct bfa_fcpim_mod_s fcpim_mod; /* FCP initiator module */
38 struct bfa_sgpg_mod_s sgpg_mod; /* SG page module */
39 struct bfa_port_s port; /* Physical port module */
40};
41
42/*
43 * !!! Only append to the enums defined here to avoid any versioning
44 * !!! needed between trace utility and driver version
45 */
46enum {
47 BFA_TRC_HAL_CORE = 1,
48 BFA_TRC_HAL_FCXP = 2,
49 BFA_TRC_HAL_FCPIM = 3,
50 BFA_TRC_HAL_IOCFC_CT = 4,
51 BFA_TRC_HAL_IOCFC_CB = 5,
52};
53
54
55/**
56 * Macro to define a new BFA module
57 */
58#define BFA_MODULE(__mod) \
59 static void bfa_ ## __mod ## _meminfo( \
60 struct bfa_iocfc_cfg_s *cfg, u32 *ndm_len, \
61 u32 *dm_len); \
62 static void bfa_ ## __mod ## _attach(struct bfa_s *bfa, \
63 void *bfad, struct bfa_iocfc_cfg_s *cfg, \
64 struct bfa_meminfo_s *meminfo, \
65 struct bfa_pcidev_s *pcidev); \
66 static void bfa_ ## __mod ## _detach(struct bfa_s *bfa); \
67 static void bfa_ ## __mod ## _start(struct bfa_s *bfa); \
68 static void bfa_ ## __mod ## _stop(struct bfa_s *bfa); \
69 static void bfa_ ## __mod ## _iocdisable(struct bfa_s *bfa); \
70 \
71 extern struct bfa_module_s hal_mod_ ## __mod; \
72 struct bfa_module_s hal_mod_ ## __mod = { \
73 bfa_ ## __mod ## _meminfo, \
74 bfa_ ## __mod ## _attach, \
75 bfa_ ## __mod ## _detach, \
76 bfa_ ## __mod ## _start, \
77 bfa_ ## __mod ## _stop, \
78 bfa_ ## __mod ## _iocdisable, \
79 }
80
81#define BFA_CACHELINE_SZ (256)
82
83/**
84 * Structure used to interact between different BFA sub modules
85 *
86 * Each sub module needs to implement only the entry points relevant to it (and
87 * can leave entry points as NULL)
88 */
89struct bfa_module_s {
90 void (*meminfo) (struct bfa_iocfc_cfg_s *cfg, u32 *km_len,
91 u32 *dm_len);
92 void (*attach) (struct bfa_s *bfa, void *bfad,
93 struct bfa_iocfc_cfg_s *cfg,
94 struct bfa_meminfo_s *meminfo,
95 struct bfa_pcidev_s *pcidev);
96 void (*detach) (struct bfa_s *bfa);
97 void (*start) (struct bfa_s *bfa);
98 void (*stop) (struct bfa_s *bfa);
99 void (*iocdisable) (struct bfa_s *bfa);
100};
101
102extern struct bfa_module_s *hal_mods[];
103
104struct bfa_s {
105 void *bfad; /* BFA driver instance */
106 struct bfa_plog_s *plog; /* portlog buffer */
107 struct bfa_trc_mod_s *trcmod; /* driver tracing */
108 struct bfa_ioc_s ioc; /* IOC module */
109 struct bfa_iocfc_s iocfc; /* IOCFC module */
110 struct bfa_timer_mod_s timer_mod; /* timer module */
111 struct bfa_modules_s modules; /* BFA modules */
112 struct list_head comp_q; /* pending completions */
113 bfa_boolean_t rme_process; /* RME processing enabled */
114 struct list_head reqq_waitq[BFI_IOC_MAX_CQS];
115 bfa_boolean_t fcs; /* FCS is attached to BFA */
116 struct bfa_msix_s msix;
117};
118
119extern bfa_isr_func_t bfa_isrs[BFI_MC_MAX];
120extern bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[];
121extern bfa_boolean_t bfa_auto_recover;
122extern struct bfa_module_s hal_mod_sgpg;
123extern struct bfa_module_s hal_mod_fcport;
124extern struct bfa_module_s hal_mod_fcxp;
125extern struct bfa_module_s hal_mod_lps;
126extern struct bfa_module_s hal_mod_uf;
127extern struct bfa_module_s hal_mod_rport;
128extern struct bfa_module_s hal_mod_fcpim;
129
130#endif /* __BFA_MODULES_H__ */