Browse Source

[infiniband] Add support for identifying the underlying hardware device

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
9e036d32ba
2 changed files with 16 additions and 2 deletions
  1. 3
    2
      src/drivers/block/srp.c
  2. 13
    0
      src/net/infiniband/ib_cmrc.c

+ 3
- 2
src/drivers/block/srp.c View File

701
 
701
 
702
 /** SRP device socket interface descriptor */
702
 /** SRP device socket interface descriptor */
703
 static struct interface_descriptor srpdev_socket_desc =
703
 static struct interface_descriptor srpdev_socket_desc =
704
-	INTF_DESC ( struct srp_device, socket, srpdev_socket_op );
704
+	INTF_DESC_PASSTHRU ( struct srp_device, socket, srpdev_socket_op,
705
+			     scsi );
705
 
706
 
706
 /** SRP device SCSI interface operations */
707
 /** SRP device SCSI interface operations */
707
 static struct interface_operation srpdev_scsi_op[] = {
708
 static struct interface_operation srpdev_scsi_op[] = {
713
 
714
 
714
 /** SRP device SCSI interface descriptor */
715
 /** SRP device SCSI interface descriptor */
715
 static struct interface_descriptor srpdev_scsi_desc =
716
 static struct interface_descriptor srpdev_scsi_desc =
716
-	INTF_DESC ( struct srp_device, scsi, srpdev_scsi_op );
717
+	INTF_DESC_PASSTHRU ( struct srp_device, scsi, srpdev_scsi_op, socket  );
717
 
718
 
718
 /**
719
 /**
719
  * Open SRP device
720
  * Open SRP device

+ 13
- 0
src/net/infiniband/ib_cmrc.c View File

334
 	return ( cmrc->connected ? IB_MAX_PAYLOAD_SIZE : 0 );
334
 	return ( cmrc->connected ? IB_MAX_PAYLOAD_SIZE : 0 );
335
 }
335
 }
336
 
336
 
337
+/**
338
+ * Identify device underlying CMRC connection
339
+ *
340
+ * @v cmrc		CMRC connection
341
+ * @ret device		Underlying device
342
+ */
343
+static struct device *
344
+ib_cmrc_identify_device ( struct ib_cmrc_connection *cmrc ) {
345
+	return cmrc->ibdev->dev;
346
+}
347
+
337
 /** CMRC data transfer interface operations */
348
 /** CMRC data transfer interface operations */
338
 static struct interface_operation ib_cmrc_xfer_operations[] = {
349
 static struct interface_operation ib_cmrc_xfer_operations[] = {
339
 	INTF_OP ( xfer_deliver, struct ib_cmrc_connection *,
350
 	INTF_OP ( xfer_deliver, struct ib_cmrc_connection *,
341
 	INTF_OP ( xfer_window, struct ib_cmrc_connection *,
352
 	INTF_OP ( xfer_window, struct ib_cmrc_connection *,
342
 		  ib_cmrc_xfer_window ),
353
 		  ib_cmrc_xfer_window ),
343
 	INTF_OP ( intf_close, struct ib_cmrc_connection *, ib_cmrc_close ),
354
 	INTF_OP ( intf_close, struct ib_cmrc_connection *, ib_cmrc_close ),
355
+	INTF_OP ( identify_device, struct ib_cmrc_connection *,
356
+		  ib_cmrc_identify_device ),
344
 };
357
 };
345
 
358
 
346
 /** CMRC data transfer interface descriptor */
359
 /** CMRC data transfer interface descriptor */

Loading…
Cancel
Save