Deleted Added
full compact
pci.h (271127) pci.h (277139)
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 135 unchanged lines hidden (view full) ---

144struct pci_dev {
145 struct device dev;
146 struct list_head links;
147 struct pci_driver *pdrv;
148 uint64_t dma_mask;
149 uint16_t device;
150 uint16_t vendor;
151 unsigned int irq;
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 135 unchanged lines hidden (view full) ---

144struct pci_dev {
145 struct device dev;
146 struct list_head links;
147 struct pci_driver *pdrv;
148 uint64_t dma_mask;
149 uint16_t device;
150 uint16_t vendor;
151 unsigned int irq;
152 unsigned int devfn;
153 u8 revision;
154 struct pci_devinfo *bus; /* bus this device is on, equivalent to linux struct pci_bus */
152 unsigned int devfn;
153 u8 revision;
155};
156
157static inline struct resource_list_entry *
158_pci_get_rle(struct pci_dev *pdev, int type, int rid)
159{
160 struct pci_devinfo *dinfo;
161 struct resource_list *rl;
162

--- 409 unchanged lines hidden (view full) ---

572 if (avail < nreq) {
573 if (avail == 0)
574 return -EINVAL;
575 return avail;
576 }
577 avail = nreq;
578 if ((error = -pci_alloc_msix(pdev->dev.bsddev, &avail)) != 0)
579 return error;
154};
155
156static inline struct resource_list_entry *
157_pci_get_rle(struct pci_dev *pdev, int type, int rid)
158{
159 struct pci_devinfo *dinfo;
160 struct resource_list *rl;
161

--- 409 unchanged lines hidden (view full) ---

571 if (avail < nreq) {
572 if (avail == 0)
573 return -EINVAL;
574 return avail;
575 }
576 avail = nreq;
577 if ((error = -pci_alloc_msix(pdev->dev.bsddev, &avail)) != 0)
578 return error;
579 /*
580 * Handle case where "pci_alloc_msix()" may allocate less
581 * interrupts than available and return with no error:
582 */
583 if (avail < nreq) {
584 pci_release_msi(pdev->dev.bsddev);
585 return avail;
586 }
580 rle = _pci_get_rle(pdev, SYS_RES_IRQ, 1);
581 pdev->dev.msix = rle->start;
582 pdev->dev.msix_max = rle->start + avail;
583 for (i = 0; i < nreq; i++)
584 entries[i].vector = pdev->dev.msix + i;
585 return (0);
586}
587

--- 243 unchanged lines hidden ---
587 rle = _pci_get_rle(pdev, SYS_RES_IRQ, 1);
588 pdev->dev.msix = rle->start;
589 pdev->dev.msix_max = rle->start + avail;
590 for (i = 0; i < nreq; i++)
591 entries[i].vector = pdev->dev.msix + i;
592 return (0);
593}
594

--- 243 unchanged lines hidden ---