summaryrefslogtreecommitdiffstats
path: root/driver/compat.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2016-03-02 16:03:57 +0100
committerSuren A. Chilingaryan <csa@suren.me>2016-03-02 16:03:57 +0100
commit01e857cca352e73243d00b62a0c248a35cea6b71 (patch)
tree3d603934cecefac55b987286dbb1539a8acc8b16 /driver/compat.c
parenteb88dc19b8729fea5dc740e80f6f9d44791570fe (diff)
downloadpcitool-01e857cca352e73243d00b62a0c248a35cea6b71.tar.gz
pcitool-01e857cca352e73243d00b62a0c248a35cea6b71.tar.bz2
pcitool-01e857cca352e73243d00b62a0c248a35cea6b71.tar.xz
pcitool-01e857cca352e73243d00b62a0c248a35cea6b71.zip
Drop support of kernels prior to 3.2 (Debian 7, Ubuntu 12.04)
Diffstat (limited to 'driver/compat.c')
-rw-r--r--driver/compat.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/driver/compat.c b/driver/compat.c
index a632781..f28f527 100644
--- a/driver/compat.c
+++ b/driver/compat.c
@@ -2,25 +2,24 @@
int pcidriver_pcie_get_mps(struct pci_dev *dev)
{
- u16 ctl;
+ u16 ctl;
- pcie_capability_read_word(dev, PCI_EXP_DEVCTL, &ctl);
+ pcie_capability_read_word(dev, PCI_EXP_DEVCTL, &ctl);
- return 128 << ((ctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5);
+ return 128 << ((ctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5);
}
int pcidriver_pcie_set_mps(struct pci_dev *dev, int mps)
{
- u16 v;
+ u16 v;
- if (mps < 128 || mps > 4096 || !is_power_of_2(mps))
- return -EINVAL;
+ 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;
+ 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);
+ return pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_PAYLOAD, v);
}