[SCSI] scsi: Added support for adapter and firmware reset

Added new sysfs attr 'host_reset' in scsi_sysfs.c to
perform adapter or firmware reset as suggested by
Mike Christie here:
http://marc.info/?l=linux-scsi&m=127359347111167&w=2

user/application can write "adapter" or "firmware" on
this attr and it will call newly added function hook
in scsi_host_template to call LDD adapter or firmware
reset implementation.

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
Vikas Chaudhary
2011-08-12 02:51:28 -07:00
committed by James Bottomley
parent 6085491c34
commit 2944369144
2 changed files with 51 additions and 0 deletions

View File

@ -355,6 +355,19 @@ struct scsi_host_template {
*/
enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *);
/* This is an optional routine that allows transport to initiate
* LLD adapter or firmware reset using sysfs attribute.
*
* Return values: 0 on success, -ve value on failure.
*
* Status: OPTIONAL
*/
int (*host_reset)(struct Scsi_Host *shost, int reset_type);
#define SCSI_ADAPTER_RESET 1
#define SCSI_FIRMWARE_RESET 2
/*
* Name of proc directory
*/