diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bfa/Makefile | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa.h | 1 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_core.c | 87 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_drv.c | 107 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_modules.h | 3 |
5 files changed, 88 insertions, 112 deletions
diff --git a/drivers/scsi/bfa/Makefile b/drivers/scsi/bfa/Makefile index d2eefd3e3bd5..ed26a6a97a44 100644 --- a/drivers/scsi/bfa/Makefile +++ b/drivers/scsi/bfa/Makefile | |||
@@ -3,6 +3,6 @@ obj-$(CONFIG_SCSI_BFA_FC) := bfa.o | |||
3 | bfa-y := bfad.o bfad_im.o bfad_attr.o bfad_debugfs.o | 3 | bfa-y := bfad.o bfad_im.o bfad_attr.o bfad_debugfs.o |
4 | bfa-y += bfa_ioc.o bfa_ioc_cb.o bfa_ioc_ct.o bfa_hw_cb.o bfa_hw_ct.o | 4 | bfa-y += bfa_ioc.o bfa_ioc_cb.o bfa_ioc_ct.o bfa_hw_cb.o bfa_hw_ct.o |
5 | bfa-y += bfa_fcs.o bfa_fcs_lport.o bfa_fcs_rport.o bfa_fcs_fcpim.o bfa_fcbuild.o | 5 | bfa-y += bfa_fcs.o bfa_fcs_lport.o bfa_fcs_rport.o bfa_fcs_fcpim.o bfa_fcbuild.o |
6 | bfa-y += bfa_port.o bfa_fcpim.o bfa_core.o bfa_drv.o bfa_svc.o | 6 | bfa-y += bfa_port.o bfa_fcpim.o bfa_core.o bfa_svc.o |
7 | 7 | ||
8 | ccflags-y := -DBFA_PERF_BUILD | 8 | ccflags-y := -DBFA_PERF_BUILD |
diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h index 6231e5aa55b3..8f17186a8dfe 100644 --- a/drivers/scsi/bfa/bfa.h +++ b/drivers/scsi/bfa/bfa.h | |||
@@ -331,7 +331,6 @@ void bfa_hwct_msix_getvecs(struct bfa_s *bfa, u32 *vecmap, u32 *nvecs, | |||
331 | u32 *maxvec); | 331 | u32 *maxvec); |
332 | void bfa_hwct_msix_get_rme_range(struct bfa_s *bfa, u32 *start, | 332 | void bfa_hwct_msix_get_rme_range(struct bfa_s *bfa, u32 *start, |
333 | u32 *end); | 333 | u32 *end); |
334 | void bfa_com_port_attach(struct bfa_s *bfa, struct bfa_meminfo_s *mi); | ||
335 | void bfa_iocfc_get_bootwwns(struct bfa_s *bfa, u8 *nwwns, wwn_t *wwns); | 334 | void bfa_iocfc_get_bootwwns(struct bfa_s *bfa, u8 *nwwns, wwn_t *wwns); |
336 | wwn_t bfa_iocfc_get_pwwn(struct bfa_s *bfa); | 335 | wwn_t bfa_iocfc_get_pwwn(struct bfa_s *bfa); |
337 | wwn_t bfa_iocfc_get_nwwn(struct bfa_s *bfa); | 336 | wwn_t bfa_iocfc_get_nwwn(struct bfa_s *bfa); |
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c index 002907c694af..d417864227ce 100644 --- a/drivers/scsi/bfa/bfa_core.c +++ b/drivers/scsi/bfa/bfa_core.c | |||
@@ -22,6 +22,93 @@ | |||
22 | BFA_TRC_FILE(HAL, CORE); | 22 | BFA_TRC_FILE(HAL, CORE); |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * BFA module list terminated by NULL | ||
26 | */ | ||
27 | static struct bfa_module_s *hal_mods[] = { | ||
28 | &hal_mod_sgpg, | ||
29 | &hal_mod_fcport, | ||
30 | &hal_mod_fcxp, | ||
31 | &hal_mod_lps, | ||
32 | &hal_mod_uf, | ||
33 | &hal_mod_rport, | ||
34 | &hal_mod_fcpim, | ||
35 | NULL | ||
36 | }; | ||
37 | |||
38 | /* | ||
39 | * Message handlers for various modules. | ||
40 | */ | ||
41 | static bfa_isr_func_t bfa_isrs[BFI_MC_MAX] = { | ||
42 | bfa_isr_unhandled, /* NONE */ | ||
43 | bfa_isr_unhandled, /* BFI_MC_IOC */ | ||
44 | bfa_isr_unhandled, /* BFI_MC_DIAG */ | ||
45 | bfa_isr_unhandled, /* BFI_MC_FLASH */ | ||
46 | bfa_isr_unhandled, /* BFI_MC_CEE */ | ||
47 | bfa_fcport_isr, /* BFI_MC_FCPORT */ | ||
48 | bfa_isr_unhandled, /* BFI_MC_IOCFC */ | ||
49 | bfa_isr_unhandled, /* BFI_MC_LL */ | ||
50 | bfa_uf_isr, /* BFI_MC_UF */ | ||
51 | bfa_fcxp_isr, /* BFI_MC_FCXP */ | ||
52 | bfa_lps_isr, /* BFI_MC_LPS */ | ||
53 | bfa_rport_isr, /* BFI_MC_RPORT */ | ||
54 | bfa_itnim_isr, /* BFI_MC_ITNIM */ | ||
55 | bfa_isr_unhandled, /* BFI_MC_IOIM_READ */ | ||
56 | bfa_isr_unhandled, /* BFI_MC_IOIM_WRITE */ | ||
57 | bfa_isr_unhandled, /* BFI_MC_IOIM_IO */ | ||
58 | bfa_ioim_isr, /* BFI_MC_IOIM */ | ||
59 | bfa_ioim_good_comp_isr, /* BFI_MC_IOIM_IOCOM */ | ||
60 | bfa_tskim_isr, /* BFI_MC_TSKIM */ | ||
61 | bfa_isr_unhandled, /* BFI_MC_SBOOT */ | ||
62 | bfa_isr_unhandled, /* BFI_MC_IPFC */ | ||
63 | bfa_isr_unhandled, /* BFI_MC_PORT */ | ||
64 | bfa_isr_unhandled, /* --------- */ | ||
65 | bfa_isr_unhandled, /* --------- */ | ||
66 | bfa_isr_unhandled, /* --------- */ | ||
67 | bfa_isr_unhandled, /* --------- */ | ||
68 | bfa_isr_unhandled, /* --------- */ | ||
69 | bfa_isr_unhandled, /* --------- */ | ||
70 | bfa_isr_unhandled, /* --------- */ | ||
71 | bfa_isr_unhandled, /* --------- */ | ||
72 | bfa_isr_unhandled, /* --------- */ | ||
73 | bfa_isr_unhandled, /* --------- */ | ||
74 | }; | ||
75 | /* | ||
76 | * Message handlers for mailbox command classes | ||
77 | */ | ||
78 | static bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[BFI_MC_MAX] = { | ||
79 | NULL, | ||
80 | NULL, /* BFI_MC_IOC */ | ||
81 | NULL, /* BFI_MC_DIAG */ | ||
82 | NULL, /* BFI_MC_FLASH */ | ||
83 | NULL, /* BFI_MC_CEE */ | ||
84 | NULL, /* BFI_MC_PORT */ | ||
85 | bfa_iocfc_isr, /* BFI_MC_IOCFC */ | ||
86 | NULL, | ||
87 | }; | ||
88 | |||
89 | |||
90 | |||
91 | static void | ||
92 | bfa_com_port_attach(struct bfa_s *bfa, struct bfa_meminfo_s *mi) | ||
93 | { | ||
94 | struct bfa_port_s *port = &bfa->modules.port; | ||
95 | u32 dm_len; | ||
96 | u8 *dm_kva; | ||
97 | u64 dm_pa; | ||
98 | |||
99 | dm_len = bfa_port_meminfo(); | ||
100 | dm_kva = bfa_meminfo_dma_virt(mi); | ||
101 | dm_pa = bfa_meminfo_dma_phys(mi); | ||
102 | |||
103 | memset(port, 0, sizeof(struct bfa_port_s)); | ||
104 | bfa_port_attach(port, &bfa->ioc, bfa, bfa->trcmod); | ||
105 | bfa_port_mem_claim(port, dm_kva, dm_pa); | ||
106 | |||
107 | bfa_meminfo_dma_virt(mi) = dm_kva + dm_len; | ||
108 | bfa_meminfo_dma_phys(mi) = dm_pa + dm_len; | ||
109 | } | ||
110 | |||
111 | /* | ||
25 | * BFA IOC FC related definitions | 112 | * BFA IOC FC related definitions |
26 | */ | 113 | */ |
27 | 114 | ||
diff --git a/drivers/scsi/bfa/bfa_drv.c b/drivers/scsi/bfa/bfa_drv.c deleted file mode 100644 index 0222d7c88a9a..000000000000 --- a/drivers/scsi/bfa/bfa_drv.c +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
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 | #include "bfa_modules.h" | ||
19 | |||
20 | /* | ||
21 | * BFA module list terminated by NULL | ||
22 | */ | ||
23 | struct bfa_module_s *hal_mods[] = { | ||
24 | &hal_mod_sgpg, | ||
25 | &hal_mod_fcport, | ||
26 | &hal_mod_fcxp, | ||
27 | &hal_mod_lps, | ||
28 | &hal_mod_uf, | ||
29 | &hal_mod_rport, | ||
30 | &hal_mod_fcpim, | ||
31 | NULL | ||
32 | }; | ||
33 | |||
34 | /* | ||
35 | * Message handlers for various modules. | ||
36 | */ | ||
37 | bfa_isr_func_t bfa_isrs[BFI_MC_MAX] = { | ||
38 | bfa_isr_unhandled, /* NONE */ | ||
39 | bfa_isr_unhandled, /* BFI_MC_IOC */ | ||
40 | bfa_isr_unhandled, /* BFI_MC_DIAG */ | ||
41 | bfa_isr_unhandled, /* BFI_MC_FLASH */ | ||
42 | bfa_isr_unhandled, /* BFI_MC_CEE */ | ||
43 | bfa_fcport_isr, /* BFI_MC_FCPORT */ | ||
44 | bfa_isr_unhandled, /* BFI_MC_IOCFC */ | ||
45 | bfa_isr_unhandled, /* BFI_MC_LL */ | ||
46 | bfa_uf_isr, /* BFI_MC_UF */ | ||
47 | bfa_fcxp_isr, /* BFI_MC_FCXP */ | ||
48 | bfa_lps_isr, /* BFI_MC_LPS */ | ||
49 | bfa_rport_isr, /* BFI_MC_RPORT */ | ||
50 | bfa_itnim_isr, /* BFI_MC_ITNIM */ | ||
51 | bfa_isr_unhandled, /* BFI_MC_IOIM_READ */ | ||
52 | bfa_isr_unhandled, /* BFI_MC_IOIM_WRITE */ | ||
53 | bfa_isr_unhandled, /* BFI_MC_IOIM_IO */ | ||
54 | bfa_ioim_isr, /* BFI_MC_IOIM */ | ||
55 | bfa_ioim_good_comp_isr, /* BFI_MC_IOIM_IOCOM */ | ||
56 | bfa_tskim_isr, /* BFI_MC_TSKIM */ | ||
57 | bfa_isr_unhandled, /* BFI_MC_SBOOT */ | ||
58 | bfa_isr_unhandled, /* BFI_MC_IPFC */ | ||
59 | bfa_isr_unhandled, /* BFI_MC_PORT */ | ||
60 | bfa_isr_unhandled, /* --------- */ | ||
61 | bfa_isr_unhandled, /* --------- */ | ||
62 | bfa_isr_unhandled, /* --------- */ | ||
63 | bfa_isr_unhandled, /* --------- */ | ||
64 | bfa_isr_unhandled, /* --------- */ | ||
65 | bfa_isr_unhandled, /* --------- */ | ||
66 | bfa_isr_unhandled, /* --------- */ | ||
67 | bfa_isr_unhandled, /* --------- */ | ||
68 | bfa_isr_unhandled, /* --------- */ | ||
69 | bfa_isr_unhandled, /* --------- */ | ||
70 | }; | ||
71 | |||
72 | |||
73 | /* | ||
74 | * Message handlers for mailbox command classes | ||
75 | */ | ||
76 | bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[BFI_MC_MAX] = { | ||
77 | NULL, | ||
78 | NULL, /* BFI_MC_IOC */ | ||
79 | NULL, /* BFI_MC_DIAG */ | ||
80 | NULL, /* BFI_MC_FLASH */ | ||
81 | NULL, /* BFI_MC_CEE */ | ||
82 | NULL, /* BFI_MC_PORT */ | ||
83 | bfa_iocfc_isr, /* BFI_MC_IOCFC */ | ||
84 | NULL, | ||
85 | }; | ||
86 | |||
87 | |||
88 | |||
89 | void | ||
90 | bfa_com_port_attach(struct bfa_s *bfa, struct bfa_meminfo_s *mi) | ||
91 | { | ||
92 | struct bfa_port_s *port = &bfa->modules.port; | ||
93 | u32 dm_len; | ||
94 | u8 *dm_kva; | ||
95 | u64 dm_pa; | ||
96 | |||
97 | dm_len = bfa_port_meminfo(); | ||
98 | dm_kva = bfa_meminfo_dma_virt(mi); | ||
99 | dm_pa = bfa_meminfo_dma_phys(mi); | ||
100 | |||
101 | memset(port, 0, sizeof(struct bfa_port_s)); | ||
102 | bfa_port_attach(port, &bfa->ioc, bfa, bfa->trcmod); | ||
103 | bfa_port_mem_claim(port, dm_kva, dm_pa); | ||
104 | |||
105 | bfa_meminfo_dma_virt(mi) = dm_kva + dm_len; | ||
106 | bfa_meminfo_dma_phys(mi) = dm_pa + dm_len; | ||
107 | } | ||
diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h index 15407ab39e77..ab79ff6fdeea 100644 --- a/drivers/scsi/bfa/bfa_modules.h +++ b/drivers/scsi/bfa/bfa_modules.h | |||
@@ -99,7 +99,6 @@ struct bfa_module_s { | |||
99 | void (*iocdisable) (struct bfa_s *bfa); | 99 | void (*iocdisable) (struct bfa_s *bfa); |
100 | }; | 100 | }; |
101 | 101 | ||
102 | extern struct bfa_module_s *hal_mods[]; | ||
103 | 102 | ||
104 | struct bfa_s { | 103 | struct bfa_s { |
105 | void *bfad; /* BFA driver instance */ | 104 | void *bfad; /* BFA driver instance */ |
@@ -116,8 +115,6 @@ struct bfa_s { | |||
116 | struct bfa_msix_s msix; | 115 | struct bfa_msix_s msix; |
117 | }; | 116 | }; |
118 | 117 | ||
119 | extern bfa_isr_func_t bfa_isrs[BFI_MC_MAX]; | ||
120 | extern bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[]; | ||
121 | extern bfa_boolean_t bfa_auto_recover; | 118 | extern bfa_boolean_t bfa_auto_recover; |
122 | extern struct bfa_module_s hal_mod_sgpg; | 119 | extern struct bfa_module_s hal_mod_sgpg; |
123 | extern struct bfa_module_s hal_mod_fcport; | 120 | extern struct bfa_module_s hal_mod_fcport; |