Lines Matching refs:bsg_job

25 	struct bsg_job *bsg_job = sp->u.bsg_job;  in qla2x00_bsg_job_done()  local
26 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_bsg_job_done()
31 __func__, sp->handle, res, bsg_job); in qla2x00_bsg_job_done()
37 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_bsg_job_done()
47 struct bsg_job *bsg_job = sp->u.bsg_job; in qla2x00_bsg_sp_free() local
48 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_bsg_sp_free()
57 bsg_job->request_payload.sg_list, in qla2x00_bsg_sp_free()
58 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_bsg_sp_free()
62 bsg_job->reply_payload.sg_list, in qla2x00_bsg_sp_free()
63 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_bsg_sp_free()
72 dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_bsg_sp_free()
73 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_bsg_sp_free()
75 dma_unmap_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_bsg_sp_free()
76 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_bsg_sp_free()
145 qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) in qla24xx_proc_fcp_prio_cfg_cmd() argument
147 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla24xx_proc_fcp_prio_cfg_cmd()
148 struct fc_bsg_request *bsg_request = bsg_job->request; in qla24xx_proc_fcp_prio_cfg_cmd()
149 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla24xx_proc_fcp_prio_cfg_cmd()
201 len = bsg_job->reply_payload.payload_len; in qla24xx_proc_fcp_prio_cfg_cmd()
211 bsg_job->reply_payload.sg_list, in qla24xx_proc_fcp_prio_cfg_cmd()
212 bsg_job->reply_payload.sg_cnt, ha->fcp_prio_cfg, in qla24xx_proc_fcp_prio_cfg_cmd()
218 len = bsg_job->request_payload.payload_len; in qla24xx_proc_fcp_prio_cfg_cmd()
238 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla24xx_proc_fcp_prio_cfg_cmd()
239 bsg_job->request_payload.sg_cnt, ha->fcp_prio_cfg, in qla24xx_proc_fcp_prio_cfg_cmd()
267 bsg_job_done(bsg_job, bsg_reply->result, in qla24xx_proc_fcp_prio_cfg_cmd()
273 qla2x00_process_els(struct bsg_job *bsg_job) in qla2x00_process_els() argument
275 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_process_els()
289 rport = fc_bsg_to_rport(bsg_job); in qla2x00_process_els()
300 host = fc_bsg_to_shost(bsg_job); in qla2x00_process_els()
306 return qla_edif_process_els(vha, bsg_job); in qla2x00_process_els()
324 if (bsg_job->request_payload.sg_cnt > 1 || in qla2x00_process_els()
325 bsg_job->reply_payload.sg_cnt > 1) { in qla2x00_process_els()
329 bsg_job->request_payload.sg_cnt, in qla2x00_process_els()
330 bsg_job->reply_payload.sg_cnt); in qla2x00_process_els()
374 dma_map_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_process_els()
375 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_els()
377 dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_process_els()
378 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_els()
383 rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_process_els()
384 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_els()
386 dma_unmap_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_process_els()
387 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_els()
392 if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) || in qla2x00_process_els()
393 (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) { in qla2x00_process_els()
397 "dma_reply_sg_cnt:%x.\n", bsg_job->request_payload.sg_cnt, in qla2x00_process_els()
398 req_sg_cnt, bsg_job->reply_payload.sg_cnt, rsp_sg_cnt); in qla2x00_process_els()
416 sp->u.bsg_job = bsg_job; in qla2x00_process_els()
437 dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_process_els()
438 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_els()
439 dma_unmap_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_process_els()
440 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_els()
465 qla2x00_process_ct(struct bsg_job *bsg_job) in qla2x00_process_ct() argument
468 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_process_ct()
469 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_process_ct()
479 dma_map_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_process_ct()
480 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_ct()
488 rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_process_ct()
489 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_ct()
553 sp->u.bsg_job = bsg_job; in qla2x00_process_ct()
577 dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_process_ct()
578 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_ct()
579 dma_unmap_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_process_ct()
580 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_ct()
733 qla2x00_process_loopback(struct bsg_job *bsg_job) in qla2x00_process_loopback() argument
735 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_process_loopback()
736 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_process_loopback()
737 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_process_loopback()
762 bsg_job->request_payload.sg_list, bsg_job->request_payload.sg_cnt, in qla2x00_process_loopback()
772 bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, in qla2x00_process_loopback()
782 if ((elreq.req_sg_cnt != bsg_job->request_payload.sg_cnt) || in qla2x00_process_loopback()
783 (elreq.rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) { in qla2x00_process_loopback()
788 bsg_job->request_payload.sg_cnt, elreq.req_sg_cnt, in qla2x00_process_loopback()
789 bsg_job->reply_payload.sg_cnt, elreq.rsp_sg_cnt); in qla2x00_process_loopback()
793 req_data_len = rsp_data_len = bsg_job->request_payload.payload_len; in qla2x00_process_loopback()
813 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_process_loopback()
814 bsg_job->request_payload.sg_cnt, req_data, req_data_len); in qla2x00_process_loopback()
942 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_process_loopback()
943 bsg_job->reply_payload.sg_cnt, rsp_data, in qla2x00_process_loopback()
947 bsg_job->reply_len = sizeof(struct fc_bsg_reply) + in qla2x00_process_loopback()
949 fw_sts_ptr = bsg_job->reply + sizeof(struct fc_bsg_reply); in qla2x00_process_loopback()
950 memcpy(bsg_job->reply + sizeof(struct fc_bsg_reply), response, in qla2x00_process_loopback()
963 bsg_job->reply_payload.sg_list, in qla2x00_process_loopback()
964 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_loopback()
967 bsg_job->request_payload.sg_list, in qla2x00_process_loopback()
968 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_loopback()
970 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_process_loopback()
976 qla84xx_reset(struct bsg_job *bsg_job) in qla84xx_reset() argument
978 struct fc_bsg_request *bsg_request = bsg_job->request; in qla84xx_reset()
979 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla84xx_reset()
980 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla84xx_reset()
1004 bsg_job_done(bsg_job, bsg_reply->result, in qla84xx_reset()
1012 qla84xx_updatefw(struct bsg_job *bsg_job) in qla84xx_updatefw() argument
1014 struct fc_bsg_request *bsg_request = bsg_job->request; in qla84xx_updatefw()
1015 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla84xx_updatefw()
1016 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla84xx_updatefw()
1035 sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla84xx_updatefw()
1036 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla84xx_updatefw()
1043 if (sg_cnt != bsg_job->request_payload.sg_cnt) { in qla84xx_updatefw()
1047 bsg_job->request_payload.sg_cnt, sg_cnt); in qla84xx_updatefw()
1052 data_len = bsg_job->request_payload.payload_len; in qla84xx_updatefw()
1062 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla84xx_updatefw()
1063 bsg_job->request_payload.sg_cnt, fw_buf, data_len); in qla84xx_updatefw()
1102 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla84xx_updatefw()
1112 dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla84xx_updatefw()
1113 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla84xx_updatefw()
1116 bsg_job_done(bsg_job, bsg_reply->result, in qla84xx_updatefw()
1122 qla84xx_mgmt_cmd(struct bsg_job *bsg_job) in qla84xx_mgmt_cmd() argument
1124 struct fc_bsg_request *bsg_request = bsg_job->request; in qla84xx_mgmt_cmd()
1125 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla84xx_mgmt_cmd()
1126 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla84xx_mgmt_cmd()
1158 bsg_job->reply_payload.sg_list, in qla84xx_mgmt_cmd()
1159 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla84xx_mgmt_cmd()
1169 if (sg_cnt != bsg_job->reply_payload.sg_cnt) { in qla84xx_mgmt_cmd()
1173 bsg_job->reply_payload.sg_cnt, sg_cnt); in qla84xx_mgmt_cmd()
1178 data_len = bsg_job->reply_payload.payload_len; in qla84xx_mgmt_cmd()
1208 bsg_job->request_payload.sg_list, in qla84xx_mgmt_cmd()
1209 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla84xx_mgmt_cmd()
1220 if (sg_cnt != bsg_job->request_payload.sg_cnt) { in qla84xx_mgmt_cmd()
1224 bsg_job->request_payload.sg_cnt, sg_cnt); in qla84xx_mgmt_cmd()
1229 data_len = bsg_job->request_payload.payload_len; in qla84xx_mgmt_cmd()
1239 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla84xx_mgmt_cmd()
1240 bsg_job->request_payload.sg_cnt, mgmt_b, data_len); in qla84xx_mgmt_cmd()
1283 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla84xx_mgmt_cmd()
1289 bsg_job->reply_payload.payload_len; in qla84xx_mgmt_cmd()
1291 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla84xx_mgmt_cmd()
1292 bsg_job->reply_payload.sg_cnt, mgmt_b, in qla84xx_mgmt_cmd()
1302 dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla84xx_mgmt_cmd()
1303 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla84xx_mgmt_cmd()
1305 dma_unmap_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla84xx_mgmt_cmd()
1306 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla84xx_mgmt_cmd()
1312 bsg_job_done(bsg_job, bsg_reply->result, in qla84xx_mgmt_cmd()
1318 qla24xx_iidma(struct bsg_job *bsg_job) in qla24xx_iidma() argument
1320 struct fc_bsg_request *bsg_request = bsg_job->request; in qla24xx_iidma()
1321 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla24xx_iidma()
1322 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla24xx_iidma()
1388 bsg_job->reply_len = sizeof(struct fc_bsg_reply) + in qla24xx_iidma()
1399 bsg_job_done(bsg_job, bsg_reply->result, in qla24xx_iidma()
1407 qla2x00_optrom_setup(struct bsg_job *bsg_job, scsi_qla_host_t *vha, in qla2x00_optrom_setup() argument
1410 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_optrom_setup()
1446 bsg_job->request_payload.payload_len); in qla2x00_optrom_setup()
1451 bsg_job->request_payload.payload_len > ha->optrom_size ? in qla2x00_optrom_setup()
1453 bsg_job->request_payload.payload_len; in qla2x00_optrom_setup()
1457 bsg_job->reply_payload.payload_len > ha->optrom_size ? in qla2x00_optrom_setup()
1459 bsg_job->reply_payload.payload_len; in qla2x00_optrom_setup()
1477 qla2x00_read_optrom(struct bsg_job *bsg_job) in qla2x00_read_optrom() argument
1479 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_read_optrom()
1480 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_read_optrom()
1489 rval = qla2x00_optrom_setup(bsg_job, vha, 0); in qla2x00_read_optrom()
1498 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_read_optrom()
1499 bsg_job->reply_payload.sg_cnt, ha->optrom_buffer, in qla2x00_read_optrom()
1508 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_read_optrom()
1514 qla2x00_update_optrom(struct bsg_job *bsg_job) in qla2x00_update_optrom() argument
1516 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_update_optrom()
1517 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_update_optrom()
1523 rval = qla2x00_optrom_setup(bsg_job, vha, 1); in qla2x00_update_optrom()
1532 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_update_optrom()
1533 bsg_job->request_payload.sg_cnt, ha->optrom_buffer, in qla2x00_update_optrom()
1549 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_update_optrom()
1555 qla2x00_update_fru_versions(struct bsg_job *bsg_job) in qla2x00_update_fru_versions() argument
1557 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_update_fru_versions()
1558 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_update_fru_versions()
1575 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_update_fru_versions()
1576 bsg_job->request_payload.sg_cnt, list, sizeof(bsg)); in qla2x00_update_fru_versions()
1599 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla2x00_update_fru_versions()
1601 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_update_fru_versions()
1608 qla2x00_read_fru_status(struct bsg_job *bsg_job) in qla2x00_read_fru_status() argument
1610 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_read_fru_status()
1611 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_read_fru_status()
1626 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_read_fru_status()
1627 bsg_job->request_payload.sg_cnt, sr, sizeof(*sr)); in qla2x00_read_fru_status()
1640 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_read_fru_status()
1641 bsg_job->reply_payload.sg_cnt, sr, sizeof(*sr)); in qla2x00_read_fru_status()
1649 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla2x00_read_fru_status()
1652 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_read_fru_status()
1659 qla2x00_write_fru_status(struct bsg_job *bsg_job) in qla2x00_write_fru_status() argument
1661 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_write_fru_status()
1662 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_write_fru_status()
1677 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_write_fru_status()
1678 bsg_job->request_payload.sg_cnt, sr, sizeof(*sr)); in qla2x00_write_fru_status()
1697 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla2x00_write_fru_status()
1699 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_write_fru_status()
1706 qla2x00_write_i2c(struct bsg_job *bsg_job) in qla2x00_write_i2c() argument
1708 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_write_i2c()
1709 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_write_i2c()
1724 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_write_i2c()
1725 bsg_job->request_payload.sg_cnt, i2c, sizeof(*i2c)); in qla2x00_write_i2c()
1743 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla2x00_write_i2c()
1745 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_write_i2c()
1752 qla2x00_read_i2c(struct bsg_job *bsg_job) in qla2x00_read_i2c() argument
1754 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_read_i2c()
1755 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_read_i2c()
1770 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_read_i2c()
1771 bsg_job->request_payload.sg_cnt, i2c, sizeof(*i2c)); in qla2x00_read_i2c()
1783 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_read_i2c()
1784 bsg_job->reply_payload.sg_cnt, i2c, sizeof(*i2c)); in qla2x00_read_i2c()
1792 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla2x00_read_i2c()
1795 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_read_i2c()
1802 qla24xx_process_bidir_cmd(struct bsg_job *bsg_job) in qla24xx_process_bidir_cmd() argument
1804 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla24xx_process_bidir_cmd()
1805 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla24xx_process_bidir_cmd()
1890 bsg_job->request_payload.sg_list, in qla24xx_process_bidir_cmd()
1891 bsg_job->request_payload.sg_cnt, in qla24xx_process_bidir_cmd()
1900 bsg_job->reply_payload.sg_list, bsg_job->reply_payload.sg_cnt, in qla24xx_process_bidir_cmd()
1908 if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) || in qla24xx_process_bidir_cmd()
1909 (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) { in qla24xx_process_bidir_cmd()
1914 bsg_job->request_payload.sg_cnt, req_sg_cnt, in qla24xx_process_bidir_cmd()
1915 bsg_job->reply_payload.sg_cnt, rsp_sg_cnt); in qla24xx_process_bidir_cmd()
1920 req_data_len = bsg_job->request_payload.payload_len; in qla24xx_process_bidir_cmd()
1921 rsp_data_len = bsg_job->reply_payload.payload_len; in qla24xx_process_bidir_cmd()
1940 sp->u.bsg_job = bsg_job; in qla24xx_process_bidir_cmd()
1958 bsg_job->reply_payload.sg_list, in qla24xx_process_bidir_cmd()
1959 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla24xx_process_bidir_cmd()
1962 bsg_job->request_payload.sg_list, in qla24xx_process_bidir_cmd()
1963 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla24xx_process_bidir_cmd()
1970 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla24xx_process_bidir_cmd()
1973 bsg_job_done(bsg_job, bsg_reply->result, in qla24xx_process_bidir_cmd()
1980 qlafx00_mgmt_cmd(struct bsg_job *bsg_job) in qlafx00_mgmt_cmd() argument
1982 struct fc_bsg_request *bsg_request = bsg_job->request; in qlafx00_mgmt_cmd()
1983 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qlafx00_mgmt_cmd()
2010 bsg_job->request_payload.sg_list, in qlafx00_mgmt_cmd()
2011 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qlafx00_mgmt_cmd()
2022 bsg_job->reply_payload.sg_list, in qlafx00_mgmt_cmd()
2023 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qlafx00_mgmt_cmd()
2034 "dma_reply_sg_cnt: %x\n", bsg_job->request_payload.sg_cnt, in qlafx00_mgmt_cmd()
2035 req_sg_cnt, bsg_job->reply_payload.sg_cnt, rsp_sg_cnt); in qlafx00_mgmt_cmd()
2066 sp->u.bsg_job = bsg_job; in qlafx00_mgmt_cmd()
2090 bsg_job->reply_payload.sg_list, in qlafx00_mgmt_cmd()
2091 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qlafx00_mgmt_cmd()
2095 bsg_job->request_payload.sg_list, in qlafx00_mgmt_cmd()
2096 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qlafx00_mgmt_cmd()
2103 qla26xx_serdes_op(struct bsg_job *bsg_job) in qla26xx_serdes_op() argument
2105 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla26xx_serdes_op()
2106 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla26xx_serdes_op()
2113 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla26xx_serdes_op()
2114 bsg_job->request_payload.sg_cnt, &sr, sizeof(sr)); in qla26xx_serdes_op()
2123 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla26xx_serdes_op()
2124 bsg_job->reply_payload.sg_cnt, &sr, sizeof(sr)); in qla26xx_serdes_op()
2137 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla26xx_serdes_op()
2139 bsg_job_done(bsg_job, bsg_reply->result, in qla26xx_serdes_op()
2145 qla8044_serdes_op(struct bsg_job *bsg_job) in qla8044_serdes_op() argument
2147 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla8044_serdes_op()
2148 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla8044_serdes_op()
2155 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla8044_serdes_op()
2156 bsg_job->request_payload.sg_cnt, &sr, sizeof(sr)); in qla8044_serdes_op()
2165 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla8044_serdes_op()
2166 bsg_job->reply_payload.sg_cnt, &sr, sizeof(sr)); in qla8044_serdes_op()
2179 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla8044_serdes_op()
2181 bsg_job_done(bsg_job, bsg_reply->result, in qla8044_serdes_op()
2187 qla27xx_get_flash_upd_cap(struct bsg_job *bsg_job) in qla27xx_get_flash_upd_cap() argument
2189 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla27xx_get_flash_upd_cap()
2190 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla27xx_get_flash_upd_cap()
2204 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla27xx_get_flash_upd_cap()
2205 bsg_job->reply_payload.sg_cnt, &cap, sizeof(cap)); in qla27xx_get_flash_upd_cap()
2211 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla27xx_get_flash_upd_cap()
2213 bsg_job_done(bsg_job, bsg_reply->result, in qla27xx_get_flash_upd_cap()
2219 qla27xx_set_flash_upd_cap(struct bsg_job *bsg_job) in qla27xx_set_flash_upd_cap() argument
2221 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla27xx_set_flash_upd_cap()
2222 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla27xx_set_flash_upd_cap()
2232 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla27xx_set_flash_upd_cap()
2233 bsg_job->request_payload.sg_cnt, &cap, sizeof(cap)); in qla27xx_set_flash_upd_cap()
2257 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla27xx_set_flash_upd_cap()
2259 bsg_job_done(bsg_job, bsg_reply->result, in qla27xx_set_flash_upd_cap()
2265 qla27xx_get_bbcr_data(struct bsg_job *bsg_job) in qla27xx_get_bbcr_data() argument
2267 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla27xx_get_bbcr_data()
2268 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla27xx_get_bbcr_data()
2310 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla27xx_get_bbcr_data()
2311 bsg_job->reply_payload.sg_cnt, &bbcr, sizeof(bbcr)); in qla27xx_get_bbcr_data()
2316 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla27xx_get_bbcr_data()
2318 bsg_job_done(bsg_job, bsg_reply->result, in qla27xx_get_bbcr_data()
2324 qla2x00_get_priv_stats(struct bsg_job *bsg_job) in qla2x00_get_priv_stats() argument
2326 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_get_priv_stats()
2327 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_get_priv_stats()
2328 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_get_priv_stats()
2363 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_priv_stats()
2364 bsg_job->reply_payload.sg_cnt, stats, sizeof(*stats)); in qla2x00_get_priv_stats()
2371 bsg_job->reply_len = sizeof(*bsg_reply); in qla2x00_get_priv_stats()
2373 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_priv_stats()
2383 qla2x00_do_dport_diagnostics(struct bsg_job *bsg_job) in qla2x00_do_dport_diagnostics() argument
2385 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_do_dport_diagnostics()
2386 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_do_dport_diagnostics()
2402 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_do_dport_diagnostics()
2403 bsg_job->request_payload.sg_cnt, dd, sizeof(*dd)); in qla2x00_do_dport_diagnostics()
2408 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_do_dport_diagnostics()
2409 bsg_job->reply_payload.sg_cnt, dd, sizeof(*dd)); in qla2x00_do_dport_diagnostics()
2416 bsg_job->reply_len = sizeof(*bsg_reply); in qla2x00_do_dport_diagnostics()
2418 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_do_dport_diagnostics()
2427 qla2x00_do_dport_diagnostics_v2(struct bsg_job *bsg_job) in qla2x00_do_dport_diagnostics_v2() argument
2429 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_do_dport_diagnostics_v2()
2430 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_do_dport_diagnostics_v2()
2445 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_do_dport_diagnostics_v2()
2446 bsg_job->request_payload.sg_cnt, dd, sizeof(*dd)); in qla2x00_do_dport_diagnostics_v2()
2495 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_do_dport_diagnostics_v2()
2496 bsg_job->reply_payload.sg_cnt, dd, sizeof(*dd)); in qla2x00_do_dport_diagnostics_v2()
2499 bsg_job->reply_len = sizeof(*bsg_reply); in qla2x00_do_dport_diagnostics_v2()
2501 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_do_dport_diagnostics_v2()
2510 qla2x00_get_flash_image_status(struct bsg_job *bsg_job) in qla2x00_get_flash_image_status() argument
2512 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_get_flash_image_status()
2513 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_get_flash_image_status()
2539 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_flash_image_status()
2540 bsg_job->reply_payload.sg_cnt, &regions, sizeof(regions)); in qla2x00_get_flash_image_status()
2545 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla2x00_get_flash_image_status()
2546 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_flash_image_status()
2553 qla2x00_manage_host_stats(struct bsg_job *bsg_job) in qla2x00_manage_host_stats() argument
2555 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_manage_host_stats()
2556 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_manage_host_stats()
2567 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_manage_host_stats()
2581 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_manage_host_stats()
2582 bsg_job->request_payload.sg_cnt, req_data, in qla2x00_manage_host_stats()
2605 bsg_job->reply_payload.payload_len = sizeof(struct ql_vnd_mng_host_stats_resp); in qla2x00_manage_host_stats()
2609 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_manage_host_stats()
2610 bsg_job->reply_payload.sg_cnt, in qla2x00_manage_host_stats()
2615 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_manage_host_stats()
2622 qla2x00_get_host_stats(struct bsg_job *bsg_job) in qla2x00_get_host_stats() argument
2624 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_get_host_stats()
2625 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_get_host_stats()
2637 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_get_host_stats()
2651 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_get_host_stats()
2652 bsg_job->request_payload.sg_cnt, req_data, req_data_len); in qla2x00_get_host_stats()
2673 if (response_len > bsg_job->reply_payload.payload_len) { in qla2x00_get_host_stats()
2676 bsg_job->reply_payload.payload_len = sizeof(struct ql_vnd_mng_host_stats_resp); in qla2x00_get_host_stats()
2679 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_host_stats()
2680 bsg_job->reply_payload.sg_cnt, &rsp_data, in qla2x00_get_host_stats()
2684 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_host_stats()
2695 ret = qla2xxx_get_ini_stats(fc_bsg_to_shost(bsg_job), req_data->stat_type, in qla2x00_get_host_stats()
2701 bsg_reply->reply_payload_rcv_len = sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_host_stats()
2702 bsg_job->reply_payload.sg_cnt, in qla2x00_get_host_stats()
2705 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_host_stats()
2727 qla2x00_get_tgt_stats(struct bsg_job *bsg_job) in qla2x00_get_tgt_stats() argument
2729 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_get_tgt_stats()
2730 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_get_tgt_stats()
2743 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_get_tgt_stats()
2757 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_get_tgt_stats()
2758 bsg_job->request_payload.sg_cnt, in qla2x00_get_tgt_stats()
2771 if (response_len > bsg_job->reply_payload.payload_len) { in qla2x00_get_tgt_stats()
2774 bsg_job->reply_payload.payload_len = sizeof(struct ql_vnd_mng_host_stats_resp); in qla2x00_get_tgt_stats()
2777 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_tgt_stats()
2778 bsg_job->reply_payload.sg_cnt, data, in qla2x00_get_tgt_stats()
2782 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_tgt_stats()
2795 ret = qla2xxx_get_tgt_stats(fc_bsg_to_shost(bsg_job), req_data->stat_type, in qla2x00_get_tgt_stats()
2801 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_tgt_stats()
2802 bsg_job->reply_payload.sg_cnt, data, in qla2x00_get_tgt_stats()
2805 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_tgt_stats()
2816 qla2x00_manage_host_port(struct bsg_job *bsg_job) in qla2x00_manage_host_port() argument
2818 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_manage_host_port()
2819 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_manage_host_port()
2825 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_manage_host_port()
2839 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_manage_host_port()
2840 bsg_job->request_payload.sg_cnt, req_data, req_data_len); in qla2x00_manage_host_port()
2860 bsg_job->reply_payload.payload_len = sizeof(struct ql_vnd_mng_host_port_resp); in qla2x00_manage_host_port()
2863 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_manage_host_port()
2864 bsg_job->reply_payload.sg_cnt, &rsp_data, in qla2x00_manage_host_port()
2867 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_manage_host_port()
2874 qla2x00_process_vendor_specific(struct scsi_qla_host *vha, struct bsg_job *bsg_job) in qla2x00_process_vendor_specific() argument
2876 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_process_vendor_specific()
2883 return qla2x00_process_loopback(bsg_job); in qla2x00_process_vendor_specific()
2886 return qla84xx_reset(bsg_job); in qla2x00_process_vendor_specific()
2889 return qla84xx_updatefw(bsg_job); in qla2x00_process_vendor_specific()
2892 return qla84xx_mgmt_cmd(bsg_job); in qla2x00_process_vendor_specific()
2895 return qla24xx_iidma(bsg_job); in qla2x00_process_vendor_specific()
2898 return qla24xx_proc_fcp_prio_cfg_cmd(bsg_job); in qla2x00_process_vendor_specific()
2901 return qla2x00_read_optrom(bsg_job); in qla2x00_process_vendor_specific()
2904 return qla2x00_update_optrom(bsg_job); in qla2x00_process_vendor_specific()
2907 return qla2x00_update_fru_versions(bsg_job); in qla2x00_process_vendor_specific()
2910 return qla2x00_read_fru_status(bsg_job); in qla2x00_process_vendor_specific()
2913 return qla2x00_write_fru_status(bsg_job); in qla2x00_process_vendor_specific()
2916 return qla2x00_write_i2c(bsg_job); in qla2x00_process_vendor_specific()
2919 return qla2x00_read_i2c(bsg_job); in qla2x00_process_vendor_specific()
2922 return qla24xx_process_bidir_cmd(bsg_job); in qla2x00_process_vendor_specific()
2925 return qlafx00_mgmt_cmd(bsg_job); in qla2x00_process_vendor_specific()
2928 return qla26xx_serdes_op(bsg_job); in qla2x00_process_vendor_specific()
2931 return qla8044_serdes_op(bsg_job); in qla2x00_process_vendor_specific()
2934 return qla27xx_get_flash_upd_cap(bsg_job); in qla2x00_process_vendor_specific()
2937 return qla27xx_set_flash_upd_cap(bsg_job); in qla2x00_process_vendor_specific()
2940 return qla27xx_get_bbcr_data(bsg_job); in qla2x00_process_vendor_specific()
2944 return qla2x00_get_priv_stats(bsg_job); in qla2x00_process_vendor_specific()
2947 return qla2x00_do_dport_diagnostics(bsg_job); in qla2x00_process_vendor_specific()
2950 return qla2x00_do_dport_diagnostics_v2(bsg_job); in qla2x00_process_vendor_specific()
2953 return qla_edif_app_mgmt(bsg_job); in qla2x00_process_vendor_specific()
2956 return qla2x00_get_flash_image_status(bsg_job); in qla2x00_process_vendor_specific()
2959 return qla2x00_manage_host_stats(bsg_job); in qla2x00_process_vendor_specific()
2962 return qla2x00_get_host_stats(bsg_job); in qla2x00_process_vendor_specific()
2965 return qla2x00_get_tgt_stats(bsg_job); in qla2x00_process_vendor_specific()
2968 return qla2x00_manage_host_port(bsg_job); in qla2x00_process_vendor_specific()
2971 return qla2x00_mailbox_passthru(bsg_job); in qla2x00_process_vendor_specific()
2979 qla24xx_bsg_request(struct bsg_job *bsg_job) in qla24xx_bsg_request() argument
2981 struct fc_bsg_request *bsg_request = bsg_job->request; in qla24xx_bsg_request()
2982 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla24xx_bsg_request()
2992 rport = fc_bsg_to_rport(bsg_job); in qla24xx_bsg_request()
2998 host = fc_bsg_to_shost(bsg_job); in qla24xx_bsg_request()
3029 __func__, bsg_request->msgcode, bsg_job); in qla24xx_bsg_request()
3034 ret = qla2x00_process_els(bsg_job); in qla24xx_bsg_request()
3037 ret = qla2x00_process_ct(bsg_job); in qla24xx_bsg_request()
3040 ret = qla2x00_process_vendor_specific(vha, bsg_job); in qla24xx_bsg_request()
3056 static bool qla_bsg_found(struct qla_qpair *qpair, struct bsg_job *bsg_job) in qla_bsg_found() argument
3059 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla_bsg_found()
3060 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla_bsg_found()
3081 sp->u.bsg_job == bsg_job) { in qla_bsg_found()
3098 bsg_job, sp, sp->handle); in qla_bsg_found()
3103 bsg_job, sp, sp->handle, rval); in qla_bsg_found()
3115 bsg_job, sp, sp->handle); in qla_bsg_found()
3122 bsg_job, sp, sp->handle); in qla_bsg_found()
3129 bsg_job, sp, rval); in qla_bsg_found()
3144 req->outstanding_cmds[cnt]->u.bsg_job != bsg_job) { in qla_bsg_found()
3160 __func__, bsg_job, bsg_reply->result, sp); in qla_bsg_found()
3162 bsg_job_done(bsg_job, bsg_reply->result, bsg_reply->reply_payload_rcv_len); in qla_bsg_found()
3168 qla24xx_bsg_timeout(struct bsg_job *bsg_job) in qla24xx_bsg_timeout() argument
3170 struct fc_bsg_request *bsg_request = bsg_job->request; in qla24xx_bsg_timeout()
3171 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla24xx_bsg_timeout()
3178 __func__, bsg_job, bsg_request->msgcode, in qla24xx_bsg_timeout()
3187 if (qla_bsg_found(ha->base_qpair, bsg_job)) in qla24xx_bsg_timeout()
3195 if (qla_bsg_found(qpair, bsg_job)) in qla24xx_bsg_timeout()
3205 int qla2x00_mailbox_passthru(struct bsg_job *bsg_job) in qla2x00_mailbox_passthru() argument
3207 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_mailbox_passthru()
3208 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_mailbox_passthru()
3214 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_mailbox_passthru()
3227 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_mailbox_passthru()
3228 bsg_job->request_payload.sg_cnt, req_data, ptsize); in qla2x00_mailbox_passthru()
3232 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_mailbox_passthru()
3233 bsg_job->reply_payload.sg_cnt, req_data, ptsize); in qla2x00_mailbox_passthru()
3241 bsg_job->reply_len = sizeof(*bsg_job->reply); in qla2x00_mailbox_passthru()
3243 bsg_job_done(bsg_job, bsg_reply->result, bsg_reply->reply_payload_rcv_len); in qla2x00_mailbox_passthru()