blob: 14127646dc54cdb811ff944b7bea9dc0c838d4ed [file] [log] [blame]
Jing Huang7725ccf2009-09-23 17:46:15 -07001/*
Krishna Gudipatia36c61f2010-09-15 11:50:55 -07002 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
Jing Huang7725ccf2009-09-23 17:46:15 -07003 * 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 */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070017
18#include "bfa_modules.h"
Jing Huang7725ccf2009-09-23 17:46:15 -070019
20/**
21 * BFA module list terminated by NULL
22 */
23struct bfa_module_s *hal_mods[] = {
24 &hal_mod_sgpg,
Krishna Gudipati1c8a4c32010-03-05 19:37:37 -080025 &hal_mod_fcport,
Jing Huang7725ccf2009-09-23 17:46:15 -070026 &hal_mod_fcxp,
27 &hal_mod_lps,
28 &hal_mod_uf,
29 &hal_mod_rport,
30 &hal_mod_fcpim,
Jing Huang7725ccf2009-09-23 17:46:15 -070031 NULL
32};
33
34/**
35 * Message handlers for various modules.
36 */
37bfa_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 */
Krishna Gudipati1c8a4c32010-03-05 19:37:37 -080043 bfa_fcport_isr, /* BFI_MC_FCPORT */
Jing Huang7725ccf2009-09-23 17:46:15 -070044 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
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070072
Jing Huang7725ccf2009-09-23 17:46:15 -070073/**
74 * Message handlers for mailbox command classes
75 */
76bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[BFI_MC_MAX] = {
77 NULL,
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070078 NULL, /* BFI_MC_IOC */
79 NULL, /* BFI_MC_DIAG */
Jing Huang7725ccf2009-09-23 17:46:15 -070080 NULL, /* BFI_MC_FLASH */
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070081 NULL, /* BFI_MC_CEE */
82 NULL, /* BFI_MC_PORT */
Jing Huang7725ccf2009-09-23 17:46:15 -070083 bfa_iocfc_isr, /* BFI_MC_IOCFC */
84 NULL,
85};
86
Krishna Gudipatia36c61f2010-09-15 11:50:55 -070087
88
89void
90bfa_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}