]> git.openfabrics.org - ~emulex/for-vlad/compat.git/commitdiff
autoconf options for qib driver for RHEL 6.6
authorVinit Agnihotri <vinit.abhay.agnihotri@intel.com>
Tue, 27 Jan 2015 08:35:09 +0000 (00:35 -0800)
committerMike Marciniszyn <mike.marciniszyn@intel.com>
Tue, 3 Mar 2015 13:21:19 +0000 (08:21 -0500)
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Vinit Agnihotri <vinit.abhay.agnihotri@intel.com>
compat/compat-3.13.c
config/rdma.m4

index a76d1def304030028e7c6c104d7da72746a75820..3f6cdc85500811bbec9d966b575bcbb98fc8ec2b 100644 (file)
@@ -16,7 +16,6 @@ int pcie_get_mps(struct pci_dev *dev)
 }
 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
@@ -28,17 +27,30 @@ EXPORT_SYMBOL(pcie_get_mps);
 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, &reg16);
+       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
index fc0ae336170a8ad4a6cfaf341783bee76b8dc4ac..2c68652a495d2f2a05c19e9af6a6b42b7a8b983b 100644 (file)
@@ -139,6 +139,38 @@ AC_DEFUN([RDMA_CONFIG_COMPAT],
 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>
@@ -346,6 +378,70 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                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>