Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 1 | /* |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame^] | 2 | * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 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 | */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame^] | 17 | |
| 18 | #include "bfa_modules.h" |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 19 | |
| 20 | /** |
| 21 | * BFA module list terminated by NULL |
| 22 | */ |
| 23 | struct bfa_module_s *hal_mods[] = { |
| 24 | &hal_mod_sgpg, |
Krishna Gudipati | 1c8a4c3 | 2010-03-05 19:37:37 -0800 | [diff] [blame] | 25 | &hal_mod_fcport, |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 26 | &hal_mod_fcxp, |
| 27 | &hal_mod_lps, |
| 28 | &hal_mod_uf, |
| 29 | &hal_mod_rport, |
| 30 | &hal_mod_fcpim, |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 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 */ |
Krishna Gudipati | 1c8a4c3 | 2010-03-05 19:37:37 -0800 | [diff] [blame] | 43 | bfa_fcport_isr, /* BFI_MC_FCPORT */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 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 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame^] | 72 | |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 73 | /** |
| 74 | * Message handlers for mailbox command classes |
| 75 | */ |
| 76 | bfa_ioc_mbox_mcfunc_t bfa_mbox_isrs[BFI_MC_MAX] = { |
| 77 | NULL, |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame^] | 78 | NULL, /* BFI_MC_IOC */ |
| 79 | NULL, /* BFI_MC_DIAG */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 80 | NULL, /* BFI_MC_FLASH */ |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame^] | 81 | NULL, /* BFI_MC_CEE */ |
| 82 | NULL, /* BFI_MC_PORT */ |
Jing Huang | 7725ccf | 2009-09-23 17:46:15 -0700 | [diff] [blame] | 83 | bfa_iocfc_isr, /* BFI_MC_IOCFC */ |
| 84 | NULL, |
| 85 | }; |
| 86 | |
Krishna Gudipati | a36c61f | 2010-09-15 11:50:55 -0700 | [diff] [blame^] | 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 | } |