]>
Commit | Line | Data |
---|---|---|
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 | */ | |
a36c61f9 KG |
17 | |
18 | #include "bfa_modules.h" | |
7725ccfd | 19 | |
5fbe25c7 | 20 | /* |
7725ccfd JH |
21 | * BFA module list terminated by NULL |
22 | */ | |
23 | struct bfa_module_s *hal_mods[] = { | |
24 | &hal_mod_sgpg, | |
1c8a4c37 | 25 | &hal_mod_fcport, |
7725ccfd JH |
26 | &hal_mod_fcxp, |
27 | &hal_mod_lps, | |
28 | &hal_mod_uf, | |
29 | &hal_mod_rport, | |
30 | &hal_mod_fcpim, | |
7725ccfd JH |
31 | NULL |
32 | }; | |
33 | ||
5fbe25c7 | 34 | /* |
7725ccfd JH |
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 */ | |
1c8a4c37 | 43 | bfa_fcport_isr, /* BFI_MC_FCPORT */ |
7725ccfd JH |
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 | ||
a36c61f9 | 72 | |
5fbe25c7 | 73 | /* |
7725ccfd JH |
74 | * Message handlers for mailbox command classes |
75 | */ | |
76 | bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[BFI_MC_MAX] = { | |
77 | NULL, | |
a36c61f9 KG |
78 | NULL, /* BFI_MC_IOC */ |
79 | NULL, /* BFI_MC_DIAG */ | |
7725ccfd | 80 | NULL, /* BFI_MC_FLASH */ |
a36c61f9 KG |
81 | NULL, /* BFI_MC_CEE */ |
82 | NULL, /* BFI_MC_PORT */ | |
7725ccfd JH |
83 | bfa_iocfc_isr, /* BFI_MC_IOCFC */ |
84 | NULL, | |
85 | }; | |
86 | ||
a36c61f9 KG |
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 | } |