}
EXPORT_SYMBOL(pcie_get_mps);
-#ifdef HAVE_PCI_DEV_PCIE_MPSS
/**
* pcie_set_mps - set PCI Express maximum payload size
* @dev: PCI device to query
int pcie_set_mps(struct pci_dev *dev, int mps)
{
u16 v;
+#ifndef HAVE_PIC_DEV_PCIE_MPSS
+ int pos;
+ u16 reg16;
+#endif
if (mps < 128 || mps > 4096 || !is_power_of_2(mps))
return -EINVAL;
v = ffs(mps) - 8;
+
+#ifdef HAVE_PCI_DEV_PCIE_MPSS
if (v > dev->pcie_mpss)
return -EINVAL;
+#else
+ pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
+ if (!pos)
+ return -EINVAL;
+ pci_read_config_word(dev, pos + PCI_EXP_DEVCAP, ®16);
+ if (v > (reg16 & PCI_EXP_DEVCAP_PAYLOAD))
+ return -EINVAL;
+#endif
v <<= 5;
return pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
PCI_EXP_DEVCTL_PAYLOAD, v);
}
EXPORT_SYMBOL(pcie_set_mps);
-#endif
dnl Examine kernel functionality
AC_DEFUN([LINUX_CONFIG_COMPAT],
[
+ AC_MSG_CHECKING([if file_system_type has mount method])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ struct file_system_type fst;
+
+ fst.mount = NULL;
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MOUNT_METHOD, 1,
+ [mount method defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ AC_MSG_CHECKING([if kernel has get_next_ino])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ unsigned int ino;
+
+ ino = get_next_ino();
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_GET_NEXT_INO, 1,
+ [get_next_ino defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
AC_MSG_CHECKING([if kernel has ktime_get_ns])
LB_LINUX_TRY_COMPILE([
#include <linux/ktime.h>
AC_MSG_RESULT(no)
])
+ AC_MSG_CHECKING([if pci.h pci_msix_vec_count])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/pci.h>
+ ],[
+ int x = pci_msix_vec_count(NULL);
+
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_PCI_MSIX_VEC_COUNT, 1,
+ [pci_msix_vec_count is defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ AC_MSG_CHECKING([if pci_dev has msix_cap])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/pci.h>
+ ],[
+ struct pci_dev pdev;
+ pdev.msix_cap = 0;
+
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_PCI_MSIX_CAP, 1,
+ [msix_cap is defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ AC_MSG_CHECKING([if mm_struct has pinned_vm])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/mm_types.h>
+ ],[
+ struct mm_types mmt;
+ mmt.pinned_vm = 0;
+
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_PINNED_VM, 1,
+ [pinned_vm is defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+ AC_MSG_CHECKING([if kernel has idr_alloc])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/idr.h>
+ ],[
+ int x;
+ x = idr_alloc(NULL, NULL, 0, 0, 0);
+
+ return 0;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_IDR_ALLOC, 1,
+ [idr_alloc is defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
+
AC_MSG_CHECKING([if struct iscsi_transport has attr_is_visible])
LB_LINUX_TRY_COMPILE([
#include <scsi/scsi_transport_iscsi.h>