summaryrefslogtreecommitdiffstats
path: root/driver/compat.c
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-03-03 10:34:49 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-03-03 10:34:49 +0100
commitee16e47966afe180d3c32e2b1d93301052894fac (patch)
tree56aecf261aaae57e28c08cef573ae6642ec5394d /driver/compat.c
parent02d0026e2df2ba5c68c0c1a67aec4437c9e8e8f3 (diff)
parent195c28f3074486165b6e0935362810f8a1fb9531 (diff)
downloadpcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.gz
pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.bz2
pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.xz
pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.zip
Merge with http://ufo.kit.edu/ufo/log/csa/pcitool 369 revision
Diffstat (limited to 'driver/compat.c')
-rw-r--r--driver/compat.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/driver/compat.c b/driver/compat.c
deleted file mode 100644
index a632781..0000000
--- a/driver/compat.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <linux/pci.h>
-
-int pcidriver_pcie_get_mps(struct pci_dev *dev)
-{
- u16 ctl;
-
- pcie_capability_read_word(dev, PCI_EXP_DEVCTL, &ctl);
-
- return 128 << ((ctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5);
-}
-
-int pcidriver_pcie_set_mps(struct pci_dev *dev, int mps)
-{
- u16 v;
-
- if (mps < 128 || mps > 4096 || !is_power_of_2(mps))
- return -EINVAL;
-
- v = ffs(mps) - 8;
- if (v > dev->pcie_mpss)
- return -EINVAL;
- v <<= 5;
-
- return pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
- PCI_EXP_DEVCTL_PAYLOAD, v);
-}