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()
30 __func__, sp->handle, res, bsg_job); in qla2x00_bsg_job_done()
35 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_bsg_job_done()
42 struct bsg_job *bsg_job = sp->u.bsg_job; in qla2x00_bsg_sp_free() local
43 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_bsg_sp_free()
52 bsg_job->request_payload.sg_list, in qla2x00_bsg_sp_free()
53 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_bsg_sp_free()
57 bsg_job->reply_payload.sg_list, in qla2x00_bsg_sp_free()
58 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_bsg_sp_free()
67 dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_bsg_sp_free()
68 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_bsg_sp_free()
70 dma_unmap_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_bsg_sp_free()
71 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_bsg_sp_free()
140 qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) in qla24xx_proc_fcp_prio_cfg_cmd() argument
142 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla24xx_proc_fcp_prio_cfg_cmd()
143 struct fc_bsg_request *bsg_request = bsg_job->request; in qla24xx_proc_fcp_prio_cfg_cmd()
144 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla24xx_proc_fcp_prio_cfg_cmd()
196 len = bsg_job->reply_payload.payload_len; in qla24xx_proc_fcp_prio_cfg_cmd()
206 bsg_job->reply_payload.sg_list, in qla24xx_proc_fcp_prio_cfg_cmd()
207 bsg_job->reply_payload.sg_cnt, ha->fcp_prio_cfg, in qla24xx_proc_fcp_prio_cfg_cmd()
213 len = bsg_job->request_payload.payload_len; in qla24xx_proc_fcp_prio_cfg_cmd()
233 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla24xx_proc_fcp_prio_cfg_cmd()
234 bsg_job->request_payload.sg_cnt, ha->fcp_prio_cfg, in qla24xx_proc_fcp_prio_cfg_cmd()
262 bsg_job_done(bsg_job, bsg_reply->result, in qla24xx_proc_fcp_prio_cfg_cmd()
268 qla2x00_process_els(struct bsg_job *bsg_job) in qla2x00_process_els() argument
270 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_process_els()
284 rport = fc_bsg_to_rport(bsg_job); in qla2x00_process_els()
291 host = fc_bsg_to_shost(bsg_job); in qla2x00_process_els()
297 return qla_edif_process_els(vha, bsg_job); in qla2x00_process_els()
315 if (bsg_job->request_payload.sg_cnt > 1 || in qla2x00_process_els()
316 bsg_job->reply_payload.sg_cnt > 1) { in qla2x00_process_els()
320 bsg_job->request_payload.sg_cnt, in qla2x00_process_els()
321 bsg_job->reply_payload.sg_cnt); in qla2x00_process_els()
364 dma_map_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_process_els()
365 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_els()
367 dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_process_els()
368 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_els()
373 rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_process_els()
374 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_els()
376 dma_unmap_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_process_els()
377 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_els()
382 if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) || in qla2x00_process_els()
383 (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) { in qla2x00_process_els()
387 "dma_reply_sg_cnt:%x.\n", bsg_job->request_payload.sg_cnt, in qla2x00_process_els()
388 req_sg_cnt, bsg_job->reply_payload.sg_cnt, rsp_sg_cnt); in qla2x00_process_els()
406 sp->u.bsg_job = bsg_job; in qla2x00_process_els()
427 dma_unmap_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_process_els()
428 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_els()
429 dma_unmap_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_process_els()
430 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_els()
455 qla2x00_process_ct(struct bsg_job *bsg_job) in qla2x00_process_ct() argument
458 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_process_ct()
459 struct Scsi_Host *host = fc_bsg_to_shost(bsg_job); in qla2x00_process_ct()
469 dma_map_sg(&ha->pdev->dev, bsg_job->request_payload.sg_list, in qla2x00_process_ct()
470 bsg_job->request_payload.sg_cnt, DMA_TO_DEVICE); in qla2x00_process_ct()
478 rsp_sg_cnt = dma_map_sg(&ha->pdev->dev, bsg_job->reply_payload.sg_list, in qla2x00_process_ct()
479 bsg_job->reply_payload.sg_cnt, DMA_FROM_DEVICE); in qla2x00_process_ct()
487 if ((req_sg_cnt != bsg_job->request_payload.sg_cnt) || in qla2x00_process_ct()
488 (rsp_sg_cnt != bsg_job->reply_payload.sg_cnt)) { in qla2x00_process_ct()
491 "dma_reply_sg_cnt: %x\n", bsg_job->request_payload.sg_cnt, in qla2x00_process_ct()
492 req_sg_cnt, bsg_job->reply_payload.sg_cnt, rsp_sg_cnt); 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_get_flash_image_status(struct bsg_job *bsg_job) in qla2x00_get_flash_image_status() argument
2429 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_get_flash_image_status()
2430 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_get_flash_image_status()
2452 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_flash_image_status()
2453 bsg_job->reply_payload.sg_cnt, &regions, sizeof(regions)); in qla2x00_get_flash_image_status()
2458 bsg_job->reply_len = sizeof(struct fc_bsg_reply); in qla2x00_get_flash_image_status()
2459 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_flash_image_status()
2466 qla2x00_manage_host_stats(struct bsg_job *bsg_job) in qla2x00_manage_host_stats() argument
2468 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_manage_host_stats()
2469 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_manage_host_stats()
2480 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_manage_host_stats()
2494 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_manage_host_stats()
2495 bsg_job->request_payload.sg_cnt, req_data, in qla2x00_manage_host_stats()
2518 bsg_job->reply_payload.payload_len = sizeof(struct ql_vnd_mng_host_stats_resp); in qla2x00_manage_host_stats()
2522 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_manage_host_stats()
2523 bsg_job->reply_payload.sg_cnt, in qla2x00_manage_host_stats()
2528 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_manage_host_stats()
2535 qla2x00_get_host_stats(struct bsg_job *bsg_job) in qla2x00_get_host_stats() argument
2537 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_get_host_stats()
2538 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_get_host_stats()
2550 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_get_host_stats()
2564 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_get_host_stats()
2565 bsg_job->request_payload.sg_cnt, req_data, req_data_len); in qla2x00_get_host_stats()
2586 if (response_len > bsg_job->reply_payload.payload_len) { in qla2x00_get_host_stats()
2589 bsg_job->reply_payload.payload_len = sizeof(struct ql_vnd_mng_host_stats_resp); in qla2x00_get_host_stats()
2592 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_host_stats()
2593 bsg_job->reply_payload.sg_cnt, &rsp_data, in qla2x00_get_host_stats()
2597 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_host_stats()
2608 ret = qla2xxx_get_ini_stats(fc_bsg_to_shost(bsg_job), req_data->stat_type, in qla2x00_get_host_stats()
2614 bsg_reply->reply_payload_rcv_len = sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_host_stats()
2615 bsg_job->reply_payload.sg_cnt, in qla2x00_get_host_stats()
2618 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_host_stats()
2640 qla2x00_get_tgt_stats(struct bsg_job *bsg_job) in qla2x00_get_tgt_stats() argument
2642 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_get_tgt_stats()
2643 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_get_tgt_stats()
2656 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_get_tgt_stats()
2670 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_get_tgt_stats()
2671 bsg_job->request_payload.sg_cnt, in qla2x00_get_tgt_stats()
2684 if (response_len > bsg_job->reply_payload.payload_len) { in qla2x00_get_tgt_stats()
2687 bsg_job->reply_payload.payload_len = sizeof(struct ql_vnd_mng_host_stats_resp); in qla2x00_get_tgt_stats()
2690 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_tgt_stats()
2691 bsg_job->reply_payload.sg_cnt, data, in qla2x00_get_tgt_stats()
2695 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_tgt_stats()
2708 ret = qla2xxx_get_tgt_stats(fc_bsg_to_shost(bsg_job), req_data->stat_type, in qla2x00_get_tgt_stats()
2714 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_get_tgt_stats()
2715 bsg_job->reply_payload.sg_cnt, data, in qla2x00_get_tgt_stats()
2718 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_get_tgt_stats()
2729 qla2x00_manage_host_port(struct bsg_job *bsg_job) in qla2x00_manage_host_port() argument
2731 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_manage_host_port()
2732 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_manage_host_port()
2738 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_manage_host_port()
2752 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_manage_host_port()
2753 bsg_job->request_payload.sg_cnt, req_data, req_data_len); in qla2x00_manage_host_port()
2773 bsg_job->reply_payload.payload_len = sizeof(struct ql_vnd_mng_host_port_resp); in qla2x00_manage_host_port()
2776 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_manage_host_port()
2777 bsg_job->reply_payload.sg_cnt, &rsp_data, in qla2x00_manage_host_port()
2780 bsg_job_done(bsg_job, bsg_reply->result, in qla2x00_manage_host_port()
2787 qla2x00_process_vendor_specific(struct scsi_qla_host *vha, struct bsg_job *bsg_job) in qla2x00_process_vendor_specific() argument
2789 struct fc_bsg_request *bsg_request = bsg_job->request; in qla2x00_process_vendor_specific()
2796 return qla2x00_process_loopback(bsg_job); in qla2x00_process_vendor_specific()
2799 return qla84xx_reset(bsg_job); in qla2x00_process_vendor_specific()
2802 return qla84xx_updatefw(bsg_job); in qla2x00_process_vendor_specific()
2805 return qla84xx_mgmt_cmd(bsg_job); in qla2x00_process_vendor_specific()
2808 return qla24xx_iidma(bsg_job); in qla2x00_process_vendor_specific()
2811 return qla24xx_proc_fcp_prio_cfg_cmd(bsg_job); in qla2x00_process_vendor_specific()
2814 return qla2x00_read_optrom(bsg_job); in qla2x00_process_vendor_specific()
2817 return qla2x00_update_optrom(bsg_job); in qla2x00_process_vendor_specific()
2820 return qla2x00_update_fru_versions(bsg_job); in qla2x00_process_vendor_specific()
2823 return qla2x00_read_fru_status(bsg_job); in qla2x00_process_vendor_specific()
2826 return qla2x00_write_fru_status(bsg_job); in qla2x00_process_vendor_specific()
2829 return qla2x00_write_i2c(bsg_job); in qla2x00_process_vendor_specific()
2832 return qla2x00_read_i2c(bsg_job); in qla2x00_process_vendor_specific()
2835 return qla24xx_process_bidir_cmd(bsg_job); in qla2x00_process_vendor_specific()
2838 return qlafx00_mgmt_cmd(bsg_job); in qla2x00_process_vendor_specific()
2841 return qla26xx_serdes_op(bsg_job); in qla2x00_process_vendor_specific()
2844 return qla8044_serdes_op(bsg_job); in qla2x00_process_vendor_specific()
2847 return qla27xx_get_flash_upd_cap(bsg_job); in qla2x00_process_vendor_specific()
2850 return qla27xx_set_flash_upd_cap(bsg_job); in qla2x00_process_vendor_specific()
2853 return qla27xx_get_bbcr_data(bsg_job); in qla2x00_process_vendor_specific()
2857 return qla2x00_get_priv_stats(bsg_job); in qla2x00_process_vendor_specific()
2860 return qla2x00_do_dport_diagnostics(bsg_job); in qla2x00_process_vendor_specific()
2863 return qla_edif_app_mgmt(bsg_job); in qla2x00_process_vendor_specific()
2866 return qla2x00_get_flash_image_status(bsg_job); in qla2x00_process_vendor_specific()
2869 return qla2x00_manage_host_stats(bsg_job); in qla2x00_process_vendor_specific()
2872 return qla2x00_get_host_stats(bsg_job); in qla2x00_process_vendor_specific()
2875 return qla2x00_get_tgt_stats(bsg_job); in qla2x00_process_vendor_specific()
2878 return qla2x00_manage_host_port(bsg_job); in qla2x00_process_vendor_specific()
2881 return qla2x00_mailbox_passthru(bsg_job); in qla2x00_process_vendor_specific()
2889 qla24xx_bsg_request(struct bsg_job *bsg_job) in qla24xx_bsg_request() argument
2891 struct fc_bsg_request *bsg_request = bsg_job->request; in qla24xx_bsg_request()
2892 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla24xx_bsg_request()
2902 rport = fc_bsg_to_rport(bsg_job); in qla24xx_bsg_request()
2906 host = fc_bsg_to_shost(bsg_job); in qla24xx_bsg_request()
2937 __func__, bsg_request->msgcode, bsg_job); in qla24xx_bsg_request()
2942 ret = qla2x00_process_els(bsg_job); in qla24xx_bsg_request()
2945 ret = qla2x00_process_ct(bsg_job); in qla24xx_bsg_request()
2948 ret = qla2x00_process_vendor_specific(vha, bsg_job); in qla24xx_bsg_request()
2965 qla24xx_bsg_timeout(struct bsg_job *bsg_job) in qla24xx_bsg_timeout() argument
2967 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla24xx_bsg_timeout()
2968 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla24xx_bsg_timeout()
2976 __func__, bsg_job); in qla24xx_bsg_timeout()
2991 sp->u.bsg_job == bsg_job) { in qla24xx_bsg_timeout()
3020 int qla2x00_mailbox_passthru(struct bsg_job *bsg_job) in qla2x00_mailbox_passthru() argument
3022 struct fc_bsg_reply *bsg_reply = bsg_job->reply; in qla2x00_mailbox_passthru()
3023 scsi_qla_host_t *vha = shost_priv(fc_bsg_to_shost(bsg_job)); in qla2x00_mailbox_passthru()
3029 req_data_len = bsg_job->request_payload.payload_len; in qla2x00_mailbox_passthru()
3042 sg_copy_to_buffer(bsg_job->request_payload.sg_list, in qla2x00_mailbox_passthru()
3043 bsg_job->request_payload.sg_cnt, req_data, ptsize); in qla2x00_mailbox_passthru()
3047 sg_copy_from_buffer(bsg_job->reply_payload.sg_list, in qla2x00_mailbox_passthru()
3048 bsg_job->reply_payload.sg_cnt, req_data, ptsize); in qla2x00_mailbox_passthru()
3056 bsg_job->reply_len = sizeof(*bsg_job->reply); in qla2x00_mailbox_passthru()
3058 bsg_job_done(bsg_job, bsg_reply->result, bsg_reply->reply_payload_rcv_len); in qla2x00_mailbox_passthru()