Lines Matching defs:iov

82  * Update iov->offset and iov->stride when NumVFs is written.
86 struct pci_sriov *iov = dev->sriov;
88 pci_write_config_word(dev, iov->pos + PCI_SRIOV_NUM_VF, nr_virtfn);
89 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_OFFSET, &iov->offset);
90 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_STRIDE, &iov->stride);
102 struct pci_sriov *iov = dev->sriov;
105 for (nr_virtfn = iov->total_VFs; nr_virtfn; nr_virtfn--) {
107 if (!iov->offset || (nr_virtfn > 1 && !iov->stride)) {
113 if (busnr > iov->max_VF_buses)
114 iov->max_VF_buses = busnr;
295 struct pci_sriov *iov = dev->sriov;
308 virtfn->device = iov->vf_device;
605 struct pci_sriov *iov = dev->sriov;
612 if (iov->num_VFs)
615 pci_read_config_word(dev, iov->pos + PCI_SRIOV_INITIAL_VF, &initial);
616 if (initial > iov->total_VFs ||
617 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (initial != iov->total_VFs)))
620 if (nr_virtfn < 0 || nr_virtfn > iov->total_VFs ||
621 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (nr_virtfn > initial)))
631 if (nres != iov->nres) {
648 if (iov->link != dev->devfn) {
649 pdev = pci_get_slot(dev->bus, iov->link);
665 iov->initial_VFs = initial;
676 iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE;
678 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
687 iov->num_VFs = nr_virtfn;
692 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
694 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
700 if (iov->link != dev->devfn)
709 struct pci_sriov *iov = dev->sriov;
712 for (i = 0; i < iov->num_VFs; i++)
718 struct pci_sriov *iov = dev->sriov;
720 if (!iov->num_VFs)
724 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
726 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
732 if (iov->link != dev->devfn)
735 iov->num_VFs = 0;
746 struct pci_sriov *iov;
782 iov = kzalloc(sizeof(*iov), GFP_KERNEL);
783 if (!iov)
806 iov->barsz[i] = resource_size(res);
814 iov->pos = pos;
815 iov->nres = nres;
816 iov->ctrl = ctrl;
817 iov->total_VFs = total;
818 iov->driver_max_VFs = total;
819 pci_read_config_word(dev, pos + PCI_SRIOV_VF_DID, &iov->vf_device);
820 iov->pgsz = pgsz;
821 iov->self = dev;
822 iov->drivers_autoprobe = true;
823 pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap);
824 pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link);
826 iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link);
829 iov->dev = pci_dev_get(pdev);
831 iov->dev = dev;
833 dev->sriov = iov;
850 kfree(iov);
869 struct pci_sriov *iov = dev->sriov;
871 pci_read_config_word(dev, iov->pos + PCI_SRIOV_CTRL, &ctrl);
880 ctrl |= iov->ctrl & PCI_SRIOV_CTRL_ARI;
881 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, ctrl);
886 pci_write_config_dword(dev, iov->pos + PCI_SRIOV_SYS_PGSIZE, iov->pgsz);
887 pci_iov_set_numvfs(dev, iov->num_VFs);
888 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
889 if (iov->ctrl & PCI_SRIOV_CTRL_VFE)
929 struct pci_sriov *iov = dev->sriov;
934 iov->driver_max_VFs = iov->total_VFs;
935 if (iov->num_VFs)
948 struct pci_sriov *iov = dev->is_physfn ? dev->sriov : NULL;
961 if (!iov)
964 pci_read_config_word(dev, iov->pos + PCI_SRIOV_CTRL, &cmd);
989 reg = iov->pos + PCI_SRIOV_BAR + 4 * vf_bar;