arch/s390/pci/pci_iov.c

Source file repositories/reference/linux-study-clean/arch/s390/pci/pci_iov.c

File Facts

System
Linux kernel
Corpus path
arch/s390/pci/pci_iov.c
Extension
.c
Size
3288 bytes
Lines
127
Domain
Architecture Layer
Bucket
arch/s390
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (zdev && zdev->is_physfn) {
			pdev = pci_get_slot(zbus->bus, zdev->devfn);
			if (!pdev)
				continue;
			cand_devfn = pci_iov_virtfn_devfn(pdev, vfid);
			if (cand_devfn == devfn)
				return pdev;
			/* balance pci_get_slot() */
			pci_dev_put(pdev);
		}
	}
	return NULL;
}

int zpci_iov_setup_virtfn(struct zpci_bus *zbus, struct pci_dev *virtfn, int vfn)
{
	struct zpci_dev *zdev = to_zpci(virtfn);
	struct pci_dev *pdev_pf;
	int rc = 0;

	pdev_pf = zpci_iov_find_parent_pf(zbus, zdev);
	if (pdev_pf) {
		/* Linux' vfids start at 0 while zdev->vfn starts at 1 */
		rc = zpci_iov_link_virtfn(pdev_pf, virtfn, zdev->vfn - 1);
		pci_dev_put(pdev_pf);
	}
	return rc;
}

Annotation

Implementation Notes