94 bfa_com_port_attach(
struct bfa_s *bfa)
107 bfa_com_ablk_attach(
struct bfa_s *bfa)
117 bfa_com_cee_attach(
struct bfa_s *bfa)
128 bfa_com_sfp_attach(
struct bfa_s *bfa)
149 bfa_com_diag_attach(
struct bfa_s *bfa)
185 #define BFA_IOCFC_TOV 5000
195 #define DEF_CFG_NUM_FABRICS 1
196 #define DEF_CFG_NUM_LPORTS 256
197 #define DEF_CFG_NUM_CQS 4
198 #define DEF_CFG_NUM_IOIM_REQS (BFA_IOIM_MAX)
199 #define DEF_CFG_NUM_TSKIM_REQS 128
200 #define DEF_CFG_NUM_FCXP_REQS 64
201 #define DEF_CFG_NUM_UF_BUFS 64
202 #define DEF_CFG_NUM_RPORTS 1024
203 #define DEF_CFG_NUM_ITNIMS (DEF_CFG_NUM_RPORTS)
204 #define DEF_CFG_NUM_TINS 256
206 #define DEF_CFG_NUM_SGPGS 2048
207 #define DEF_CFG_NUM_REQQ_ELEMS 256
208 #define DEF_CFG_NUM_RSPQ_ELEMS 64
209 #define DEF_CFG_NUM_SBOOT_TGTS 16
210 #define DEF_CFG_NUM_SBOOT_LUNS 16
238 static void bfa_iocfc_start_submod(
struct bfa_s *bfa);
239 static void bfa_iocfc_disable_submod(
struct bfa_s *bfa);
240 static void bfa_iocfc_send_cfg(
void *bfa_arg);
242 static void bfa_iocfc_disable_cbfn(
void *bfa_arg);
243 static void bfa_iocfc_hbfail_cbfn(
void *bfa_arg);
244 static void bfa_iocfc_reset_cbfn(
void *bfa_arg);
247 static void bfa_iocfc_stop_cb(
void *bfa_arg,
bfa_boolean_t compl);
248 static void bfa_iocfc_enable_cb(
void *bfa_arg,
bfa_boolean_t compl);
249 static void bfa_iocfc_disable_cb(
void *bfa_arg,
bfa_boolean_t compl);
252 bfa_iocfc_sm_stopped_entry(
struct bfa_iocfc_s *iocfc)
273 bfa_iocfc_sm_initing_entry(
struct bfa_iocfc_s *iocfc)
306 bfa_iocfc_sm_dconf_read_entry(
struct bfa_iocfc_s *iocfc)
339 bfa_iocfc_sm_init_cfg_wait_entry(
struct bfa_iocfc_s *iocfc)
341 bfa_iocfc_send_cfg(iocfc->
bfa);
372 bfa_iocfc_sm_init_cfg_done_entry(
struct bfa_iocfc_s *iocfc)
376 bfa_iocfc_init_cb, iocfc->
bfa);
404 bfa_iocfc_sm_operational_entry(
struct bfa_iocfc_s *iocfc)
407 bfa_iocfc_start_submod(iocfc->
bfa);
432 bfa_iocfc_sm_dconf_write_entry(
struct bfa_iocfc_s *iocfc)
454 bfa_iocfc_sm_stopping_entry(
struct bfa_iocfc_s *iocfc)
467 bfa_iocfc_disable_submod(iocfc->
bfa);
471 bfa_iocfc_stop_cb, iocfc->
bfa);
486 bfa_iocfc_sm_enabling_entry(
struct bfa_iocfc_s *iocfc)
517 bfa_iocfc_enable_cb, iocfc->
bfa);
527 bfa_iocfc_sm_cfg_wait_entry(
struct bfa_iocfc_s *iocfc)
529 bfa_iocfc_send_cfg(iocfc->
bfa);
545 bfa_iocfc_enable_cb, iocfc->
bfa);
562 bfa_iocfc_enable_cb, iocfc->
bfa);
572 bfa_iocfc_sm_disabling_entry(
struct bfa_iocfc_s *iocfc)
597 bfa_iocfc_sm_disabled_entry(
struct bfa_iocfc_s *iocfc)
600 bfa_iocfc_disable_submod(iocfc->
bfa);
603 bfa_iocfc_disable_cb, iocfc->
bfa);
625 bfa_iocfc_sm_failed_entry(
struct bfa_iocfc_s *iocfc)
628 bfa_iocfc_disable_submod(iocfc->
bfa);
655 bfa_iocfc_sm_init_failed_entry(
struct bfa_iocfc_s *iocfc)
660 bfa_iocfc_init_cb, iocfc->
bfa);
682 bfa_iocfc_disable_cb, iocfc->
bfa);
696 bfa_reqq_resume(
struct bfa_s *bfa,
int qid)
732 bfa_isrs[m->
mhdr.msg_class] (bfa,
m);
733 CQ_INCR(ci, bfa->iocfc.cfg.drvcfg.num_rspq_elems);
745 if (!list_empty(waitq))
746 bfa_reqq_resume(bfa, qid);
752 bfa_isr_reqq(
struct bfa_s *bfa,
int qid)
762 if (!list_empty(waitq))
763 bfa_reqq_resume(bfa, qid);
772 intr =
readl(bfa->
iocfc.bfa_regs.intr_status);
795 bfa_isr_reqq(bfa, queue);
811 intr =
readl(bfa->
iocfc.bfa_regs.intr_status);
835 bfa_isr_reqq(bfa, queue);
860 umsk |= port_id == 0 ?
869 bfa->
iocfc.intr_mask = ~umsk;
890 bfa_isr_reqq(bfa, vec - bfa->
iocfc.hwif.cpe_vec_q0);
900 bfa_trc_stop(bfa->
trcmod);
915 intr =
readl(bfa->
iocfc.bfa_regs.intr_status);
941 curr_value =
readl(bfa->
ioc.ioc_regs.ll_halt);
943 writel(curr_value, bfa->
ioc.ioc_regs.ll_halt);
953 bfa->
ioc.ioc_regs.pss_err_status_reg);
955 bfa->
ioc.ioc_regs.pss_err_status_reg);
975 bfa_iocfc_send_cfg(
void *bfa_arg)
977 struct bfa_s *bfa = bfa_arg;
993 if (bfa->
msix.nvecs == 1)
998 cfg->
fwcfg.num_ioim_reqs));
1005 for (i = 0; i < cfg->
fwcfg.num_cqs; i++) {
1084 iocfc->
hwif.hw_isr_mode_set =
NULL;
1088 iocfc->
hwif.hw_reginit(bfa);
1089 bfa->
msix.nvecs = 0;
1097 int i, per_reqq_sz, per_rspq_sz;
1113 for (i = 0; i < cfg->
fwcfg.num_cqs; i++) {
1129 for (i = 0; i < cfg->
fwcfg.num_cqs; i++) {
1142 bfa->
iocfc.cfg_info.kva = dm_kva;
1143 bfa->
iocfc.cfg_info.pa = dm_pa;
1149 bfa->
iocfc.cfgrsp_dma.kva = dm_kva;
1150 bfa->
iocfc.cfgrsp_dma.pa = dm_pa;
1166 bfa_iocfc_start_submod(
struct bfa_s *bfa)
1174 for (i = 0; hal_mods[
i]; i++)
1175 hal_mods[i]->
start(bfa);
1184 bfa_iocfc_disable_submod(
struct bfa_s *bfa)
1191 for (i = 0; hal_mods[
i]; i++)
1192 hal_mods[i]->iocdisable(bfa);
1200 struct bfa_s *bfa = bfa_arg;
1209 struct bfa_s *bfa = bfa_arg;
1219 struct bfa_s *bfa = bfa_arg;
1229 struct bfa_s *bfa = bfa_arg;
1275 bfa_iocfc_cfgrsp(
struct bfa_s *bfa)
1292 bfa_iocfc_qreg(bfa, &cfgrsp->
qreg);
1297 bfa_iocfc_res_recfg(bfa, fwcfg);
1304 if (bfa->
iocfc.cfgrsp->pbc_cfg.pbc_pwwn != 0) {
1305 bfa->
ioc.attr->pwwn = bfa->
iocfc.cfgrsp->pbc_cfg.pbc_pwwn;
1306 bfa->
ioc.attr->nwwn = bfa->
iocfc.cfgrsp->pbc_cfg.pbc_nwwn;
1336 bfa->
ioc.attr->pwwn = msg->
pwwn;
1337 bfa->
ioc.attr->nwwn = msg->
nwwn;
1347 bfa_faa_validate_request(
struct bfa_s *bfa)
1371 iocfc->
faa_args.faa_cb.faa_cbfn = cbfn;
1372 iocfc->
faa_args.faa_cb.faa_cbarg = cbarg;
1374 status = bfa_faa_validate_request(bfa);
1399 void *cbarg = iocfc->
faa_args.faa_cb.faa_cbarg;
1402 iocfc->
faa_args.faa_attr->faa = rsp->faa;
1403 iocfc->
faa_args.faa_attr->faa_state = rsp->faa_status;
1404 iocfc->
faa_args.faa_attr->pwwn_source = rsp->addr_source;
1419 struct bfa_s *bfa = bfa_arg;
1431 bfa_iocfc_disable_cbfn(
void *bfa_arg)
1433 struct bfa_s *bfa = bfa_arg;
1442 bfa_iocfc_hbfail_cbfn(
void *bfa_arg)
1444 struct bfa_s *bfa = bfa_arg;
1454 bfa_iocfc_reset_cbfn(
void *bfa_arg)
1456 struct bfa_s *bfa = bfa_arg;
1469 int q, per_reqq_sz, per_rspq_sz;
1485 for (q = 0; q < cfg->
fwcfg.num_cqs; q++) {
1493 for (q = 0; q < cfg->
fwcfg.num_cqs; q++)
1518 bfa_iocfc_cbfn.enable_cbfn = bfa_iocfc_enable_cbfn;
1519 bfa_iocfc_cbfn.disable_cbfn = bfa_iocfc_disable_cbfn;
1520 bfa_iocfc_cbfn.hbfail_cbfn = bfa_iocfc_hbfail_cbfn;
1521 bfa_iocfc_cbfn.reset_cbfn = bfa_iocfc_reset_cbfn;
1529 bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev);
1530 bfa_iocfc_mem_claim(bfa, cfg);
1531 INIT_LIST_HEAD(&bfa->
timer_mod.timer_q);
1533 INIT_LIST_HEAD(&bfa->
comp_q);
1577 struct bfa_s *bfa = bfaarg;
1584 switch (msg->
mh.msg_id) {
1586 bfa_iocfc_cfgrsp(bfa);
1592 bfa_iocfc_process_faa_addr(bfa,
1700 *nwwns = cfgrsp->
pbc_cfg.nbluns;
1701 for (i = 0; i < cfgrsp->
pbc_cfg.nbluns; i++)
1702 wwns[i] = cfgrsp->
pbc_cfg.blun[i].tgt_pwwn;
1718 return cfgrsp->
pbc_cfg.nvports;
1772 INIT_LIST_HEAD(&meminfo->
dma_info.qe);
1773 INIT_LIST_HEAD(&meminfo->
kva_info.qe);
1777 for (i = 0; hal_mods[
i]; i++)
1778 hal_mods[i]->
meminfo(cfg, meminfo, bfa);
1854 for (i = 0; hal_mods[
i]; i++)
1855 hal_mods[i]->
attach(bfa, bfad, cfg, pcidev);
1857 bfa_com_port_attach(bfa);
1858 bfa_com_ablk_attach(bfa);
1859 bfa_com_cee_attach(bfa);
1860 bfa_com_sfp_attach(bfa);
1861 bfa_com_flash_attach(bfa, cfg->
drvcfg.min_cfg);
1862 bfa_com_diag_attach(bfa);
1863 bfa_com_phy_attach(bfa, cfg->
drvcfg.min_cfg);
1864 bfa_com_fru_attach(bfa, cfg->
drvcfg.min_cfg);
1885 for (i = 0; hal_mods[
i]; i++)
1886 hal_mods[i]->detach(bfa);
1893 INIT_LIST_HEAD(comp_q);
1894 list_splice_tail_init(&bfa->
comp_q, comp_q);
1923 while (!list_empty(comp_q)) {
1945 *npciids =
sizeof(__pciids) /
sizeof(__pciids[0]);
1973 cfg->
fwcfg.num_fwtio_reqs = 0;
1995 cfg->
fwcfg.num_fwtio_reqs = 0;