Lines Matching refs:bna

17 	if (ethport->bna->enet.type == BNA_ENET_T_REGULAR)  in ethport_can_be_up()
65 stats_src = (u64 *)&bna->stats.hw_stats_kva->_name ## _stats; \
66 stats_dst = (u64 *)&bna->stats.hw_stats._name ## _stats; \
119 ethport->link_cbfn(ethport->bna->bnad, BNA_LINK_DOWN); in bna_bfi_ethport_admin_rsp()
179 bna_bfi_stats_get_rsp(struct bna *bna, struct bfi_msgq_mhdr *msghdr) in bna_bfi_stats_get_rsp() argument
181 struct bfi_enet_stats_req *stats_req = &bna->stats_mod.stats_get; in bna_bfi_stats_get_rsp()
196 stats_src = (u64 *)&(bna->stats.hw_stats_kva->rxf_stats[0]); in bna_bfi_stats_get_rsp()
200 stats_dst = (u64 *)&(bna->stats.hw_stats.rxf_stats[i]); in bna_bfi_stats_get_rsp()
215 stats_dst = (u64 *)&(bna->stats.hw_stats.txf_stats[i]); in bna_bfi_stats_get_rsp()
228 bna->stats_mod.stats_get_busy = false; in bna_bfi_stats_get_rsp()
229 bnad_cb_stats_get(bna->bnad, BNA_CB_SUCCESS, &bna->stats); in bna_bfi_stats_get_rsp()
239 ethport->link_cbfn(ethport->bna->bnad, ethport->link_status); in bna_bfi_ethport_linkup_aen()
249 ethport->link_cbfn(ethport->bna->bnad, BNA_LINK_DOWN); in bna_bfi_ethport_linkdown_aen()
253 bna_err_handler(struct bna *bna, u32 intr_status) in bna_err_handler() argument
255 if (BNA_IS_HALT_INTR(bna, intr_status)) in bna_err_handler()
256 bna_halt_clear(bna); in bna_err_handler()
258 bfa_nw_ioc_error_isr(&bna->ioceth.ioc); in bna_err_handler()
262 bna_mbox_handler(struct bna *bna, u32 intr_status) in bna_mbox_handler() argument
264 if (BNA_IS_ERR_INTR(bna, intr_status)) { in bna_mbox_handler()
265 bna_err_handler(bna, intr_status); in bna_mbox_handler()
268 if (BNA_IS_MBOX_INTR(bna, intr_status)) in bna_mbox_handler()
269 bfa_nw_ioc_mbox_isr(&bna->ioceth.ioc); in bna_mbox_handler()
275 struct bna *bna = (struct bna *)arg; in bna_msgq_rsp_handler() local
281 bna_rx_from_rid(bna, msghdr->enet_id, rx); in bna_msgq_rsp_handler()
287 bna_rx_from_rid(bna, msghdr->enet_id, rx); in bna_msgq_rsp_handler()
304 bna_rx_from_rid(bna, msghdr->enet_id, rx); in bna_msgq_rsp_handler()
310 bna_rx_from_rid(bna, msghdr->enet_id, rx); in bna_msgq_rsp_handler()
316 bna_rx_from_rid(bna, msghdr->enet_id, rx); in bna_msgq_rsp_handler()
322 bna_tx_from_rid(bna, msghdr->enet_id, tx); in bna_msgq_rsp_handler()
328 bna_tx_from_rid(bna, msghdr->enet_id, tx); in bna_msgq_rsp_handler()
334 bna_bfi_ethport_admin_rsp(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
338 bna_bfi_ethport_lpbk_rsp(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
342 bna_bfi_pause_set_rsp(&bna->enet, msghdr); in bna_msgq_rsp_handler()
346 bna_bfi_attr_get_rsp(&bna->ioceth, msghdr); in bna_msgq_rsp_handler()
350 bna_bfi_stats_get_rsp(bna, msghdr); in bna_msgq_rsp_handler()
358 bna_bfi_ethport_linkup_aen(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
362 bna_bfi_ethport_linkdown_aen(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
366 bna_bfi_ethport_enable_aen(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
370 bna_bfi_ethport_disable_aen(&bna->ethport, msghdr); in bna_msgq_rsp_handler()
374 bna_bfi_bw_update_aen(&bna->tx_mod); in bna_msgq_rsp_handler()
390 cbfn(&(_ethport)->bna->enet); \
400 cbfn((ethport)->bna->bnad, status); \
418 bfa_msgq_cmd_post(&ethport->bna->msgq, &ethport->msgq_cmd); in bna_bfi_ethport_admin_up()
435 bfa_msgq_cmd_post(&ethport->bna->msgq, &ethport->msgq_cmd); in bna_bfi_ethport_admin_down()
448 lpbk_up_req->mode = (ethport->bna->enet.type == in bna_bfi_ethport_lpbk_up()
456 bfa_msgq_cmd_post(&ethport->bna->msgq, &ethport->msgq_cmd); in bna_bfi_ethport_lpbk_up()
473 bfa_msgq_cmd_post(&ethport->bna->msgq, &ethport->msgq_cmd); in bna_bfi_ethport_lpbk_down()
479 if (ethport->bna->enet.type == BNA_ENET_T_REGULAR) in bna_bfi_ethport_up()
488 if (ethport->bna->enet.type == BNA_ENET_T_REGULAR) in bna_bfi_ethport_down()
721 bna_ethport_init(struct bna_ethport *ethport, struct bna *bna) in bna_ethport_init() argument
724 ethport->bna = bna; in bna_ethport_init()
743 ethport->bna = NULL; in bna_ethport_uninit()
773 ethport->link_cbfn(ethport->bna->bnad, BNA_LINK_DOWN); in bna_ethport_fail()
817 bna_ethport_start(&(enet)->bna->ethport); \
818 bna_tx_mod_start(&(enet)->bna->tx_mod, tx_type); \
819 bna_rx_mod_start(&(enet)->bna->rx_mod, rx_type); \
832 bna_ethport_stop(&(enet)->bna->ethport); \
834 bna_tx_mod_stop(&(enet)->bna->tx_mod, tx_type); \
836 bna_rx_mod_stop(&(enet)->bna->rx_mod, rx_type); \
842 bna_ethport_fail(&(enet)->bna->ethport); \
843 bna_tx_mod_fail(&(enet)->bna->tx_mod); \
844 bna_rx_mod_fail(&(enet)->bna->rx_mod); \
852 bna_rx_mod_start(&(enet)->bna->rx_mod, rx_type); \
862 bna_rx_mod_stop(&(enet)->bna->rx_mod, rx_type); \
885 cbfn((enet)->bna->bnad); \
1171 bfa_msgq_cmd_post(&enet->bna->msgq, &enet->msgq_cmd); in bna_bfi_pause_set()
1183 bna_enet_init(struct bna_enet *enet, struct bna *bna) in bna_enet_init() argument
1185 enet->bna = bna; in bna_enet_init()
1203 enet->bna = NULL; in bna_enet_uninit()
1226 enet->stop_cbarg = &enet->bna->ioceth; in bna_enet_stop()
1274 (*cbfn)(enet->bna->bnad); in bna_enet_disable()
1279 enet->stop_cbarg = enet->bna->bnad; in bna_enet_disable()
1309 bfa_nw_ioc_get_mac(&enet->bna->ioceth.ioc, mac); in bna_enet_perm_mac_get()
1317 bna_intr_status_get((_ioceth)->bna, intr_status); \
1318 bnad_cb_mbox_intr_enable((_ioceth)->bna->bnad); \
1319 bna_mbox_intr_enable((_ioceth)->bna); \
1324 bna_mbox_intr_disable((_ioceth)->bna); \
1325 bnad_cb_mbox_intr_disable((_ioceth)->bna->bnad); \
1484 bna_enet_start(&ioceth->bna->enet); in bna_ioceth_sm_ready_entry()
1485 bna_stats_mod_start(&ioceth->bna->stats_mod); in bna_ioceth_sm_ready_entry()
1486 bnad_cb_ioceth_ready(ioceth->bna->bnad); in bna_ioceth_sm_ready_entry()
1499 bna_enet_fail(&ioceth->bna->enet); in bna_ioceth_sm_ready()
1500 bna_stats_mod_fail(&ioceth->bna->stats_mod); in bna_ioceth_sm_ready()
1538 bna_stats_mod_stop(&ioceth->bna->stats_mod); in bna_ioceth_sm_enet_stop_wait_entry()
1539 bna_enet_stop(&ioceth->bna->enet); in bna_ioceth_sm_enet_stop_wait_entry()
1550 bna_enet_fail(&ioceth->bna->enet); in bna_ioceth_sm_enet_stop_wait()
1551 bna_stats_mod_fail(&ioceth->bna->stats_mod); in bna_ioceth_sm_enet_stop_wait()
1593 bnad_cb_ioceth_failed(ioceth->bna->bnad); in bna_ioceth_sm_failed_entry()
1630 bfa_msgq_cmd_post(&ioceth->bna->msgq, &ioceth->msgq_cmd); in bna_bfi_attr_get()
1688 bna_ioceth_init(struct bna_ioceth *ioceth, struct bna *bna, in bna_ioceth_init() argument
1694 ioceth->bna = bna; in bna_ioceth_init()
1702 bfa_nw_ioc_pci_init(&ioceth->ioc, &bna->pcidev, BFI_PCIFN_CLASS_ETH); in bna_ioceth_init()
1719 bfa_nw_cee_attach(&bna->cee, &ioceth->ioc, bna); in bna_ioceth_init()
1720 bfa_nw_cee_mem_claim(&bna->cee, kva, dma); in bna_ioceth_init()
1724 bfa_nw_flash_attach(&bna->flash, &ioceth->ioc, bna); in bna_ioceth_init()
1725 bfa_nw_flash_memclaim(&bna->flash, kva, dma); in bna_ioceth_init()
1729 bfa_msgq_attach(&bna->msgq, &ioceth->ioc); in bna_ioceth_init()
1730 bfa_msgq_memclaim(&bna->msgq, kva, dma); in bna_ioceth_init()
1731 bfa_msgq_regisr(&bna->msgq, BFI_MC_ENET, bna_msgq_rsp_handler, bna); in bna_ioceth_init()
1748 ioceth->bna = NULL; in bna_ioceth_uninit()
1755 bnad_cb_ioceth_ready(ioceth->bna->bnad); in bna_ioceth_enable()
1767 bnad_cb_ioceth_disabled(ioceth->bna->bnad); in bna_ioceth_disable()
1772 ioceth->stop_cbarg = ioceth->bna->bnad; in bna_ioceth_disable()
1778 bna_ucam_mod_init(struct bna_ucam_mod *ucam_mod, struct bna *bna, in bna_ucam_mod_init() argument
1787 for (i = 0; i < bna->ioceth.attr.num_ucmac; i++) in bna_ucam_mod_init()
1792 for (; i < (bna->ioceth.attr.num_ucmac * 2); i++) in bna_ucam_mod_init()
1795 ucam_mod->bna = bna; in bna_ucam_mod_init()
1801 ucam_mod->bna = NULL; in bna_ucam_mod_uninit()
1805 bna_mcam_mod_init(struct bna_mcam_mod *mcam_mod, struct bna *bna, in bna_mcam_mod_init() argument
1814 for (i = 0; i < bna->ioceth.attr.num_mcmac; i++) in bna_mcam_mod_init()
1821 for (i = 0; i < bna->ioceth.attr.num_mcmac; i++) in bna_mcam_mod_init()
1827 for (; i < (bna->ioceth.attr.num_mcmac * 2); i++) in bna_mcam_mod_init()
1830 mcam_mod->bna = bna; in bna_mcam_mod_init()
1836 mcam_mod->bna = NULL; in bna_mcam_mod_uninit()
1840 bna_bfi_stats_get(struct bna *bna) in bna_bfi_stats_get() argument
1842 struct bfi_enet_stats_req *stats_req = &bna->stats_mod.stats_get; in bna_bfi_stats_get()
1844 bna->stats_mod.stats_get_busy = true; in bna_bfi_stats_get()
1851 stats_req->tx_enet_mask = htonl(bna->tx_mod.rid_mask); in bna_bfi_stats_get()
1852 stats_req->rx_enet_mask = htonl(bna->rx_mod.rid_mask); in bna_bfi_stats_get()
1853 stats_req->host_buffer.a32.addr_hi = bna->stats.hw_stats_dma.msb; in bna_bfi_stats_get()
1854 stats_req->host_buffer.a32.addr_lo = bna->stats.hw_stats_dma.lsb; in bna_bfi_stats_get()
1856 bfa_msgq_cmd_set(&bna->stats_mod.stats_get_cmd, NULL, NULL, in bna_bfi_stats_get()
1858 bfa_msgq_cmd_post(&bna->msgq, &bna->stats_mod.stats_get_cmd); in bna_bfi_stats_get()
1896 bna_mod_res_req(struct bna *bna, struct bna_res_info *res_info) in bna_mod_res_req() argument
1898 struct bna_attr *attr = &bna->ioceth.attr; in bna_mod_res_req()
1966 bna_init(struct bna *bna, struct bnad *bnad, in bna_init() argument
1969 bna->bnad = bnad; in bna_init()
1970 bna->pcidev = *pcidev; in bna_init()
1972 bna->stats.hw_stats_kva = (struct bfi_enet_stats *) in bna_init()
1974 bna->stats.hw_stats_dma.msb = in bna_init()
1976 bna->stats.hw_stats_dma.lsb = in bna_init()
1979 bna_reg_addr_init(bna, &bna->pcidev); in bna_init()
1982 bna_ioceth_init(&bna->ioceth, bna, res_info); in bna_init()
1984 bna_enet_init(&bna->enet, bna); in bna_init()
1985 bna_ethport_init(&bna->ethport, bna); in bna_init()
1989 bna_mod_init(struct bna *bna, struct bna_res_info *res_info) in bna_mod_init() argument
1991 bna_tx_mod_init(&bna->tx_mod, bna, res_info); in bna_mod_init()
1993 bna_rx_mod_init(&bna->rx_mod, bna, res_info); in bna_mod_init()
1995 bna_ucam_mod_init(&bna->ucam_mod, bna, res_info); in bna_mod_init()
1997 bna_mcam_mod_init(&bna->mcam_mod, bna, res_info); in bna_mod_init()
1999 bna->default_mode_rid = BFI_INVALID_RID; in bna_mod_init()
2000 bna->promisc_rid = BFI_INVALID_RID; in bna_mod_init()
2002 bna->mod_flags |= BNA_MOD_F_INIT_DONE; in bna_mod_init()
2006 bna_uninit(struct bna *bna) in bna_uninit() argument
2008 if (bna->mod_flags & BNA_MOD_F_INIT_DONE) { in bna_uninit()
2009 bna_mcam_mod_uninit(&bna->mcam_mod); in bna_uninit()
2010 bna_ucam_mod_uninit(&bna->ucam_mod); in bna_uninit()
2011 bna_rx_mod_uninit(&bna->rx_mod); in bna_uninit()
2012 bna_tx_mod_uninit(&bna->tx_mod); in bna_uninit()
2013 bna->mod_flags &= ~BNA_MOD_F_INIT_DONE; in bna_uninit()
2016 bna_stats_mod_uninit(&bna->stats_mod); in bna_uninit()
2017 bna_ethport_uninit(&bna->ethport); in bna_uninit()
2018 bna_enet_uninit(&bna->enet); in bna_uninit()
2020 bna_ioceth_uninit(&bna->ioceth); in bna_uninit()
2022 bna->bnad = NULL; in bna_uninit()
2026 bna_num_txq_set(struct bna *bna, int num_txq) in bna_num_txq_set() argument
2028 if (bna->ioceth.attr.fw_query_complete && in bna_num_txq_set()
2029 (num_txq <= bna->ioceth.attr.num_txq)) { in bna_num_txq_set()
2030 bna->ioceth.attr.num_txq = num_txq; in bna_num_txq_set()
2038 bna_num_rxp_set(struct bna *bna, int num_rxp) in bna_num_rxp_set() argument
2040 if (bna->ioceth.attr.fw_query_complete && in bna_num_rxp_set()
2041 (num_rxp <= bna->ioceth.attr.num_rxp)) { in bna_num_rxp_set()
2042 bna->ioceth.attr.num_rxp = num_rxp; in bna_num_rxp_set()
2082 bna_hw_stats_get(struct bna *bna) in bna_hw_stats_get() argument
2084 if (!bna->stats_mod.ioc_ready) { in bna_hw_stats_get()
2085 bnad_cb_stats_get(bna->bnad, BNA_CB_FAIL, &bna->stats); in bna_hw_stats_get()
2088 if (bna->stats_mod.stats_get_busy) { in bna_hw_stats_get()
2089 bnad_cb_stats_get(bna->bnad, BNA_CB_BUSY, &bna->stats); in bna_hw_stats_get()
2093 bna_bfi_stats_get(bna); in bna_hw_stats_get()