Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148098
b: refs/heads/master
c: 6d29cc5
h: refs/heads/master
v: v3
  • Loading branch information
Brian King authored and James Bottomley committed Jun 8, 2009
1 parent eceba7d commit 63f9aba
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e47167b6be0ca24cbb04fb71ea611ab7c089aff
refs/heads/master: 6d29cc56bead73b6f386cf43333708579deb5eed
38 changes: 37 additions & 1 deletion trunk/drivers/scsi/ibmvscsi/ibmvfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,27 @@ static void ibmvfc_log_error(struct ibmvfc_event *evt)
rsp->flags, rsp_code, scsi_get_resid(cmnd), rsp->scsi_status);
}

/**
* ibmvfc_relogin - Log back into the specified device
* @sdev: scsi device struct
*
**/
static void ibmvfc_relogin(struct scsi_device *sdev)
{
struct ibmvfc_host *vhost = shost_priv(sdev->host);
struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
struct ibmvfc_target *tgt;

list_for_each_entry(tgt, &vhost->targets, queue) {
if (rport == tgt->rport) {
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
break;
}
}

ibmvfc_reinit_host(vhost);
}

/**
* ibmvfc_scsi_done - Handle responses from commands
* @evt: ibmvfc event to be handled
Expand Down Expand Up @@ -1516,7 +1537,7 @@ static void ibmvfc_scsi_done(struct ibmvfc_event *evt)
if ((rsp->flags & FCP_SNS_LEN_VALID) && rsp->fcp_sense_len && rsp_len <= 8)
memcpy(cmnd->sense_buffer, rsp->data.sense + rsp_len, sense_len);
if ((vfc_cmd->status & IBMVFC_VIOS_FAILURE) && (vfc_cmd->error == IBMVFC_PLOGI_REQUIRED))
ibmvfc_reinit_host(evt->vhost);
ibmvfc_relogin(cmnd->device);

if (!cmnd->result && (!scsi_get_resid(cmnd) || (rsp->flags & FCP_RESID_OVER)))
cmnd->result = (DID_ERROR << 16);
Expand Down Expand Up @@ -2181,6 +2202,7 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
struct ibmvfc_host *vhost)
{
const char *desc = ibmvfc_get_ae_desc(crq->event);
struct ibmvfc_target *tgt;

ibmvfc_log(vhost, 3, "%s event received. scsi_id: %llx, wwpn: %llx,"
" node_name: %llx\n", desc, crq->scsi_id, crq->wwpn, crq->node_name);
Expand Down Expand Up @@ -2218,9 +2240,23 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
case IBMVFC_AE_SCN_NPORT:
case IBMVFC_AE_SCN_GROUP:
vhost->events_to_log |= IBMVFC_AE_RSCN;
ibmvfc_reinit_host(vhost);
break;
case IBMVFC_AE_ELS_LOGO:
case IBMVFC_AE_ELS_PRLO:
case IBMVFC_AE_ELS_PLOGI:
list_for_each_entry(tgt, &vhost->targets, queue) {
if (!crq->scsi_id && !crq->wwpn && !crq->node_name)
break;
if (crq->scsi_id && tgt->scsi_id != crq->scsi_id)
continue;
if (crq->wwpn && tgt->ids.port_name != crq->wwpn)
continue;
if (crq->node_name && tgt->ids.node_name != crq->node_name)
continue;
ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
}

ibmvfc_reinit_host(vhost);
break;
case IBMVFC_AE_LINK_DOWN:
Expand Down

0 comments on commit 63f9aba

Please sign in to comment.