]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/scsi/bfa/bfa_modules.h
[SCSI] bfa: Added support for CEE info and stats query.
[mirror_ubuntu-artful-kernel.git] / drivers / scsi / bfa / bfa_modules.h
CommitLineData
7725ccfd 1/*
a36c61f9 2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
7725ccfd
JH
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
acdc79a6 18/*
a36c61f9
KG
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 */
e2187d7f 37 struct bfa_fcp_mod_s fcp_mod; /* FCP initiator module */
a36c61f9
KG
38 struct bfa_sgpg_mod_s sgpg_mod; /* SG page module */
39 struct bfa_port_s port; /* Physical port module */
1a4d8e1b 40 struct bfa_ablk_s ablk; /* ASIC block config module */
148d6103 41 struct bfa_cee_s cee; /* CEE Module */
a36c61f9
KG
42};
43
44/*
45 * !!! Only append to the enums defined here to avoid any versioning
46 * !!! needed between trace utility and driver version
47 */
48enum {
49 BFA_TRC_HAL_CORE = 1,
50 BFA_TRC_HAL_FCXP = 2,
51 BFA_TRC_HAL_FCPIM = 3,
52 BFA_TRC_HAL_IOCFC_CT = 4,
53 BFA_TRC_HAL_IOCFC_CB = 5,
54};
7725ccfd 55
acdc79a6 56/*
7725ccfd
JH
57 * Macro to define a new BFA module
58 */
a36c61f9 59#define BFA_MODULE(__mod) \
7725ccfd 60 static void bfa_ ## __mod ## _meminfo( \
4507025d
KG
61 struct bfa_iocfc_cfg_s *cfg, \
62 struct bfa_meminfo_s *meminfo, \
63 struct bfa_s *bfa); \
7725ccfd 64 static void bfa_ ## __mod ## _attach(struct bfa_s *bfa, \
a36c61f9 65 void *bfad, struct bfa_iocfc_cfg_s *cfg, \
7725ccfd 66 struct bfa_pcidev_s *pcidev); \
7725ccfd
JH
67 static void bfa_ ## __mod ## _detach(struct bfa_s *bfa); \
68 static void bfa_ ## __mod ## _start(struct bfa_s *bfa); \
69 static void bfa_ ## __mod ## _stop(struct bfa_s *bfa); \
70 static void bfa_ ## __mod ## _iocdisable(struct bfa_s *bfa); \
71 \
72 extern struct bfa_module_s hal_mod_ ## __mod; \
73 struct bfa_module_s hal_mod_ ## __mod = { \
74 bfa_ ## __mod ## _meminfo, \
75 bfa_ ## __mod ## _attach, \
7725ccfd
JH
76 bfa_ ## __mod ## _detach, \
77 bfa_ ## __mod ## _start, \
78 bfa_ ## __mod ## _stop, \
79 bfa_ ## __mod ## _iocdisable, \
80 }
81
82#define BFA_CACHELINE_SZ (256)
83
acdc79a6 84/*
7725ccfd
JH
85 * Structure used to interact between different BFA sub modules
86 *
87 * Each sub module needs to implement only the entry points relevant to it (and
88 * can leave entry points as NULL)
89 */
90struct bfa_module_s {
4507025d
KG
91 void (*meminfo) (struct bfa_iocfc_cfg_s *cfg,
92 struct bfa_meminfo_s *meminfo,
93 struct bfa_s *bfa);
7725ccfd
JH
94 void (*attach) (struct bfa_s *bfa, void *bfad,
95 struct bfa_iocfc_cfg_s *cfg,
7725ccfd 96 struct bfa_pcidev_s *pcidev);
7725ccfd
JH
97 void (*detach) (struct bfa_s *bfa);
98 void (*start) (struct bfa_s *bfa);
99 void (*stop) (struct bfa_s *bfa);
100 void (*iocdisable) (struct bfa_s *bfa);
101};
102
7725ccfd
JH
103
104struct bfa_s {
105 void *bfad; /* BFA driver instance */
7725ccfd 106 struct bfa_plog_s *plog; /* portlog buffer */
7725ccfd
JH
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 */
a36c61f9 112 struct list_head comp_q; /* pending completions */
775c7742 113 bfa_boolean_t queue_process; /* queue processing enabled */
a36c61f9 114 struct list_head reqq_waitq[BFI_IOC_MAX_CQS];
7725ccfd
JH
115 bfa_boolean_t fcs; /* FCS is attached to BFA */
116 struct bfa_msix_s msix;
117};
118
7725ccfd 119extern bfa_boolean_t bfa_auto_recover;
7725ccfd 120extern struct bfa_module_s hal_mod_sgpg;
1c8a4c37 121extern struct bfa_module_s hal_mod_fcport;
7725ccfd
JH
122extern struct bfa_module_s hal_mod_fcxp;
123extern struct bfa_module_s hal_mod_lps;
124extern struct bfa_module_s hal_mod_uf;
125extern struct bfa_module_s hal_mod_rport;
e2187d7f 126extern struct bfa_module_s hal_mod_fcp;
7725ccfd 127
a36c61f9 128#endif /* __BFA_MODULES_H__ */