Lines Matching refs:iov
39 * Update iov->offset and iov->stride when NumVFs is written.
43 struct pci_sriov *iov = dev->sriov;
45 pci_write_config_word(dev, iov->pos + PCI_SRIOV_NUM_VF, nr_virtfn);
46 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_OFFSET, &iov->offset);
47 pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_STRIDE, &iov->stride);
59 struct pci_sriov *iov = dev->sriov;
62 for (nr_virtfn = iov->total_VFs; nr_virtfn; nr_virtfn--) {
64 if (!iov->offset || (nr_virtfn > 1 && !iov->stride)) {
70 if (busnr > iov->max_VF_buses)
71 iov->max_VF_buses = busnr;
167 struct pci_sriov *iov = dev->sriov;
180 virtfn->device = iov->vf_device;
468 struct pci_sriov *iov = dev->sriov;
475 if (iov->num_VFs)
478 pci_read_config_word(dev, iov->pos + PCI_SRIOV_INITIAL_VF, &initial);
479 if (initial > iov->total_VFs ||
480 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (initial != iov->total_VFs)))
483 if (nr_virtfn < 0 || nr_virtfn > iov->total_VFs ||
484 (!(iov->cap & PCI_SRIOV_CAP_VFM) && (nr_virtfn > initial)))
494 if (nres != iov->nres) {
511 if (iov->link != dev->devfn) {
512 pdev = pci_get_slot(dev->bus, iov->link);
528 iov->initial_VFs = initial;
539 iov->ctrl |= PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE;
541 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
550 iov->num_VFs = nr_virtfn;
555 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
557 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
563 if (iov->link != dev->devfn)
572 struct pci_sriov *iov = dev->sriov;
575 for (i = 0; i < iov->num_VFs; i++)
581 struct pci_sriov *iov = dev->sriov;
583 if (!iov->num_VFs)
587 iov->ctrl &= ~(PCI_SRIOV_CTRL_VFE | PCI_SRIOV_CTRL_MSE);
589 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
595 if (iov->link != dev->devfn)
598 iov->num_VFs = 0;
609 struct pci_sriov *iov;
644 iov = kzalloc(sizeof(*iov), GFP_KERNEL);
645 if (!iov)
666 iov->barsz[i] = resource_size(res);
674 iov->pos = pos;
675 iov->nres = nres;
676 iov->ctrl = ctrl;
677 iov->total_VFs = total;
678 iov->driver_max_VFs = total;
679 pci_read_config_word(dev, pos + PCI_SRIOV_VF_DID, &iov->vf_device);
680 iov->pgsz = pgsz;
681 iov->self = dev;
682 iov->drivers_autoprobe = true;
683 pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap);
684 pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link);
686 iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link);
689 iov->dev = pci_dev_get(pdev);
691 iov->dev = dev;
693 dev->sriov = iov;
710 kfree(iov);
729 struct pci_sriov *iov = dev->sriov;
731 pci_read_config_word(dev, iov->pos + PCI_SRIOV_CTRL, &ctrl);
740 ctrl |= iov->ctrl & PCI_SRIOV_CTRL_ARI;
741 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, ctrl);
746 pci_write_config_dword(dev, iov->pos + PCI_SRIOV_SYS_PGSIZE, iov->pgsz);
747 pci_iov_set_numvfs(dev, iov->num_VFs);
748 pci_write_config_word(dev, iov->pos + PCI_SRIOV_CTRL, iov->ctrl);
749 if (iov->ctrl & PCI_SRIOV_CTRL_VFE)
789 struct pci_sriov *iov = dev->sriov;
794 iov->driver_max_VFs = iov->total_VFs;
795 if (iov->num_VFs)
808 struct pci_sriov *iov = dev->is_physfn ? dev->sriov : NULL;
821 if (!iov)
824 pci_read_config_word(dev, iov->pos + PCI_SRIOV_CTRL, &cmd);
849 reg = iov->pos + PCI_SRIOV_BAR + 4 * vf_bar;