aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDennis Dalessandro <dennis.dalessandro@intel.com>2016-01-06 09:54:07 -0800
committerDoug Ledford <dledford@redhat.com>2016-03-10 20:37:06 -0500
commit765525c11ef48e63717891a6636f610620ab4e7c (patch)
tree5dd58df3afee9170c28b519e18289c5e63d701c8 /drivers
parentIB/rdmavt: Add query and modify device stubs (diff)
downloadlinux-dev-765525c11ef48e63717891a6636f610620ab4e7c.tar.xz
linux-dev-765525c11ef48e63717891a6636f610620ab4e7c.zip
IB/rdmavt: Add query and modify port stubs
This patch adds the query and modify port stubs. The query will mostly entail the driver returning everything in the ib_port_attr which will get handed back to the verbs layer. The modify will need some API helpers in the driver. The send_trap and post_mad_send are still issues to address. 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')
-rw-r--r--drivers/infiniband/sw/rdmavt/vt.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index db1464678a14..5ac241c7966f 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -91,6 +91,52 @@ static int rvt_modify_device(struct ib_device *device,
return -EOPNOTSUPP;
}
+/**
+ * rvt_query_port: Passes the query port call to the driver
+ * @ibdev: Verbs IB dev
+ * @port: port number
+ * @props: structure to hold returned properties
+ *
+ * Returns 0 on success
+ */
+static int rvt_query_port(struct ib_device *ibdev, u8 port,
+ struct ib_port_attr *props)
+{
+ /*
+ * VT-DRIVER-API: query_port_state()
+ * driver returns pretty much everything in ib_port_attr
+ */
+ return -EOPNOTSUPP;
+}
+
+/**
+ * rvt_modify_port
+ * @ibdev: Verbs IB dev
+ * @port: Port number
+ * @port_modify_mask: How to change the port
+ * @props: Structure to fill in
+ *
+ * Returns 0 on success
+ */
+static int rvt_modify_port(struct ib_device *ibdev, u8 port,
+ int port_modify_mask, struct ib_port_modify *props)
+{
+ /*
+ * VT-DRIVER-API: set_link_state()
+ * driver will set the link state using the IB enumeration
+ *
+ * VT-DRIVER-API: clear_qkey_violations()
+ * clears driver private qkey counter
+ *
+ * VT-DRIVER-API: get_lid()
+ * driver needs to return the LID
+ *
+ * TBD: send_trap() and post_mad_send() need examined to see where they
+ * fit in.
+ */
+ return -EOPNOTSUPP;
+}
+
/*
* Check driver override. If driver passes a value use it, otherwise we use our
* own value.
@@ -106,6 +152,8 @@ int rvt_register_device(struct rvt_dev_info *rdi)
/* Dev Ops */
CHECK_DRIVER_OVERRIDE(rdi, query_device);
CHECK_DRIVER_OVERRIDE(rdi, modify_device);
+ CHECK_DRIVER_OVERRIDE(rdi, query_port);
+ CHECK_DRIVER_OVERRIDE(rdi, modify_port);
/* DMA Operations */
rdi->ibdev.dma_ops =