Pārlūkot izejas kodu

[infiniband] Add support for identifying the underlying hardware device

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 gadus atpakaļ
vecāks
revīzija
9e036d32ba
2 mainītis faili ar 16 papildinājumiem un 2 dzēšanām
  1. 3
    2
      src/drivers/block/srp.c
  2. 13
    0
      src/net/infiniband/ib_cmrc.c

+ 3
- 2
src/drivers/block/srp.c Parādīt failu

@@ -701,7 +701,8 @@ static struct interface_operation srpdev_socket_op[] = {
701 701
 
702 702
 /** SRP device socket interface descriptor */
703 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 707
 /** SRP device SCSI interface operations */
707 708
 static struct interface_operation srpdev_scsi_op[] = {
@@ -713,7 +714,7 @@ static struct interface_operation srpdev_scsi_op[] = {
713 714
 
714 715
 /** SRP device SCSI interface descriptor */
715 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 720
  * Open SRP device

+ 13
- 0
src/net/infiniband/ib_cmrc.c Parādīt failu

@@ -334,6 +334,17 @@ static size_t ib_cmrc_xfer_window ( struct ib_cmrc_connection *cmrc ) {
334 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 348
 /** CMRC data transfer interface operations */
338 349
 static struct interface_operation ib_cmrc_xfer_operations[] = {
339 350
 	INTF_OP ( xfer_deliver, struct ib_cmrc_connection *,
@@ -341,6 +352,8 @@ static struct interface_operation ib_cmrc_xfer_operations[] = {
341 352
 	INTF_OP ( xfer_window, struct ib_cmrc_connection *,
342 353
 		  ib_cmrc_xfer_window ),
343 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 359
 /** CMRC data transfer interface descriptor */

Notiek ielāde…
Atcelt
Saglabāt