Lines Matching defs:iov

87  * Update iov->offset and iov->stride when NumVFs is written.
91 struct pci_sriov *iov = dev->sriov;
93 pci_write_config_word(dev, iov->pos + PCI_SRIOV_NUM_VF, nr_virtfn);
94 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_OFFSET, &iov->offset);
95 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_STRIDE, &iov->stride);
107 struct pci_sriov *iov = dev->sriov;
110 for (nr_virtfn = iov->total_VFs; nr_virtfn; nr_virtfn--) {
112 if (!iov->offset || (nr_virtfn > 1 && !iov->stride)) {
118 if (busnr > iov->max_VF_buses)
119 iov->max_VF_buses = busnr;
317 struct pci_sriov *iov = dev->sriov;
327 virtfn->device = iov->vf_device;
657 struct pci_sriov *iov = dev->sriov;
664 if (iov->num_VFs)
667 pci_read_config_word(dev, iov->pos + PCI_SRIOV_INITIAL_VF, &initial);
668 if (initial > iov->total_VFs ||
669 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (initial != iov->total_VFs)))
672 if (nr_virtfn < 0 || nr_virtfn > iov->total_VFs ||
673 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (nr_virtfn > initial)))
688 if (nres != iov->nres) {
705 if (iov->link != dev->devfn) {
706 pdev = pci_get_slot(dev->bus, iov->link);
722 iov->initial_VFs = initial;
733 iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE;
735 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
744 iov->num_VFs = nr_virtfn;
749 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
751 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
757 if (iov->link != dev->devfn)
766 struct pci_sriov *iov = dev->sriov;
769 for (i = 0; i < iov->num_VFs; i++)
775 struct pci_sriov *iov = dev->sriov;
777 if (!iov->num_VFs)
781 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
783 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
789 if (iov->link != dev->devfn)
792 iov->num_VFs = 0;
803 struct pci_sriov *iov;
840 iov = kzalloc_obj(*iov);
841 if (!iov)
871 iov->barsz[i] = resource_size(res);
879 iov->pos = pos;
880 iov->nres = nres;
881 iov->ctrl = ctrl;
882 iov->total_VFs = total;
883 iov->driver_max_VFs = total;
884 pci_read_config_word(dev, pos + PCI_SRIOV_VF_DID, &iov->vf_device);
885 iov->pgsz = pgsz;
886 iov->self = dev;
887 iov->drivers_autoprobe = true;
888 pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap);
889 pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link);
891 iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link);
892 iov->vf_rebar_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_VF_REBAR);
895 iov->dev = pci_dev_get(pdev);
897 iov->dev = dev;
899 dev->sriov = iov;
916 kfree(iov);
964 struct pci_sriov *iov = dev->sriov;
966 pci_read_config_word(dev, iov->pos + PCI_SRIOV_CTRL, &ctrl);
975 ctrl |= iov->ctrl & PCI_SRIOV_CTRL_ARI;
976 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, ctrl);
981 pci_write_config_dword(dev, iov->pos + PCI_SRIOV_SYS_PGSIZE, iov->pgsz);
982 pci_iov_set_numvfs(dev, iov->num_VFs);
983 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
984 if (iov->ctrl & PCI_SRIOV_CTRL_VFE)
1024 struct pci_sriov *iov = dev->sriov;
1029 iov->driver_max_VFs = iov->total_VFs;
1030 if (iov->num_VFs)
1043 struct pci_sriov *iov = dev->is_physfn ? dev->sriov : NULL;
1056 if (!iov)
1059 pci_read_config_word(dev, iov->pos + PCI_SRIOV_CTRL, &cmd);
1084 reg = iov->pos + PCI_SRIOV_BAR + 4 * vf_bar;