Lines Matching refs:octpf
383 static void octep_vdpa_pf_bar_shrink(struct octep_pf *octpf) in octep_vdpa_pf_bar_shrink() argument
385 struct pci_dev *pf_dev = octpf->pdev; in octep_vdpa_pf_bar_shrink()
389 octpf->res.start = res->start; in octep_vdpa_pf_bar_shrink()
390 octpf->res.end = res->end; in octep_vdpa_pf_bar_shrink()
391 octpf->vf_base = res->start; in octep_vdpa_pf_bar_shrink()
399 static void octep_vdpa_pf_bar_expand(struct octep_pf *octpf) in octep_vdpa_pf_bar_expand() argument
401 struct pci_dev *pf_dev = octpf->pdev; in octep_vdpa_pf_bar_expand()
405 bus_region.start = octpf->res.start; in octep_vdpa_pf_bar_expand()
406 bus_region.end = octpf->res.end; in octep_vdpa_pf_bar_expand()
413 struct octep_pf *octpf = pci_get_drvdata(pdev); in octep_vdpa_remove_pf() local
417 if (octpf->base[OCTEP_HW_CAPS_BAR]) in octep_vdpa_remove_pf()
418 octep_iounmap_region(pdev, octpf->base, OCTEP_HW_CAPS_BAR); in octep_vdpa_remove_pf()
420 if (octpf->base[OCTEP_HW_MBOX_BAR]) in octep_vdpa_remove_pf()
421 octep_iounmap_region(pdev, octpf->base, OCTEP_HW_MBOX_BAR); in octep_vdpa_remove_pf()
423 octep_vdpa_pf_bar_expand(octpf); in octep_vdpa_remove_pf()
750 static int octep_vdpa_pf_setup(struct octep_pf *octpf) in octep_vdpa_pf_setup() argument
752 u8 __iomem *addr = octpf->base[OCTEP_HW_MBOX_BAR]; in octep_vdpa_pf_setup()
753 struct pci_dev *pdev = octpf->pdev; in octep_vdpa_pf_setup()
764 addr = octpf->base[OCTEP_HW_MBOX_BAR]; in octep_vdpa_pf_setup()
779 octpf->vf_stride = len / totalvfs; in octep_vdpa_pf_setup()
780 octpf->vf_devid = octep_get_vf_devid(pdev); in octep_vdpa_pf_setup()
782 octep_vdpa_pf_bar_shrink(octpf); in octep_vdpa_pf_setup()
790 struct octep_pf *octpf; in octep_vdpa_probe_pf() local
804 octpf = devm_kzalloc(dev, sizeof(*octpf), GFP_KERNEL); in octep_vdpa_probe_pf()
805 if (!octpf) in octep_vdpa_probe_pf()
808 ret = octep_iomap_region(pdev, octpf->base, OCTEP_HW_MBOX_BAR); in octep_vdpa_probe_pf()
813 pci_set_drvdata(pdev, octpf); in octep_vdpa_probe_pf()
814 octpf->pdev = pdev; in octep_vdpa_probe_pf()
816 ret = octep_vdpa_pf_setup(octpf); in octep_vdpa_probe_pf()
823 octep_iounmap_region(pdev, octpf->base, OCTEP_HW_MBOX_BAR); in octep_vdpa_probe_pf()