| 1 | |
| 2 |
|
| 3 | #include <linux/pci.h>
|
| 4 |
|
| 5 | __rust_helper u16 rust_helper_pci_dev_id(struct pci_dev *dev)
|
| 6 | {
|
| 7 | return PCI_DEVID(dev->bus->number, dev->devfn);
|
| 8 | }
|
| 9 |
|
| 10 | __rust_helper resource_size_t
|
| 11 | rust_helper_pci_resource_start(struct pci_dev *pdev, int bar)
|
| 12 | {
|
| 13 | return pci_resource_start(pdev, bar);
|
| 14 | }
|
| 15 |
|
| 16 | __rust_helper resource_size_t rust_helper_pci_resource_len(struct pci_dev *pdev,
|
| 17 | int bar)
|
| 18 | {
|
| 19 | return pci_resource_len(pdev, bar);
|
| 20 | }
|
| 21 |
|
| 22 | __rust_helper bool rust_helper_dev_is_pci(const struct device *dev)
|
| 23 | {
|
| 24 | return dev_is_pci(dev);
|
| 25 | }
|
| 26 |
|
| 27 | __rust_helper unsigned int rust_helper_pci_irq_type(struct pci_dev *pdev)
|
| 28 | {
|
| 29 | return pci_irq_type(pdev);
|
| 30 | }
|
| 31 |
|
| 32 | #ifndef CONFIG_PCI_IOV
|
| 33 | __rust_helper unsigned int
|
| 34 | rust_helper_pci_sriov_get_totalvfs(struct pci_dev *pdev)
|
| 35 | {
|
| 36 | return pci_sriov_get_totalvfs(pdev);
|
| 37 | }
|
| 38 | #endif
|
| 39 |
|
| 40 | #ifndef CONFIG_PCI_MSI
|
| 41 | __rust_helper int rust_helper_pci_alloc_irq_vectors(struct pci_dev *dev,
|
| 42 | unsigned int min_vecs,
|
| 43 | unsigned int max_vecs,
|
| 44 | unsigned int flags)
|
| 45 | {
|
| 46 | return pci_alloc_irq_vectors(dev, min_vecs, max_vecs, flags);
|
| 47 | }
|
| 48 |
|
| 49 | __rust_helper void rust_helper_pci_free_irq_vectors(struct pci_dev *dev)
|
| 50 | {
|
| 51 | pci_free_irq_vectors(dev);
|
| 52 | }
|
| 53 |
|
| 54 | __rust_helper int rust_helper_pci_irq_vector(struct pci_dev *pdev,
|
| 55 | unsigned int nvec)
|
| 56 | {
|
| 57 | return pci_irq_vector(pdev, nvec);
|
| 58 | }
|
| 59 | #endif
|