Lines Matching refs:softc
201 static int bnxt_probe_phy(struct bnxt_softc *softc);
202 static void bnxt_add_media_types(struct bnxt_softc *softc);
203 static int bnxt_pci_mapping(struct bnxt_softc *softc);
204 static void bnxt_pci_mapping_free(struct bnxt_softc *softc);
205 static int bnxt_update_link(struct bnxt_softc *softc, bool chng_link_state);
208 static void bnxt_clear_ids(struct bnxt_softc *softc);
213 static void bnxt_handle_async_event(struct bnxt_softc *softc,
215 static uint8_t get_phy_type(struct bnxt_softc *softc);
217 static void bnxt_get_wol_settings(struct bnxt_softc *softc);
349 struct bnxt_softc *softc; in bnxt_tx_queues_alloc() local
353 softc = iflib_get_softc(ctx); in bnxt_tx_queues_alloc()
355 softc->tx_cp_rings = malloc(sizeof(struct bnxt_cp_ring) * ntxqsets, in bnxt_tx_queues_alloc()
357 if (!softc->tx_cp_rings) { in bnxt_tx_queues_alloc()
363 softc->tx_rings = malloc(sizeof(struct bnxt_ring) * ntxqsets, in bnxt_tx_queues_alloc()
365 if (!softc->tx_rings) { in bnxt_tx_queues_alloc()
372 &softc->tx_stats, 0); in bnxt_tx_queues_alloc()
375 bus_dmamap_sync(softc->tx_stats.idi_tag, softc->tx_stats.idi_map, in bnxt_tx_queues_alloc()
380 softc->tx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_tx_queues_alloc()
381 softc->tx_cp_rings[i].ring.phys_id = in bnxt_tx_queues_alloc()
383 softc->tx_cp_rings[i].ring.softc = softc; in bnxt_tx_queues_alloc()
384 softc->tx_cp_rings[i].ring.id = in bnxt_tx_queues_alloc()
385 (softc->scctx->isc_nrxqsets * 2) + 1 + i; in bnxt_tx_queues_alloc()
386 softc->tx_cp_rings[i].ring.doorbell = in bnxt_tx_queues_alloc()
387 softc->tx_cp_rings[i].ring.id * 0x80; in bnxt_tx_queues_alloc()
388 softc->tx_cp_rings[i].ring.ring_size = in bnxt_tx_queues_alloc()
389 softc->scctx->isc_ntxd[0]; in bnxt_tx_queues_alloc()
390 softc->tx_cp_rings[i].ring.vaddr = vaddrs[i * ntxqs]; in bnxt_tx_queues_alloc()
391 softc->tx_cp_rings[i].ring.paddr = paddrs[i * ntxqs]; in bnxt_tx_queues_alloc()
394 softc->tx_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_tx_queues_alloc()
395 softc->tx_rings[i].softc = softc; in bnxt_tx_queues_alloc()
396 softc->tx_rings[i].id = in bnxt_tx_queues_alloc()
397 (softc->scctx->isc_nrxqsets * 2) + 1 + i; in bnxt_tx_queues_alloc()
398 softc->tx_rings[i].doorbell = softc->tx_rings[i].id * 0x80; in bnxt_tx_queues_alloc()
399 softc->tx_rings[i].ring_size = softc->scctx->isc_ntxd[1]; in bnxt_tx_queues_alloc()
400 softc->tx_rings[i].vaddr = vaddrs[i * ntxqs + 1]; in bnxt_tx_queues_alloc()
401 softc->tx_rings[i].paddr = paddrs[i * ntxqs + 1]; in bnxt_tx_queues_alloc()
403 bnxt_create_tx_sysctls(softc, i); in bnxt_tx_queues_alloc()
406 softc->ntxqsets = ntxqsets; in bnxt_tx_queues_alloc()
410 free(softc->tx_rings, M_DEVBUF); in bnxt_tx_queues_alloc()
412 free(softc->tx_cp_rings, M_DEVBUF); in bnxt_tx_queues_alloc()
420 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_queues_free() local
423 iflib_dma_free(&softc->tx_stats); in bnxt_queues_free()
424 free(softc->tx_rings, M_DEVBUF); in bnxt_queues_free()
425 softc->tx_rings = NULL; in bnxt_queues_free()
426 free(softc->tx_cp_rings, M_DEVBUF); in bnxt_queues_free()
427 softc->tx_cp_rings = NULL; in bnxt_queues_free()
428 softc->ntxqsets = 0; in bnxt_queues_free()
431 iflib_dma_free(&softc->rx_stats); in bnxt_queues_free()
432 iflib_dma_free(&softc->hw_tx_port_stats); in bnxt_queues_free()
433 iflib_dma_free(&softc->hw_rx_port_stats); in bnxt_queues_free()
434 free(softc->grp_info, M_DEVBUF); in bnxt_queues_free()
435 free(softc->ag_rings, M_DEVBUF); in bnxt_queues_free()
436 free(softc->rx_rings, M_DEVBUF); in bnxt_queues_free()
437 free(softc->rx_cp_rings, M_DEVBUF); in bnxt_queues_free()
444 struct bnxt_softc *softc; in bnxt_rx_queues_alloc() local
448 softc = iflib_get_softc(ctx); in bnxt_rx_queues_alloc()
450 softc->rx_cp_rings = malloc(sizeof(struct bnxt_cp_ring) * nrxqsets, in bnxt_rx_queues_alloc()
452 if (!softc->rx_cp_rings) { in bnxt_rx_queues_alloc()
458 softc->rx_rings = malloc(sizeof(struct bnxt_ring) * nrxqsets, in bnxt_rx_queues_alloc()
460 if (!softc->rx_rings) { in bnxt_rx_queues_alloc()
466 softc->ag_rings = malloc(sizeof(struct bnxt_ring) * nrxqsets, in bnxt_rx_queues_alloc()
468 if (!softc->ag_rings) { in bnxt_rx_queues_alloc()
474 softc->grp_info = malloc(sizeof(struct bnxt_grp_info) * nrxqsets, in bnxt_rx_queues_alloc()
476 if (!softc->grp_info) { in bnxt_rx_queues_alloc()
484 &softc->rx_stats, 0); in bnxt_rx_queues_alloc()
487 bus_dmamap_sync(softc->rx_stats.idi_tag, softc->rx_stats.idi_map, in bnxt_rx_queues_alloc()
498 &softc->hw_rx_port_stats, 0); in bnxt_rx_queues_alloc()
502 bus_dmamap_sync(softc->hw_rx_port_stats.idi_tag, in bnxt_rx_queues_alloc()
503 softc->hw_rx_port_stats.idi_map, BUS_DMASYNC_PREREAD); in bnxt_rx_queues_alloc()
506 &softc->hw_tx_port_stats, 0); in bnxt_rx_queues_alloc()
511 bus_dmamap_sync(softc->hw_tx_port_stats.idi_tag, in bnxt_rx_queues_alloc()
512 softc->hw_tx_port_stats.idi_map, BUS_DMASYNC_PREREAD); in bnxt_rx_queues_alloc()
514 softc->rx_port_stats = (void *) softc->hw_rx_port_stats.idi_vaddr; in bnxt_rx_queues_alloc()
515 softc->tx_port_stats = (void *) softc->hw_tx_port_stats.idi_vaddr; in bnxt_rx_queues_alloc()
519 softc->rx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
520 softc->rx_cp_rings[i].ring.phys_id = in bnxt_rx_queues_alloc()
522 softc->rx_cp_rings[i].ring.softc = softc; in bnxt_rx_queues_alloc()
523 softc->rx_cp_rings[i].ring.id = i + 1; in bnxt_rx_queues_alloc()
524 softc->rx_cp_rings[i].ring.doorbell = in bnxt_rx_queues_alloc()
525 softc->rx_cp_rings[i].ring.id * 0x80; in bnxt_rx_queues_alloc()
529 softc->rx_cp_rings[i].ring.ring_size = in bnxt_rx_queues_alloc()
530 softc->scctx->isc_nrxd[0]; in bnxt_rx_queues_alloc()
531 softc->rx_cp_rings[i].ring.vaddr = vaddrs[i * nrxqs]; in bnxt_rx_queues_alloc()
532 softc->rx_cp_rings[i].ring.paddr = paddrs[i * nrxqs]; in bnxt_rx_queues_alloc()
535 softc->rx_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
536 softc->rx_rings[i].softc = softc; in bnxt_rx_queues_alloc()
537 softc->rx_rings[i].id = i + 1; in bnxt_rx_queues_alloc()
538 softc->rx_rings[i].doorbell = softc->rx_rings[i].id * 0x80; in bnxt_rx_queues_alloc()
539 softc->rx_rings[i].ring_size = softc->scctx->isc_nrxd[1]; in bnxt_rx_queues_alloc()
540 softc->rx_rings[i].vaddr = vaddrs[i * nrxqs + 1]; in bnxt_rx_queues_alloc()
541 softc->rx_rings[i].paddr = paddrs[i * nrxqs + 1]; in bnxt_rx_queues_alloc()
544 softc->rx_rings[i].tpa_start = malloc(sizeof(struct bnxt_full_tpa_start) * in bnxt_rx_queues_alloc()
547 if (softc->rx_rings[i].tpa_start == NULL) { in bnxt_rx_queues_alloc()
549 device_printf(softc->dev, in bnxt_rx_queues_alloc()
555 softc->ag_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
556 softc->ag_rings[i].softc = softc; in bnxt_rx_queues_alloc()
557 softc->ag_rings[i].id = nrxqsets + i + 1; in bnxt_rx_queues_alloc()
558 softc->ag_rings[i].doorbell = softc->ag_rings[i].id * 0x80; in bnxt_rx_queues_alloc()
559 softc->ag_rings[i].ring_size = softc->scctx->isc_nrxd[2]; in bnxt_rx_queues_alloc()
560 softc->ag_rings[i].vaddr = vaddrs[i * nrxqs + 2]; in bnxt_rx_queues_alloc()
561 softc->ag_rings[i].paddr = paddrs[i * nrxqs + 2]; in bnxt_rx_queues_alloc()
564 softc->grp_info[i].grp_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
565 softc->grp_info[i].stats_ctx = in bnxt_rx_queues_alloc()
566 softc->rx_cp_rings[i].stats_ctx_id; in bnxt_rx_queues_alloc()
567 softc->grp_info[i].rx_ring_id = softc->rx_rings[i].phys_id; in bnxt_rx_queues_alloc()
568 softc->grp_info[i].ag_ring_id = softc->ag_rings[i].phys_id; in bnxt_rx_queues_alloc()
569 softc->grp_info[i].cp_ring_id = in bnxt_rx_queues_alloc()
570 softc->rx_cp_rings[i].ring.phys_id; in bnxt_rx_queues_alloc()
572 bnxt_create_rx_sysctls(softc, i); in bnxt_rx_queues_alloc()
579 if (BNXT_PF(softc)) in bnxt_rx_queues_alloc()
580 bnxt_create_port_stats_sysctls(softc); in bnxt_rx_queues_alloc()
583 softc->vnic_info.id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
584 softc->vnic_info.flow_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
585 softc->vnic_info.filter_id = -1; in bnxt_rx_queues_alloc()
586 softc->vnic_info.def_ring_grp = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
587 softc->vnic_info.cos_rule = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
588 softc->vnic_info.lb_rule = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_rx_queues_alloc()
589 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()
716 softc->ver_info = malloc(sizeof(struct bnxt_ver_info), in bnxt_attach_pre()
718 if (softc->ver_info == NULL) { in bnxt_attach_pre()
720 device_printf(softc->dev, in bnxt_attach_pre()
725 softc->ver_info->hwrm_min_major = 1; in bnxt_attach_pre()
726 softc->ver_info->hwrm_min_minor = 2; in bnxt_attach_pre()
727 softc->ver_info->hwrm_min_update = 2; in bnxt_attach_pre()
729 rc = bnxt_hwrm_ver_get(softc); in bnxt_attach_pre()
731 device_printf(softc->dev, "attach: hwrm ver get failed\n"); in bnxt_attach_pre()
735 if (softc->flags & BNXT_FLAG_SHORT_CMD) { in bnxt_attach_pre()
736 rc = bnxt_alloc_hwrm_short_cmd_req(softc); in bnxt_attach_pre()
742 if (BNXT_PF(softc)) { in bnxt_attach_pre()
743 softc->nvm_info = malloc(sizeof(struct bnxt_nvram_info), in bnxt_attach_pre()
745 if (softc->nvm_info == NULL) { in bnxt_attach_pre()
747 device_printf(softc->dev, in bnxt_attach_pre()
752 rc = bnxt_hwrm_nvm_get_dev_info(softc, &softc->nvm_info->mfg_id, in bnxt_attach_pre()
753 &softc->nvm_info->device_id, &softc->nvm_info->sector_size, in bnxt_attach_pre()
754 &softc->nvm_info->size, &softc->nvm_info->reserved_size, in bnxt_attach_pre()
755 &softc->nvm_info->available_size); in bnxt_attach_pre()
759 rc = bnxt_hwrm_func_drv_rgtr(softc); in bnxt_attach_pre()
761 device_printf(softc->dev, "attach: hwrm drv rgtr failed\n"); in bnxt_attach_pre()
765 rc = bnxt_hwrm_func_rgtr_async_events(softc, NULL, 0); in bnxt_attach_pre()
767 device_printf(softc->dev, "attach: hwrm rgtr async evts failed\n"); in bnxt_attach_pre()
772 rc = bnxt_hwrm_func_qcaps(softc); in bnxt_attach_pre()
777 rc = bnxt_hwrm_func_qcfg(softc); in bnxt_attach_pre()
779 device_printf(softc->dev, "attach: hwrm func qcfg failed\n"); in bnxt_attach_pre()
783 iflib_set_mac(ctx, softc->func.mac_addr); in bnxt_attach_pre()
799 if (bnxt_wol_supported(softc)) in bnxt_attach_pre()
801 bnxt_get_wol_settings(softc); in bnxt_attach_pre()
802 if (softc->wol) in bnxt_attach_pre()
806 rc = bnxt_hwrm_queue_qportcfg(softc); in bnxt_attach_pre()
808 device_printf(softc->dev, "attach: hwrm qportcfg failed\n"); 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()
1099 rc = bnxt_hwrm_vnic_ctx_alloc(softc, &softc->vnic_info.rss_id); in bnxt_init()
1104 softc->vnic_info.def_ring_grp = softc->grp_info[0].grp_id; in bnxt_init()
1105 softc->vnic_info.mru = softc->scctx->isc_max_frame_size; in bnxt_init()
1106 rc = bnxt_hwrm_vnic_alloc(softc, &softc->vnic_info); in bnxt_init()
1109 rc = bnxt_hwrm_vnic_cfg(softc, &softc->vnic_info); in bnxt_init()
1112 rc = bnxt_hwrm_set_filter(softc, &softc->vnic_info); in bnxt_init()
1119 softc->vnic_info.rss_grp_tbl.idi_vaddr)[i] = in bnxt_init()
1120 htole16(softc->grp_info[j].grp_id); in bnxt_init()
1121 if (++j == softc->nrxqsets) in bnxt_init()
1125 rc = bnxt_hwrm_rss_cfg(softc, &softc->vnic_info, in bnxt_init()
1126 softc->vnic_info.rss_hash_type); in bnxt_init()
1130 rc = bnxt_hwrm_vnic_tpa_cfg(softc); in bnxt_init()
1134 for (i = 0; i < softc->ntxqsets; i++) { in bnxt_init()
1136 rc = bnxt_hwrm_stat_ctx_alloc(softc, &softc->tx_cp_rings[i], in bnxt_init()
1137 softc->tx_stats.idi_paddr + in bnxt_init()
1143 softc->tx_cp_rings[i].cons = UINT32_MAX; in bnxt_init()
1144 softc->tx_cp_rings[i].v_bit = 1; in bnxt_init()
1145 bnxt_mark_cpr_invalid(&softc->tx_cp_rings[i]); in bnxt_init()
1146 rc = bnxt_hwrm_ring_alloc(softc, in bnxt_init()
1148 &softc->tx_cp_rings[i].ring, (uint16_t)HWRM_NA_SIGNATURE, in bnxt_init()
1154 rc = bnxt_hwrm_ring_alloc(softc, in bnxt_init()
1156 &softc->tx_rings[i], softc->tx_cp_rings[i].ring.phys_id, in bnxt_init()
1157 softc->tx_cp_rings[i].stats_ctx_id, false); in bnxt_init()
1160 BNXT_TX_DB(&softc->tx_rings[i], 0); in bnxt_init()
1162 BNXT_TX_DB(&softc->tx_rings[i], 0); in bnxt_init()
1165 bnxt_do_enable_intr(&softc->def_cp_ring); in bnxt_init()
1166 bnxt_media_status(softc->ctx, &ifmr); in bnxt_init()
1167 bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info); in bnxt_init()
1171 bnxt_hwrm_func_reset(softc); in bnxt_init()
1172 bnxt_clear_ids(softc); in bnxt_init()
1179 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_stop() local
1181 bnxt_do_disable_intr(&softc->def_cp_ring); in bnxt_stop()
1182 bnxt_hwrm_func_reset(softc); in bnxt_stop()
1183 bnxt_clear_ids(softc); in bnxt_stop()
1203 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_multi_set() local
1208 mta = softc->vnic_info.mc_list.idi_vaddr; in bnxt_multi_set()
1209 bzero(mta, softc->vnic_info.mc_list.idi_size); in bnxt_multi_set()
1213 softc->vnic_info.rx_mask |= in bnxt_multi_set()
1215 bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info); in bnxt_multi_set()
1217 softc->vnic_info.rx_mask &= in bnxt_multi_set()
1219 bus_dmamap_sync(softc->vnic_info.mc_list.idi_tag, in bnxt_multi_set()
1220 softc->vnic_info.mc_list.idi_map, BUS_DMASYNC_PREWRITE); in bnxt_multi_set()
1221 softc->vnic_info.mc_list_count = mcnt; in bnxt_multi_set()
1222 softc->vnic_info.rx_mask |= in bnxt_multi_set()
1224 if (bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info)) in bnxt_multi_set()
1225 device_printf(softc->dev, in bnxt_multi_set()
1233 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_mtu_set() local
1238 softc->scctx->isc_max_frame_size = mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; in bnxt_mtu_set()
1245 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_media_status() local
1246 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_media_status()
1251 bnxt_update_link(softc, true); in bnxt_media_status()
1283 bnxt_report_link(softc); in bnxt_media_status()
1290 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_media_change() local
1300 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1301 softc->link_info.req_link_speed = in bnxt_media_change()
1307 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1308 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()
1322 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1323 softc->link_info.req_link_speed = in bnxt_media_change()
1327 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1328 softc->link_info.req_link_speed = in bnxt_media_change()
1334 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1335 softc->link_info.req_link_speed = in bnxt_media_change()
1342 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1343 softc->link_info.req_link_speed = in bnxt_media_change()
1348 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1349 softc->link_info.req_link_speed = in bnxt_media_change()
1356 softc->link_info.autoneg &= ~BNXT_AUTONEG_SPEED; in bnxt_media_change()
1357 softc->link_info.req_link_speed = in bnxt_media_change()
1361 device_printf(softc->dev, in bnxt_media_change()
1366 softc->link_info.autoneg |= BNXT_AUTONEG_SPEED; in bnxt_media_change()
1369 rc = bnxt_hwrm_set_link_setting(softc, true, true, true); in bnxt_media_change()
1370 bnxt_media_status(softc->ctx, &ifmr); in bnxt_media_change()
1377 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_promisc_set() local
1383 softc->vnic_info.rx_mask |= in bnxt_promisc_set()
1386 softc->vnic_info.rx_mask &= in bnxt_promisc_set()
1390 softc->vnic_info.rx_mask |= in bnxt_promisc_set()
1394 softc->vnic_info.rx_mask &= in bnxt_promisc_set()
1397 rc = bnxt_hwrm_cfa_l2_set_rx_mask(softc, &softc->vnic_info); in bnxt_promisc_set()
1416 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_update_admin_status() local
1422 if (BNXT_PF(softc)) { in bnxt_update_admin_status()
1423 bnxt_hwrm_port_qstats(softc); in bnxt_update_admin_status()
1433 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_if_timer() local
1437 if (ticks_now - softc->admin_ticks >= hz) { in bnxt_if_timer()
1438 softc->admin_ticks = ticks_now; in bnxt_if_timer()
1468 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_intr_enable() local
1471 bnxt_do_enable_intr(&softc->def_cp_ring); in bnxt_intr_enable()
1472 for (i = 0; i < softc->nrxqsets; i++) in bnxt_intr_enable()
1473 bnxt_do_enable_intr(&softc->rx_cp_rings[i]); in bnxt_intr_enable()
1482 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_tx_queue_intr_enable() local
1484 bnxt_do_enable_intr(&softc->tx_cp_rings[qid]); in bnxt_tx_queue_intr_enable()
1491 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_rx_queue_intr_enable() local
1493 bnxt_do_enable_intr(&softc->rx_cp_rings[qid]); in bnxt_rx_queue_intr_enable()
1501 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_disable_intr() local
1508 for (i = 0; i < softc->ntxqsets; i++) in bnxt_disable_intr()
1509 bnxt_do_disable_intr(&softc->tx_cp_rings[i]); in bnxt_disable_intr()
1510 for (i = 0; i < softc->nrxqsets; i++) in bnxt_disable_intr()
1511 bnxt_do_disable_intr(&softc->rx_cp_rings[i]); in bnxt_disable_intr()
1519 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_msix_intr_assign() local
1524 rc = iflib_irq_alloc_generic(ctx, &softc->def_cp_ring.irq, in bnxt_msix_intr_assign()
1525 softc->def_cp_ring.ring.id + 1, IFLIB_INTR_ADMIN, in bnxt_msix_intr_assign()
1526 bnxt_handle_def_cp, softc, 0, "def_cp"); in bnxt_msix_intr_assign()
1533 for (i=0; i<softc->scctx->isc_nrxqsets; i++) { in bnxt_msix_intr_assign()
1535 rc = iflib_irq_alloc_generic(ctx, &softc->rx_cp_rings[i].irq, in bnxt_msix_intr_assign()
1536 softc->rx_cp_rings[i].ring.id + 1, IFLIB_INTR_RXTX, in bnxt_msix_intr_assign()
1537 bnxt_handle_rx_cp, &softc->rx_cp_rings[i], i, irq_name); in bnxt_msix_intr_assign()
1546 for (i=0; i<softc->scctx->isc_ntxqsets; i++) in bnxt_msix_intr_assign()
1553 iflib_irq_free(ctx, &softc->rx_cp_rings[i].irq); in bnxt_msix_intr_assign()
1554 iflib_irq_free(ctx, &softc->def_cp_ring.irq); in bnxt_msix_intr_assign()
1565 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_vlan_register() local
1573 SLIST_INSERT_HEAD(&softc->vnic_info.vlan_tags, new_tag, next); in bnxt_vlan_register()
1579 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_vlan_unregister() local
1582 SLIST_FOREACH(vlan_tag, &softc->vnic_info.vlan_tags, next) { in bnxt_vlan_unregister()
1584 SLIST_REMOVE(&softc->vnic_info.vlan_tags, vlan_tag, in bnxt_vlan_unregister()
1595 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_wol_config() local
1598 if (!softc) in bnxt_wol_config()
1601 if (!bnxt_wol_supported(softc)) in bnxt_wol_config()
1605 if (!softc->wol) { in bnxt_wol_config()
1606 if (bnxt_hwrm_alloc_wol_fltr(softc)) in bnxt_wol_config()
1608 softc->wol = 1; in bnxt_wol_config()
1611 if (softc->wol) { in bnxt_wol_config()
1612 if (bnxt_hwrm_free_wol_fltr(softc)) in bnxt_wol_config()
1614 softc->wol = 0; in bnxt_wol_config()
1638 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_resume() local
1640 bnxt_get_wol_settings(softc); in bnxt_resume()
1647 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_priv_ioctl() local
1673 rc = bnxt_hwrm_nvm_find_dir_entry(softc, find->type, in bnxt_priv_ioctl()
1702 rc = iflib_dma_alloc(softc->ctx, in bnxt_priv_ioctl()
1709 rc = bnxt_hwrm_nvm_read(softc, rd->index, in bnxt_priv_ioctl()
1736 rc = bnxt_hwrm_fw_reset(softc, rst->processor, in bnxt_priv_ioctl()
1756 rc = bnxt_hwrm_fw_qstatus(softc, qstat->processor, in bnxt_priv_ioctl()
1776 rc = bnxt_hwrm_nvm_write(softc, wr->data, true, in bnxt_priv_ioctl()
1798 rc = bnxt_hwrm_nvm_erase_dir_entry(softc, erase->index); in bnxt_priv_ioctl()
1817 rc = bnxt_hwrm_nvm_get_dir_info(softc, &info->entries, in bnxt_priv_ioctl()
1838 rc = iflib_dma_alloc(softc->ctx, get->max_size, in bnxt_priv_ioctl()
1842 rc = bnxt_hwrm_nvm_get_dir_entries(softc, &get->entries, in bnxt_priv_ioctl()
1865 rc = bnxt_hwrm_nvm_verify_update(softc, vrfy->type, in bnxt_priv_ioctl()
1885 rc = bnxt_hwrm_nvm_install_update(softc, in bnxt_priv_ioctl()
1906 rc = bnxt_hwrm_nvm_modify(softc, mod->index, in bnxt_priv_ioctl()
1926 rc = bnxt_hwrm_fw_get_time(softc, >m->year, in bnxt_priv_ioctl()
1947 rc = bnxt_hwrm_fw_set_time(softc, stm->year, in bnxt_priv_ioctl()
1975 bnxt_probe_phy(struct bnxt_softc *softc) in bnxt_probe_phy() argument
1977 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_probe_phy()
1980 rc = bnxt_update_link(softc, false); in bnxt_probe_phy()
1982 device_printf(softc->dev, in bnxt_probe_phy()
2000 bnxt_add_media_types(struct bnxt_softc *softc) in bnxt_add_media_types() argument
2002 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_add_media_types()
2004 uint8_t phy_type = get_phy_type(softc); in bnxt_add_media_types()
2009 ifmedia_add(softc->media, IFM_ETHER | IFM_AUTO, 0, NULL); in bnxt_add_media_types()
2011 if (softc->flags & BNXT_FLAG_NPAR) in bnxt_add_media_types()
2097 device_printf(softc->dev, "Unknown phy type\n"); in bnxt_add_media_types()
2102 device_printf(softc->dev, "phy type %d not supported by driver\n", phy_type); in bnxt_add_media_types()
2110 bnxt_map_bar(struct bnxt_softc *softc, struct bnxt_bar_info *bar, int bar_num, bool shareable) in bnxt_map_bar() argument
2115 device_printf(softc->dev, "Bar %d already mapped\n", bar_num); in bnxt_map_bar()
2125 bus_alloc_resource_any(softc->dev, in bnxt_map_bar()
2129 device_printf(softc->dev, in bnxt_map_bar()
2141 bnxt_pci_mapping(struct bnxt_softc *softc) in bnxt_pci_mapping() argument
2145 rc = bnxt_map_bar(softc, &softc->hwrm_bar, 0, true); in bnxt_pci_mapping()
2149 rc = bnxt_map_bar(softc, &softc->doorbell_bar, 2, false); in bnxt_pci_mapping()
2155 bnxt_pci_mapping_free(struct bnxt_softc *softc) in bnxt_pci_mapping_free() argument
2157 if (softc->hwrm_bar.res != NULL) in bnxt_pci_mapping_free()
2158 bus_release_resource(softc->dev, SYS_RES_MEMORY, in bnxt_pci_mapping_free()
2159 softc->hwrm_bar.rid, softc->hwrm_bar.res); in bnxt_pci_mapping_free()
2160 softc->hwrm_bar.res = NULL; in bnxt_pci_mapping_free()
2162 if (softc->doorbell_bar.res != NULL) in bnxt_pci_mapping_free()
2163 bus_release_resource(softc->dev, SYS_RES_MEMORY, in bnxt_pci_mapping_free()
2164 softc->doorbell_bar.rid, softc->doorbell_bar.res); in bnxt_pci_mapping_free()
2165 softc->doorbell_bar.res = NULL; in bnxt_pci_mapping_free()
2169 bnxt_update_link(struct bnxt_softc *softc, bool chng_link_state) in bnxt_update_link() argument
2171 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_update_link()
2175 rc = bnxt_hwrm_port_phy_qcfg(softc); in bnxt_update_link()
2187 bnxt_report_link(softc); in bnxt_update_link()
2198 bnxt_report_link(struct bnxt_softc *softc) in bnxt_report_link() argument
2200 struct bnxt_link_info *link_info = &softc->link_info; in bnxt_report_link()
2225 iflib_link_state_change(softc->ctx, LINK_STATE_UP, in bnxt_report_link()
2227 device_printf(softc->dev, "Link is UP %s, %s - %d Mbps \n", duplex, in bnxt_report_link()
2230 iflib_link_state_change(softc->ctx, LINK_STATE_DOWN, in bnxt_report_link()
2231 bnxt_get_baudrate(&softc->link_info)); in bnxt_report_link()
2232 device_printf(softc->dev, "Link is Down\n"); in bnxt_report_link()
2241 ifmedia_removeall(softc->media); in bnxt_report_link()
2242 bnxt_add_media_types(softc); in bnxt_report_link()
2243 ifmedia_set(softc->media, IFM_ETHER | IFM_AUTO); in bnxt_report_link()
2259 struct bnxt_softc *softc = arg; in bnxt_handle_def_cp() local
2261 BNXT_CP_DISABLE_DB(&softc->def_cp_ring.ring); in bnxt_handle_def_cp()
2262 GROUPTASK_ENQUEUE(&softc->def_cp_task); in bnxt_handle_def_cp()
2267 bnxt_clear_ids(struct bnxt_softc *softc) in bnxt_clear_ids() argument
2271 softc->def_cp_ring.stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2272 softc->def_cp_ring.ring.phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2273 for (i = 0; i < softc->ntxqsets; i++) { in bnxt_clear_ids()
2274 softc->tx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2275 softc->tx_cp_rings[i].ring.phys_id = in bnxt_clear_ids()
2277 softc->tx_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2279 for (i = 0; i < softc->nrxqsets; i++) { in bnxt_clear_ids()
2280 softc->rx_cp_rings[i].stats_ctx_id = HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2281 softc->rx_cp_rings[i].ring.phys_id = in bnxt_clear_ids()
2283 softc->rx_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2284 softc->ag_rings[i].phys_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2285 softc->grp_info[i].grp_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2287 softc->vnic_info.filter_id = -1; in bnxt_clear_ids()
2288 softc->vnic_info.id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2289 softc->vnic_info.rss_id = (uint16_t)HWRM_NA_SIGNATURE; in bnxt_clear_ids()
2290 memset(softc->vnic_info.rss_grp_tbl.idi_vaddr, 0xff, in bnxt_clear_ids()
2291 softc->vnic_info.rss_grp_tbl.idi_size); in bnxt_clear_ids()
2305 bnxt_handle_async_event(struct bnxt_softc *softc, struct cmpl_base *cmpl) in bnxt_handle_async_event() argument
2315 bnxt_media_status(softc->ctx, &ifmr); in bnxt_handle_async_event()
2330 device_printf(softc->dev, in bnxt_handle_async_event()
2334 device_printf(softc->dev, in bnxt_handle_async_event()
2344 struct bnxt_softc *softc = iflib_get_softc(ctx); in bnxt_def_cp_task() local
2345 struct bnxt_cp_ring *cpr = &softc->def_cp_ring; in bnxt_def_cp_task()
2367 bnxt_handle_async_event(softc, cmpl); in bnxt_def_cp_task()
2383 device_printf(softc->dev, in bnxt_def_cp_task()
2387 device_printf(softc->dev, in bnxt_def_cp_task()
2399 get_phy_type(struct bnxt_softc *softc) in get_phy_type() argument
2401 struct bnxt_link_info *link_info = &softc->link_info; in get_phy_type()
2430 bnxt_check_hwrm_version(struct bnxt_softc *softc) in bnxt_check_hwrm_version() argument
2434 sprintf(buf, "%hhu.%hhu.%hhu", softc->ver_info->hwrm_min_major, in bnxt_check_hwrm_version()
2435 softc->ver_info->hwrm_min_minor, softc->ver_info->hwrm_min_update); in bnxt_check_hwrm_version()
2436 if (softc->ver_info->hwrm_min_major > softc->ver_info->hwrm_if_major) { in bnxt_check_hwrm_version()
2437 device_printf(softc->dev, in bnxt_check_hwrm_version()
2439 softc->ver_info->hwrm_if_ver, buf); in bnxt_check_hwrm_version()
2442 else if(softc->ver_info->hwrm_min_major == in bnxt_check_hwrm_version()
2443 softc->ver_info->hwrm_if_major) { in bnxt_check_hwrm_version()
2444 if (softc->ver_info->hwrm_min_minor > in bnxt_check_hwrm_version()
2445 softc->ver_info->hwrm_if_minor) { in bnxt_check_hwrm_version()
2446 device_printf(softc->dev, in bnxt_check_hwrm_version()
2448 softc->ver_info->hwrm_if_ver, buf); in bnxt_check_hwrm_version()
2451 else if (softc->ver_info->hwrm_min_minor == in bnxt_check_hwrm_version()
2452 softc->ver_info->hwrm_if_minor) { in bnxt_check_hwrm_version()
2453 if (softc->ver_info->hwrm_min_update > in bnxt_check_hwrm_version()
2454 softc->ver_info->hwrm_if_update) { in bnxt_check_hwrm_version()
2455 device_printf(softc->dev, in bnxt_check_hwrm_version()
2457 softc->ver_info->hwrm_if_ver, buf); in bnxt_check_hwrm_version()
2496 bnxt_get_wol_settings(struct bnxt_softc *softc) in bnxt_get_wol_settings() argument
2500 if (!bnxt_wol_supported(softc)) in bnxt_get_wol_settings()
2504 wol_handle = bnxt_hwrm_get_wol_fltrs(softc, wol_handle); in bnxt_get_wol_settings()