[scsi] Generalise iscsi_detached_command() to scsi_detached_command()
This commit is contained in:
parent
04878ef745
commit
976f12c501
|
@ -44,6 +44,18 @@ block_to_scsi ( struct block_device *blockdev ) {
|
||||||
return container_of ( blockdev, struct scsi_device, blockdev );
|
return container_of ( blockdev, struct scsi_device, blockdev );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle SCSI command with no backing device
|
||||||
|
*
|
||||||
|
* @v scsi SCSI device
|
||||||
|
* @v command SCSI command
|
||||||
|
* @ret rc Return status code
|
||||||
|
*/
|
||||||
|
int scsi_detached_command ( struct scsi_device *scsi __unused,
|
||||||
|
struct scsi_command *command __unused ) {
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Issue SCSI command
|
* Issue SCSI command
|
||||||
*
|
*
|
||||||
|
|
|
@ -270,6 +270,8 @@ struct scsi_device {
|
||||||
struct refcnt *backend;
|
struct refcnt *backend;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern int scsi_detached_command ( struct scsi_device *scsi,
|
||||||
|
struct scsi_command *command );
|
||||||
extern int init_scsidev ( struct scsi_device *scsi );
|
extern int init_scsidev ( struct scsi_device *scsi );
|
||||||
|
|
||||||
#endif /* _GPXE_SCSI_H */
|
#endif /* _GPXE_SCSI_H */
|
||||||
|
|
|
@ -1571,11 +1571,6 @@ static int iscsi_command ( struct scsi_device *scsi,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iscsi_detached_command ( struct scsi_device *scsi __unused,
|
|
||||||
struct scsi_command *command __unused ) {
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shut down iSCSI interface
|
* Shut down iSCSI interface
|
||||||
*
|
*
|
||||||
|
@ -1588,7 +1583,7 @@ void iscsi_detach ( struct scsi_device *scsi ) {
|
||||||
xfer_nullify ( &iscsi->socket );
|
xfer_nullify ( &iscsi->socket );
|
||||||
iscsi_close_connection ( iscsi, 0 );
|
iscsi_close_connection ( iscsi, 0 );
|
||||||
process_del ( &iscsi->process );
|
process_del ( &iscsi->process );
|
||||||
scsi->command = iscsi_detached_command;
|
scsi->command = scsi_detached_command;
|
||||||
ref_put ( scsi->backend );
|
ref_put ( scsi->backend );
|
||||||
scsi->backend = NULL;
|
scsi->backend = NULL;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue