]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging/rdma/hfi1: Add device specific info prints
authorDennis Dalessandro <dennis.dalessandro@intel.com>
Tue, 19 Jan 2016 22:42:06 +0000 (14:42 -0800)
committerDoug Ledford <dledford@redhat.com>
Fri, 11 Mar 2016 01:37:37 +0000 (20:37 -0500)
Implement get_card_name and get_pci_dev helper functions for rdmavt
for hfi1.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/staging/rdma/hfi1/driver.c
drivers/staging/rdma/hfi1/hfi.h
drivers/staging/rdma/hfi1/verbs.c

index d096f11c0baace4ebcdfc02a1e9585a1897951cc..62ee03ee4d9ed4a0d3158343de5940806df586d8 100644 (file)
@@ -162,6 +162,22 @@ const char *get_unit_name(int unit)
        return iname;
 }
 
+const char *get_card_name(struct rvt_dev_info *rdi)
+{
+       struct hfi1_ibdev *ibdev = container_of(rdi, struct hfi1_ibdev, rdi);
+       struct hfi1_devdata *dd = container_of(ibdev,
+                                              struct hfi1_devdata, verbs_dev);
+       return get_unit_name(dd->unit);
+}
+
+struct pci_dev *get_pci_dev(struct rvt_dev_info *rdi)
+{
+       struct hfi1_ibdev *ibdev = container_of(rdi, struct hfi1_ibdev, rdi);
+       struct hfi1_devdata *dd = container_of(ibdev,
+                                              struct hfi1_devdata, verbs_dev);
+       return dd->pcidev;
+}
+
 /*
  * Return count of units with at least one port ACTIVE.
  */
index dbea286cde727377a4b4d026675cb1c2ca559add..cff966e5938fd0b7776e906df9bf87edeeb49553 100644 (file)
@@ -1660,6 +1660,8 @@ int get_platform_config_field(struct hfi1_devdata *dd,
                        int table_index, int field_index, u32 *data, u32 len);
 
 const char *get_unit_name(int unit);
+const char *get_card_name(struct rvt_dev_info *rdi);
+struct pci_dev *get_pci_dev(struct rvt_dev_info *rdi);
 
 /*
  * Flush write combining store buffers (if present) and perform a write
index b8c6f742b18fa596427711abbee6f2c178c7e65a..ccd91da1868bf23684a9f199b49198d8743faf8b 100644 (file)
@@ -2031,6 +2031,8 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
         * Fill in rvt info object.
         */
        dd->verbs_dev.rdi.driver_f.port_callback = hfi1_create_port_files;
+       dd->verbs_dev.rdi.driver_f.get_card_name = get_card_name;
+       dd->verbs_dev.rdi.driver_f.get_pci_dev = get_pci_dev;
        dd->verbs_dev.rdi.dparms.props.max_pd = hfi1_max_pds;
        dd->verbs_dev.rdi.flags = (RVT_FLAG_MR_INIT_DRIVER |
                                   RVT_FLAG_QP_INIT_DRIVER |