aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index c04fbcd75235..15f6acaca305 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -858,8 +858,7 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
858 858
859 DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);) 859 DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no);)
860 860
861 fcport = sp->fclun->fcport; 861 fcport = sp->fcport;
862
863 if (atomic_read(&ha->loop_state) == LOOP_DOWN || 862 if (atomic_read(&ha->loop_state) == LOOP_DOWN ||
864 atomic_read(&fcport->state) == FCS_DEVICE_LOST) { 863 atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
865 return 1; 864 return 1;
@@ -884,7 +883,7 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
884 mcp->mb[1] = fcport->loop_id << 8; 883 mcp->mb[1] = fcport->loop_id << 8;
885 mcp->mb[2] = (uint16_t)handle; 884 mcp->mb[2] = (uint16_t)handle;
886 mcp->mb[3] = (uint16_t)(handle >> 16); 885 mcp->mb[3] = (uint16_t)(handle >> 16);
887 mcp->mb[6] = (uint16_t)sp->fclun->lun; 886 mcp->mb[6] = (uint16_t)sp->cmd->device->lun;
888 mcp->out_mb = MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; 887 mcp->out_mb = MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
889 mcp->in_mb = MBX_0; 888 mcp->in_mb = MBX_0;
890 mcp->tov = 30; 889 mcp->tov = 30;
@@ -980,30 +979,22 @@ qla2x00_abort_target(fc_port_t *fcport)
980 * Kernel context. 979 * Kernel context.
981 */ 980 */
982int 981int
983qla2x00_target_reset(scsi_qla_host_t *ha, uint16_t b, uint16_t t) 982qla2x00_target_reset(scsi_qla_host_t *ha, struct fc_port *fcport)
984{ 983{
985 int rval; 984 int rval;
986 mbx_cmd_t mc; 985 mbx_cmd_t mc;
987 mbx_cmd_t *mcp = &mc; 986 mbx_cmd_t *mcp = &mc;
988 os_tgt_t *tgt;
989 987
990 DEBUG11(printk("qla2x00_target_reset(%ld): entered.\n", ha->host_no);) 988 DEBUG11(printk("qla2x00_target_reset(%ld): entered.\n", ha->host_no);)
991 989
992 tgt = TGT_Q(ha, t); 990 if (atomic_read(&fcport->state) != FCS_ONLINE)
993 if (tgt->fcport == NULL) {
994 /* no target to abort */
995 return 0;
996 }
997 if (atomic_read(&tgt->fcport->state) != FCS_ONLINE) {
998 /* target not online */
999 return 0; 991 return 0;
1000 }
1001 992
1002 mcp->mb[0] = MBC_TARGET_RESET; 993 mcp->mb[0] = MBC_TARGET_RESET;
1003 if (HAS_EXTENDED_IDS(ha)) 994 if (HAS_EXTENDED_IDS(ha))
1004 mcp->mb[1] = tgt->fcport->loop_id; 995 mcp->mb[1] = fcport->loop_id;
1005 else 996 else
1006 mcp->mb[1] = tgt->fcport->loop_id << 8; 997 mcp->mb[1] = fcport->loop_id << 8;
1007 mcp->mb[2] = ha->loop_reset_delay; 998 mcp->mb[2] = ha->loop_reset_delay;
1008 mcp->out_mb = MBX_2|MBX_1|MBX_0; 999 mcp->out_mb = MBX_2|MBX_1|MBX_0;
1009 mcp->in_mb = MBX_0; 1000 mcp->in_mb = MBX_0;