Prefix some _pci_xxx() functions in the Linux KPI with linux_ and make
sure the IRQ number used by these functions is unsigned. Sponsored by: Mellanox Technologies MFC after: 1 week
This commit is contained in:
parent
c247abf015
commit
7dcfee78f0
@ -50,11 +50,11 @@ struct irq_ent {
|
||||
void *arg;
|
||||
irqreturn_t (*handler)(int, void *);
|
||||
void *tag;
|
||||
int irq;
|
||||
unsigned int irq;
|
||||
};
|
||||
|
||||
static inline int
|
||||
linux_irq_rid(struct device *dev, int irq)
|
||||
linux_irq_rid(struct device *dev, unsigned int irq)
|
||||
{
|
||||
if (irq == dev->irq)
|
||||
return (0);
|
||||
@ -64,7 +64,7 @@ linux_irq_rid(struct device *dev, int irq)
|
||||
extern void linux_irq_handler(void *);
|
||||
|
||||
static inline struct irq_ent *
|
||||
linux_irq_ent(struct device *dev, int irq)
|
||||
linux_irq_ent(struct device *dev, unsigned int irq)
|
||||
{
|
||||
struct irq_ent *irqe;
|
||||
|
||||
@ -85,7 +85,7 @@ request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
|
||||
int error;
|
||||
int rid;
|
||||
|
||||
dev = _pci_find_irq_dev(irq);
|
||||
dev = linux_pci_find_irq_dev(irq);
|
||||
if (dev == NULL)
|
||||
return -ENXIO;
|
||||
rid = linux_irq_rid(dev, irq);
|
||||
@ -117,7 +117,7 @@ bind_irq_to_cpu(unsigned int irq, int cpu_id)
|
||||
struct irq_ent *irqe;
|
||||
struct device *dev;
|
||||
|
||||
dev = _pci_find_irq_dev(irq);
|
||||
dev = linux_pci_find_irq_dev(irq);
|
||||
if (dev == NULL)
|
||||
return (-ENOENT);
|
||||
|
||||
@ -135,7 +135,7 @@ free_irq(unsigned int irq, void *device)
|
||||
struct device *dev;
|
||||
int rid;
|
||||
|
||||
dev = _pci_find_irq_dev(irq);
|
||||
dev = linux_pci_find_irq_dev(irq);
|
||||
if (dev == NULL)
|
||||
return;
|
||||
rid = linux_irq_rid(dev, irq);
|
||||
|
@ -171,7 +171,7 @@ struct pci_dev {
|
||||
};
|
||||
|
||||
static inline struct resource_list_entry *
|
||||
_pci_get_rle(struct pci_dev *pdev, int type, int rid)
|
||||
linux_pci_get_rle(struct pci_dev *pdev, int type, int rid)
|
||||
{
|
||||
struct pci_devinfo *dinfo;
|
||||
struct resource_list *rl;
|
||||
@ -182,18 +182,18 @@ _pci_get_rle(struct pci_dev *pdev, int type, int rid)
|
||||
}
|
||||
|
||||
static inline struct resource_list_entry *
|
||||
_pci_get_bar(struct pci_dev *pdev, int bar)
|
||||
linux_pci_get_bar(struct pci_dev *pdev, int bar)
|
||||
{
|
||||
struct resource_list_entry *rle;
|
||||
|
||||
bar = PCIR_BAR(bar);
|
||||
if ((rle = _pci_get_rle(pdev, SYS_RES_MEMORY, bar)) == NULL)
|
||||
rle = _pci_get_rle(pdev, SYS_RES_IOPORT, bar);
|
||||
if ((rle = linux_pci_get_rle(pdev, SYS_RES_MEMORY, bar)) == NULL)
|
||||
rle = linux_pci_get_rle(pdev, SYS_RES_IOPORT, bar);
|
||||
return (rle);
|
||||
}
|
||||
|
||||
static inline struct device *
|
||||
_pci_find_irq_dev(unsigned int irq)
|
||||
linux_pci_find_irq_dev(unsigned int irq)
|
||||
{
|
||||
struct pci_dev *pdev;
|
||||
|
||||
@ -215,7 +215,7 @@ pci_resource_start(struct pci_dev *pdev, int bar)
|
||||
{
|
||||
struct resource_list_entry *rle;
|
||||
|
||||
if ((rle = _pci_get_bar(pdev, bar)) == NULL)
|
||||
if ((rle = linux_pci_get_bar(pdev, bar)) == NULL)
|
||||
return (0);
|
||||
return rle->start;
|
||||
}
|
||||
@ -225,7 +225,7 @@ pci_resource_len(struct pci_dev *pdev, int bar)
|
||||
{
|
||||
struct resource_list_entry *rle;
|
||||
|
||||
if ((rle = _pci_get_bar(pdev, bar)) == NULL)
|
||||
if ((rle = linux_pci_get_bar(pdev, bar)) == NULL)
|
||||
return (0);
|
||||
return rle->count;
|
||||
}
|
||||
@ -331,7 +331,7 @@ pci_release_region(struct pci_dev *pdev, int bar)
|
||||
{
|
||||
struct resource_list_entry *rle;
|
||||
|
||||
if ((rle = _pci_get_bar(pdev, bar)) == NULL)
|
||||
if ((rle = linux_pci_get_bar(pdev, bar)) == NULL)
|
||||
return;
|
||||
bus_release_resource(pdev->dev.bsddev, rle->type, rle->rid, rle->res);
|
||||
}
|
||||
@ -477,7 +477,7 @@ pci_enable_msix(struct pci_dev *pdev, struct msix_entry *entries, int nreq)
|
||||
pci_release_msi(pdev->dev.bsddev);
|
||||
return avail;
|
||||
}
|
||||
rle = _pci_get_rle(pdev, SYS_RES_IRQ, 1);
|
||||
rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 1);
|
||||
pdev->dev.msix = rle->start;
|
||||
pdev->dev.msix_max = rle->start + avail;
|
||||
for (i = 0; i < nreq; i++)
|
||||
|
@ -140,8 +140,8 @@ linux_pci_attach(device_t dev)
|
||||
kobject_set_name(&pdev->dev.kobj, device_get_nameunit(dev));
|
||||
kobject_add(&pdev->dev.kobj, &linux_root_device.kobj,
|
||||
kobject_name(&pdev->dev.kobj));
|
||||
rle = _pci_get_rle(pdev, SYS_RES_IRQ, 0);
|
||||
if (rle)
|
||||
rle = linux_pci_get_rle(pdev, SYS_RES_IRQ, 0);
|
||||
if (rle != NULL)
|
||||
pdev->dev.irq = rle->start;
|
||||
else
|
||||
pdev->dev.irq = 255;
|
||||
|
Loading…
Reference in New Issue
Block a user