jr->reply_payload_rcv_len = job->reply_payload.payload_len;
jr->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
jr->result = zfcp_ct_els->status ? -EIO : 0;
- fc_bsg_jobdone(job, jr->result, jr->reply_payload_rcv_len);
+ bsg_job_done(job, jr->result, jr->reply_payload_rcv_len);
}
static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct bsg_job *job)
bsg_reply->reply_payload_rcv_len = job->reply_payload.payload_len;
bsg_reply->result = rc;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc;
error:
bsg_reply->result = rc;
if (rc == BFA_STATUS_OK)
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc;
ibmvfc_free_event(evt);
spin_unlock_irqrestore(vhost->host->host_lock, flags);
bsg_reply->result = rc;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
rc = 0;
out:
bsg_reply->result = (PTR_ERR(fp) == -FC_EX_CLOSED) ?
-ECONNABORTED : -ETIMEDOUT;
job->reply_len = sizeof(uint32_t);
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
kfree(info);
return;
bsg_reply->reply_payload_rcv_len =
job->reply_payload.payload_len;
bsg_reply->result = 0;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
kfree(info);
}
if (job) {
bsg_reply->result = rc;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
}
return;
if (job) {
bsg_reply->result = rc;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
}
return;
job->dd_data = NULL;
/* complete the job back to userspace */
spin_unlock_irqrestore(&phba->ct_ev_lock, flags);
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
spin_lock_irqsave(&phba->ct_ev_lock, flags);
}
spin_unlock_irqrestore(&phba->ct_ev_lock, flags);
job->dd_data = NULL;
bsg_reply->result = 0;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
if (job) {
bsg_reply->result = rc;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
}
return;
bsg_reply->result = rc;
/* complete the job back to userspace if no error */
if (rc == 0)
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc;
}
bsg_reply->result = rc;
/* complete the job back to userspace if no error */
if (rc == 0)
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc;
}
bsg_reply->result = rc;
/* complete the job back to userspace if no error */
if (rc == 0)
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc;
}
bsg_reply->result = rc;
/* complete the job back to userspace if no error */
if (rc == 0)
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc;
}
job->dd_data = NULL;
/* complete the job back to userspace if no error */
if (rc == IOCB_SUCCESS)
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc;
}
job_error:
bsg_reply->result = rc;
if (rc == 0)
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc;
}
if (job) {
bsg_reply->result = 0;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
}
return;
/* if the job is still active, call job done */
if (job) {
bsg_reply = job->reply;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
}
return;
/* if the job is still active, call job done */
if (job) {
bsg_reply = job->reply;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
}
/* wait for additoinal external buffers */
bsg_reply->result = 0;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return SLI_CONFIG_HANDLED;
}
bsg_reply->result = 0;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return SLI_CONFIG_HANDLED;
/* wait for additoinal external buffers */
bsg_reply->result = 0;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return SLI_CONFIG_HANDLED;
/* job done */
bsg_reply->result = 0;
job->dd_data = NULL;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
} else if (rc == 1)
/* job submitted, will complete later*/
if (job) {
bsg_reply->result = rc;
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
}
job_error:
bsg_reply->result = rc;
if (rc == 0)
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rc;
}
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
bsg_reply->result = res;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
sp->free(vha, sp);
}
}
exit_fcp_prio_cfg:
if (!ret)
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return ret;
}
bsg_job->request_payload.sg_list,
bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);
if (!rval)
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rval;
}
ql_dbg(ql_dbg_user, vha, 0x7031,
"Vendor request 84xx reset completed.\n");
bsg_reply->result = DID_OK;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
}
bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE);
if (!rval)
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rval;
}
dma_pool_free(ha->s_dma_pool, mn, mn_dma);
if (!rval)
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rval;
}
}
bsg_reply->result = DID_OK;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
}
ha->optrom_buffer = NULL;
ha->optrom_state = QLA_SWAITING;
mutex_unlock(&ha->optrom_mutex);
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rval;
}
ha->optrom_buffer = NULL;
ha->optrom_state = QLA_SWAITING;
mutex_unlock(&ha->optrom_mutex);
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return rval;
}
done:
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->reply_payload_rcv_len = sizeof(*sr);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
done:
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
done:
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->reply_payload_rcv_len = sizeof(*i2c);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->reply_payload_rcv_len = 0;
bsg_reply->result = (DID_OK) << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
/* Always return success, vendor rsp carries correct status */
return 0;
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
}
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
}
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
}
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
}
bsg_job->reply_len = sizeof(struct fc_bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return 0;
}
bsg_job->reply_len = sizeof(*bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
dma_free_coherent(&ha->pdev->dev, sizeof(*stats),
bsg_job->reply_len = sizeof(*bsg_reply);
bsg_reply->result = DID_OK << 16;
- fc_bsg_jobdone(bsg_job, bsg_reply->result,
+ bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
kfree(dd);
*/
/**
- * fc_bsg_jobdone - completion routine for bsg requests that the LLD has
- * completed
- * @job: fc_bsg_job that is complete
- * @result: job reply result
- * @reply_payload_rcv_len: length of payload received
- */
-void fc_bsg_jobdone(struct bsg_job *job, int result,
- unsigned int reply_payload_rcv_len)
-{
- struct request *req = job->req;
- struct request *rsp = req->next_rq;
- int err;
-
- err = job->req->errors = result;
-
- if (err < 0)
- /* we're only returning the result field in the reply */
- job->req->sense_len = sizeof(uint32_t);
- else
- job->req->sense_len = job->reply_len;
-
- /* we assume all request payload was transferred, residual == 0 */
- req->resid_len = 0;
-
- if (rsp) {
- WARN_ON(reply_payload_rcv_len > rsp->resid_len);
-
- /* set reply (bidi) residual */
- rsp->resid_len -= min(reply_payload_rcv_len, rsp->resid_len);
- }
- blk_complete_request(req);
-}
-EXPORT_SYMBOL_GPL(fc_bsg_jobdone);
-
-/**
* fc_bsg_job_timeout - handler for when a bsg request timesout
* @req: request that timed out
*/
bsg_reply->reply_payload_rcv_len = 0;
bsg_reply->result = ret;
job->reply_len = sizeof(uint32_t);
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return FC_DISPATCH_UNLOCKED;
}
bsg_reply->reply_payload_rcv_len = 0;
bsg_reply->result = ret;
job->reply_len = sizeof(uint32_t);
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
return FC_DISPATCH_UNLOCKED;
}
bsg_reply->reply_payload_rcv_len = 0;
bsg_reply->result = -ENOMSG;
job->reply_len = sizeof(uint32_t);
- fc_bsg_jobdone(job, bsg_reply->result,
+ bsg_job_done(job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);
spin_lock_irq(q->queue_lock);
continue;
struct fc_vport_identifiers *);
int fc_vport_terminate(struct fc_vport *vport);
int fc_block_scsi_eh(struct scsi_cmnd *cmnd);
-void fc_bsg_jobdone(struct bsg_job *job, int result,
- unsigned int reply_payload_rcv_len);
static inline struct Scsi_Host *fc_bsg_to_shost(struct bsg_job *job)
{