Deleted Added
full compact
pci.h (277139) pci.h (282513)
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

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

265pci_set_master(struct pci_dev *pdev)
266{
267
268 pci_enable_busmaster(pdev->dev.bsddev);
269 return (0);
270}
271
272static inline int
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

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

265pci_set_master(struct pci_dev *pdev)
266{
267
268 pci_enable_busmaster(pdev->dev.bsddev);
269 return (0);
270}
271
272static inline int
273pci_clear_master(struct pci_dev *pdev)
274{
275
276 pci_disable_busmaster(pdev->dev.bsddev);
277 return (0);
278}
279
280static inline int
273pci_request_region(struct pci_dev *pdev, int bar, const char *res_name)
274{
275 int rid;
276 int type;
277
278 type = pci_resource_flags(pdev, bar);
279 if (type == 0)
280 return (-ENODEV);

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

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
281pci_request_region(struct pci_dev *pdev, int bar, const char *res_name)
282{
283 int rid;
284 int type;
285
286 type = pci_resource_flags(pdev, bar);
287 if (type == 0)
288 return (-ENODEV);

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

595 rle = _pci_get_rle(pdev, SYS_RES_IRQ, 1);
596 pdev->dev.msix = rle->start;
597 pdev->dev.msix_max = rle->start + avail;
598 for (i = 0; i < nreq; i++)
599 entries[i].vector = pdev->dev.msix + i;
600 return (0);
601}
602
603#define pci_enable_msix_range linux_pci_enable_msix_range
604static inline int
605pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
606 int minvec, int maxvec)
607{
608 int nvec = maxvec;
609 int rc;
610
611 if (maxvec < minvec)
612 return (-ERANGE);
613
614 do {
615 rc = pci_enable_msix(dev, entries, nvec);
616 if (rc < 0) {
617 return (rc);
618 } else if (rc > 0) {
619 if (rc < minvec)
620 return (-ENOSPC);
621 nvec = rc;
622 }
623 } while (rc);
624 return (nvec);
625}
626
595static inline int pci_channel_offline(struct pci_dev *pdev)
596{
597 return false;
598}
599
600static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
601{
602 return -ENODEV;

--- 235 unchanged lines hidden ---
627static inline int pci_channel_offline(struct pci_dev *pdev)
628{
629 return false;
630}
631
632static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
633{
634 return -ENODEV;

--- 235 unchanged lines hidden ---