浏览代码

[scsi] Generalise iscsi_detached_command() to scsi_detached_command()

tags/v0.9.8
Michael Brown 15 年前
父节点
当前提交
976f12c501
共有 3 个文件被更改,包括 15 次插入6 次删除
  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 查看文件

@@ -44,6 +44,18 @@ block_to_scsi ( struct block_device *blockdev ) {
44 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 60
  * Issue SCSI command
49 61
  *

+ 2
- 0
src/include/gpxe/scsi.h 查看文件

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

+ 1
- 6
src/net/tcp/iscsi.c 查看文件

@@ -1571,11 +1571,6 @@ static int iscsi_command ( struct scsi_device *scsi,
1571 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 1575
  * Shut down iSCSI interface
1581 1576
  *
@@ -1588,7 +1583,7 @@ void iscsi_detach ( struct scsi_device *scsi ) {
1588 1583
 	xfer_nullify ( &iscsi->socket );
1589 1584
 	iscsi_close_connection ( iscsi, 0 );
1590 1585
 	process_del ( &iscsi->process );
1591
-	scsi->command = iscsi_detached_command;
1586
+	scsi->command = scsi_detached_command;
1592 1587
 	ref_put ( scsi->backend );
1593 1588
 	scsi->backend = NULL;
1594 1589
 }

正在加载...
取消
保存