/* Called to send an abort and then wait for abort completion  */
static int fc_fcp_pkt_abort(struct fc_fcp_pkt *fsp)
/* Called to send an abort and then wait for abort completion  */
static int fc_fcp_pkt_abort(struct fc_fcp_pkt *fsp)
{
	int rc = FAILED;
	if (fc_fcp_send_abort(fsp))
		return FAILED;
	init_completion(&fsp->tm_done);
	fsp->wait_for_comp = 1;
	spin_unlock_bh(&fsp->scsi_pkt_lock);
	rc = wait_for_completion_timeout(&fsp->tm_done, FC_SCSI_TM_TOV);
	spin_lock_bh(&fsp->scsi_pkt_lock);
	fsp->wait_for_comp = 0;
	if (!rc) {
		FC_FCP_DBG(fsp, "target abort cmd  failed\n");
		rc = FAILED;
	} else if (fsp->state & FC_SRB_ABORTED) {
		FC_FCP_DBG(fsp, "target abort cmd  passed\n");
		rc = SUCCESS;
		fc_fcp_complete_locked(fsp);
	}
	return rc;
}