Lines Matching +full:smem +full:- +full:states

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Linux network driver for QLogic BR-series Converged Network Adapter.
6 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
7 * Copyright (c) 2014-2015 QLogic Corporation
21 ((__ioc)->ioc_hwif->ioc_firmware_lock(__ioc))
23 ((__ioc)->ioc_hwif->ioc_firmware_unlock(__ioc))
24 #define bfa_ioc_reg_init(__ioc) ((__ioc)->ioc_hwif->ioc_reg_init(__ioc))
25 #define bfa_ioc_map_port(__ioc) ((__ioc)->ioc_hwif->ioc_map_port(__ioc))
27 ((__ioc)->ioc_hwif->ioc_notify_fail(__ioc))
29 ((__ioc)->ioc_hwif->ioc_sync_start(__ioc))
31 ((__ioc)->ioc_hwif->ioc_sync_join(__ioc))
33 ((__ioc)->ioc_hwif->ioc_sync_leave(__ioc))
35 ((__ioc)->ioc_hwif->ioc_sync_ack(__ioc))
37 ((__ioc)->ioc_hwif->ioc_sync_complete(__ioc))
39 ((__ioc)->ioc_hwif->ioc_set_fwstate(__ioc, __fwstate))
41 ((__ioc)->ioc_hwif->ioc_get_fwstate(__ioc))
43 ((__ioc)->ioc_hwif->ioc_set_alt_fwstate(__ioc, __fwstate))
156 /* IOCPF states */
225 /* Reset entry actions -- initialize state machine */
229 bfa_fsm_set_state(&ioc->iocpf, bfa_iocpf_sm_reset); in bfa_ioc_sm_reset_entry()
274 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_enabling()
281 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_enabling()
306 mod_timer(&ioc->ioc_timer, jiffies + in bfa_ioc_sm_getattr_entry()
317 del_timer(&ioc->ioc_timer); in bfa_ioc_sm_getattr()
323 del_timer(&ioc->ioc_timer); in bfa_ioc_sm_getattr()
326 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_getattr()
333 del_timer(&ioc->ioc_timer); in bfa_ioc_sm_getattr()
348 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_OK); in bfa_ioc_sm_op_entry()
371 if (ioc->iocpf.auto_recover) in bfa_ioc_sm_op()
437 ioc->cbfn->disable_cbfn(ioc->bfa); in bfa_ioc_sm_disabled()
469 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_fail_retry()
476 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_fail_retry()
508 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_fail()
541 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_sm_hwfail()
545 ioc->cbfn->disable_cbfn(ioc->bfa); in bfa_ioc_sm_hwfail()
559 /* Reset entry actions -- initialize state machine */
563 iocpf->fw_mismatch_notified = false; in bfa_iocpf_sm_reset_entry()
564 iocpf->auto_recover = bfa_nw_auto_recover; in bfa_iocpf_sm_reset_entry()
588 bfa_ioc_hw_sem_init(iocpf->ioc); in bfa_iocpf_sm_fwcheck_entry()
589 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_fwcheck_entry()
596 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_fwcheck()
607 mod_timer(&ioc->sem_timer, jiffies + in bfa_iocpf_sm_fwcheck()
642 if (!iocpf->fw_mismatch_notified) in bfa_iocpf_sm_mismatch_entry()
643 bfa_ioc_pf_fwmismatch(iocpf->ioc); in bfa_iocpf_sm_mismatch_entry()
645 iocpf->fw_mismatch_notified = true; in bfa_iocpf_sm_mismatch_entry()
646 mod_timer(&(iocpf->ioc)->iocpf_timer, jiffies + in bfa_iocpf_sm_mismatch_entry()
654 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_mismatch()
662 del_timer(&ioc->iocpf_timer); in bfa_iocpf_sm_mismatch()
668 del_timer(&ioc->iocpf_timer); in bfa_iocpf_sm_mismatch()
681 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_semwait_entry()
688 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_semwait()
697 mod_timer(&ioc->sem_timer, jiffies + in bfa_iocpf_sm_semwait()
720 iocpf->poll_time = 0; in bfa_iocpf_sm_hwinit_entry()
721 bfa_ioc_reset(iocpf->ioc, false); in bfa_iocpf_sm_hwinit_entry()
730 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_hwinit()
744 del_timer(&ioc->iocpf_timer); in bfa_iocpf_sm_hwinit()
758 mod_timer(&(iocpf->ioc)->iocpf_timer, jiffies + in bfa_iocpf_sm_enabling_entry()
763 iocpf->ioc->cbfn->reset_cbfn(iocpf->ioc->bfa); in bfa_iocpf_sm_enabling_entry()
764 bfa_ioc_send_enable(iocpf->ioc); in bfa_iocpf_sm_enabling_entry()
773 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_enabling()
777 del_timer(&ioc->iocpf_timer); in bfa_iocpf_sm_enabling()
783 del_timer(&ioc->iocpf_timer); in bfa_iocpf_sm_enabling()
794 del_timer(&ioc->iocpf_timer); in bfa_iocpf_sm_enabling()
807 bfa_ioc_pf_enabled(iocpf->ioc); in bfa_iocpf_sm_ready_entry()
834 mod_timer(&(iocpf->ioc)->iocpf_timer, jiffies + in bfa_iocpf_sm_disabling_entry()
836 bfa_ioc_send_disable(iocpf->ioc); in bfa_iocpf_sm_disabling_entry()
843 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_disabling()
847 del_timer(&ioc->iocpf_timer); in bfa_iocpf_sm_disabling()
852 del_timer(&ioc->iocpf_timer); in bfa_iocpf_sm_disabling()
871 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_disabling_sync_entry()
878 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_disabling_sync()
904 bfa_ioc_mbox_flush(iocpf->ioc); in bfa_iocpf_sm_disabled_entry()
905 bfa_ioc_pf_disabled(iocpf->ioc); in bfa_iocpf_sm_disabled_entry()
911 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_disabled()
931 bfa_nw_ioc_debug_save_ftrc(iocpf->ioc); in bfa_iocpf_sm_initfail_sync_entry()
932 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_initfail_sync_entry()
939 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_initfail_sync()
983 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_initfail()
1006 bfa_ioc_lpu_stop(iocpf->ioc); in bfa_iocpf_sm_fail_sync_entry()
1011 bfa_ioc_mbox_flush(iocpf->ioc); in bfa_iocpf_sm_fail_sync_entry()
1012 bfa_ioc_hw_sem_get(iocpf->ioc); in bfa_iocpf_sm_fail_sync_entry()
1019 struct bfa_ioc *ioc = iocpf->ioc; in bfa_iocpf_sm_fail_sync()
1025 if (!iocpf->auto_recover) { in bfa_iocpf_sm_fail_sync()
1085 list_for_each_entry(notify, &ioc->notify_q, qe) in bfa_ioc_event_notify()
1086 notify->cbfn(notify->cbarg, event); in bfa_ioc_event_notify()
1092 ioc->cbfn->disable_cbfn(ioc->bfa); in bfa_ioc_disable_comp()
1131 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff); in bfa_ioc_fwver_clear()
1132 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_fwver_clear()
1135 writel(0, ioc->ioc_regs.smem_page_start + loff); in bfa_ioc_fwver_clear()
1148 r32 = readl(ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_hw_sem_init()
1151 r32 = readl(ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_hw_sem_init()
1156 writel(1, ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_hw_sem_init()
1163 writel(1, ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_hw_sem_init()
1174 readl(ioc->ioc_regs.ioc_sem_reg); in bfa_ioc_hw_sem_init()
1175 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_ioc_hw_sem_init()
1178 writel(1, ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_hw_sem_init()
1190 r32 = readl(ioc->ioc_regs.ioc_sem_reg); in bfa_ioc_hw_sem_get()
1192 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_SEM_ERROR); in bfa_ioc_hw_sem_get()
1196 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_SEMLOCKED); in bfa_ioc_hw_sem_get()
1200 mod_timer(&ioc->sem_timer, jiffies + in bfa_ioc_hw_sem_get()
1207 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_nw_ioc_hw_sem_release()
1213 del_timer(&ioc->sem_timer); in bfa_ioc_hw_sem_get_cancel()
1224 pss_ctl = readl(ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lmem_init()
1232 writel(pss_ctl, ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lmem_init()
1239 pss_ctl = readl(ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lmem_init()
1250 writel(pss_ctl, ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lmem_init()
1261 pss_ctl = readl(ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lpu_start()
1264 writel(pss_ctl, ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lpu_start()
1275 pss_ctl = readl(ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lpu_stop()
1278 writel(pss_ctl, ioc->ioc_regs.pss_ctl_reg); in bfa_ioc_lpu_stop()
1291 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_nw_ioc_fwver_get()
1296 swab32(readl(loff + ioc->ioc_regs.smem_page_start)); in bfa_nw_ioc_fwver_get()
1308 if (fwhdr_1->md5sum[i] != fwhdr_2->md5sum[i]) in bfa_ioc_fwver_md5_check()
1322 if (drv_fwhdr->signature != fwhdr_to_cmp->signature) in bfa_ioc_fw_ver_compatible()
1324 if (drv_fwhdr->fwver.major != fwhdr_to_cmp->fwver.major) in bfa_ioc_fw_ver_compatible()
1326 if (drv_fwhdr->fwver.minor != fwhdr_to_cmp->fwver.minor) in bfa_ioc_fw_ver_compatible()
1328 if (drv_fwhdr->fwver.maint != fwhdr_to_cmp->fwver.maint) in bfa_ioc_fw_ver_compatible()
1330 if (drv_fwhdr->fwver.patch == fwhdr_to_cmp->fwver.patch && in bfa_ioc_fw_ver_compatible()
1331 drv_fwhdr->fwver.phase == fwhdr_to_cmp->fwver.phase && in bfa_ioc_fw_ver_compatible()
1332 drv_fwhdr->fwver.build == fwhdr_to_cmp->fwver.build) in bfa_ioc_fw_ver_compatible()
1341 if (flash_fwhdr->fwver.major == 0 || flash_fwhdr->fwver.major == 0xFF) in bfa_ioc_flash_fwver_valid()
1350 if (fwhdr->fwver.phase == 0 && in fwhdr_is_ga()
1351 fwhdr->fwver.build == 0) in fwhdr_is_ga()
1365 if (fwhdr_to_cmp->fwver.patch > base_fwhdr->fwver.patch) in bfa_ioc_fw_ver_patch_cmp()
1367 else if (fwhdr_to_cmp->fwver.patch < base_fwhdr->fwver.patch) in bfa_ioc_fw_ver_patch_cmp()
1382 if (fwhdr_to_cmp->fwver.phase > base_fwhdr->fwver.phase) in bfa_ioc_fw_ver_patch_cmp()
1384 else if (fwhdr_to_cmp->fwver.phase < base_fwhdr->fwver.phase) in bfa_ioc_fw_ver_patch_cmp()
1387 if (fwhdr_to_cmp->fwver.build > base_fwhdr->fwver.build) in bfa_ioc_fw_ver_patch_cmp()
1389 else if (fwhdr_to_cmp->fwver.build < base_fwhdr->fwver.build) in bfa_ioc_fw_ver_patch_cmp()
1424 BFA_FLASH_NOT_PRESENT = -1, /*!< flash not present */
1425 BFA_FLASH_UNINIT = -2, /*!< flash not initialized */
1426 BFA_FLASH_BAD = -3, /*!< flash bad */
1427 BFA_FLASH_BUSY = -4, /*!< flash busy */
1428 BFA_FLASH_ERR_CMD_ACT = -5, /*!< command active never cleared */
1429 BFA_FLASH_ERR_FIFO_CNT = -6, /*!< fifo count never cleared */
1430 BFA_FLASH_ERR_WIP = -7, /*!< write-in-progress never cleared */
1431 BFA_FLASH_ERR_TIMEOUT = -8, /*!< fli timeout */
1432 BFA_FLASH_ERR_LEN = -9, /*!< invalid length */
1620 /* check if write-in-progress bit is cleared */ in bfa_flash_read_start()
1677 if (--n <= 0) in bfa_flash_sem_get()
1708 l = (n + 1) * fifo_sz - s; in bfa_flash_raw_read()
1721 if (--n <= 0) { in bfa_flash_raw_read()
1729 residue -= l; in bfa_flash_raw_read()
1743 return bfa_flash_raw_read(ioc->pcidev.pci_bar_kva, in bfa_nw_ioc_flash_img_get_chnk()
1768 * Returns TRUE if driver is willing to work with current smem f/w version.
1779 /* If smem is incompatible or old, driver should not work with it. */ in bfa_nw_ioc_fwver_cmp()
1786 /* IF Flash has a better F/W than smem do not work with smem. in bfa_nw_ioc_fwver_cmp()
1787 * If smem f/w == flash f/w, as smem f/w not old | incmp, work with it. in bfa_nw_ioc_fwver_cmp()
1788 * If Flash is old or incomp work with smem iff smem f/w == drv f/w. in bfa_nw_ioc_fwver_cmp()
1822 r32 = readl(ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgflush()
1824 writel(1, ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgflush()
1866 * just re-enable IOC. in bfa_ioc_hwinit()
1870 * When using MSI-X any pending firmware ready event should in bfa_ioc_hwinit()
1871 * be flushed. Otherwise MSI-X interrupts are not delivered. in bfa_ioc_hwinit()
1874 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FWREADY); in bfa_ioc_hwinit()
1879 * Initialize the h/w for any other states. in bfa_ioc_hwinit()
1905 ioc->ioc_regs.hfn_mbox + i * sizeof(u32)); in bfa_ioc_mbox_send()
1908 writel(0, ioc->ioc_regs.hfn_mbox + i * sizeof(u32)); in bfa_ioc_mbox_send()
1913 writel(1, ioc->ioc_regs.hfn_mbox_cmd); in bfa_ioc_mbox_send()
1914 (void) readl(ioc->ioc_regs.hfn_mbox_cmd); in bfa_ioc_mbox_send()
1924 enable_req.clscode = htons(ioc->clscode); in bfa_ioc_send_enable()
1938 disable_req.clscode = htons(ioc->clscode); in bfa_ioc_send_disable()
1952 bfa_dma_be_addr_set(attr_req.attr_addr, ioc->attr_dma.pa); in bfa_ioc_send_getattr()
1961 hb_count = readl(ioc->ioc_regs.heartbeat); in bfa_nw_ioc_hb_check()
1962 if (ioc->hb_count == hb_count) { in bfa_nw_ioc_hb_check()
1966 ioc->hb_count = hb_count; in bfa_nw_ioc_hb_check()
1970 mod_timer(&ioc->hb_timer, jiffies + in bfa_nw_ioc_hb_check()
1977 ioc->hb_count = readl(ioc->ioc_regs.heartbeat); in bfa_ioc_hb_monitor()
1978 mod_timer(&ioc->hb_timer, jiffies + in bfa_ioc_hb_monitor()
1985 del_timer(&ioc->hb_timer); in bfa_ioc_hb_stop()
2021 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_ioc_download_fw()
2043 * write smem in bfa_ioc_download_fw()
2046 ioc->ioc_regs.smem_page_start + loff); in bfa_ioc_download_fw()
2057 ioc->ioc_regs.host_page_num_fn); in bfa_ioc_download_fw()
2062 ioc->ioc_regs.host_page_num_fn); in bfa_ioc_download_fw()
2071 asicmode = BFI_FWBOOT_DEVMODE(ioc->asic_gen, ioc->asic_mode, in bfa_ioc_download_fw()
2072 ioc->port0_mode, ioc->port1_mode); in bfa_ioc_download_fw()
2073 writel(asicmode, ((ioc->ioc_regs.smem_page_start) in bfa_ioc_download_fw()
2075 writel(boot_type, ((ioc->ioc_regs.smem_page_start) in bfa_ioc_download_fw()
2077 writel(boot_env, ((ioc->ioc_regs.smem_page_start) in bfa_ioc_download_fw()
2093 struct bfa_iocpf *iocpf = &ioc->iocpf; in bfa_ioc_enable_reply()
2095 ioc->port_mode = ioc->port_mode_cfg = port_mode; in bfa_ioc_enable_reply()
2096 ioc->ad_cap_bm = cap_bm; in bfa_ioc_enable_reply()
2104 struct bfi_ioc_attr *attr = ioc->attr; in bfa_ioc_getattr_reply()
2106 attr->adapter_prop = ntohl(attr->adapter_prop); in bfa_ioc_getattr_reply()
2107 attr->card_type = ntohl(attr->card_type); in bfa_ioc_getattr_reply()
2108 attr->maxfrsize = ntohs(attr->maxfrsize); in bfa_ioc_getattr_reply()
2117 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; in bfa_ioc_mbox_attach()
2120 INIT_LIST_HEAD(&mod->cmd_q); in bfa_ioc_mbox_attach()
2122 mod->mbhdlr[mc].cbfn = NULL; in bfa_ioc_mbox_attach()
2123 mod->mbhdlr[mc].cbarg = ioc->bfa; in bfa_ioc_mbox_attach()
2127 /* Mbox poll timer -- restarts any pending mailbox requests. */
2131 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; in bfa_ioc_mbox_poll()
2140 if (list_empty(&mod->cmd_q)) in bfa_ioc_mbox_poll()
2146 stat = readl(ioc->ioc_regs.hfn_mbox_cmd); in bfa_ioc_mbox_poll()
2153 cmd = list_first_entry(&mod->cmd_q, struct bfa_mbox_cmd, qe); in bfa_ioc_mbox_poll()
2154 list_del(&cmd->qe); in bfa_ioc_mbox_poll()
2155 bfa_ioc_mbox_send(ioc, cmd->msg, sizeof(cmd->msg)); in bfa_ioc_mbox_poll()
2160 if (cmd->cbfn) { in bfa_ioc_mbox_poll()
2161 cbfn = cmd->cbfn; in bfa_ioc_mbox_poll()
2162 cbarg = cmd->cbarg; in bfa_ioc_mbox_poll()
2163 cmd->cbfn = NULL; in bfa_ioc_mbox_poll()
2172 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; in bfa_ioc_mbox_flush()
2175 while (!list_empty(&mod->cmd_q)) { in bfa_ioc_mbox_flush()
2176 cmd = list_first_entry(&mod->cmd_q, struct bfa_mbox_cmd, qe); in bfa_ioc_mbox_flush()
2177 list_del(&cmd->qe); in bfa_ioc_mbox_flush()
2182 * bfa_nw_ioc_smem_read - Read data from SMEM to host through PCI memmap
2185 * @tbuf: app memory to store data from smem
2186 * @soff: smem offset
2187 * @sz: size of smem in bytes
2196 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, soff); in bfa_nw_ioc_smem_read()
2202 if (!bfa_nw_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg)) in bfa_nw_ioc_smem_read()
2205 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_nw_ioc_smem_read()
2209 r32 = swab32(readl(loff + ioc->ioc_regs.smem_page_start)); in bfa_nw_ioc_smem_read()
2219 writel(pgnum, ioc->ioc_regs.host_page_num_fn); in bfa_nw_ioc_smem_read()
2223 writel(PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, 0), in bfa_nw_ioc_smem_read()
2224 ioc->ioc_regs.host_page_num_fn); in bfa_nw_ioc_smem_read()
2229 readl(ioc->ioc_regs.ioc_init_sem_reg); in bfa_nw_ioc_smem_read()
2230 writel(1, ioc->ioc_regs.ioc_init_sem_reg); in bfa_nw_ioc_smem_read()
2238 u32 loff = BFI_IOC_TRC_OFF + BNA_DBG_FWTRC_LEN * ioc->port_id; in bfa_nw_ioc_debug_fwtrc()
2256 if (ioc->dbg_fwsave_once) { in bfa_nw_ioc_debug_save_ftrc()
2257 ioc->dbg_fwsave_once = false; in bfa_nw_ioc_debug_save_ftrc()
2258 if (ioc->dbg_fwsave_len) { in bfa_nw_ioc_debug_save_ftrc()
2259 tlen = ioc->dbg_fwsave_len; in bfa_nw_ioc_debug_save_ftrc()
2260 bfa_nw_ioc_debug_fwtrc(ioc, ioc->dbg_fwsave, &tlen); in bfa_nw_ioc_debug_save_ftrc()
2271 if (ioc->dbg_fwsave_len == 0) in bfa_nw_ioc_debug_fwsave()
2275 if (tlen > ioc->dbg_fwsave_len) in bfa_nw_ioc_debug_fwsave()
2276 tlen = ioc->dbg_fwsave_len; in bfa_nw_ioc_debug_fwsave()
2278 memcpy(trcdata, ioc->dbg_fwsave, tlen); in bfa_nw_ioc_debug_fwsave()
2289 ioc->cbfn->hbfail_cbfn(ioc->bfa); in bfa_ioc_fail_notify()
2325 ioc->cbfn->enable_cbfn(ioc->bfa, BFA_STATUS_IOC_FAILURE); in bfa_ioc_pf_fwmismatch()
2335 bfa_nw_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_pll_init()
2339 ioc->pllinit = true; in bfa_ioc_pll_init()
2347 bfa_nw_ioc_sem_release(ioc->ioc_regs.ioc_init_sem_reg); in bfa_ioc_pll_init()
2393 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_TIMEOUT); in bfa_ioc_boot()
2412 r32 = readl(ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgget()
2421 r32 = readl(ioc->ioc_regs.lpu_mbox + in bfa_ioc_msgget()
2429 writel(1, ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgget()
2430 readl(ioc->ioc_regs.lpu_mbox_cmd); in bfa_ioc_msgget()
2439 struct bfa_iocpf *iocpf = &ioc->iocpf; in bfa_ioc_isr()
2445 switch (msg->mh.msg_id) { in bfa_ioc_isr()
2451 (enum bfa_mode)msg->fw_event.port_mode, in bfa_ioc_isr()
2452 msg->fw_event.cap_bm); in bfa_ioc_isr()
2469 * bfa_nw_ioc_attach - IOC attach time initialization and setup.
2478 ioc->bfa = bfa; in bfa_nw_ioc_attach()
2479 ioc->cbfn = cbfn; in bfa_nw_ioc_attach()
2480 ioc->fcmode = false; in bfa_nw_ioc_attach()
2481 ioc->pllinit = false; in bfa_nw_ioc_attach()
2482 ioc->dbg_fwsave_once = true; in bfa_nw_ioc_attach()
2483 ioc->iocpf.ioc = ioc; in bfa_nw_ioc_attach()
2486 INIT_LIST_HEAD(&ioc->notify_q); in bfa_nw_ioc_attach()
2499 INIT_LIST_HEAD(&ioc->notify_q); in bfa_nw_ioc_detach()
2503 * bfa_nw_ioc_pci_init - Setup IOC PCI properties.
2513 ioc->clscode = clscode; in bfa_nw_ioc_pci_init()
2514 ioc->pcidev = *pcidev; in bfa_nw_ioc_pci_init()
2519 ioc->port0_mode = ioc->port1_mode = BFI_PORT_MODE_FC; in bfa_nw_ioc_pci_init()
2520 ioc->asic_mode = BFI_ASIC_MODE_FC; in bfa_nw_ioc_pci_init()
2522 switch (pcidev->device_id) { in bfa_nw_ioc_pci_init()
2524 ioc->asic_gen = BFI_ASIC_GEN_CT; in bfa_nw_ioc_pci_init()
2525 ioc->port0_mode = ioc->port1_mode = BFI_PORT_MODE_ETH; in bfa_nw_ioc_pci_init()
2526 ioc->asic_mode = BFI_ASIC_MODE_ETH; in bfa_nw_ioc_pci_init()
2527 ioc->port_mode = ioc->port_mode_cfg = BFA_MODE_CNA; in bfa_nw_ioc_pci_init()
2528 ioc->ad_cap_bm = BFA_CM_CNA; in bfa_nw_ioc_pci_init()
2532 ioc->asic_gen = BFI_ASIC_GEN_CT2; in bfa_nw_ioc_pci_init()
2534 pcidev->ssid == BFA_PCI_CT2_SSID_FC) { in bfa_nw_ioc_pci_init()
2535 ioc->asic_mode = BFI_ASIC_MODE_FC16; in bfa_nw_ioc_pci_init()
2536 ioc->fcmode = true; in bfa_nw_ioc_pci_init()
2537 ioc->port_mode = ioc->port_mode_cfg = BFA_MODE_HBA; in bfa_nw_ioc_pci_init()
2538 ioc->ad_cap_bm = BFA_CM_HBA; in bfa_nw_ioc_pci_init()
2540 ioc->port0_mode = ioc->port1_mode = BFI_PORT_MODE_ETH; in bfa_nw_ioc_pci_init()
2541 ioc->asic_mode = BFI_ASIC_MODE_ETH; in bfa_nw_ioc_pci_init()
2542 if (pcidev->ssid == BFA_PCI_CT2_SSID_FCoE) { in bfa_nw_ioc_pci_init()
2543 ioc->port_mode = in bfa_nw_ioc_pci_init()
2544 ioc->port_mode_cfg = BFA_MODE_CNA; in bfa_nw_ioc_pci_init()
2545 ioc->ad_cap_bm = BFA_CM_CNA; in bfa_nw_ioc_pci_init()
2547 ioc->port_mode = in bfa_nw_ioc_pci_init()
2548 ioc->port_mode_cfg = BFA_MODE_NIC; in bfa_nw_ioc_pci_init()
2549 ioc->ad_cap_bm = BFA_CM_NIC; in bfa_nw_ioc_pci_init()
2561 if (ioc->asic_gen == BFI_ASIC_GEN_CT) in bfa_nw_ioc_pci_init()
2564 WARN_ON(ioc->asic_gen != BFI_ASIC_GEN_CT2); in bfa_nw_ioc_pci_init()
2574 * bfa_nw_ioc_mem_claim - Initialize IOC dma memory
2586 ioc->attr_dma.kva = dm_kva; in bfa_nw_ioc_mem_claim()
2587 ioc->attr_dma.pa = dm_pa; in bfa_nw_ioc_mem_claim()
2588 ioc->attr = (struct bfi_ioc_attr *) dm_kva; in bfa_nw_ioc_mem_claim()
2602 ioc->dbg_fwsave_once = true; in bfa_nw_ioc_enable()
2618 ioc->dbg_fwsave = dbg_fwsave; in bfa_nw_ioc_debug_memclaim()
2619 ioc->dbg_fwsave_len = ioc->iocpf.auto_recover ? BNA_DBG_FWTRC_LEN : 0; in bfa_nw_ioc_debug_memclaim()
2625 return PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, fmaddr); in bfa_ioc_smem_pgnum()
2633 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; in bfa_nw_ioc_mbox_regisr()
2635 mod->mbhdlr[mc].cbfn = cbfn; in bfa_nw_ioc_mbox_regisr()
2636 mod->mbhdlr[mc].cbarg = cbarg; in bfa_nw_ioc_mbox_regisr()
2640 * bfa_nw_ioc_mbox_queue - Queue a mailbox command request to firmware.
2653 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; in bfa_nw_ioc_mbox_queue()
2656 cmd->cbfn = cbfn; in bfa_nw_ioc_mbox_queue()
2657 cmd->cbarg = cbarg; in bfa_nw_ioc_mbox_queue()
2662 if (!list_empty(&mod->cmd_q)) { in bfa_nw_ioc_mbox_queue()
2663 list_add_tail(&cmd->qe, &mod->cmd_q); in bfa_nw_ioc_mbox_queue()
2670 stat = readl(ioc->ioc_regs.hfn_mbox_cmd); in bfa_nw_ioc_mbox_queue()
2672 list_add_tail(&cmd->qe, &mod->cmd_q); in bfa_nw_ioc_mbox_queue()
2677 * mailbox is free -- queue command to firmware in bfa_nw_ioc_mbox_queue()
2679 bfa_ioc_mbox_send(ioc, cmd->msg, sizeof(cmd->msg)); in bfa_nw_ioc_mbox_queue()
2688 struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod; in bfa_nw_ioc_mbox_isr()
2702 if ((mc >= BFI_MC_MAX) || (mod->mbhdlr[mc].cbfn == NULL)) in bfa_nw_ioc_mbox_isr()
2705 mod->mbhdlr[mc].cbfn(mod->mbhdlr[mc].cbarg, &m); in bfa_nw_ioc_mbox_isr()
2720 bfa_ioc_stats_hb_count(ioc, ioc->hb_count); in bfa_nw_ioc_error_isr()
2746 list_add_tail(&notify->qe, &ioc->notify_q); in bfa_nw_ioc_notify_register()
2756 ioc_attr = ioc->attr; in bfa_ioc_get_adapter_attr()
2758 bfa_ioc_get_adapter_serial_num(ioc, ad_attr->serial_num); in bfa_ioc_get_adapter_attr()
2759 bfa_ioc_get_adapter_fw_ver(ioc, ad_attr->fw_ver); in bfa_ioc_get_adapter_attr()
2760 bfa_ioc_get_adapter_optrom_ver(ioc, ad_attr->optrom_ver); in bfa_ioc_get_adapter_attr()
2761 bfa_ioc_get_adapter_manufacturer(ioc, ad_attr->manufacturer); in bfa_ioc_get_adapter_attr()
2762 memcpy(&ad_attr->vpd, &ioc_attr->vpd, in bfa_ioc_get_adapter_attr()
2765 ad_attr->nports = bfa_ioc_get_nports(ioc); in bfa_ioc_get_adapter_attr()
2766 ad_attr->max_speed = bfa_ioc_speed_sup(ioc); in bfa_ioc_get_adapter_attr()
2768 bfa_ioc_get_adapter_model(ioc, ad_attr->model); in bfa_ioc_get_adapter_attr()
2770 bfa_ioc_get_adapter_model(ioc, ad_attr->model_descr); in bfa_ioc_get_adapter_attr()
2772 ad_attr->card_type = ioc_attr->card_type; in bfa_ioc_get_adapter_attr()
2773 ad_attr->is_mezz = bfa_mfg_is_mezz(ioc_attr->card_type); in bfa_ioc_get_adapter_attr()
2775 if (BFI_ADAPTER_IS_SPECIAL(ioc_attr->adapter_prop)) in bfa_ioc_get_adapter_attr()
2776 ad_attr->prototype = 1; in bfa_ioc_get_adapter_attr()
2778 ad_attr->prototype = 0; in bfa_ioc_get_adapter_attr()
2780 ad_attr->pwwn = bfa_ioc_get_pwwn(ioc); in bfa_ioc_get_adapter_attr()
2781 bfa_nw_ioc_get_mac(ioc, ad_attr->mac); in bfa_ioc_get_adapter_attr()
2783 ad_attr->pcie_gen = ioc_attr->pcie_gen; in bfa_ioc_get_adapter_attr()
2784 ad_attr->pcie_lanes = ioc_attr->pcie_lanes; in bfa_ioc_get_adapter_attr()
2785 ad_attr->pcie_lanes_orig = ioc_attr->pcie_lanes_orig; in bfa_ioc_get_adapter_attr()
2786 ad_attr->asic_rev = ioc_attr->asic_rev; in bfa_ioc_get_adapter_attr()
2788 bfa_ioc_get_pci_chip_rev(ioc, ad_attr->hw_ver); in bfa_ioc_get_adapter_attr()
2794 if (ioc->clscode == BFI_PCIFN_CLASS_ETH) in bfa_ioc_get_type()
2797 BUG_ON(!(ioc->clscode == BFI_PCIFN_CLASS_FC)); in bfa_ioc_get_type()
2799 return (ioc->attr->port_mode == BFI_PORT_MODE_FC) in bfa_ioc_get_type()
2807 (void *)ioc->attr->brcd_serialnum, in bfa_ioc_get_adapter_serial_num()
2814 memcpy(fw_ver, ioc->attr->fw_version, BFA_VERSION_LEN); in bfa_ioc_get_adapter_fw_ver()
2827 chip_rev[3] = '-'; in bfa_ioc_get_pci_chip_rev()
2828 chip_rev[4] = ioc->attr->asic_rev; in bfa_ioc_get_pci_chip_rev()
2835 memcpy(optrom_ver, ioc->attr->optrom_version, in bfa_ioc_get_adapter_optrom_ver()
2853 ioc_attr = ioc->attr; in bfa_ioc_get_adapter_model()
2855 snprintf(model, BFA_ADAPTER_MODEL_NAME_LEN, "%s-%u", in bfa_ioc_get_adapter_model()
2856 BFA_MFG_NAME, ioc_attr->card_type); in bfa_ioc_get_adapter_model()
2863 enum bfa_ioc_state ioc_st = bfa_sm_to_state(ioc_sm_table, ioc->fsm); in bfa_ioc_get_state()
2868 iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm); in bfa_ioc_get_state()
2903 ioc_attr->state = bfa_ioc_get_state(ioc); in bfa_nw_ioc_get_attr()
2904 ioc_attr->port_id = bfa_ioc_portid(ioc); in bfa_nw_ioc_get_attr()
2905 ioc_attr->port_mode = ioc->port_mode; in bfa_nw_ioc_get_attr()
2907 ioc_attr->port_mode_cfg = ioc->port_mode_cfg; in bfa_nw_ioc_get_attr()
2908 ioc_attr->cap_bm = ioc->ad_cap_bm; in bfa_nw_ioc_get_attr()
2910 ioc_attr->ioc_type = bfa_ioc_get_type(ioc); in bfa_nw_ioc_get_attr()
2912 bfa_ioc_get_adapter_attr(ioc, &ioc_attr->adapter_attr); in bfa_nw_ioc_get_attr()
2914 ioc_attr->pci_attr.device_id = bfa_ioc_devid(ioc); in bfa_nw_ioc_get_attr()
2915 ioc_attr->pci_attr.pcifn = bfa_ioc_pcifn(ioc); in bfa_nw_ioc_get_attr()
2916 ioc_attr->def_fn = bfa_ioc_is_default(ioc); in bfa_nw_ioc_get_attr()
2917 bfa_ioc_get_pci_chip_rev(ioc, ioc_attr->pci_attr.chip_rev); in bfa_nw_ioc_get_attr()
2924 return ioc->attr->pwwn; in bfa_ioc_get_pwwn()
2930 ether_addr_copy(mac, ioc->attr->mac); in bfa_nw_ioc_get_mac()
2939 bfa_ioc_stats_hb_count(ioc, ioc->hb_count); in bfa_ioc_recover()
2948 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_ENABLE); in bfa_iocpf_enable()
2954 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_DISABLE); in bfa_iocpf_disable()
2960 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FAIL); in bfa_iocpf_fail()
2966 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_INITFAIL); in bfa_iocpf_initfail()
2972 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_GETATTRFAIL); in bfa_iocpf_getattrfail()
2978 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_STOP); in bfa_iocpf_stop()
2986 iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm); in bfa_nw_iocpf_timeout()
2991 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_TIMEOUT); in bfa_nw_iocpf_timeout()
3006 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_FWREADY); in bfa_ioc_poll_fwinit()
3010 if (ioc->iocpf.poll_time >= BFA_IOC_TOV) { in bfa_ioc_poll_fwinit()
3011 bfa_fsm_send_event(&ioc->iocpf, IOCPF_E_TIMEOUT); in bfa_ioc_poll_fwinit()
3013 ioc->iocpf.poll_time += BFA_IOC_POLL_TOV; in bfa_ioc_poll_fwinit()
3014 mod_timer(&ioc->iocpf_timer, jiffies + in bfa_ioc_poll_fwinit()
3035 flash->op_busy = 0; in bfa_flash_cb()
3036 if (flash->cbfn) in bfa_flash_cb()
3037 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_cb()
3048 if (flash->op_busy) { in bfa_flash_notify()
3049 flash->status = BFA_STATUS_IOC_FAILURE; in bfa_flash_notify()
3050 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_notify()
3051 flash->op_busy = 0; in bfa_flash_notify()
3066 (struct bfi_flash_write_req *) flash->mb.msg; in bfa_flash_write_send()
3069 msg->type = be32_to_cpu(flash->type); in bfa_flash_write_send()
3070 msg->instance = flash->instance; in bfa_flash_write_send()
3071 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_write_send()
3072 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_write_send()
3073 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_write_send()
3074 msg->length = be32_to_cpu(len); in bfa_flash_write_send()
3077 msg->last = (len == flash->residue) ? 1 : 0; in bfa_flash_write_send()
3079 bfi_h2i_set(msg->mh, BFI_MC_FLASH, BFI_FLASH_H2I_WRITE_REQ, in bfa_flash_write_send()
3080 bfa_ioc_portid(flash->ioc)); in bfa_flash_write_send()
3081 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_write_send()
3082 memcpy(flash->dbuf_kva, flash->ubuf + flash->offset, len); in bfa_flash_write_send()
3083 bfa_nw_ioc_mbox_queue(flash->ioc, &flash->mb, NULL, NULL); in bfa_flash_write_send()
3085 flash->residue -= len; in bfa_flash_write_send()
3086 flash->offset += len; in bfa_flash_write_send()
3090 * bfa_flash_read_send - Send flash read request.
3099 (struct bfi_flash_read_req *) flash->mb.msg; in bfa_flash_read_send()
3102 msg->type = be32_to_cpu(flash->type); in bfa_flash_read_send()
3103 msg->instance = flash->instance; in bfa_flash_read_send()
3104 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_read_send()
3105 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_read_send()
3106 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_read_send()
3107 msg->length = be32_to_cpu(len); in bfa_flash_read_send()
3108 bfi_h2i_set(msg->mh, BFI_MC_FLASH, BFI_FLASH_H2I_READ_REQ, in bfa_flash_read_send()
3109 bfa_ioc_portid(flash->ioc)); in bfa_flash_read_send()
3110 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_read_send()
3111 bfa_nw_ioc_mbox_queue(flash->ioc, &flash->mb, NULL, NULL); in bfa_flash_read_send()
3115 * bfa_flash_intr - Process flash response messages upon receiving interrupts.
3136 if (!flash->op_busy && msg->mh.msg_id != BFI_FLASH_I2H_EVENT) in bfa_flash_intr()
3139 switch (msg->mh.msg_id) { in bfa_flash_intr()
3141 status = be32_to_cpu(m.query->status); in bfa_flash_intr()
3146 attr = (struct bfa_flash_attr *) flash->ubuf; in bfa_flash_intr()
3147 f = (struct bfa_flash_attr *) flash->dbuf_kva; in bfa_flash_intr()
3148 attr->status = be32_to_cpu(f->status); in bfa_flash_intr()
3149 attr->npart = be32_to_cpu(f->npart); in bfa_flash_intr()
3150 for (i = 0; i < attr->npart; i++) { in bfa_flash_intr()
3151 attr->part[i].part_type = in bfa_flash_intr()
3152 be32_to_cpu(f->part[i].part_type); in bfa_flash_intr()
3153 attr->part[i].part_instance = in bfa_flash_intr()
3154 be32_to_cpu(f->part[i].part_instance); in bfa_flash_intr()
3155 attr->part[i].part_off = in bfa_flash_intr()
3156 be32_to_cpu(f->part[i].part_off); in bfa_flash_intr()
3157 attr->part[i].part_size = in bfa_flash_intr()
3158 be32_to_cpu(f->part[i].part_size); in bfa_flash_intr()
3159 attr->part[i].part_len = in bfa_flash_intr()
3160 be32_to_cpu(f->part[i].part_len); in bfa_flash_intr()
3161 attr->part[i].part_status = in bfa_flash_intr()
3162 be32_to_cpu(f->part[i].part_status); in bfa_flash_intr()
3165 flash->status = status; in bfa_flash_intr()
3169 status = be32_to_cpu(m.write->status); in bfa_flash_intr()
3170 if (status != BFA_STATUS_OK || flash->residue == 0) { in bfa_flash_intr()
3171 flash->status = status; in bfa_flash_intr()
3177 status = be32_to_cpu(m.read->status); in bfa_flash_intr()
3179 flash->status = status; in bfa_flash_intr()
3182 u32 len = be32_to_cpu(m.read->length); in bfa_flash_intr()
3183 memcpy(flash->ubuf + flash->offset, in bfa_flash_intr()
3184 flash->dbuf_kva, len); in bfa_flash_intr()
3185 flash->residue -= len; in bfa_flash_intr()
3186 flash->offset += len; in bfa_flash_intr()
3187 if (flash->residue == 0) { in bfa_flash_intr()
3188 flash->status = status; in bfa_flash_intr()
3212 * bfa_nw_flash_attach - Flash attach API.
3221 flash->ioc = ioc; in bfa_nw_flash_attach()
3222 flash->cbfn = NULL; in bfa_nw_flash_attach()
3223 flash->cbarg = NULL; in bfa_nw_flash_attach()
3224 flash->op_busy = 0; in bfa_nw_flash_attach()
3226 bfa_nw_ioc_mbox_regisr(flash->ioc, BFI_MC_FLASH, bfa_flash_intr, flash); in bfa_nw_flash_attach()
3227 bfa_ioc_notify_init(&flash->ioc_notify, bfa_flash_notify, flash); in bfa_nw_flash_attach()
3228 list_add_tail(&flash->ioc_notify.qe, &flash->ioc->notify_q); in bfa_nw_flash_attach()
3232 * bfa_nw_flash_memclaim - Claim memory for flash
3241 flash->dbuf_kva = dm_kva; in bfa_nw_flash_memclaim()
3242 flash->dbuf_pa = dm_pa; in bfa_nw_flash_memclaim()
3243 memset(flash->dbuf_kva, 0, BFA_FLASH_DMA_BUF_SZ); in bfa_nw_flash_memclaim()
3249 * bfa_nw_flash_get_attr - Get flash attribute.
3263 (struct bfi_flash_query_req *) flash->mb.msg; in bfa_nw_flash_get_attr()
3265 if (!bfa_nw_ioc_is_operational(flash->ioc)) in bfa_nw_flash_get_attr()
3268 if (flash->op_busy) in bfa_nw_flash_get_attr()
3271 flash->op_busy = 1; in bfa_nw_flash_get_attr()
3272 flash->cbfn = cbfn; in bfa_nw_flash_get_attr()
3273 flash->cbarg = cbarg; in bfa_nw_flash_get_attr()
3274 flash->ubuf = (u8 *) attr; in bfa_nw_flash_get_attr()
3276 bfi_h2i_set(msg->mh, BFI_MC_FLASH, BFI_FLASH_H2I_QUERY_REQ, in bfa_nw_flash_get_attr()
3277 bfa_ioc_portid(flash->ioc)); in bfa_nw_flash_get_attr()
3278 bfa_alen_set(&msg->alen, sizeof(struct bfa_flash_attr), flash->dbuf_pa); in bfa_nw_flash_get_attr()
3279 bfa_nw_ioc_mbox_queue(flash->ioc, &flash->mb, NULL, NULL); in bfa_nw_flash_get_attr()
3285 * bfa_nw_flash_update_part - Update flash partition.
3303 if (!bfa_nw_ioc_is_operational(flash->ioc)) in bfa_nw_flash_update_part()
3307 * 'len' must be in word (4-byte) boundary in bfa_nw_flash_update_part()
3315 if (flash->op_busy) in bfa_nw_flash_update_part()
3318 flash->op_busy = 1; in bfa_nw_flash_update_part()
3319 flash->cbfn = cbfn; in bfa_nw_flash_update_part()
3320 flash->cbarg = cbarg; in bfa_nw_flash_update_part()
3321 flash->type = type; in bfa_nw_flash_update_part()
3322 flash->instance = instance; in bfa_nw_flash_update_part()
3323 flash->residue = len; in bfa_nw_flash_update_part()
3324 flash->offset = 0; in bfa_nw_flash_update_part()
3325 flash->addr_off = offset; in bfa_nw_flash_update_part()
3326 flash->ubuf = buf; in bfa_nw_flash_update_part()
3334 * bfa_nw_flash_read_part - Read flash partition.
3352 if (!bfa_nw_ioc_is_operational(flash->ioc)) in bfa_nw_flash_read_part()
3356 * 'len' must be in word (4-byte) boundary in bfa_nw_flash_read_part()
3361 if (flash->op_busy) in bfa_nw_flash_read_part()
3364 flash->op_busy = 1; in bfa_nw_flash_read_part()
3365 flash->cbfn = cbfn; in bfa_nw_flash_read_part()
3366 flash->cbarg = cbarg; in bfa_nw_flash_read_part()
3367 flash->type = type; in bfa_nw_flash_read_part()
3368 flash->instance = instance; in bfa_nw_flash_read_part()
3369 flash->residue = len; in bfa_nw_flash_read_part()
3370 flash->offset = 0; in bfa_nw_flash_read_part()
3371 flash->addr_off = offset; in bfa_nw_flash_read_part()
3372 flash->ubuf = buf; in bfa_nw_flash_read_part()