Commit 01e0e15c authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Martin K. Petersen

scsi: don't use fc_bsg_job::request and fc_bsg_job::reply directly

Don't use fc_bsg_job::request and fc_bsg_job::reply directly, but use
helper variables bsg_request and bsg_reply. This will be helpful when
transitioning to bsg-lib.
Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent eb340948
...@@ -900,8 +900,9 @@ static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct fc_bsg_job *job) ...@@ -900,8 +900,9 @@ static struct zfcp_fc_wka_port *zfcp_fc_job_wka_port(struct fc_bsg_job *job)
u32 preamble_word1; u32 preamble_word1;
u8 gs_type; u8 gs_type;
struct zfcp_adapter *adapter; struct zfcp_adapter *adapter;
struct fc_bsg_request *bsg_request = job->request;
preamble_word1 = job->request->rqst_data.r_ct.preamble_word1; preamble_word1 = bsg_request->rqst_data.r_ct.preamble_word1;
gs_type = (preamble_word1 & 0xff000000) >> 24; gs_type = (preamble_word1 & 0xff000000) >> 24;
adapter = (struct zfcp_adapter *) job->shost->hostdata[0]; adapter = (struct zfcp_adapter *) job->shost->hostdata[0];
...@@ -938,6 +939,7 @@ static int zfcp_fc_exec_els_job(struct fc_bsg_job *job, ...@@ -938,6 +939,7 @@ static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
{ {
struct zfcp_fsf_ct_els *els = job->dd_data; struct zfcp_fsf_ct_els *els = job->dd_data;
struct fc_rport *rport = job->rport; struct fc_rport *rport = job->rport;
struct fc_bsg_request *bsg_request = job->request;
struct zfcp_port *port; struct zfcp_port *port;
u32 d_id; u32 d_id;
...@@ -949,7 +951,7 @@ static int zfcp_fc_exec_els_job(struct fc_bsg_job *job, ...@@ -949,7 +951,7 @@ static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
d_id = port->d_id; d_id = port->d_id;
put_device(&port->dev); put_device(&port->dev);
} else } else
d_id = ntoh24(job->request->rqst_data.h_els.port_id); d_id = ntoh24(bsg_request->rqst_data.h_els.port_id);
els->handler = zfcp_fc_ct_els_job_handler; els->handler = zfcp_fc_ct_els_job_handler;
return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ); return zfcp_fsf_send_els(adapter, d_id, els, job->req->timeout / HZ);
...@@ -983,6 +985,7 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job) ...@@ -983,6 +985,7 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job)
struct Scsi_Host *shost; struct Scsi_Host *shost;
struct zfcp_adapter *adapter; struct zfcp_adapter *adapter;
struct zfcp_fsf_ct_els *ct_els = job->dd_data; struct zfcp_fsf_ct_els *ct_els = job->dd_data;
struct fc_bsg_request *bsg_request = job->request;
shost = job->rport ? rport_to_shost(job->rport) : job->shost; shost = job->rport ? rport_to_shost(job->rport) : job->shost;
adapter = (struct zfcp_adapter *)shost->hostdata[0]; adapter = (struct zfcp_adapter *)shost->hostdata[0];
...@@ -994,7 +997,7 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job) ...@@ -994,7 +997,7 @@ int zfcp_fc_exec_bsg_job(struct fc_bsg_job *job)
ct_els->resp = job->reply_payload.sg_list; ct_els->resp = job->reply_payload.sg_list;
ct_els->handler_data = job; ct_els->handler_data = job;
switch (job->request->msgcode) { switch (bsg_request->msgcode) {
case FC_BSG_RPT_ELS: case FC_BSG_RPT_ELS:
case FC_BSG_HST_ELS_NOLOGIN: case FC_BSG_HST_ELS_NOLOGIN:
return zfcp_fc_exec_els_job(job, adapter); return zfcp_fc_exec_els_job(job, adapter);
......
...@@ -3132,7 +3132,9 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, ...@@ -3132,7 +3132,9 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd,
static int static int
bfad_im_bsg_vendor_request(struct fc_bsg_job *job) bfad_im_bsg_vendor_request(struct fc_bsg_job *job)
{ {
uint32_t vendor_cmd = job->request->rqst_data.h_vendor.vendor_cmd[0]; struct fc_bsg_request *bsg_request = job->request;
struct fc_bsg_reply *bsg_reply = job->reply;
uint32_t vendor_cmd = bsg_request->rqst_data.h_vendor.vendor_cmd[0];
struct bfad_im_port_s *im_port = struct bfad_im_port_s *im_port =
(struct bfad_im_port_s *) job->shost->hostdata[0]; (struct bfad_im_port_s *) job->shost->hostdata[0];
struct bfad_s *bfad = im_port->bfad; struct bfad_s *bfad = im_port->bfad;
...@@ -3175,8 +3177,8 @@ bfad_im_bsg_vendor_request(struct fc_bsg_job *job) ...@@ -3175,8 +3177,8 @@ bfad_im_bsg_vendor_request(struct fc_bsg_job *job)
/* Fill the BSG job reply data */ /* Fill the BSG job reply data */
job->reply_len = job->reply_payload.payload_len; job->reply_len = job->reply_payload.payload_len;
job->reply->reply_payload_rcv_len = job->reply_payload.payload_len; bsg_reply->reply_payload_rcv_len = job->reply_payload.payload_len;
job->reply->result = rc; bsg_reply->result = rc;
job->job_done(job); job->job_done(job);
return rc; return rc;
...@@ -3184,9 +3186,9 @@ bfad_im_bsg_vendor_request(struct fc_bsg_job *job) ...@@ -3184,9 +3186,9 @@ bfad_im_bsg_vendor_request(struct fc_bsg_job *job)
/* free the command buffer */ /* free the command buffer */
kfree(payload_kbuf); kfree(payload_kbuf);
out: out:
job->reply->result = rc; bsg_reply->result = rc;
job->reply_len = sizeof(uint32_t); job->reply_len = sizeof(uint32_t);
job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
return rc; return rc;
} }
...@@ -3362,18 +3364,20 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job) ...@@ -3362,18 +3364,20 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job)
struct bfad_fcxp *drv_fcxp; struct bfad_fcxp *drv_fcxp;
struct bfa_fcs_lport_s *fcs_port; struct bfa_fcs_lport_s *fcs_port;
struct bfa_fcs_rport_s *fcs_rport; struct bfa_fcs_rport_s *fcs_rport;
uint32_t command_type = job->request->msgcode; struct fc_bsg_request *bsg_request = bsg_request;
struct fc_bsg_reply *bsg_reply = job->reply;
uint32_t command_type = bsg_request->msgcode;
unsigned long flags; unsigned long flags;
struct bfad_buf_info *rsp_buf_info; struct bfad_buf_info *rsp_buf_info;
void *req_kbuf = NULL, *rsp_kbuf = NULL; void *req_kbuf = NULL, *rsp_kbuf = NULL;
int rc = -EINVAL; int rc = -EINVAL;
job->reply_len = sizeof(uint32_t); /* Atleast uint32_t reply_len */ job->reply_len = sizeof(uint32_t); /* Atleast uint32_t reply_len */
job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
/* Get the payload passed in from userspace */ /* Get the payload passed in from userspace */
bsg_data = (struct bfa_bsg_data *) (((char *)job->request) + bsg_data = (struct bfa_bsg_data *) (((char *)bsg_request) +
sizeof(struct fc_bsg_request)); sizeof(struct fc_bsg_request));
if (bsg_data == NULL) if (bsg_data == NULL)
goto out; goto out;
...@@ -3517,13 +3521,13 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job) ...@@ -3517,13 +3521,13 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job)
/* fill the job->reply data */ /* fill the job->reply data */
if (drv_fcxp->req_status == BFA_STATUS_OK) { if (drv_fcxp->req_status == BFA_STATUS_OK) {
job->reply_len = drv_fcxp->rsp_len; job->reply_len = drv_fcxp->rsp_len;
job->reply->reply_payload_rcv_len = drv_fcxp->rsp_len; bsg_reply->reply_payload_rcv_len = drv_fcxp->rsp_len;
job->reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK; bsg_reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
} else { } else {
job->reply->reply_payload_rcv_len = bsg_reply->reply_payload_rcv_len =
sizeof(struct fc_bsg_ctels_reply); sizeof(struct fc_bsg_ctels_reply);
job->reply_len = sizeof(uint32_t); job->reply_len = sizeof(uint32_t);
job->reply->reply_data.ctels_reply.status = bsg_reply->reply_data.ctels_reply.status =
FC_CTELS_STATUS_REJECT; FC_CTELS_STATUS_REJECT;
} }
...@@ -3549,7 +3553,7 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job) ...@@ -3549,7 +3553,7 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job)
kfree(bsg_fcpt); kfree(bsg_fcpt);
kfree(drv_fcxp); kfree(drv_fcxp);
out: out:
job->reply->result = rc; bsg_reply->result = rc;
if (rc == BFA_STATUS_OK) if (rc == BFA_STATUS_OK)
job->job_done(job); job->job_done(job);
...@@ -3560,9 +3564,11 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job) ...@@ -3560,9 +3564,11 @@ bfad_im_bsg_els_ct_request(struct fc_bsg_job *job)
int int
bfad_im_bsg_request(struct fc_bsg_job *job) bfad_im_bsg_request(struct fc_bsg_job *job)
{ {
struct fc_bsg_request *bsg_request = job->request;
struct fc_bsg_reply *bsg_reply = job->reply;
uint32_t rc = BFA_STATUS_OK; uint32_t rc = BFA_STATUS_OK;
switch (job->request->msgcode) { switch (bsg_request->msgcode) {
case FC_BSG_HST_VENDOR: case FC_BSG_HST_VENDOR:
/* Process BSG HST Vendor requests */ /* Process BSG HST Vendor requests */
rc = bfad_im_bsg_vendor_request(job); rc = bfad_im_bsg_vendor_request(job);
...@@ -3575,8 +3581,8 @@ bfad_im_bsg_request(struct fc_bsg_job *job) ...@@ -3575,8 +3581,8 @@ bfad_im_bsg_request(struct fc_bsg_job *job)
rc = bfad_im_bsg_els_ct_request(job); rc = bfad_im_bsg_els_ct_request(job);
break; break;
default: default:
job->reply->result = rc = -EINVAL; bsg_reply->result = rc = -EINVAL;
job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
break; break;
} }
......
...@@ -1827,28 +1827,30 @@ static int ibmvfc_bsg_request(struct fc_bsg_job *job) ...@@ -1827,28 +1827,30 @@ static int ibmvfc_bsg_request(struct fc_bsg_job *job)
struct ibmvfc_event *evt; struct ibmvfc_event *evt;
union ibmvfc_iu rsp_iu; union ibmvfc_iu rsp_iu;
unsigned long flags, port_id = -1; unsigned long flags, port_id = -1;
unsigned int code = job->request->msgcode; struct fc_bsg_request *bsg_request = job->request;
struct fc_bsg_reply *bsg_reply = job->reply;
unsigned int code = bsg_request->msgcode;
int rc = 0, req_seg, rsp_seg, issue_login = 0; int rc = 0, req_seg, rsp_seg, issue_login = 0;
u32 fc_flags, rsp_len; u32 fc_flags, rsp_len;
ENTER; ENTER;
job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
if (rport) if (rport)
port_id = rport->port_id; port_id = rport->port_id;
switch (code) { switch (code) {
case FC_BSG_HST_ELS_NOLOGIN: case FC_BSG_HST_ELS_NOLOGIN:
port_id = (job->request->rqst_data.h_els.port_id[0] << 16) | port_id = (bsg_request->rqst_data.h_els.port_id[0] << 16) |
(job->request->rqst_data.h_els.port_id[1] << 8) | (bsg_request->rqst_data.h_els.port_id[1] << 8) |
job->request->rqst_data.h_els.port_id[2]; bsg_request->rqst_data.h_els.port_id[2];
case FC_BSG_RPT_ELS: case FC_BSG_RPT_ELS:
fc_flags = IBMVFC_FC_ELS; fc_flags = IBMVFC_FC_ELS;
break; break;
case FC_BSG_HST_CT: case FC_BSG_HST_CT:
issue_login = 1; issue_login = 1;
port_id = (job->request->rqst_data.h_ct.port_id[0] << 16) | port_id = (bsg_request->rqst_data.h_ct.port_id[0] << 16) |
(job->request->rqst_data.h_ct.port_id[1] << 8) | (bsg_request->rqst_data.h_ct.port_id[1] << 8) |
job->request->rqst_data.h_ct.port_id[2]; bsg_request->rqst_data.h_ct.port_id[2];
case FC_BSG_RPT_CT: case FC_BSG_RPT_CT:
fc_flags = IBMVFC_FC_CT_IU; fc_flags = IBMVFC_FC_CT_IU;
break; break;
...@@ -1937,12 +1939,12 @@ static int ibmvfc_bsg_request(struct fc_bsg_job *job) ...@@ -1937,12 +1939,12 @@ static int ibmvfc_bsg_request(struct fc_bsg_job *job)
if (rsp_iu.passthru.common.status) if (rsp_iu.passthru.common.status)
rc = -EIO; rc = -EIO;
else else
job->reply->reply_payload_rcv_len = rsp_len; bsg_reply->reply_payload_rcv_len = rsp_len;
spin_lock_irqsave(vhost->host->host_lock, flags); spin_lock_irqsave(vhost->host->host_lock, flags);
ibmvfc_free_event(evt); ibmvfc_free_event(evt);
spin_unlock_irqrestore(vhost->host->host_lock, flags); spin_unlock_irqrestore(vhost->host->host_lock, flags);
job->reply->result = rc; bsg_reply->result = rc;
job->job_done(job); job->job_done(job);
rc = 0; rc = 0;
out: out:
......
...@@ -1902,13 +1902,14 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp, ...@@ -1902,13 +1902,14 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp,
{ {
struct fc_bsg_info *info = info_arg; struct fc_bsg_info *info = info_arg;
struct fc_bsg_job *job = info->job; struct fc_bsg_job *job = info->job;
struct fc_bsg_reply *bsg_reply = job->reply;
struct fc_lport *lport = info->lport; struct fc_lport *lport = info->lport;
struct fc_frame_header *fh; struct fc_frame_header *fh;
size_t len; size_t len;
void *buf; void *buf;
if (IS_ERR(fp)) { if (IS_ERR(fp)) {
job->reply->result = (PTR_ERR(fp) == -FC_EX_CLOSED) ? bsg_reply->result = (PTR_ERR(fp) == -FC_EX_CLOSED) ?
-ECONNABORTED : -ETIMEDOUT; -ECONNABORTED : -ETIMEDOUT;
job->reply_len = sizeof(uint32_t); job->reply_len = sizeof(uint32_t);
job->state_flags |= FC_RQST_STATE_DONE; job->state_flags |= FC_RQST_STATE_DONE;
...@@ -1929,23 +1930,23 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp, ...@@ -1929,23 +1930,23 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp,
(unsigned short)fc_frame_payload_op(fp); (unsigned short)fc_frame_payload_op(fp);
/* Save the reply status of the job */ /* Save the reply status of the job */
job->reply->reply_data.ctels_reply.status = bsg_reply->reply_data.ctels_reply.status =
(cmd == info->rsp_code) ? (cmd == info->rsp_code) ?
FC_CTELS_STATUS_OK : FC_CTELS_STATUS_REJECT; FC_CTELS_STATUS_OK : FC_CTELS_STATUS_REJECT;
} }
job->reply->reply_payload_rcv_len += bsg_reply->reply_payload_rcv_len +=
fc_copy_buffer_to_sglist(buf, len, info->sg, &info->nents, fc_copy_buffer_to_sglist(buf, len, info->sg, &info->nents,
&info->offset, NULL); &info->offset, NULL);
if (fr_eof(fp) == FC_EOF_T && if (fr_eof(fp) == FC_EOF_T &&
(ntoh24(fh->fh_f_ctl) & (FC_FC_LAST_SEQ | FC_FC_END_SEQ)) == (ntoh24(fh->fh_f_ctl) & (FC_FC_LAST_SEQ | FC_FC_END_SEQ)) ==
(FC_FC_LAST_SEQ | FC_FC_END_SEQ)) { (FC_FC_LAST_SEQ | FC_FC_END_SEQ)) {
if (job->reply->reply_payload_rcv_len > if (bsg_reply->reply_payload_rcv_len >
job->reply_payload.payload_len) job->reply_payload.payload_len)
job->reply->reply_payload_rcv_len = bsg_reply->reply_payload_rcv_len =
job->reply_payload.payload_len; job->reply_payload.payload_len;
job->reply->result = 0; bsg_reply->result = 0;
job->state_flags |= FC_RQST_STATE_DONE; job->state_flags |= FC_RQST_STATE_DONE;
job->job_done(job); job->job_done(job);
kfree(info); kfree(info);
...@@ -2082,6 +2083,8 @@ static int fc_lport_ct_request(struct fc_bsg_job *job, ...@@ -2082,6 +2083,8 @@ static int fc_lport_ct_request(struct fc_bsg_job *job,
*/ */
int fc_lport_bsg_request(struct fc_bsg_job *job) int fc_lport_bsg_request(struct fc_bsg_job *job)
{ {
struct fc_bsg_request *bsg_request = job->request;
struct fc_bsg_reply *bsg_reply = job->reply;
struct request *rsp = job->req->next_rq; struct request *rsp = job->req->next_rq;
struct Scsi_Host *shost = job->shost; struct Scsi_Host *shost = job->shost;
struct fc_lport *lport = shost_priv(shost); struct fc_lport *lport = shost_priv(shost);
...@@ -2090,13 +2093,13 @@ int fc_lport_bsg_request(struct fc_bsg_job *job) ...@@ -2090,13 +2093,13 @@ int fc_lport_bsg_request(struct fc_bsg_job *job)
int rc = -EINVAL; int rc = -EINVAL;
u32 did, tov; u32 did, tov;
job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
if (rsp) if (rsp)
rsp->resid_len = job->reply_payload.payload_len; rsp->resid_len = job->reply_payload.payload_len;
mutex_lock(&lport->lp_mutex); mutex_lock(&lport->lp_mutex);
switch (job->request->msgcode) { switch (bsg_request->msgcode) {
case FC_BSG_RPT_ELS: case FC_BSG_RPT_ELS:
rport = job->rport; rport = job->rport;
if (!rport) if (!rport)
...@@ -2118,7 +2121,7 @@ int fc_lport_bsg_request(struct fc_bsg_job *job) ...@@ -2118,7 +2121,7 @@ int fc_lport_bsg_request(struct fc_bsg_job *job)
break; break;
case FC_BSG_HST_CT: case FC_BSG_HST_CT:
did = ntoh24(job->request->rqst_data.h_ct.port_id); did = ntoh24(bsg_request->rqst_data.h_ct.port_id);
if (did == FC_FID_DIR_SERV) { if (did == FC_FID_DIR_SERV) {
rdata = lport->dns_rdata; rdata = lport->dns_rdata;
if (!rdata) if (!rdata)
...@@ -2136,7 +2139,7 @@ int fc_lport_bsg_request(struct fc_bsg_job *job) ...@@ -2136,7 +2139,7 @@ int fc_lport_bsg_request(struct fc_bsg_job *job)
break; break;
case FC_BSG_HST_ELS_NOLOGIN: case FC_BSG_HST_ELS_NOLOGIN:
did = ntoh24(job->request->rqst_data.h_els.port_id); did = ntoh24(bsg_request->rqst_data.h_els.port_id);
rc = fc_lport_els_request(job, lport, did, lport->e_d_tov); rc = fc_lport_els_request(job, lport, did, lport->e_d_tov);
break; break;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -2198,6 +2198,7 @@ static void ...@@ -2198,6 +2198,7 @@ static void
qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
{ {
struct fc_bsg_job *bsg_job = sp->u.bsg_job; struct fc_bsg_job *bsg_job = sp->u.bsg_job;
struct fc_bsg_request *bsg_request = bsg_job->request;
els_iocb->entry_type = ELS_IOCB_TYPE; els_iocb->entry_type = ELS_IOCB_TYPE;
els_iocb->entry_count = 1; els_iocb->entry_count = 1;
...@@ -2212,8 +2213,8 @@ qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) ...@@ -2212,8 +2213,8 @@ qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
els_iocb->opcode = els_iocb->opcode =
sp->type == SRB_ELS_CMD_RPT ? sp->type == SRB_ELS_CMD_RPT ?
bsg_job->request->rqst_data.r_els.els_code : bsg_request->rqst_data.r_els.els_code :
bsg_job->request->rqst_data.h_els.command_code; bsg_request->rqst_data.h_els.command_code;
els_iocb->port_id[0] = sp->fcport->d_id.b.al_pa; els_iocb->port_id[0] = sp->fcport->d_id.b.al_pa;
els_iocb->port_id[1] = sp->fcport->d_id.b.area; els_iocb->port_id[1] = sp->fcport->d_id.b.area;
els_iocb->port_id[2] = sp->fcport->d_id.b.domain; els_iocb->port_id[2] = sp->fcport->d_id.b.domain;
......
...@@ -1357,6 +1357,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1357,6 +1357,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
const char *type; const char *type;
srb_t *sp; srb_t *sp;
struct fc_bsg_job *bsg_job; struct fc_bsg_job *bsg_job;
struct fc_bsg_reply *bsg_reply;
uint16_t comp_status; uint16_t comp_status;
int res; int res;
...@@ -1365,6 +1366,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1365,6 +1366,7 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
return; return;
bsg_job = sp->u.bsg_job; bsg_job = sp->u.bsg_job;
bsg_reply = bsg_job->reply;
type = "ct pass-through"; type = "ct pass-through";
...@@ -1373,32 +1375,32 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1373,32 +1375,32 @@ qla2x00_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
/* return FC_CTELS_STATUS_OK and leave the decoding of the ELS/CT /* return FC_CTELS_STATUS_OK and leave the decoding of the ELS/CT
* fc payload to the caller * fc payload to the caller
*/ */
bsg_job->reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK; bsg_reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
bsg_job->reply_len = sizeof(struct fc_bsg_reply); bsg_job->reply_len = sizeof(struct fc_bsg_reply);
if (comp_status != CS_COMPLETE) { if (comp_status != CS_COMPLETE) {
if (comp_status == CS_DATA_UNDERRUN) { if (comp_status == CS_DATA_UNDERRUN) {
res = DID_OK << 16; res = DID_OK << 16;
bsg_job->reply->reply_payload_rcv_len = bsg_reply->reply_payload_rcv_len =
le16_to_cpu(((sts_entry_t *)pkt)->rsp_info_len); le16_to_cpu(((sts_entry_t *)pkt)->rsp_info_len);
ql_log(ql_log_warn, vha, 0x5048, ql_log(ql_log_warn, vha, 0x5048,
"CT pass-through-%s error " "CT pass-through-%s error "
"comp_status-status=0x%x total_byte = 0x%x.\n", "comp_status-status=0x%x total_byte = 0x%x.\n",
type, comp_status, type, comp_status,
bsg_job->reply->reply_payload_rcv_len); bsg_reply->reply_payload_rcv_len);
} else { } else {
ql_log(ql_log_warn, vha, 0x5049, ql_log(ql_log_warn, vha, 0x5049,
"CT pass-through-%s error " "CT pass-through-%s error "
"comp_status-status=0x%x.\n", type, comp_status); "comp_status-status=0x%x.\n", type, comp_status);
res = DID_ERROR << 16; res = DID_ERROR << 16;
bsg_job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
} }
ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5035, ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x5035,
(uint8_t *)pkt, sizeof(*pkt)); (uint8_t *)pkt, sizeof(*pkt));
} else { } else {
res = DID_OK << 16; res = DID_OK << 16;
bsg_job->reply->reply_payload_rcv_len = bsg_reply->reply_payload_rcv_len =
bsg_job->reply_payload.payload_len; bsg_job->reply_payload.payload_len;
bsg_job->reply_len = 0; bsg_job->reply_len = 0;
} }
...@@ -1414,6 +1416,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1414,6 +1416,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
const char *type; const char *type;
srb_t *sp; srb_t *sp;
struct fc_bsg_job *bsg_job; struct fc_bsg_job *bsg_job;
struct fc_bsg_reply *bsg_reply;
uint16_t comp_status; uint16_t comp_status;
uint32_t fw_status[3]; uint32_t fw_status[3];
uint8_t* fw_sts_ptr; uint8_t* fw_sts_ptr;
...@@ -1423,6 +1426,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1423,6 +1426,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
if (!sp) if (!sp)
return; return;
bsg_job = sp->u.bsg_job; bsg_job = sp->u.bsg_job;
bsg_reply = bsg_job->reply;
type = NULL; type = NULL;
switch (sp->type) { switch (sp->type) {
...@@ -1452,13 +1456,13 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1452,13 +1456,13 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
/* return FC_CTELS_STATUS_OK and leave the decoding of the ELS/CT /* return FC_CTELS_STATUS_OK and leave the decoding of the ELS/CT
* fc payload to the caller * fc payload to the caller
*/ */
bsg_job->reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK; bsg_reply->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
bsg_job->reply_len = sizeof(struct fc_bsg_reply) + sizeof(fw_status); bsg_job->reply_len = sizeof(struct fc_bsg_reply) + sizeof(fw_status);
if (comp_status != CS_COMPLETE) { if (comp_status != CS_COMPLETE) {
if (comp_status == CS_DATA_UNDERRUN) { if (comp_status == CS_DATA_UNDERRUN) {
res = DID_OK << 16; res = DID_OK << 16;
bsg_job->reply->reply_payload_rcv_len = bsg_reply->reply_payload_rcv_len =
le16_to_cpu(((struct els_sts_entry_24xx *)pkt)->total_byte_count); le16_to_cpu(((struct els_sts_entry_24xx *)pkt)->total_byte_count);
ql_dbg(ql_dbg_user, vha, 0x503f, ql_dbg(ql_dbg_user, vha, 0x503f,
...@@ -1480,7 +1484,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1480,7 +1484,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
le16_to_cpu(((struct els_sts_entry_24xx *) le16_to_cpu(((struct els_sts_entry_24xx *)
pkt)->error_subcode_2)); pkt)->error_subcode_2));
res = DID_ERROR << 16; res = DID_ERROR << 16;
bsg_job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
fw_sts_ptr = ((uint8_t*)bsg_job->req->sense) + sizeof(struct fc_bsg_reply); fw_sts_ptr = ((uint8_t*)bsg_job->req->sense) + sizeof(struct fc_bsg_reply);
memcpy( fw_sts_ptr, fw_status, sizeof(fw_status)); memcpy( fw_sts_ptr, fw_status, sizeof(fw_status));
} }
...@@ -1489,7 +1493,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -1489,7 +1493,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
} }
else { else {
res = DID_OK << 16; res = DID_OK << 16;
bsg_job->reply->reply_payload_rcv_len = bsg_job->reply_payload.payload_len; bsg_reply->reply_payload_rcv_len = bsg_job->reply_payload.payload_len;
bsg_job->reply_len = 0; bsg_job->reply_len = 0;
} }
...@@ -1905,6 +1909,8 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt, ...@@ -1905,6 +1909,8 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt,
uint16_t thread_id; uint16_t thread_id;
uint32_t rval = EXT_STATUS_OK; uint32_t rval = EXT_STATUS_OK;
struct fc_bsg_job *bsg_job = NULL; struct fc_bsg_job *bsg_job = NULL;
struct fc_bsg_request *bsg_request;
struct fc_bsg_reply *bsg_reply;
sts_entry_t *sts; sts_entry_t *sts;
struct sts_entry_24xx *sts24; struct sts_entry_24xx *sts24;
sts = (sts_entry_t *) pkt; sts = (sts_entry_t *) pkt;
...@@ -1919,11 +1925,7 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt, ...@@ -1919,11 +1925,7 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt,
} }
sp = req->outstanding_cmds[index]; sp = req->outstanding_cmds[index];
if (sp) { if (!sp) {
/* Free outstanding command slot. */
req->outstanding_cmds[index] = NULL;
bsg_job = sp->u.bsg_job;
} else {
ql_log(ql_log_warn, vha, 0x70b0, ql_log(ql_log_warn, vha, 0x70b0,
"Req:%d: Invalid ISP SCSI completion handle(0x%x)\n", "Req:%d: Invalid ISP SCSI completion handle(0x%x)\n",
req->id, index); req->id, index);
...@@ -1932,6 +1934,12 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt, ...@@ -1932,6 +1934,12 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt,
return; return;
} }
/* Free outstanding command slot. */
req->outstanding_cmds[index] = NULL;
bsg_job = sp->u.bsg_job;
bsg_request = bsg_job->request;
bsg_reply = bsg_job->reply;
if (IS_FWI2_CAPABLE(ha)) { if (IS_FWI2_CAPABLE(ha)) {
comp_status = le16_to_cpu(sts24->comp_status); comp_status = le16_to_cpu(sts24->comp_status);
scsi_status = le16_to_cpu(sts24->scsi_status) & SS_MASK; scsi_status = le16_to_cpu(sts24->scsi_status) & SS_MASK;
...@@ -1940,14 +1948,14 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt, ...@@ -1940,14 +1948,14 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt,
scsi_status = le16_to_cpu(sts->scsi_status) & SS_MASK; scsi_status = le16_to_cpu(sts->scsi_status) & SS_MASK;
} }
thread_id = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1]; thread_id = bsg_request->rqst_data.h_vendor.vendor_cmd[1];
switch (comp_status) { switch (comp_status) {
case CS_COMPLETE: case CS_COMPLETE:
if (scsi_status == 0) { if (scsi_status == 0) {
bsg_job->reply->reply_payload_rcv_len = bsg_reply->reply_payload_rcv_len =
bsg_job->reply_payload.payload_len; bsg_job->reply_payload.payload_len;
vha->qla_stats.input_bytes += vha->qla_stats.input_bytes +=
bsg_job->reply->reply_payload_rcv_len; bsg_reply->reply_payload_rcv_len;
vha->qla_stats.input_requests++; vha->qla_stats.input_requests++;
rval = EXT_STATUS_OK; rval = EXT_STATUS_OK;
} }
...@@ -2028,11 +2036,11 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt, ...@@ -2028,11 +2036,11 @@ qla25xx_process_bidir_status_iocb(scsi_qla_host_t *vha, void *pkt,
rval = EXT_STATUS_ERR; rval = EXT_STATUS_ERR;
break; break;
} }
bsg_job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
done: done:
/* Return the vendor specific reply to API */ /* Return the vendor specific reply to API */
bsg_job->reply->reply_data.vendor_reply.vendor_rsp[0] = rval; bsg_reply->reply_data.vendor_reply.vendor_rsp[0] = rval;
bsg_job->reply_len = sizeof(struct fc_bsg_reply); bsg_job->reply_len = sizeof(struct fc_bsg_reply);
/* Always return DID_OK, bsg will send the vendor specific response /* Always return DID_OK, bsg will send the vendor specific response
* in this case only */ * in this case only */
......
...@@ -2207,6 +2207,7 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -2207,6 +2207,7 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req,
const char func[] = "IOSB_IOCB"; const char func[] = "IOSB_IOCB";
srb_t *sp; srb_t *sp;
struct fc_bsg_job *bsg_job; struct fc_bsg_job *bsg_job;
struct fc_bsg_reply *bsg_reply;
struct srb_iocb *iocb_job; struct srb_iocb *iocb_job;
int res; int res;
struct qla_mt_iocb_rsp_fx00 fstatus; struct qla_mt_iocb_rsp_fx00 fstatus;
...@@ -2226,6 +2227,7 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -2226,6 +2227,7 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req,
pkt->dataword_r; pkt->dataword_r;
} else { } else {
bsg_job = sp->u.bsg_job; bsg_job = sp->u.bsg_job;
bsg_reply = bsg_job->reply;
memset(&fstatus, 0, sizeof(struct qla_mt_iocb_rsp_fx00)); memset(&fstatus, 0, sizeof(struct qla_mt_iocb_rsp_fx00));
...@@ -2257,8 +2259,8 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req, ...@@ -2257,8 +2259,8 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req,
sp->fcport->vha, 0x5074, sp->fcport->vha, 0x5074,
(uint8_t *)fw_sts_ptr, sizeof(struct qla_mt_iocb_rsp_fx00)); (uint8_t *)fw_sts_ptr, sizeof(struct qla_mt_iocb_rsp_fx00));
res = bsg_job->reply->result = DID_OK << 16; res = bsg_reply->result = DID_OK << 16;
bsg_job->reply->reply_payload_rcv_len = bsg_reply->reply_payload_rcv_len =
bsg_job->reply_payload.payload_len; bsg_job->reply_payload.payload_len;
} }
sp->done(vha, sp, res); sp->done(vha, sp, res);
...@@ -3253,6 +3255,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) ...@@ -3253,6 +3255,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
struct srb_iocb *fxio = &sp->u.iocb_cmd; struct srb_iocb *fxio = &sp->u.iocb_cmd;
struct qla_mt_iocb_rqst_fx00 *piocb_rqst; struct qla_mt_iocb_rqst_fx00 *piocb_rqst;
struct fc_bsg_job *bsg_job; struct fc_bsg_job *bsg_job;
struct fc_bsg_request *bsg_request;
struct fxdisc_entry_fx00 fx_iocb; struct fxdisc_entry_fx00 fx_iocb;
uint8_t entry_cnt = 1; uint8_t entry_cnt = 1;
...@@ -3301,8 +3304,9 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) ...@@ -3301,8 +3304,9 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
} else { } else {
struct scatterlist *sg; struct scatterlist *sg;
bsg_job = sp->u.bsg_job; bsg_job = sp->u.bsg_job;
bsg_request = bsg_job->request;
piocb_rqst = (struct qla_mt_iocb_rqst_fx00 *) piocb_rqst = (struct qla_mt_iocb_rqst_fx00 *)
&bsg_job->request->rqst_data.h_vendor.vendor_cmd[1]; &bsg_request->rqst_data.h_vendor.vendor_cmd[1];
fx_iocb.func_num = piocb_rqst->func_type; fx_iocb.func_num = piocb_rqst->func_type;
fx_iocb.adapid = piocb_rqst->adapid; fx_iocb.adapid = piocb_rqst->adapid;
......
...@@ -3588,9 +3588,10 @@ fc_bsg_jobdone(struct fc_bsg_job *job) ...@@ -3588,9 +3588,10 @@ fc_bsg_jobdone(struct fc_bsg_job *job)
{ {
struct request *req = job->req; struct request *req = job->req;
struct request *rsp = req->next_rq; struct request *rsp = req->next_rq;
struct fc_bsg_reply *bsg_reply = job->reply;
int err; int err;
err = job->req->errors = job->reply->result; err = job->req->errors = bsg_reply->result;
if (err < 0) if (err < 0)
/* we're only returning the result field in the reply */ /* we're only returning the result field in the reply */
...@@ -3602,10 +3603,10 @@ fc_bsg_jobdone(struct fc_bsg_job *job) ...@@ -3602,10 +3603,10 @@ fc_bsg_jobdone(struct fc_bsg_job *job)
req->resid_len = 0; req->resid_len = 0;
if (rsp) { if (rsp) {
WARN_ON(job->reply->reply_payload_rcv_len > rsp->resid_len); WARN_ON(bsg_reply->reply_payload_rcv_len > rsp->resid_len);
/* set reply (bidi) residual */ /* set reply (bidi) residual */
rsp->resid_len -= min(job->reply->reply_payload_rcv_len, rsp->resid_len -= min(bsg_reply->reply_payload_rcv_len,
rsp->resid_len); rsp->resid_len);
} }
blk_complete_request(req); blk_complete_request(req);
...@@ -3779,11 +3780,19 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost, ...@@ -3779,11 +3780,19 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost,
struct fc_bsg_job *job) struct fc_bsg_job *job)
{ {
struct fc_internal *i = to_fc_internal(shost->transportt); struct fc_internal *i = to_fc_internal(shost->transportt);
struct fc_bsg_request *bsg_request = job->request;
struct fc_bsg_reply *bsg_reply = job->reply;
int cmdlen = sizeof(uint32_t); /* start with length of msgcode */ int cmdlen = sizeof(uint32_t); /* start with length of msgcode */
int ret; int ret;
/* check if we really have all the request data needed */
if (job->request_len < cmdlen) {
ret = -ENOMSG;
goto fail_host_msg;
}
/* Validate the host command */ /* Validate the host command */
switch (job->request->msgcode) { switch (bsg_request->msgcode) {
case FC_BSG_HST_ADD_RPORT: case FC_BSG_HST_ADD_RPORT:
cmdlen += sizeof(struct fc_bsg_host_add_rport); cmdlen += sizeof(struct fc_bsg_host_add_rport);
break; break;
...@@ -3815,7 +3824,7 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost, ...@@ -3815,7 +3824,7 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost,
case FC_BSG_HST_VENDOR: case FC_BSG_HST_VENDOR:
cmdlen += sizeof(struct fc_bsg_host_vendor); cmdlen += sizeof(struct fc_bsg_host_vendor);
if ((shost->hostt->vendor_id == 0L) || if ((shost->hostt->vendor_id == 0L) ||
(job->request->rqst_data.h_vendor.vendor_id != (bsg_request->rqst_data.h_vendor.vendor_id !=
shost->hostt->vendor_id)) { shost->hostt->vendor_id)) {
ret = -ESRCH; ret = -ESRCH;
goto fail_host_msg; goto fail_host_msg;
...@@ -3827,12 +3836,6 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost, ...@@ -3827,12 +3836,6 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost,
goto fail_host_msg; goto fail_host_msg;
} }
/* check if we really have all the request data needed */
if (job->request_len < cmdlen) {
ret = -ENOMSG;
goto fail_host_msg;
}
ret = i->f->bsg_request(job); ret = i->f->bsg_request(job);
if (!ret) if (!ret)
return FC_DISPATCH_UNLOCKED; return FC_DISPATCH_UNLOCKED;
...@@ -3840,8 +3843,8 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost, ...@@ -3840,8 +3843,8 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost,
fail_host_msg: fail_host_msg:
/* return the errno failure code as the only status */ /* return the errno failure code as the only status */
BUG_ON(job->reply_len < sizeof(uint32_t)); BUG_ON(job->reply_len < sizeof(uint32_t));
job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
job->reply->result = ret; bsg_reply->result = ret;
job->reply_len = sizeof(uint32_t); job->reply_len = sizeof(uint32_t);
fc_bsg_jobdone(job); fc_bsg_jobdone(job);
return FC_DISPATCH_UNLOCKED; return FC_DISPATCH_UNLOCKED;
...@@ -3878,11 +3881,19 @@ fc_bsg_rport_dispatch(struct request_queue *q, struct Scsi_Host *shost, ...@@ -3878,11 +3881,19 @@ fc_bsg_rport_dispatch(struct request_queue *q, struct Scsi_Host *shost,
struct fc_rport *rport, struct fc_bsg_job *job) struct fc_rport *rport, struct fc_bsg_job *job)
{ {
struct fc_internal *i = to_fc_internal(shost->transportt); struct fc_internal *i = to_fc_internal(shost->transportt);
struct fc_bsg_request *bsg_request = job->request;
struct fc_bsg_reply *bsg_reply = job->reply;
int cmdlen = sizeof(uint32_t); /* start with length of msgcode */ int cmdlen = sizeof(uint32_t); /* start with length of msgcode */
int ret; int ret;
/* check if we really have all the request data needed */
if (job->request_len < cmdlen) {
ret = -ENOMSG;
goto fail_rport_msg;
}
/* Validate the rport command */ /* Validate the rport command */
switch (job->request->msgcode) { switch (bsg_request->msgcode) {
case FC_BSG_RPT_ELS: case FC_BSG_RPT_ELS:
cmdlen += sizeof(struct fc_bsg_rport_els); cmdlen += sizeof(struct fc_bsg_rport_els);
goto check_bidi; goto check_bidi;
...@@ -3902,12 +3913,6 @@ fc_bsg_rport_dispatch(struct request_queue *q, struct Scsi_Host *shost, ...@@ -3902,12 +3913,6 @@ fc_bsg_rport_dispatch(struct request_queue *q, struct Scsi_Host *shost,
goto fail_rport_msg; goto fail_rport_msg;
} }
/* check if we really have all the request data needed */
if (job->request_len < cmdlen) {
ret = -ENOMSG;
goto fail_rport_msg;
}
ret = i->f->bsg_request(job); ret = i->f->bsg_request(job);
if (!ret) if (!ret)
return FC_DISPATCH_UNLOCKED; return FC_DISPATCH_UNLOCKED;
...@@ -3915,8 +3920,8 @@ fc_bsg_rport_dispatch(struct request_queue *q, struct Scsi_Host *shost, ...@@ -3915,8 +3920,8 @@ fc_bsg_rport_dispatch(struct request_queue *q, struct Scsi_Host *shost,
fail_rport_msg: fail_rport_msg:
/* return the errno failure code as the only status */ /* return the errno failure code as the only status */
BUG_ON(job->reply_len < sizeof(uint32_t)); BUG_ON(job->reply_len < sizeof(uint32_t));
job->reply->reply_payload_rcv_len = 0; bsg_reply->reply_payload_rcv_len = 0;
job->reply->result = ret; bsg_reply->result = ret;
job->reply_len = sizeof(uint32_t); job->reply_len = sizeof(uint32_t);
fc_bsg_jobdone(job); fc_bsg_jobdone(job);
return FC_DISPATCH_UNLOCKED; return FC_DISPATCH_UNLOCKED;
...@@ -3937,6 +3942,7 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost, ...@@ -3937,6 +3942,7 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost,
struct request *req; struct request *req;
struct fc_bsg_job *job; struct fc_bsg_job *job;
enum fc_dispatch_result ret; enum fc_dispatch_result ret;
struct fc_bsg_reply *bsg_reply;
if (!get_device(dev)) if (!get_device(dev))
return; return;
...@@ -3973,8 +3979,9 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost, ...@@ -3973,8 +3979,9 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost,
/* check if we have the msgcode value at least */ /* check if we have the msgcode value at least */
if (job->request_len < sizeof(uint32_t)) { if (job->request_len < sizeof(uint32_t)) {
BUG_ON(job->reply_len < sizeof(uint32_t)); BUG_ON(job->reply_len < sizeof(uint32_t));
job->reply->reply_payload_rcv_len = 0; bsg_reply = job->reply;
job->reply->result = -ENOMSG; bsg_reply->reply_payload_rcv_len = 0;
bsg_reply->result = -ENOMSG;
job->reply_len = sizeof(uint32_t); job->reply_len = sizeof(uint32_t);
fc_bsg_jobdone(job); fc_bsg_jobdone(job);
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment