aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw/rdmavt/vt.h
diff options
context:
space:
mode:
authorDennis Dalessandro <dennis.dalessandro@intel.com>2016-01-06 10:02:59 -0800
committerDoug Ledford <dledford@redhat.com>2016-03-10 20:37:11 -0500
commitb534875d5ab348fb9193692589e2ee82ae768e3a (patch)
tree680b69581da57c6cebf18eeecdcaa8ed2216459b /drivers/infiniband/sw/rdmavt/vt.h
parentIB/rdmavt: Move driver helper functions to a common structure (diff)
downloadlinux-dev-b534875d5ab348fb9193692589e2ee82ae768e3a.tar.xz
linux-dev-b534875d5ab348fb9193692589e2ee82ae768e3a.zip
IB/rdmavt: Add device specific info prints
Follow hfi1's example for printing information about the driver and incorporate into rdmavt. This requires two new functions to be provided by the driver, one to get_card_name and one to get_pci_dev. 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>
Diffstat (limited to 'drivers/infiniband/sw/rdmavt/vt.h')
-rw-r--r--drivers/infiniband/sw/rdmavt/vt.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rdmavt/vt.h b/drivers/infiniband/sw/rdmavt/vt.h
index fdb52a8221bc..54ee05a4a9b9 100644
--- a/drivers/infiniband/sw/rdmavt/vt.h
+++ b/drivers/infiniband/sw/rdmavt/vt.h
@@ -49,6 +49,7 @@
*/
#include <rdma/rdma_vt.h>
+#include <linux/pci.h>
#include "dma.h"
#include "pd.h"
#include "qp.h"
@@ -59,4 +60,31 @@
#include "mmap.h"
#include "cq.h"
+#define rvt_pr_info(rdi, fmt, ...) \
+ __rvt_pr_info(rdi->driver_f.get_pci_dev(rdi), \
+ rdi->driver_f.get_card_name(rdi), \
+ fmt, \
+ ##__VA_ARGS__)
+
+#define rvt_pr_warn(rdi, fmt, ...) \
+ __rvt_pr_warn(rdi->driver_f.get_pci_dev(rdi), \
+ rdi->driver_f.get_card_name(rdi), \
+ fmt, \
+ ##__VA_ARGS__)
+
+#define rvt_pr_err(rdi, fmt, ...) \
+ __rvt_pr_err(rdi->driver_f.get_pci_dev(rdi), \
+ rdi->driver_f.get_card_name(rdi), \
+ fmt, \
+ ##__VA_ARGS__)
+
+#define __rvt_pr_info(pdev, name, fmt, ...) \
+ dev_info(&pdev->dev, "%s: " fmt, name, ##__VA_ARGS__)
+
+#define __rvt_pr_warn(pdev, name, fmt, ...) \
+ dev_warn(&pdev->dev, "%s: " fmt, name, ##__VA_ARGS__)
+
+#define __rvt_pr_err(pdev, name, fmt, ...) \
+ dev_err(&pdev->dev, "%s: " fmt, name, ##__VA_ARGS__)
+
#endif /* DEF_RDMAVT_H */