Lines Matching refs:softc

200 static int bnxt_probe_phy(struct bnxt_softc *softc);
201 static void bnxt_add_media_types(struct bnxt_softc *softc);
202 static int bnxt_pci_mapping(struct bnxt_softc *softc);
203 static void bnxt_pci_mapping_free(struct bnxt_softc *softc);
204 static int bnxt_update_link(struct bnxt_softc *softc, bool chng_link_state);
207 static void bnxt_clear_ids(struct bnxt_softc *softc);
212 static void bnxt_handle_async_event(struct bnxt_softc *softc,
214 static uint8_t get_phy_type(struct bnxt_softc *softc);
216 static void bnxt_get_wol_settings(struct bnxt_softc *softc);
350 struct bnxt_softc *softc; in bnxt_tx_queues_alloc() local
354 softc = iflib_get_softc(ctx); in bnxt_tx_queues_alloc()
356 softc->tx_cp_rings = malloc(sizeof(struct bnxt_cp_ring) * ntxqsets, in bnxt_tx_queues_alloc()
358 if (!softc->tx_cp_rings) { in bnxt_tx_queues_alloc()
364 softc->tx_rings = malloc(sizeof(struct bnxt_ring) * ntxqsets, in bnxt_tx_queues_alloc()
366 if (!softc->tx_rings) { in bnxt_tx_queues_alloc()
373 &softc->tx_stats, 0); in bnxt_tx_queues_alloc()
376 bus_dmamap_sync(softc->tx_stats.idi_tag, softc->tx_stats.idi_map, in bnxt_tx_queues_alloc()
381 softc->tx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_tx_queues_alloc()
382 softc->tx_cp_rings[i].ring.phys_id = in bnxt_tx_queues_alloc()
384 softc->tx_cp_rings[i].ring.softc = softc; in bnxt_tx_queues_alloc()
385 softc->tx_cp_rings[i].ring.id = in bnxt_tx_queues_alloc()
386 (softc->scctx->isc_nrxqsets * 2) + 1 + i; in bnxt_tx_queues_alloc()
387 softc->tx_cp_rings[i].ring.doorbell = in bnxt_tx_queues_alloc()
388 softc->tx_cp_rings[i].ring.id * 0x80; in bnxt_tx_queues_alloc()
389 softc->tx_cp_rings[i].ring.ring_size = in bnxt_tx_queues_alloc()
390 softc->scctx->isc_ntxd[0]; in bnxt_tx_queues_alloc()
391 softc->tx_cp_rings[i].ring.vaddr = vaddrs[i * ntxqs]; in bnxt_tx_queues_alloc()
392 softc->tx_cp_rings[i].ring.paddr = paddrs[i * ntxqs]; in bnxt_tx_queues_alloc()
395 softc->tx_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_tx_queues_alloc()
396 softc->tx_rings[i].softc = softc; in bnxt_tx_queues_alloc()
397 softc->tx_rings[i].id = in bnxt_tx_queues_alloc()
398 (softc->scctx->isc_nrxqsets * 2) + 1 + i; in bnxt_tx_queues_alloc()
399 softc->tx_rings[i].doorbell = softc->tx_rings[i].id * 0x80; in bnxt_tx_queues_alloc()
400 softc->tx_rings[i].ring_size = softc->scctx->isc_ntxd[1]; in bnxt_tx_queues_alloc()
401 softc->tx_rings[i].vaddr = vaddrs[i * ntxqs + 1]; in bnxt_tx_queues_alloc()
402 softc->tx_rings[i].paddr = paddrs[i * ntxqs + 1]; in bnxt_tx_queues_alloc()
404 bnxt_create_tx_sysctls(softc, i); in bnxt_tx_queues_alloc()
407 softc->ntxqsets = ntxqsets; in bnxt_tx_queues_alloc()
411 free(softc->tx_rings, M_DEVBUF); in bnxt_tx_queues_alloc()
413 free(softc->tx_cp_rings, M_DEVBUF); in bnxt_tx_queues_alloc()
421 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_queues_free() local
424 iflib_dma_free(&softc->tx_stats); in bnxt_queues_free()
425 free(softc->tx_rings, M_DEVBUF); in bnxt_queues_free()
426 softc->tx_rings = NULL; in bnxt_queues_free()
427 free(softc->tx_cp_rings, M_DEVBUF); in bnxt_queues_free()
428 softc->tx_cp_rings = NULL; in bnxt_queues_free()
429 softc->ntxqsets = 0; in bnxt_queues_free()
432 iflib_dma_free(&softc->rx_stats); in bnxt_queues_free()
433 iflib_dma_free(&softc->hw_tx_port_stats); in bnxt_queues_free()
434 iflib_dma_free(&softc->hw_rx_port_stats); in bnxt_queues_free()
435 free(softc->grp_info, M_DEVBUF); in bnxt_queues_free()
436 free(softc->ag_rings, M_DEVBUF); in bnxt_queues_free()
437 free(softc->rx_rings, M_DEVBUF); in bnxt_queues_free()
438 free(softc->rx_cp_rings, M_DEVBUF); in bnxt_queues_free()
445 struct bnxt_softc *softc; in bnxt_rx_queues_alloc() local
449 softc = iflib_get_softc(ctx); in bnxt_rx_queues_alloc()
451 softc->rx_cp_rings = malloc(sizeof(struct bnxt_cp_ring) * nrxqsets, in bnxt_rx_queues_alloc()
453 if (!softc->rx_cp_rings) { in bnxt_rx_queues_alloc()
459 softc->rx_rings = malloc(sizeof(struct bnxt_ring) * nrxqsets, in bnxt_rx_queues_alloc()
461 if (!softc->rx_rings) { in bnxt_rx_queues_alloc()
467 softc->ag_rings = malloc(sizeof(struct bnxt_ring) * nrxqsets, in bnxt_rx_queues_alloc()
469 if (!softc->ag_rings) { in bnxt_rx_queues_alloc()
475 softc->grp_info = malloc(sizeof(struct bnxt_grp_info) * nrxqsets, in bnxt_rx_queues_alloc()
477 if (!softc->grp_info) { in bnxt_rx_queues_alloc()
485 &softc->rx_stats, 0); in bnxt_rx_queues_alloc()
488 bus_dmamap_sync(softc->rx_stats.idi_tag, softc->rx_stats.idi_map, in bnxt_rx_queues_alloc()
499 &softc->hw_rx_port_stats, 0); in bnxt_rx_queues_alloc()
503 bus_dmamap_sync(softc->hw_rx_port_stats.idi_tag, in bnxt_rx_queues_alloc()
504 softc->hw_rx_port_stats.idi_map, BUS_DMASYNC_PREREAD); in bnxt_rx_queues_alloc()
507 &softc->hw_tx_port_stats, 0); in bnxt_rx_queues_alloc()
512 bus_dmamap_sync(softc->hw_tx_port_stats.idi_tag, in bnxt_rx_queues_alloc()
513 softc->hw_tx_port_stats.idi_map, BUS_DMASYNC_PREREAD); in bnxt_rx_queues_alloc()
515 softc->rx_port_stats = (void *) softc->hw_rx_port_stats.idi_vaddr; in bnxt_rx_queues_alloc()
516 softc->tx_port_stats = (void *) softc->hw_tx_port_stats.idi_vaddr; in bnxt_rx_queues_alloc()
520 softc->rx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
521 softc->rx_cp_rings[i].ring.phys_id = in bnxt_rx_queues_alloc()
523 softc->rx_cp_rings[i].ring.softc = softc; in bnxt_rx_queues_alloc()
524 softc->rx_cp_rings[i].ring.id = i + 1; in bnxt_rx_queues_alloc()
525 softc->rx_cp_rings[i].ring.doorbell = in bnxt_rx_queues_alloc()
526 softc->rx_cp_rings[i].ring.id * 0x80; in bnxt_rx_queues_alloc()
530 softc->rx_cp_rings[i].ring.ring_size = in bnxt_rx_queues_alloc()
531 softc->scctx->isc_nrxd[0]; in bnxt_rx_queues_alloc()
532 softc->rx_cp_rings[i].ring.vaddr = vaddrs[i * nrxqs]; in bnxt_rx_queues_alloc()
533 softc->rx_cp_rings[i].ring.paddr = paddrs[i * nrxqs]; in bnxt_rx_queues_alloc()
536 softc->rx_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
537 softc->rx_rings[i].softc = softc; in bnxt_rx_queues_alloc()
538 softc->rx_rings[i].id = i + 1; in bnxt_rx_queues_alloc()
539 softc->rx_rings[i].doorbell = softc->rx_rings[i].id * 0x80; in bnxt_rx_queues_alloc()
540 softc->rx_rings[i].ring_size = softc->scctx->isc_nrxd[1]; in bnxt_rx_queues_alloc()
541 softc->rx_rings[i].vaddr = vaddrs[i * nrxqs + 1]; in bnxt_rx_queues_alloc()
542 softc->rx_rings[i].paddr = paddrs[i * nrxqs + 1]; in bnxt_rx_queues_alloc()
545 softc->rx_rings[i].tpa_start = malloc(sizeof(struct bnxt_full_tpa_start) * in bnxt_rx_queues_alloc()
548 if (softc->rx_rings[i].tpa_start == NULL) { in bnxt_rx_queues_alloc()
550 device_printf(softc->dev, in bnxt_rx_queues_alloc()
556 softc->ag_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
557 softc->ag_rings[i].softc = softc; in bnxt_rx_queues_alloc()
558 softc->ag_rings[i].id = nrxqsets + i + 1; in bnxt_rx_queues_alloc()
559 softc->ag_rings[i].doorbell = softc->ag_rings[i].id * 0x80; in bnxt_rx_queues_alloc()
560 softc->ag_rings[i].ring_size = softc->scctx->isc_nrxd[2]; in bnxt_rx_queues_alloc()
561 softc->ag_rings[i].vaddr = vaddrs[i * nrxqs + 2]; in bnxt_rx_queues_alloc()
562 softc->ag_rings[i].paddr = paddrs[i * nrxqs + 2]; in bnxt_rx_queues_alloc()
565 softc->grp_info[i].grp_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
566 softc->grp_info[i].stats_ctx = in bnxt_rx_queues_alloc()
567 softc->rx_cp_rings[i].stats_ctx_id; in bnxt_rx_queues_alloc()
568 softc->grp_info[i].rx_ring_id = softc->rx_rings[i].phys_id; in bnxt_rx_queues_alloc()
569 softc->grp_info[i].ag_ring_id = softc->ag_rings[i].phys_id; in bnxt_rx_queues_alloc()
570 softc->grp_info[i].cp_ring_id = in bnxt_rx_queues_alloc()
571 softc->rx_cp_rings[i].ring.phys_id; in bnxt_rx_queues_alloc()
573 bnxt_create_rx_sysctls(softc, i); in bnxt_rx_queues_alloc()
580 if (BNXT_PF(softc)) in bnxt_rx_queues_alloc()
581 bnxt_create_port_stats_sysctls(softc); in bnxt_rx_queues_alloc()
584 softc->vnic_info.id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
585 softc->vnic_info.flow_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
586 softc->vnic_info.filter_id = -1; in bnxt_rx_queues_alloc()
587 softc->vnic_info.def_ring_grp = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
588 softc->vnic_info.cos_rule = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
589 softc->vnic_info.lb_rule = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
590 softc->vnic_info.rx_mask = HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST; in bnxt_rx_queues_alloc()
591 softc->vnic_info.mc_list_count = 0; in bnxt_rx_queues_alloc()
592 softc->vnic_info.flags = BNXT_VNIC_FLAG_DEFAULT; in bnxt_rx_queues_alloc()
594 &softc->vnic_info.mc_list, 0); in bnxt_rx_queues_alloc()
600 &softc->vnic_info.rss_hash_key_tbl, 0); in bnxt_rx_queues_alloc()
603 bus_dmamap_sync(softc->vnic_info.rss_hash_key_tbl.idi_tag, in bnxt_rx_queues_alloc()
604 softc->vnic_info.rss_hash_key_tbl.idi_map, in bnxt_rx_queues_alloc()
606 memcpy(softc->vnic_info.rss_hash_key_tbl.idi_vaddr, in bnxt_rx_queues_alloc()
607 softc->vnic_info.rss_hash_key, HW_HASH_KEY_SIZE); in bnxt_rx_queues_alloc()
611 &softc->vnic_info.rss_grp_tbl, 0); in bnxt_rx_queues_alloc()
614 bus_dmamap_sync(softc->vnic_info.rss_grp_tbl.idi_tag, in bnxt_rx_queues_alloc()
615 softc->vnic_info.rss_grp_tbl.idi_map, in bnxt_rx_queues_alloc()
617 memset(softc->vnic_info.rss_grp_tbl.idi_vaddr, 0xff, in bnxt_rx_queues_alloc()
618 softc->vnic_info.rss_grp_tbl.idi_size); in bnxt_rx_queues_alloc()
620 softc->nrxqsets = nrxqsets; in bnxt_rx_queues_alloc()
624 iflib_dma_free(&softc->vnic_info.rss_hash_key_tbl); in bnxt_rx_queues_alloc()
626 iflib_dma_free(&softc->vnic_info.mc_list); in bnxt_rx_queues_alloc()
630 free(softc->rx_rings[i].tpa_start, M_DEVBUF); in bnxt_rx_queues_alloc()
631 iflib_dma_free(&softc->hw_tx_port_stats); in bnxt_rx_queues_alloc()
633 iflib_dma_free(&softc->hw_rx_port_stats); in bnxt_rx_queues_alloc()
635 iflib_dma_free(&softc->rx_stats); in bnxt_rx_queues_alloc()
637 free(softc->grp_info, M_DEVBUF); in bnxt_rx_queues_alloc()
639 free(softc->ag_rings, M_DEVBUF); in bnxt_rx_queues_alloc()
641 free(softc->rx_rings, M_DEVBUF); in bnxt_rx_queues_alloc()
643 free(softc->rx_cp_rings, M_DEVBUF); in bnxt_rx_queues_alloc()
648 static void bnxt_free_hwrm_short_cmd_req(struct bnxt_softc *softc) in bnxt_free_hwrm_short_cmd_req() argument
650 if (softc->hwrm_short_cmd_req_addr.idi_vaddr) in bnxt_free_hwrm_short_cmd_req()
651 iflib_dma_free(&softc->hwrm_short_cmd_req_addr); in bnxt_free_hwrm_short_cmd_req()
652 softc->hwrm_short_cmd_req_addr.idi_vaddr = NULL; in bnxt_free_hwrm_short_cmd_req()
655 static int bnxt_alloc_hwrm_short_cmd_req(struct bnxt_softc *softc) in bnxt_alloc_hwrm_short_cmd_req() argument
659 rc = iflib_dma_alloc(softc->ctx, softc->hwrm_max_req_len, in bnxt_alloc_hwrm_short_cmd_req()
660 &softc->hwrm_short_cmd_req_addr, BUS_DMA_NOWAIT); in bnxt_alloc_hwrm_short_cmd_req()
669 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_attach_pre() local
673 softc->ctx = ctx; in bnxt_attach_pre()
674 softc->dev = iflib_get_dev(ctx); in bnxt_attach_pre()
675 softc->media = iflib_get_media(ctx); in bnxt_attach_pre()
676 softc->scctx = iflib_get_softc_ctx(ctx); in bnxt_attach_pre()
677 softc->sctx = iflib_get_sctx(ctx); in bnxt_attach_pre()
678 scctx = softc->scctx; in bnxt_attach_pre()
681 switch (pci_get_device(softc->dev)) { in bnxt_attach_pre()
692 softc->flags |= BNXT_FLAG_NPAR; in bnxt_attach_pre()
700 softc->flags |= BNXT_FLAG_VF; in bnxt_attach_pre()
704 pci_enable_busmaster(softc->dev); in bnxt_attach_pre()
706 if (bnxt_pci_mapping(softc)) in bnxt_attach_pre()
710 BNXT_HWRM_LOCK_INIT(softc, device_get_nameunit(softc->dev)); in bnxt_attach_pre()
711 rc = bnxt_alloc_hwrm_dma_mem(softc); in bnxt_attach_pre()
717 softc->ver_info = malloc(sizeof(struct bnxt_ver_info), in bnxt_attach_pre()
719 if (softc->ver_info == NULL) { in bnxt_attach_pre()
721 device_printf(softc->dev, in bnxt_attach_pre()
726 softc->ver_info->hwrm_min_major = 1; in bnxt_attach_pre()
727 softc->ver_info->hwrm_min_minor = 2; in bnxt_attach_pre()
728 softc->ver_info->hwrm_min_update = 2; in bnxt_attach_pre()
730 rc = bnxt_hwrm_ver_get(softc); in bnxt_attach_pre()
732 device_printf(softc->dev, "attach: hwrm ver get failed\n"); in bnxt_attach_pre()
736 if (softc->flags & BNXT_FLAG_SHORT_CMD) { in bnxt_attach_pre()
737 rc = bnxt_alloc_hwrm_short_cmd_req(softc); in bnxt_attach_pre()
743 if (BNXT_PF(softc)) { in bnxt_attach_pre()
744 softc->nvm_info = malloc(sizeof(struct bnxt_nvram_info), in bnxt_attach_pre()
746 if (softc->nvm_info == NULL) { in bnxt_attach_pre()
748 device_printf(softc->dev, in bnxt_attach_pre()
753 rc = bnxt_hwrm_nvm_get_dev_info(softc, &softc->nvm_info->mfg_id, in bnxt_attach_pre()
754 &softc->nvm_info->device_id, &softc->nvm_info->sector_size, in bnxt_attach_pre()
755 &softc->nvm_info->size, &softc->nvm_info->reserved_size, in bnxt_attach_pre()
756 &softc->nvm_info->available_size); in bnxt_attach_pre()
760 rc = bnxt_hwrm_func_drv_rgtr(softc); in bnxt_attach_pre()
762 device_printf(softc->dev, "attach: hwrm drv rgtr failed\n"); in bnxt_attach_pre()
766 rc = bnxt_hwrm_func_rgtr_async_events(softc, NULL, 0); in bnxt_attach_pre()
768 device_printf(softc->dev, "attach: hwrm rgtr async evts failed\n"); in bnxt_attach_pre()
773 rc = bnxt_hwrm_func_qcaps(softc); in bnxt_attach_pre()
778 rc = bnxt_hwrm_func_qcfg(softc); in bnxt_attach_pre()
780 device_printf(softc->dev, "attach: hwrm func qcfg failed\n"); in bnxt_attach_pre()
784 iflib_set_mac(ctx, softc->func.mac_addr); in bnxt_attach_pre()
800 if (bnxt_wol_supported(softc)) in bnxt_attach_pre()
804 rc = bnxt_hwrm_queue_qportcfg(softc); in bnxt_attach_pre()
806 device_printf(softc->dev, "attach: hwrm qportcfg failed\n"); in bnxt_attach_pre()
810 bnxt_get_wol_settings(softc); in bnxt_attach_pre()
813 rc = bnxt_hwrm_func_reset(softc); in bnxt_attach_pre()
814 bnxt_clear_ids(softc); in bnxt_attach_pre()
823 scctx->isc_vectors = softc->func.max_cp_rings; in bnxt_attach_pre()
829 device_printf(softc->dev, in bnxt_attach_pre()
833 device_printf(softc->dev, in bnxt_attach_pre()
845 scctx->isc_nrxqsets_max = min(pci_msix_count(softc->dev)-1, in bnxt_attach_pre()
846 softc->fn_qcfg.alloc_completion_rings - 1); in bnxt_attach_pre()
848 softc->fn_qcfg.alloc_rx_rings); in bnxt_attach_pre()
850 softc->fn_qcfg.alloc_vnics); in bnxt_attach_pre()
851 scctx->isc_ntxqsets_max = min(softc->fn_qcfg.alloc_tx_rings, in bnxt_attach_pre()
852 softc->fn_qcfg.alloc_completion_rings - scctx->isc_nrxqsets_max - 1); in bnxt_attach_pre()
858 scctx->isc_msix_bar = pci_msix_table_bar(softc->dev); in bnxt_attach_pre()
865 softc->hw_lro.enable = 0; in bnxt_attach_pre()
866 softc->hw_lro.is_mode_gro = 0; in bnxt_attach_pre()
867 softc->hw_lro.max_agg_segs = 5; /* 2^5 = 32 segs */ in bnxt_attach_pre()
868 softc->hw_lro.max_aggs = HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX; in bnxt_attach_pre()
869 softc->hw_lro.min_agg_len = 512; in bnxt_attach_pre()
872 softc->def_cp_ring.stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_attach_pre()
873 softc->def_cp_ring.ring.phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_attach_pre()
874 softc->def_cp_ring.ring.softc = softc; in bnxt_attach_pre()
875 softc->def_cp_ring.ring.id = 0; in bnxt_attach_pre()
876 softc->def_cp_ring.ring.doorbell = softc->def_cp_ring.ring.id * 0x80; in bnxt_attach_pre()
877 softc->def_cp_ring.ring.ring_size = PAGE_SIZE / in bnxt_attach_pre()
880 sizeof(struct cmpl_base) * softc->def_cp_ring.ring.ring_size, in bnxt_attach_pre()
881 &softc->def_cp_ring_mem, 0); in bnxt_attach_pre()
882 softc->def_cp_ring.ring.vaddr = softc->def_cp_ring_mem.idi_vaddr; in bnxt_attach_pre()
883 softc->def_cp_ring.ring.paddr = softc->def_cp_ring_mem.idi_paddr; in bnxt_attach_pre()
884 iflib_config_gtask_init(ctx, &softc->def_cp_task, bnxt_def_cp_task, in bnxt_attach_pre()
887 rc = bnxt_init_sysctl_ctx(softc); in bnxt_attach_pre()
890 if (BNXT_PF(softc)) { in bnxt_attach_pre()
891 rc = bnxt_create_nvram_sysctls(softc->nvm_info); in bnxt_attach_pre()
896 arc4rand(softc->vnic_info.rss_hash_key, HW_HASH_KEY_SIZE, 0); in bnxt_attach_pre()
897 softc->vnic_info.rss_hash_type = in bnxt_attach_pre()
904 rc = bnxt_create_config_sysctls_pre(softc); in bnxt_attach_pre()
908 rc = bnxt_create_hw_lro_sysctls(softc); in bnxt_attach_pre()
912 rc = bnxt_create_pause_fc_sysctls(softc); in bnxt_attach_pre()
917 SLIST_INIT(&softc->vnic_info.vlan_tags); in bnxt_attach_pre()
918 softc->vnic_info.vlan_tag_list.idi_vaddr = NULL; in bnxt_attach_pre()
923 bnxt_free_sysctl_ctx(softc); in bnxt_attach_pre()
925 bnxt_hwrm_func_drv_unrgtr(softc, false); in bnxt_attach_pre()
927 if (BNXT_PF(softc)) in bnxt_attach_pre()
928 free(softc->nvm_info, M_DEVBUF); in bnxt_attach_pre()
930 bnxt_free_hwrm_short_cmd_req(softc); in bnxt_attach_pre()
933 free(softc->ver_info, M_DEVBUF); in bnxt_attach_pre()
935 bnxt_free_hwrm_dma_mem(softc); in bnxt_attach_pre()
937 BNXT_HWRM_LOCK_DESTROY(softc); in bnxt_attach_pre()
938 bnxt_pci_mapping_free(softc); in bnxt_attach_pre()
939 pci_disable_busmaster(softc->dev); in bnxt_attach_pre()
946 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_attach_post() local
950 bnxt_create_config_sysctls_post(softc); in bnxt_attach_post()
953 rc = bnxt_probe_phy(softc); in bnxt_attach_post()
958 bnxt_create_ver_sysctls(softc); in bnxt_attach_post()
959 bnxt_add_media_types(softc); in bnxt_attach_post()
960 ifmedia_set(softc->media, IFM_ETHER | IFM_AUTO); in bnxt_attach_post()
962 softc->scctx->isc_max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + in bnxt_attach_post()
972 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_detach() local
978 bnxt_do_disable_intr(&softc->def_cp_ring); in bnxt_detach()
979 bnxt_free_sysctl_ctx(softc); in bnxt_detach()
980 bnxt_hwrm_func_reset(softc); in bnxt_detach()
981 bnxt_clear_ids(softc); in bnxt_detach()
982 iflib_irq_free(ctx, &softc->def_cp_ring.irq); in bnxt_detach()
983 iflib_config_gtask_deinit(&softc->def_cp_task); in bnxt_detach()
985 for (i = softc->nrxqsets-1; i>=0; i--) { in bnxt_detach()
986 iflib_irq_free(ctx, &softc->rx_cp_rings[i].irq); in bnxt_detach()
988 iflib_dma_free(&softc->vnic_info.mc_list); in bnxt_detach()
989 iflib_dma_free(&softc->vnic_info.rss_hash_key_tbl); in bnxt_detach()
990 iflib_dma_free(&softc->vnic_info.rss_grp_tbl); in bnxt_detach()
991 if (softc->vnic_info.vlan_tag_list.idi_vaddr) in bnxt_detach()
992 iflib_dma_free(&softc->vnic_info.vlan_tag_list); in bnxt_detach()
993 SLIST_FOREACH_SAFE(tag, &softc->vnic_info.vlan_tags, next, tmp) in bnxt_detach()
995 iflib_dma_free(&softc->def_cp_ring_mem); in bnxt_detach()
996 for (i = 0; i < softc->nrxqsets; i++) in bnxt_detach()
997 free(softc->rx_rings[i].tpa_start, M_DEVBUF); in bnxt_detach()
998 free(softc->ver_info, M_DEVBUF); in bnxt_detach()
999 if (BNXT_PF(softc)) in bnxt_detach()
1000 free(softc->nvm_info, M_DEVBUF); in bnxt_detach()
1002 bnxt_hwrm_func_drv_unrgtr(softc, false); in bnxt_detach()
1003 bnxt_free_hwrm_dma_mem(softc); in bnxt_detach()
1004 bnxt_free_hwrm_short_cmd_req(softc); in bnxt_detach()
1005 BNXT_HWRM_LOCK_DESTROY(softc); in bnxt_detach()
1007 pci_disable_busmaster(softc->dev); in bnxt_detach()
1008 bnxt_pci_mapping_free(softc); in bnxt_detach()
1017 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_init() local
1022 rc = bnxt_hwrm_func_reset(softc); in bnxt_init()
1025 bnxt_clear_ids(softc); in bnxt_init()
1028 softc->def_cp_ring.cons = UINT32_MAX; in bnxt_init()
1029 softc->def_cp_ring.v_bit = 1; in bnxt_init()
1030 bnxt_mark_cpr_invalid(&softc->def_cp_ring); in bnxt_init()
1031 rc = bnxt_hwrm_ring_alloc(softc, in bnxt_init()
1033 &softc->def_cp_ring.ring, in bnxt_init()
1040 rc = bnxt_cfg_async_cr(softc); in bnxt_init()
1044 for (i = 0; i < softc->nrxqsets; i++) { in bnxt_init()
1046 rc = bnxt_hwrm_stat_ctx_alloc(softc, &softc->rx_cp_rings[i], in bnxt_init()
1047 softc->rx_stats.idi_paddr + in bnxt_init()
1053 softc->rx_cp_rings[i].cons = UINT32_MAX; in bnxt_init()
1054 softc->rx_cp_rings[i].v_bit = 1; in bnxt_init()
1055 softc->rx_cp_rings[i].last_idx = UINT32_MAX; in bnxt_init()
1056 bnxt_mark_cpr_invalid(&softc->rx_cp_rings[i]); in bnxt_init()
1057 rc = bnxt_hwrm_ring_alloc(softc, in bnxt_init()
1059 &softc->rx_cp_rings[i].ring, (uint16_t)HWRM_NA_SIGNATURE, in bnxt_init()
1065 rc = bnxt_hwrm_ring_alloc(softc, in bnxt_init()
1067 &softc->rx_rings[i], (uint16_t)HWRM_NA_SIGNATURE, in bnxt_init()
1071 BNXT_RX_DB(&softc->rx_rings[i], 0); in bnxt_init()
1073 BNXT_RX_DB(&softc->rx_rings[i], 0); in bnxt_init()
1076 rc = bnxt_hwrm_ring_alloc(softc, in bnxt_init()
1078 &softc->ag_rings[i], (uint16_t)HWRM_NA_SIGNATURE, in bnxt_init()
1082 BNXT_RX_DB(&softc->rx_rings[i], 0); in bnxt_init()
1084 BNXT_RX_DB(&softc->ag_rings[i], 0); in bnxt_init()
1087 softc->grp_info[i].stats_ctx = in bnxt_init()
1088 softc->rx_cp_rings[i].stats_ctx_id; in bnxt_init()
1089 softc->grp_info[i].rx_ring_id = softc->rx_rings[i].phys_id; in bnxt_init()
1090 softc->grp_info[i].ag_ring_id = softc->ag_rings[i].phys_id; in bnxt_init()
1091 softc->grp_info[i].cp_ring_id = in bnxt_init()
1092 softc->rx_cp_rings[i].ring.phys_id; in bnxt_init()
1093 rc = bnxt_hwrm_ring_grp_alloc(softc, &softc->grp_info[i]); in bnxt_init()
1100 rc = bnxt_hwrm_vnic_ctx_alloc(softc, &softc->vnic_info.rss_id); in bnxt_init()
1105 softc->vnic_info.def_ring_grp = softc->grp_info[0].grp_id; in bnxt_init()
1106 softc->vnic_info.mru = softc->scctx->isc_max_frame_size; in bnxt_init()
1107 rc = bnxt_hwrm_vnic_alloc(softc, &softc->vnic_info); in bnxt_init()
1110 rc = bnxt_hwrm_vnic_cfg(softc, &softc->vnic_info); in bnxt_init()
1113 rc = bnxt_hwrm_set_filter(softc, &softc->vnic_info); in bnxt_init()
1120 softc->vnic_info.rss_grp_tbl.idi_vaddr)[i] = in bnxt_init()
1121 htole16(softc->grp_info[j].grp_id); in bnxt_init()
1122 if (++j == softc->nrxqsets) in bnxt_init()
1126 rc = bnxt_hwrm_rss_cfg(softc, &softc->vnic_info, in bnxt_init()
1127 softc->vnic_info.rss_hash_type); in bnxt_init()
1131 rc = bnxt_hwrm_vnic_tpa_cfg(softc); in bnxt_init()
1135 for (i = 0; i < softc->ntxqsets; i++) { in bnxt_init()
1137 rc = bnxt_hwrm_stat_ctx_alloc(softc, &softc->tx_cp_rings[i], in bnxt_init()
1138 softc->tx_stats.idi_paddr + in bnxt_init()
1144 softc->tx_cp_rings[i].cons = UINT32_MAX; in bnxt_init()
1145 softc->tx_cp_rings[i].v_bit = 1; in bnxt_init()
1146 bnxt_mark_cpr_invalid(&softc->tx_cp_rings[i]); in bnxt_init()
1147 rc = bnxt_hwrm_ring_alloc(softc, in bnxt_init()
1149 &softc->tx_cp_rings[i].ring, (uint16_t)HWRM_NA_SIGNATURE, in bnxt_init()
1155 rc = bnxt_hwrm_ring_alloc(softc, in bnxt_init()
1157 &softc->tx_rings[i], softc->tx_cp_rings[i].ring.phys_id, in bnxt_init()
1158 softc->tx_cp_rings[i].stats_ctx_id, false); in bnxt_init()
1161 BNXT_TX_DB(&softc->tx_rings[i], 0); in bnxt_init()
1163 BNXT_TX_DB(&softc->tx_rings[i], 0); in bnxt_init()
1166 bnxt_do_enable_intr(&softc->def_cp_ring); in bnxt_init()
1167 bnxt_media_status(softc->ctx, &ifmr); in bnxt_init()
1168 bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info); in bnxt_init()
1172 bnxt_hwrm_func_reset(softc); in bnxt_init()
1173 bnxt_clear_ids(softc); in bnxt_init()
1180 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_stop() local
1182 bnxt_do_disable_intr(&softc->def_cp_ring); in bnxt_stop()
1183 bnxt_hwrm_func_reset(softc); in bnxt_stop()
1184 bnxt_clear_ids(softc); in bnxt_stop()
1191 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_multi_set() local
1199 softc->vnic_info.rx_mask |= in bnxt_multi_set()
1201 bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info); in bnxt_multi_set()
1204 softc->vnic_info.rx_mask &= in bnxt_multi_set()
1206 mta = softc->vnic_info.mc_list.idi_vaddr; in bnxt_multi_set()
1207 bzero(mta, softc->vnic_info.mc_list.idi_size); in bnxt_multi_set()
1209 bus_dmamap_sync(softc->vnic_info.mc_list.idi_tag, in bnxt_multi_set()
1210 softc->vnic_info.mc_list.idi_map, BUS_DMASYNC_PREWRITE); in bnxt_multi_set()
1211 softc->vnic_info.mc_list_count = cnt; in bnxt_multi_set()
1212 softc->vnic_info.rx_mask |= in bnxt_multi_set()
1214 if (bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info)) in bnxt_multi_set()
1215 device_printf(softc->dev, in bnxt_multi_set()
1223 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_mtu_set() local
1228 softc->scctx->isc_max_frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; in bnxt_mtu_set()
1235 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_media_status() local
1236 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_media_status()
1242 bnxt_update_link(softc, true); in bnxt_media_status()
1274 bnxt_report_link(softc); in bnxt_media_status()
1281 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_media_change() local
1291 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1292 softc->link_info.req_link_speed = in bnxt_media_change()
1298 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1299 softc->link_info.req_link_speed = in bnxt_media_change()
1304 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1305 softc->link_info.req_link_speed = in bnxt_media_change()
1313 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1314 softc->link_info.req_link_speed = in bnxt_media_change()
1318 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1319 softc->link_info.req_link_speed = in bnxt_media_change()
1325 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1326 softc->link_info.req_link_speed = in bnxt_media_change()
1333 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1334 softc->link_info.req_link_speed = in bnxt_media_change()
1339 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1340 softc->link_info.req_link_speed = in bnxt_media_change()
1347 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1348 softc->link_info.req_link_speed = in bnxt_media_change()
1352 device_printf(softc->dev, in bnxt_media_change()
1357 softc->link_info.autoneg |= BNXT_AUTONEG_SPEED; in bnxt_media_change()
1360 rc = bnxt_hwrm_set_link_setting(softc, true, true, true); in bnxt_media_change()
1361 bnxt_media_status(softc->ctx, &ifmr); in bnxt_media_change()
1368 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_promisc_set() local
1374 softc->vnic_info.rx_mask |= in bnxt_promisc_set()
1377 softc->vnic_info.rx_mask &= in bnxt_promisc_set()
1381 softc->vnic_info.rx_mask |= in bnxt_promisc_set()
1385 softc->vnic_info.rx_mask &= in bnxt_promisc_set()
1389 rc = bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info); in bnxt_promisc_set()
1408 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_update_admin_status() local
1414 if (BNXT_PF(softc)) { in bnxt_update_admin_status()
1415 bnxt_hwrm_port_qstats(softc); in bnxt_update_admin_status()
1425 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_if_timer() local
1429 if (ticks_now - softc->admin_ticks >= hz) { in bnxt_if_timer()
1430 softc->admin_ticks = ticks_now; in bnxt_if_timer()
1460 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_intr_enable() local
1463 bnxt_do_enable_intr(&softc->def_cp_ring); in bnxt_intr_enable()
1464 for (i = 0; i < softc->nrxqsets; i++) in bnxt_intr_enable()
1465 bnxt_do_enable_intr(&softc->rx_cp_rings[i]); in bnxt_intr_enable()
1474 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_tx_queue_intr_enable() local
1476 bnxt_do_enable_intr(&softc->tx_cp_rings[qid]); in bnxt_tx_queue_intr_enable()
1483 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_rx_queue_intr_enable() local
1485 bnxt_do_enable_intr(&softc->rx_cp_rings[qid]); in bnxt_rx_queue_intr_enable()
1493 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_disable_intr() local
1500 for (i = 0; i < softc->ntxqsets; i++) in bnxt_disable_intr()
1501 bnxt_do_disable_intr(&softc->tx_cp_rings[i]); in bnxt_disable_intr()
1502 for (i = 0; i < softc->nrxqsets; i++) in bnxt_disable_intr()
1503 bnxt_do_disable_intr(&softc->rx_cp_rings[i]); in bnxt_disable_intr()
1511 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_msix_intr_assign() local
1516 rc = iflib_irq_alloc_generic(ctx, &softc->def_cp_ring.irq, in bnxt_msix_intr_assign()
1517 softc->def_cp_ring.ring.id + 1, IFLIB_INTR_ADMIN, in bnxt_msix_intr_assign()
1518 bnxt_handle_def_cp, softc, 0, "def_cp"); in bnxt_msix_intr_assign()
1525 for (i=0; i<softc->scctx->isc_nrxqsets; i++) { in bnxt_msix_intr_assign()
1527 rc = iflib_irq_alloc_generic(ctx, &softc->rx_cp_rings[i].irq, in bnxt_msix_intr_assign()
1528 softc->rx_cp_rings[i].ring.id + 1, IFLIB_INTR_RX, in bnxt_msix_intr_assign()
1529 bnxt_handle_rx_cp, &softc->rx_cp_rings[i], i, irq_name); in bnxt_msix_intr_assign()
1538 for (i=0; i<softc->scctx->isc_ntxqsets; i++) in bnxt_msix_intr_assign()
1545 iflib_irq_free(ctx, &softc->rx_cp_rings[i].irq); in bnxt_msix_intr_assign()
1546 iflib_irq_free(ctx, &softc->def_cp_ring.irq); in bnxt_msix_intr_assign()
1557 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_vlan_register() local
1565 SLIST_INSERT_HEAD(&softc->vnic_info.vlan_tags, new_tag, next); in bnxt_vlan_register()
1571 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_vlan_unregister() local
1574 SLIST_FOREACH(vlan_tag, &softc->vnic_info.vlan_tags, next) { in bnxt_vlan_unregister()
1576 SLIST_REMOVE(&softc->vnic_info.vlan_tags, vlan_tag, in bnxt_vlan_unregister()
1587 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_wol_config() local
1590 if (!softc) in bnxt_wol_config()
1593 if (!bnxt_wol_supported(softc)) in bnxt_wol_config()
1597 if (!softc->wol) { in bnxt_wol_config()
1598 if (bnxt_hwrm_alloc_wol_fltr(softc)) in bnxt_wol_config()
1600 softc->wol = 1; in bnxt_wol_config()
1603 if (softc->wol) { in bnxt_wol_config()
1604 if (bnxt_hwrm_free_wol_fltr(softc)) in bnxt_wol_config()
1606 softc->wol = 0; in bnxt_wol_config()
1630 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_resume() local
1632 bnxt_get_wol_settings(softc); in bnxt_resume()
1639 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_priv_ioctl() local
1665 rc = bnxt_hwrm_nvm_find_dir_entry(softc, find->type, in bnxt_priv_ioctl()
1694 rc = iflib_dma_alloc(softc->ctx, in bnxt_priv_ioctl()
1701 rc = bnxt_hwrm_nvm_read(softc, rd->index, in bnxt_priv_ioctl()
1728 rc = bnxt_hwrm_fw_reset(softc, rst->processor, in bnxt_priv_ioctl()
1748 rc = bnxt_hwrm_fw_qstatus(softc, qstat->processor, in bnxt_priv_ioctl()
1768 rc = bnxt_hwrm_nvm_write(softc, wr->data, true, in bnxt_priv_ioctl()
1790 rc = bnxt_hwrm_nvm_erase_dir_entry(softc, erase->index); in bnxt_priv_ioctl()
1809 rc = bnxt_hwrm_nvm_get_dir_info(softc, &info->entries, in bnxt_priv_ioctl()
1830 rc = iflib_dma_alloc(softc->ctx, get->max_size, in bnxt_priv_ioctl()
1834 rc = bnxt_hwrm_nvm_get_dir_entries(softc, &get->entries, in bnxt_priv_ioctl()
1857 rc = bnxt_hwrm_nvm_verify_update(softc, vrfy->type, in bnxt_priv_ioctl()
1877 rc = bnxt_hwrm_nvm_install_update(softc, in bnxt_priv_ioctl()
1898 rc = bnxt_hwrm_nvm_modify(softc, mod->index, in bnxt_priv_ioctl()
1918 rc = bnxt_hwrm_fw_get_time(softc, &gtm->year, in bnxt_priv_ioctl()
1939 rc = bnxt_hwrm_fw_set_time(softc, stm->year, in bnxt_priv_ioctl()
1969 bnxt_probe_phy(struct bnxt_softc *softc) in bnxt_probe_phy() argument
1971 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_probe_phy()
1974 rc = bnxt_update_link(softc, false); in bnxt_probe_phy()
1976 device_printf(softc->dev, in bnxt_probe_phy()
1994 bnxt_add_media_types(struct bnxt_softc *softc) in bnxt_add_media_types() argument
1996 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_add_media_types()
1998 uint8_t phy_type = get_phy_type(softc); in bnxt_add_media_types()
2003 ifmedia_add(softc->media, IFM_ETHER | IFM_AUTO, 0, NULL); in bnxt_add_media_types()
2005 if (softc->flags & BNXT_FLAG_NPAR) in bnxt_add_media_types()
2091 device_printf(softc->dev, "Unknown phy type\n"); in bnxt_add_media_types()
2096 device_printf(softc->dev, "phy type %d not supported by driver\n", phy_type); in bnxt_add_media_types()
2104 bnxt_map_bar(struct bnxt_softc *softc, struct bnxt_bar_info *bar, int bar_num, bool shareable) in bnxt_map_bar() argument
2109 device_printf(softc->dev, "Bar %d already mapped\n", bar_num); in bnxt_map_bar()
2119 bus_alloc_resource_any(softc->dev, in bnxt_map_bar()
2123 device_printf(softc->dev, in bnxt_map_bar()
2135 bnxt_pci_mapping(struct bnxt_softc *softc) in bnxt_pci_mapping() argument
2139 rc = bnxt_map_bar(softc, &softc->hwrm_bar, 0, true); in bnxt_pci_mapping()
2143 rc = bnxt_map_bar(softc, &softc->doorbell_bar, 2, false); in bnxt_pci_mapping()
2149 bnxt_pci_mapping_free(struct bnxt_softc *softc) in bnxt_pci_mapping_free() argument
2151 if (softc->hwrm_bar.res != NULL) in bnxt_pci_mapping_free()
2152 bus_release_resource(softc->dev, SYS_RES_MEMORY, in bnxt_pci_mapping_free()
2153 softc->hwrm_bar.rid, softc->hwrm_bar.res); in bnxt_pci_mapping_free()
2154 softc->hwrm_bar.res = NULL; in bnxt_pci_mapping_free()
2156 if (softc->doorbell_bar.res != NULL) in bnxt_pci_mapping_free()
2157 bus_release_resource(softc->dev, SYS_RES_MEMORY, in bnxt_pci_mapping_free()
2158 softc->doorbell_bar.rid, softc->doorbell_bar.res); in bnxt_pci_mapping_free()
2159 softc->doorbell_bar.res = NULL; in bnxt_pci_mapping_free()
2163 bnxt_update_link(struct bnxt_softc *softc, bool chng_link_state) in bnxt_update_link() argument
2165 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_update_link()
2169 rc = bnxt_hwrm_port_phy_qcfg(softc); in bnxt_update_link()
2181 bnxt_report_link(softc); in bnxt_update_link()
2192 bnxt_report_link(struct bnxt_softc *softc) in bnxt_report_link() argument
2194 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_report_link()
2219 iflib_link_state_change(softc->ctx, LINK_STATE_UP, in bnxt_report_link()
2221 device_printf(softc->dev, "Link is UP %s, %s - %d Mbps \n", duplex, in bnxt_report_link()
2224 iflib_link_state_change(softc->ctx, LINK_STATE_DOWN, in bnxt_report_link()
2225 bnxt_get_baudrate(&softc->link_info)); in bnxt_report_link()
2226 device_printf(softc->dev, "Link is Down\n"); in bnxt_report_link()
2235 ifmedia_removeall(softc->media); in bnxt_report_link()
2236 bnxt_add_media_types(softc); in bnxt_report_link()
2237 ifmedia_set(softc->media, IFM_ETHER | IFM_AUTO); in bnxt_report_link()
2253 struct bnxt_softc *softc = arg; in bnxt_handle_def_cp() local
2255 BNXT_CP_DISABLE_DB(&softc->def_cp_ring.ring); in bnxt_handle_def_cp()
2256 GROUPTASK_ENQUEUE(&softc->def_cp_task); in bnxt_handle_def_cp()
2261 bnxt_clear_ids(struct bnxt_softc *softc) in bnxt_clear_ids() argument
2265 softc->def_cp_ring.stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2266 softc->def_cp_ring.ring.phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2267 for (i = 0; i < softc->ntxqsets; i++) { in bnxt_clear_ids()
2268 softc->tx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2269 softc->tx_cp_rings[i].ring.phys_id = in bnxt_clear_ids()
2271 softc->tx_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2273 for (i = 0; i < softc->nrxqsets; i++) { in bnxt_clear_ids()
2274 softc->rx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2275 softc->rx_cp_rings[i].ring.phys_id = in bnxt_clear_ids()
2277 softc->rx_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2278 softc->ag_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2279 softc->grp_info[i].grp_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2281 softc->vnic_info.filter_id = -1; in bnxt_clear_ids()
2282 softc->vnic_info.id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2283 softc->vnic_info.rss_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2284 memset(softc->vnic_info.rss_grp_tbl.idi_vaddr, 0xff, in bnxt_clear_ids()
2285 softc->vnic_info.rss_grp_tbl.idi_size); in bnxt_clear_ids()
2299 bnxt_handle_async_event(struct bnxt_softc *softc, struct cmpl_base *cmpl) in bnxt_handle_async_event() argument
2309 bnxt_media_status(softc->ctx, &ifmr); in bnxt_handle_async_event()
2324 device_printf(softc->dev, in bnxt_handle_async_event()
2328 device_printf(softc->dev, in bnxt_handle_async_event()
2338 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_def_cp_task() local
2339 struct bnxt_cp_ring *cpr = &softc->def_cp_ring; in bnxt_def_cp_task()
2361 bnxt_handle_async_event(softc, cmpl); in bnxt_def_cp_task()
2377 device_printf(softc->dev, in bnxt_def_cp_task()
2381 device_printf(softc->dev, in bnxt_def_cp_task()
2393 get_phy_type(struct bnxt_softc *softc) in get_phy_type() argument
2395 struct bnxt_link_info *link_info = &softc->link_info; in get_phy_type()
2424 bnxt_check_hwrm_version(struct bnxt_softc *softc) in bnxt_check_hwrm_version() argument
2428 sprintf(buf, "%hhu.%hhu.%hhu", softc->ver_info->hwrm_min_major, in bnxt_check_hwrm_version()
2429 softc->ver_info->hwrm_min_minor, softc->ver_info->hwrm_min_update); in bnxt_check_hwrm_version()
2430 if (softc->ver_info->hwrm_min_major > softc->ver_info->hwrm_if_major) { in bnxt_check_hwrm_version()
2431 device_printf(softc->dev, in bnxt_check_hwrm_version()
2433 softc->ver_info->hwrm_if_ver, buf); in bnxt_check_hwrm_version()
2436 else if(softc->ver_info->hwrm_min_major == in bnxt_check_hwrm_version()
2437 softc->ver_info->hwrm_if_major) { in bnxt_check_hwrm_version()
2438 if (softc->ver_info->hwrm_min_minor > in bnxt_check_hwrm_version()
2439 softc->ver_info->hwrm_if_minor) { in bnxt_check_hwrm_version()
2440 device_printf(softc->dev, in bnxt_check_hwrm_version()
2442 softc->ver_info->hwrm_if_ver, buf); in bnxt_check_hwrm_version()
2445 else if (softc->ver_info->hwrm_min_minor == in bnxt_check_hwrm_version()
2446 softc->ver_info->hwrm_if_minor) { in bnxt_check_hwrm_version()
2447 if (softc->ver_info->hwrm_min_update > in bnxt_check_hwrm_version()
2448 softc->ver_info->hwrm_if_update) { in bnxt_check_hwrm_version()
2449 device_printf(softc->dev, in bnxt_check_hwrm_version()
2451 softc->ver_info->hwrm_if_ver, buf); in bnxt_check_hwrm_version()
2490 bnxt_get_wol_settings(struct bnxt_softc *softc) in bnxt_get_wol_settings() argument
2494 if (!bnxt_wol_supported(softc)) in bnxt_get_wol_settings()
2498 wol_handle = bnxt_hwrm_get_wol_fltrs(softc, wol_handle); in bnxt_get_wol_settings()