Browse Source

[scsi] Generalise iscsi_detached_command() to scsi_detached_command()

tags/v0.9.8
Michael Brown 15 years ago
parent
commit
976f12c501
3 changed files with 15 additions and 6 deletions
  1. 12
    0
      src/drivers/block/scsi.c
  2. 2
    0
      src/include/gpxe/scsi.h
  3. 1
    6
      src/net/tcp/iscsi.c

+ 12
- 0
src/drivers/block/scsi.c View File

44
 	return container_of ( blockdev, struct scsi_device, blockdev );
44
 	return container_of ( blockdev, struct scsi_device, blockdev );
45
 }
45
 }
46
 
46
 
47
+/**
48
+ * Handle SCSI command with no backing device
49
+ *
50
+ * @v scsi		SCSI device
51
+ * @v command		SCSI command
52
+ * @ret rc		Return status code
53
+ */
54
+int scsi_detached_command ( struct scsi_device *scsi __unused,
55
+			    struct scsi_command *command __unused ) {
56
+	return -ENODEV;
57
+}
58
+
47
 /**
59
 /**
48
  * Issue SCSI command
60
  * Issue SCSI command
49
  *
61
  *

+ 2
- 0
src/include/gpxe/scsi.h View File

270
 	struct refcnt *backend;
270
 	struct refcnt *backend;
271
 };
271
 };
272
 
272
 
273
+extern int scsi_detached_command ( struct scsi_device *scsi,
274
+				   struct scsi_command *command );
273
 extern int init_scsidev ( struct scsi_device *scsi );
275
 extern int init_scsidev ( struct scsi_device *scsi );
274
 
276
 
275
 #endif /* _GPXE_SCSI_H */
277
 #endif /* _GPXE_SCSI_H */

+ 1
- 6
src/net/tcp/iscsi.c View File

1571
 	return 0;
1571
 	return 0;
1572
 }
1572
 }
1573
 
1573
 
1574
-static int iscsi_detached_command ( struct scsi_device *scsi __unused,
1575
-				    struct scsi_command *command __unused ) {
1576
-	return -ENODEV;
1577
-}
1578
-
1579
 /**
1574
 /**
1580
  * Shut down iSCSI interface
1575
  * Shut down iSCSI interface
1581
  *
1576
  *
1588
 	xfer_nullify ( &iscsi->socket );
1583
 	xfer_nullify ( &iscsi->socket );
1589
 	iscsi_close_connection ( iscsi, 0 );
1584
 	iscsi_close_connection ( iscsi, 0 );
1590
 	process_del ( &iscsi->process );
1585
 	process_del ( &iscsi->process );
1591
-	scsi->command = iscsi_detached_command;
1586
+	scsi->command = scsi_detached_command;
1592
 	ref_put ( scsi->backend );
1587
 	ref_put ( scsi->backend );
1593
 	scsi->backend = NULL;
1588
 	scsi->backend = NULL;
1594
 }
1589
 }

Loading…
Cancel
Save