Lines Matching full:job
71 /* driver data associated with the job */
104 struct bsg_job *set_job; /* job waiting for this iocb to finish */
304 struct bsg_job *job; in lpfc_bsg_send_mgmt_cmd_cmp() local
316 /* Determine if job has been aborted */ in lpfc_bsg_send_mgmt_cmd_cmp()
318 job = dd_data->set_job; in lpfc_bsg_send_mgmt_cmd_cmp()
319 if (job) { in lpfc_bsg_send_mgmt_cmd_cmp()
320 bsg_reply = job->reply; in lpfc_bsg_send_mgmt_cmd_cmp()
321 /* Prevent timeout handling from trying to abort job */ in lpfc_bsg_send_mgmt_cmd_cmp()
322 job->dd_data = NULL; in lpfc_bsg_send_mgmt_cmd_cmp()
340 if (job) { in lpfc_bsg_send_mgmt_cmd_cmp()
360 lpfc_bsg_copy_data(rmp, &job->reply_payload, in lpfc_bsg_send_mgmt_cmd_cmp()
373 /* Complete the job if the job is still active */ in lpfc_bsg_send_mgmt_cmd_cmp()
375 if (job) { in lpfc_bsg_send_mgmt_cmd_cmp()
377 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_send_mgmt_cmd_cmp()
385 * @job: fc_bsg_job to handle
388 lpfc_bsg_send_mgmt_cmd(struct bsg_job *job) in lpfc_bsg_send_mgmt_cmd() argument
390 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_bsg_send_mgmt_cmd()
392 struct lpfc_rport_data *rdata = fc_bsg_to_rport(job)->dd_data; in lpfc_bsg_send_mgmt_cmd()
394 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_send_mgmt_cmd()
453 cmp = lpfc_alloc_bsg_buffers(phba, job->request_payload.payload_len, in lpfc_bsg_send_mgmt_cmd()
459 lpfc_bsg_copy_data(cmp, &job->request_payload, in lpfc_bsg_send_mgmt_cmd()
460 job->request_payload.payload_len, 1); in lpfc_bsg_send_mgmt_cmd()
464 rmp = lpfc_alloc_bsg_buffers(phba, job->reply_payload.payload_len, 0, in lpfc_bsg_send_mgmt_cmd()
501 dd_data->set_job = job; in lpfc_bsg_send_mgmt_cmd()
505 job->dd_data = dd_data; in lpfc_bsg_send_mgmt_cmd()
535 job->dd_data = NULL; in lpfc_bsg_send_mgmt_cmd()
554 job->dd_data = NULL; in lpfc_bsg_send_mgmt_cmd()
581 struct bsg_job *job; in lpfc_bsg_rport_els_cmp() local
596 /* Determine if job has been aborted */ in lpfc_bsg_rport_els_cmp()
598 job = dd_data->set_job; in lpfc_bsg_rport_els_cmp()
599 if (job) { in lpfc_bsg_rport_els_cmp()
600 bsg_reply = job->reply; in lpfc_bsg_rport_els_cmp()
601 /* Prevent timeout handling from trying to abort job */ in lpfc_bsg_rport_els_cmp()
602 job->dd_data = NULL; in lpfc_bsg_rport_els_cmp()
615 /* Copy the completed job data or determine the job status if job is in lpfc_bsg_rport_els_cmp()
619 if (job) { in lpfc_bsg_rport_els_cmp()
623 sg_copy_from_buffer(job->reply_payload.sg_list, in lpfc_bsg_rport_els_cmp()
624 job->reply_payload.sg_cnt, in lpfc_bsg_rport_els_cmp()
647 /* Complete the job if the job is still active */ in lpfc_bsg_rport_els_cmp()
649 if (job) { in lpfc_bsg_rport_els_cmp()
651 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_rport_els_cmp()
659 * @job: fc_bsg_job to handle
662 lpfc_bsg_rport_els(struct bsg_job *job) in lpfc_bsg_rport_els() argument
664 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_bsg_rport_els()
666 struct lpfc_rport_data *rdata = fc_bsg_to_rport(job)->dd_data; in lpfc_bsg_rport_els()
668 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_rport_els()
669 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_rport_els()
686 if (job->request_payload.payload_len > FCELSSIZE) { in lpfc_bsg_rport_els()
701 cmdsize = job->request_payload.payload_len; in lpfc_bsg_rport_els()
709 * and response to ensure if the job times out and the request is freed, in lpfc_bsg_rport_els()
725 sg_copy_to_buffer(job->request_payload.sg_list, in lpfc_bsg_rport_els()
726 job->request_payload.sg_cnt, in lpfc_bsg_rport_els()
739 dd_data->set_job = job; in lpfc_bsg_rport_els()
743 job->dd_data = dd_data; in lpfc_bsg_rport_els()
773 job->dd_data = NULL; in lpfc_bsg_rport_els()
788 job->dd_data = NULL; in lpfc_bsg_rport_els()
933 struct bsg_job *job = NULL; in lpfc_bsg_ct_unsol_event() local
1133 job = dd_data->set_job; in lpfc_bsg_ct_unsol_event()
1136 if (job) { in lpfc_bsg_ct_unsol_event()
1137 bsg_reply = job->reply; in lpfc_bsg_ct_unsol_event()
1141 job->dd_data = NULL; in lpfc_bsg_ct_unsol_event()
1142 /* complete the job back to userspace */ in lpfc_bsg_ct_unsol_event()
1144 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_ct_unsol_event()
1203 * @job: SET_EVENT fc_bsg_job
1206 lpfc_bsg_hba_set_event(struct bsg_job *job) in lpfc_bsg_hba_set_event() argument
1208 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_bsg_hba_set_event()
1210 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_hba_set_event()
1218 if (job->request_len < in lpfc_bsg_hba_set_event()
1273 dd_data->set_job = job; /* for unsolicited command */ in lpfc_bsg_hba_set_event()
1274 job->dd_data = dd_data; /* for fc transport timeout callback*/ in lpfc_bsg_hba_set_event()
1276 return 0; /* call job done later */ in lpfc_bsg_hba_set_event()
1280 job->dd_data = NULL; in lpfc_bsg_hba_set_event()
1286 * @job: GET_EVENT fc_bsg_job
1289 lpfc_bsg_hba_get_event(struct bsg_job *job) in lpfc_bsg_hba_get_event() argument
1291 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_bsg_hba_get_event()
1293 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_hba_get_event()
1294 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_hba_get_event()
1302 if (job->request_len < in lpfc_bsg_hba_get_event()
1340 if (evt_dat->len > job->request_payload.payload_len) { in lpfc_bsg_hba_get_event()
1341 evt_dat->len = job->request_payload.payload_len; in lpfc_bsg_hba_get_event()
1345 job->request_payload.payload_len); in lpfc_bsg_hba_get_event()
1352 sg_copy_from_buffer(job->request_payload.sg_list, in lpfc_bsg_hba_get_event()
1353 job->request_payload.sg_cnt, in lpfc_bsg_hba_get_event()
1366 job->dd_data = NULL; in lpfc_bsg_hba_get_event()
1368 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_hba_get_event()
1373 job->dd_data = NULL; in lpfc_bsg_hba_get_event()
1401 struct bsg_job *job; in lpfc_issue_ct_rsp_cmp() local
1411 /* Determine if job has been aborted */ in lpfc_issue_ct_rsp_cmp()
1413 job = dd_data->set_job; in lpfc_issue_ct_rsp_cmp()
1414 if (job) { in lpfc_issue_ct_rsp_cmp()
1415 /* Prevent timeout handling from trying to abort job */ in lpfc_issue_ct_rsp_cmp()
1416 job->dd_data = NULL; in lpfc_issue_ct_rsp_cmp()
1430 /* Copy the completed job data or set the error status */ in lpfc_issue_ct_rsp_cmp()
1432 if (job) { in lpfc_issue_ct_rsp_cmp()
1433 bsg_reply = job->reply; in lpfc_issue_ct_rsp_cmp()
1462 /* Complete the job if the job is still active */ in lpfc_issue_ct_rsp_cmp()
1464 if (job) { in lpfc_issue_ct_rsp_cmp()
1466 bsg_job_done(job, bsg_reply->result, in lpfc_issue_ct_rsp_cmp()
1475 * @job: Pointer to the job object.
1481 lpfc_issue_ct_rsp(struct lpfc_hba *phba, struct bsg_job *job, uint32_t tag, in lpfc_issue_ct_rsp() argument
1581 dd_data->set_job = job; in lpfc_issue_ct_rsp()
1585 job->dd_data = dd_data; in lpfc_issue_ct_rsp()
1611 job->dd_data = NULL; in lpfc_issue_ct_rsp()
1623 * @job: SEND_MGMT_RESP fc_bsg_job
1626 lpfc_bsg_send_mgmt_rsp(struct bsg_job *job) in lpfc_bsg_send_mgmt_rsp() argument
1628 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_bsg_send_mgmt_rsp()
1630 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_send_mgmt_rsp()
1631 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_send_mgmt_rsp()
1639 (unsigned long)job->request_payload.payload_len; in lpfc_bsg_send_mgmt_rsp()
1665 cmp = lpfc_alloc_bsg_buffers(phba, job->request_payload.payload_len, in lpfc_bsg_send_mgmt_rsp()
1671 lpfc_bsg_copy_data(cmp, &job->request_payload, in lpfc_bsg_send_mgmt_rsp()
1672 job->request_payload.payload_len, 1); in lpfc_bsg_send_mgmt_rsp()
1674 rc = lpfc_issue_ct_rsp(phba, job, tag, cmp, bmp, bpl_entries); in lpfc_bsg_send_mgmt_rsp()
1690 job->dd_data = NULL; in lpfc_bsg_send_mgmt_rsp()
1780 * @job: LPFC_BSG_VENDOR_DIAG_MODE
1791 lpfc_sli3_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct bsg_job *job) in lpfc_sli3_bsg_diag_loopback_mode() argument
1793 struct fc_bsg_request *bsg_request = job->request; in lpfc_sli3_bsg_diag_loopback_mode()
1794 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_sli3_bsg_diag_loopback_mode()
1806 if (job->request_len < sizeof(struct fc_bsg_request) + in lpfc_sli3_bsg_diag_loopback_mode()
1811 job->request_len, in lpfc_sli3_bsg_diag_loopback_mode()
1898 /* complete the job back to userspace if no error */ in lpfc_sli3_bsg_diag_loopback_mode()
1900 bsg_job_done(job, bsg_reply->result, in lpfc_sli3_bsg_diag_loopback_mode()
2054 * @job: LPFC_BSG_VENDOR_DIAG_MODE
2060 lpfc_sli4_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct bsg_job *job) in lpfc_sli4_bsg_diag_loopback_mode() argument
2062 struct fc_bsg_request *bsg_request = job->request; in lpfc_sli4_bsg_diag_loopback_mode()
2063 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_sli4_bsg_diag_loopback_mode()
2071 if (job->request_len < sizeof(struct fc_bsg_request) + in lpfc_sli4_bsg_diag_loopback_mode()
2076 job->request_len, in lpfc_sli4_bsg_diag_loopback_mode()
2263 /* complete the job back to userspace if no error */ in lpfc_sli4_bsg_diag_loopback_mode()
2265 bsg_job_done(job, bsg_reply->result, in lpfc_sli4_bsg_diag_loopback_mode()
2272 * @job: LPFC_BSG_VENDOR_DIAG_MODE
2278 lpfc_bsg_diag_loopback_mode(struct bsg_job *job) in lpfc_bsg_diag_loopback_mode() argument
2285 shost = fc_bsg_to_shost(job); in lpfc_bsg_diag_loopback_mode()
2296 rc = lpfc_sli3_bsg_diag_loopback_mode(phba, job); in lpfc_bsg_diag_loopback_mode()
2299 rc = lpfc_sli4_bsg_diag_loopback_mode(phba, job); in lpfc_bsg_diag_loopback_mode()
2308 * @job: LPFC_BSG_VENDOR_DIAG_MODE_END
2314 lpfc_sli4_bsg_diag_mode_end(struct bsg_job *job) in lpfc_sli4_bsg_diag_mode_end() argument
2316 struct fc_bsg_request *bsg_request = job->request; in lpfc_sli4_bsg_diag_mode_end()
2317 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_sli4_bsg_diag_mode_end()
2325 shost = fc_bsg_to_shost(job); in lpfc_sli4_bsg_diag_mode_end()
2378 /* complete the job back to userspace if no error */ in lpfc_sli4_bsg_diag_mode_end()
2380 bsg_job_done(job, bsg_reply->result, in lpfc_sli4_bsg_diag_mode_end()
2387 * @job: LPFC_BSG_VENDOR_DIAG_LINK_TEST
2393 lpfc_sli4_bsg_link_diag_test(struct bsg_job *job) in lpfc_sli4_bsg_link_diag_test() argument
2395 struct fc_bsg_request *bsg_request = job->request; in lpfc_sli4_bsg_link_diag_test()
2396 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_sli4_bsg_link_diag_test()
2409 shost = fc_bsg_to_shost(job); in lpfc_sli4_bsg_link_diag_test()
2429 if (job->request_len < sizeof(struct fc_bsg_request) + in lpfc_sli4_bsg_link_diag_test()
2434 job->request_len, in lpfc_sli4_bsg_link_diag_test()
2497 if (job->reply_len < sizeof(*bsg_reply) + sizeof(*diag_status_reply)) { in lpfc_sli4_bsg_link_diag_test()
2503 job->reply_len); in lpfc_sli4_bsg_link_diag_test()
2525 /* complete the job back to userspace if no error */ in lpfc_sli4_bsg_link_diag_test()
2527 bsg_job_done(job, bsg_reply->result, in lpfc_sli4_bsg_link_diag_test()
3078 * @job: LPFC_BSG_VENDOR_DIAG_TEST fc_bsg_job
3096 lpfc_bsg_diag_loopback_run(struct bsg_job *job) in lpfc_bsg_diag_loopback_run() argument
3098 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_bsg_diag_loopback_run()
3099 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_diag_loopback_run()
3129 if (job->request_len < in lpfc_bsg_diag_loopback_run()
3138 if (job->request_payload.payload_len != in lpfc_bsg_diag_loopback_run()
3139 job->reply_payload.payload_len) { in lpfc_bsg_diag_loopback_run()
3156 size = job->request_payload.payload_len; in lpfc_bsg_diag_loopback_run()
3188 sg_copy_to_buffer(job->request_payload.sg_list, in lpfc_bsg_diag_loopback_run()
3189 job->request_payload.sg_cnt, in lpfc_bsg_diag_loopback_run()
3353 sg_copy_from_buffer(job->reply_payload.sg_list, in lpfc_bsg_diag_loopback_run()
3354 job->reply_payload.sg_cnt, in lpfc_bsg_diag_loopback_run()
3387 job->dd_data = NULL; in lpfc_bsg_diag_loopback_run()
3388 /* complete the job back to userspace if no error */ in lpfc_bsg_diag_loopback_run()
3390 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_diag_loopback_run()
3397 * @job: GET_DFC_REV fc_bsg_job
3400 lpfc_bsg_get_dfc_rev(struct bsg_job *job) in lpfc_bsg_get_dfc_rev() argument
3402 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_bsg_get_dfc_rev()
3403 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_get_dfc_rev()
3408 if (job->request_len < in lpfc_bsg_get_dfc_rev()
3420 if (job->reply_len < sizeof(*bsg_reply) + sizeof(*event_reply)) { in lpfc_bsg_get_dfc_rev()
3433 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_get_dfc_rev()
3454 struct bsg_job *job; in lpfc_bsg_issue_mbox_cmpl() local
3469 /* Determine if job has been aborted */ in lpfc_bsg_issue_mbox_cmpl()
3472 job = dd_data->set_job; in lpfc_bsg_issue_mbox_cmpl()
3473 if (job) { in lpfc_bsg_issue_mbox_cmpl()
3474 /* Prevent timeout handling from trying to abort job */ in lpfc_bsg_issue_mbox_cmpl()
3475 job->dd_data = NULL; in lpfc_bsg_issue_mbox_cmpl()
3479 /* Copy the mailbox data to the job if it is still active */ in lpfc_bsg_issue_mbox_cmpl()
3481 if (job) { in lpfc_bsg_issue_mbox_cmpl()
3482 bsg_reply = job->reply; in lpfc_bsg_issue_mbox_cmpl()
3483 size = job->reply_payload.payload_len; in lpfc_bsg_issue_mbox_cmpl()
3485 sg_copy_from_buffer(job->reply_payload.sg_list, in lpfc_bsg_issue_mbox_cmpl()
3486 job->reply_payload.sg_cnt, in lpfc_bsg_issue_mbox_cmpl()
3495 /* Complete the job if the job is still active */ in lpfc_bsg_issue_mbox_cmpl()
3497 if (job) { in lpfc_bsg_issue_mbox_cmpl()
3499 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_issue_mbox_cmpl()
3517 /* return negative error values for bsg job */ in lpfc_bsg_check_cmd_access()
3623 * lpfc_bsg_issue_mbox_ext_handle_job - job handler for multi-buffer mbox cmpl
3627 * This is routine handles BSG job for mailbox commands completions with
3634 struct bsg_job *job; in lpfc_bsg_issue_mbox_ext_handle_job() local
3646 /* Determine if job has been aborted */ in lpfc_bsg_issue_mbox_ext_handle_job()
3648 job = dd_data->set_job; in lpfc_bsg_issue_mbox_ext_handle_job()
3649 if (job) { in lpfc_bsg_issue_mbox_ext_handle_job()
3650 bsg_reply = job->reply; in lpfc_bsg_issue_mbox_ext_handle_job()
3651 /* Prevent timeout handling from trying to abort job */ in lpfc_bsg_issue_mbox_ext_handle_job()
3652 job->dd_data = NULL; in lpfc_bsg_issue_mbox_ext_handle_job()
3677 /* Complete the job if the job is still active */ in lpfc_bsg_issue_mbox_ext_handle_job()
3679 if (job) { in lpfc_bsg_issue_mbox_ext_handle_job()
3680 size = job->reply_payload.payload_len; in lpfc_bsg_issue_mbox_ext_handle_job()
3682 sg_copy_from_buffer(job->reply_payload.sg_list, in lpfc_bsg_issue_mbox_ext_handle_job()
3683 job->reply_payload.sg_cnt, in lpfc_bsg_issue_mbox_ext_handle_job()
3691 "(x%x/x%x) complete bsg job done, bsize:%d\n", in lpfc_bsg_issue_mbox_ext_handle_job()
3711 return job; in lpfc_bsg_issue_mbox_ext_handle_job()
3725 struct bsg_job *job; in lpfc_bsg_issue_read_mbox_ext_cmpl() local
3728 job = lpfc_bsg_issue_mbox_ext_handle_job(phba, pmboxq); in lpfc_bsg_issue_read_mbox_ext_cmpl()
3730 /* handle the BSG job with mailbox command */ in lpfc_bsg_issue_read_mbox_ext_cmpl()
3731 if (!job) in lpfc_bsg_issue_read_mbox_ext_cmpl()
3745 /* if the job is still active, call job done */ in lpfc_bsg_issue_read_mbox_ext_cmpl()
3746 if (job) { in lpfc_bsg_issue_read_mbox_ext_cmpl()
3747 bsg_reply = job->reply; in lpfc_bsg_issue_read_mbox_ext_cmpl()
3748 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_issue_read_mbox_ext_cmpl()
3765 struct bsg_job *job; in lpfc_bsg_issue_write_mbox_ext_cmpl() local
3768 job = lpfc_bsg_issue_mbox_ext_handle_job(phba, pmboxq); in lpfc_bsg_issue_write_mbox_ext_cmpl()
3770 /* handle the BSG job with the mailbox command */ in lpfc_bsg_issue_write_mbox_ext_cmpl()
3771 if (!job) in lpfc_bsg_issue_write_mbox_ext_cmpl()
3783 /* if the job is still active, call job done */ in lpfc_bsg_issue_write_mbox_ext_cmpl()
3784 if (job) { in lpfc_bsg_issue_write_mbox_ext_cmpl()
3785 bsg_reply = job->reply; in lpfc_bsg_issue_write_mbox_ext_cmpl()
3786 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_issue_write_mbox_ext_cmpl()
3897 lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, in lpfc_bsg_sli_cfg_read_cmd_ext() argument
3901 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_sli_cfg_read_cmd_ext()
4033 dd_data->set_job = job; in lpfc_bsg_sli_cfg_read_cmd_ext()
4036 job->dd_data = dd_data; in lpfc_bsg_sli_cfg_read_cmd_ext()
4085 lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job, in lpfc_bsg_sli_cfg_write_cmd_ext() argument
4089 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_sli_cfg_write_cmd_ext()
4090 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_sli_cfg_write_cmd_ext()
4204 dd_data->set_job = job; in lpfc_bsg_sli_cfg_write_cmd_ext()
4207 job->dd_data = dd_data; in lpfc_bsg_sli_cfg_write_cmd_ext()
4229 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_sli_cfg_write_cmd_ext()
4252 lpfc_bsg_handle_sli_cfg_mbox(struct lpfc_hba *phba, struct bsg_job *job, in lpfc_bsg_handle_sli_cfg_mbox() argument
4279 rc = lpfc_bsg_sli_cfg_read_cmd_ext(phba, job, in lpfc_bsg_handle_sli_cfg_mbox()
4289 rc = lpfc_bsg_sli_cfg_write_cmd_ext(phba, job, in lpfc_bsg_handle_sli_cfg_mbox()
4310 rc = lpfc_bsg_sli_cfg_read_cmd_ext(phba, job, in lpfc_bsg_handle_sli_cfg_mbox()
4341 rc = lpfc_bsg_sli_cfg_read_cmd_ext(phba, job, in lpfc_bsg_handle_sli_cfg_mbox()
4349 rc = lpfc_bsg_sli_cfg_write_cmd_ext(phba, job, in lpfc_bsg_handle_sli_cfg_mbox()
4402 lpfc_bsg_read_ebuf_get(struct lpfc_hba *phba, struct bsg_job *job) in lpfc_bsg_read_ebuf_get() argument
4404 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_read_ebuf_get()
4443 sg_copy_from_buffer(job->reply_payload.sg_list, in lpfc_bsg_read_ebuf_get()
4444 job->reply_payload.sg_cnt, in lpfc_bsg_read_ebuf_get()
4457 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_read_ebuf_get()
4472 lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job, in lpfc_bsg_write_ebuf_set() argument
4475 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_write_ebuf_set()
4490 size = job->request_payload.payload_len; in lpfc_bsg_write_ebuf_set()
4491 sg_copy_to_buffer(job->request_payload.sg_list, in lpfc_bsg_write_ebuf_set()
4492 job->request_payload.sg_cnt, in lpfc_bsg_write_ebuf_set()
4551 dd_data->set_job = job; in lpfc_bsg_write_ebuf_set()
4554 job->dd_data = dd_data; in lpfc_bsg_write_ebuf_set()
4575 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_write_ebuf_set()
4598 lpfc_bsg_handle_sli_cfg_ebuf(struct lpfc_hba *phba, struct bsg_job *job, in lpfc_bsg_handle_sli_cfg_ebuf() argument
4616 rc = lpfc_bsg_read_ebuf_get(phba, job); in lpfc_bsg_handle_sli_cfg_ebuf()
4628 rc = lpfc_bsg_write_ebuf_set(phba, job, dmabuf); in lpfc_bsg_handle_sli_cfg_ebuf()
4643 lpfc_bsg_handle_sli_cfg_ext(struct lpfc_hba *phba, struct bsg_job *job, in lpfc_bsg_handle_sli_cfg_ext() argument
4646 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_handle_sli_cfg_ext()
4664 rc = lpfc_bsg_handle_sli_cfg_mbox(phba, job, dmabuf); in lpfc_bsg_handle_sli_cfg_ext()
4687 rc = lpfc_bsg_handle_sli_cfg_ebuf(phba, job, dmabuf); in lpfc_bsg_handle_sli_cfg_ext()
4717 * being reset) and com-plete the job, otherwise issue the mailbox command and
4721 lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job, in lpfc_bsg_issue_mbox() argument
4724 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_issue_mbox()
4725 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_issue_mbox()
4747 if (job->reply_payload.payload_len > BSG_MBOX_SIZE || in lpfc_bsg_issue_mbox()
4748 job->request_payload.payload_len > BSG_MBOX_SIZE) { in lpfc_bsg_issue_mbox()
4780 size = job->request_payload.payload_len; in lpfc_bsg_issue_mbox()
4781 sg_copy_to_buffer(job->request_payload.sg_list, in lpfc_bsg_issue_mbox()
4782 job->request_payload.sg_cnt, pmbx, size); in lpfc_bsg_issue_mbox()
4786 rc = lpfc_bsg_handle_sli_cfg_ext(phba, job, dmabuf); in lpfc_bsg_issue_mbox()
4966 dd_data->set_job = job; in lpfc_bsg_issue_mbox()
4973 job->dd_data = dd_data; in lpfc_bsg_issue_mbox()
4983 /* job finished, copy the data */ in lpfc_bsg_issue_mbox()
4986 sg_copy_from_buffer(job->reply_payload.sg_list, in lpfc_bsg_issue_mbox()
4987 job->reply_payload.sg_cnt, in lpfc_bsg_issue_mbox()
4996 return 1; /* job started */ in lpfc_bsg_issue_mbox()
4999 /* common exit for error or job completed inline */ in lpfc_bsg_issue_mbox()
5011 * @job: MBOX fc_bsg_job for LPFC_BSG_VENDOR_MBOX.
5014 lpfc_bsg_mbox_cmd(struct bsg_job *job) in lpfc_bsg_mbox_cmd() argument
5016 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_bsg_mbox_cmd()
5017 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_mbox_cmd()
5018 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_mbox_cmd()
5025 if (job->request_len < in lpfc_bsg_mbox_cmd()
5031 (int)(job->request_len - in lpfc_bsg_mbox_cmd()
5040 rc = lpfc_bsg_issue_mbox(phba, job, vport); in lpfc_bsg_mbox_cmd()
5043 /* job done */ in lpfc_bsg_mbox_cmd()
5045 job->dd_data = NULL; in lpfc_bsg_mbox_cmd()
5046 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_mbox_cmd()
5049 /* job submitted, will complete later*/ in lpfc_bsg_mbox_cmd()
5054 job->dd_data = NULL; in lpfc_bsg_mbox_cmd()
5083 struct bsg_job *job; in lpfc_bsg_menlo_cmd_cmp() local
5100 /* Determine if job has been aborted */ in lpfc_bsg_menlo_cmd_cmp()
5102 job = dd_data->set_job; in lpfc_bsg_menlo_cmd_cmp()
5103 if (job) { in lpfc_bsg_menlo_cmd_cmp()
5104 bsg_reply = job->reply; in lpfc_bsg_menlo_cmd_cmp()
5105 /* Prevent timeout handling from trying to abort job */ in lpfc_bsg_menlo_cmd_cmp()
5106 job->dd_data = NULL; in lpfc_bsg_menlo_cmd_cmp()
5110 /* Copy the job data or set the failing status for the job */ in lpfc_bsg_menlo_cmd_cmp()
5112 if (job) { in lpfc_bsg_menlo_cmd_cmp()
5140 lpfc_bsg_copy_data(rmp, &job->reply_payload, in lpfc_bsg_menlo_cmd_cmp()
5153 /* Complete the job if active */ in lpfc_bsg_menlo_cmd_cmp()
5155 if (job) { in lpfc_bsg_menlo_cmd_cmp()
5157 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_menlo_cmd_cmp()
5166 * @job: fc_bsg_job to handle
5174 lpfc_menlo_cmd(struct bsg_job *job) in lpfc_menlo_cmd() argument
5176 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_menlo_cmd()
5177 struct fc_bsg_request *bsg_request = job->request; in lpfc_menlo_cmd()
5178 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_menlo_cmd()
5193 if (job->request_len < in lpfc_menlo_cmd()
5203 if (job->reply_len < sizeof(*bsg_reply) + in lpfc_menlo_cmd()
5248 cmp = lpfc_alloc_bsg_buffers(phba, job->request_payload.payload_len, in lpfc_menlo_cmd()
5254 lpfc_bsg_copy_data(cmp, &job->request_payload, in lpfc_menlo_cmd()
5255 job->request_payload.payload_len, 1); in lpfc_menlo_cmd()
5259 rmp = lpfc_alloc_bsg_buffers(phba, job->reply_payload.payload_len, 0, in lpfc_menlo_cmd()
5308 dd_data->set_job = job; in lpfc_menlo_cmd()
5311 job->dd_data = dd_data; in lpfc_menlo_cmd()
5333 job->dd_data = NULL; in lpfc_menlo_cmd()
5338 lpfc_forced_link_speed(struct bsg_job *job) in lpfc_forced_link_speed() argument
5340 struct Scsi_Host *shost = fc_bsg_to_shost(job); in lpfc_forced_link_speed()
5343 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_forced_link_speed()
5347 if (job->request_len < in lpfc_forced_link_speed()
5360 if (job->reply_len < sizeof(*bsg_reply) + sizeof(*forced_reply)) { in lpfc_forced_link_speed()
5374 bsg_job_done(job, bsg_reply->result, in lpfc_forced_link_speed()
5402 * @job: fc_bsg_job to handle
5407 lpfc_bsg_get_ras_config(struct bsg_job *job) in lpfc_bsg_get_ras_config() argument
5409 struct Scsi_Host *shost = fc_bsg_to_shost(job); in lpfc_bsg_get_ras_config()
5411 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_get_ras_config()
5417 if (job->request_len < in lpfc_bsg_get_ras_config()
5450 /* complete the job back to userspace */ in lpfc_bsg_get_ras_config()
5452 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_get_ras_config()
5459 * @job: fc_bsg_job to handle
5464 lpfc_bsg_set_ras_config(struct bsg_job *job) in lpfc_bsg_set_ras_config() argument
5466 struct Scsi_Host *shost = fc_bsg_to_shost(job); in lpfc_bsg_set_ras_config()
5470 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_set_ras_config()
5472 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_set_ras_config()
5476 if (job->request_len < in lpfc_bsg_set_ras_config()
5536 /* complete the job back to userspace */ in lpfc_bsg_set_ras_config()
5538 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_set_ras_config()
5546 * @job: fc_bsg_job to handle
5552 lpfc_bsg_get_ras_lwpd(struct bsg_job *job) in lpfc_bsg_get_ras_lwpd() argument
5554 struct Scsi_Host *shost = fc_bsg_to_shost(job); in lpfc_bsg_get_ras_lwpd()
5559 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_get_ras_lwpd()
5567 if (job->request_len < in lpfc_bsg_get_ras_lwpd()
5598 /* complete the job back to userspace */ in lpfc_bsg_get_ras_lwpd()
5600 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_get_ras_lwpd()
5608 * @job: fc_bsg_job to handle
5613 lpfc_bsg_get_ras_fwlog(struct bsg_job *job) in lpfc_bsg_get_ras_fwlog() argument
5615 struct Scsi_Host *shost = fc_bsg_to_shost(job); in lpfc_bsg_get_ras_fwlog()
5618 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_get_ras_fwlog()
5619 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_get_ras_fwlog()
5642 if (job->request_len < in lpfc_bsg_get_ras_fwlog()
5678 sg_copy_from_buffer(job->reply_payload.sg_list, in lpfc_bsg_get_ras_fwlog()
5679 job->reply_payload.sg_cnt, in lpfc_bsg_get_ras_fwlog()
5687 bsg_job_done(job, bsg_reply->result, in lpfc_bsg_get_ras_fwlog()
5694 lpfc_get_trunk_info(struct bsg_job *job) in lpfc_get_trunk_info() argument
5696 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_get_trunk_info()
5698 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_get_trunk_info()
5702 if (job->request_len < in lpfc_get_trunk_info()
5714 if (job->reply_len < sizeof(*bsg_reply) + sizeof(*event_reply)) { in lpfc_get_trunk_info()
5759 bsg_job_done(job, bsg_reply->result, in lpfc_get_trunk_info()
5767 * @job: fc_bsg_job to handle
5770 lpfc_bsg_hst_vendor(struct bsg_job *job) in lpfc_bsg_hst_vendor() argument
5772 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_hst_vendor()
5773 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_hst_vendor()
5779 rc = lpfc_bsg_hba_set_event(job); in lpfc_bsg_hst_vendor()
5782 rc = lpfc_bsg_hba_get_event(job); in lpfc_bsg_hst_vendor()
5785 rc = lpfc_bsg_send_mgmt_rsp(job); in lpfc_bsg_hst_vendor()
5788 rc = lpfc_bsg_diag_loopback_mode(job); in lpfc_bsg_hst_vendor()
5791 rc = lpfc_sli4_bsg_diag_mode_end(job); in lpfc_bsg_hst_vendor()
5794 rc = lpfc_bsg_diag_loopback_run(job); in lpfc_bsg_hst_vendor()
5797 rc = lpfc_sli4_bsg_link_diag_test(job); in lpfc_bsg_hst_vendor()
5800 rc = lpfc_bsg_get_dfc_rev(job); in lpfc_bsg_hst_vendor()
5803 rc = lpfc_bsg_mbox_cmd(job); in lpfc_bsg_hst_vendor()
5807 rc = lpfc_menlo_cmd(job); in lpfc_bsg_hst_vendor()
5810 rc = lpfc_forced_link_speed(job); in lpfc_bsg_hst_vendor()
5813 rc = lpfc_bsg_get_ras_lwpd(job); in lpfc_bsg_hst_vendor()
5816 rc = lpfc_bsg_get_ras_fwlog(job); in lpfc_bsg_hst_vendor()
5819 rc = lpfc_bsg_get_ras_config(job); in lpfc_bsg_hst_vendor()
5822 rc = lpfc_bsg_set_ras_config(job); in lpfc_bsg_hst_vendor()
5825 rc = lpfc_get_trunk_info(job); in lpfc_bsg_hst_vendor()
5840 * @job: bsg_job to handle
5843 lpfc_bsg_request(struct bsg_job *job) in lpfc_bsg_request() argument
5845 struct fc_bsg_request *bsg_request = job->request; in lpfc_bsg_request()
5846 struct fc_bsg_reply *bsg_reply = job->reply; in lpfc_bsg_request()
5853 rc = lpfc_bsg_hst_vendor(job); in lpfc_bsg_request()
5856 rc = lpfc_bsg_rport_els(job); in lpfc_bsg_request()
5859 rc = lpfc_bsg_send_mgmt_cmd(job); in lpfc_bsg_request()
5874 * @job: bsg_job that has timed out
5876 * This function just aborts the job's IOCB. The aborted IOCB will return to
5880 lpfc_bsg_timeout(struct bsg_job *job) in lpfc_bsg_timeout() argument
5882 struct lpfc_vport *vport = shost_priv(fc_bsg_to_shost(job)); in lpfc_bsg_timeout()
5896 /* if job's driver data is NULL, the command completed or is in the in lpfc_bsg_timeout()
5901 * command's completion handler from executing the job done callback in lpfc_bsg_timeout()
5906 dd_data = (struct bsg_job_data *)job->dd_data; in lpfc_bsg_timeout()
5909 job->dd_data = NULL; in lpfc_bsg_timeout()