| 1 |
// SPDX-License-Identifier: GPL-2.0 |
| 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 |
#ifndef CONFIG_PCI_MSI |
| 28 |
__rust_helper int rust_helper_pci_alloc_irq_vectors(struct pci_dev *dev, |
| 29 |
unsigned int min_vecs, |
| 30 |
unsigned int max_vecs, |
| 31 |
unsigned int flags) |
| 32 |
{ |
| 33 |
return pci_alloc_irq_vectors(dev, min_vecs, max_vecs, flags); |
| 34 |
} |
| 35 |
|
| 36 |
__rust_helper void rust_helper_pci_free_irq_vectors(struct pci_dev *dev) |
| 37 |
{ |
| 38 |
pci_free_irq_vectors(dev); |
| 39 |
} |
| 40 |
|
| 41 |
__rust_helper int rust_helper_pci_irq_vector(struct pci_dev *pdev, |
| 42 |
unsigned int nvec) |
| 43 |
{ |
| 44 |
return pci_irq_vector(pdev, nvec); |
| 45 |
} |
| 46 |
#endif |