Lines Matching refs:cmd

53 		     struct megasas_cmd *cmd, u8 alt_status);
55 wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd,
279 struct megasas_cmd_fusion *cmd) in megasas_return_cmd_fusion() argument
281 cmd->scmd = NULL; in megasas_return_cmd_fusion()
282 memset(cmd->io_request, 0, MEGA_MPI2_RAID_DEFAULT_IO_FRAME_SIZE); in megasas_return_cmd_fusion()
283 cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; in megasas_return_cmd_fusion()
284 cmd->cmd_completed = false; in megasas_return_cmd_fusion()
391 struct megasas_cmd_fusion *cmd, in megasas_get_msix_index() argument
397 cmd->request_desc->SCSIIO.MSIxIndex = in megasas_get_msix_index()
401 cmd->request_desc->SCSIIO.MSIxIndex = in megasas_get_msix_index()
407 cmd->request_desc->SCSIIO.MSIxIndex = blk_mq_unique_tag_to_hwq(tag) + in megasas_get_msix_index()
410 cmd->request_desc->SCSIIO.MSIxIndex = in megasas_get_msix_index()
424 struct megasas_cmd_fusion *cmd; in megasas_free_cmds_fusion() local
433 cmd = fusion->cmd_list[i]; in megasas_free_cmds_fusion()
434 if (cmd) { in megasas_free_cmds_fusion()
435 if (cmd->sg_frame) in megasas_free_cmds_fusion()
437 cmd->sg_frame, in megasas_free_cmds_fusion()
438 cmd->sg_frame_phys_addr); in megasas_free_cmds_fusion()
440 kfree(cmd); in megasas_free_cmds_fusion()
486 struct megasas_cmd_fusion *cmd; in megasas_create_sg_sense_fusion() local
558 cmd = fusion->cmd_list[i]; in megasas_create_sg_sense_fusion()
559 cmd->sg_frame = dma_pool_alloc(fusion->sg_dma_pool, in megasas_create_sg_sense_fusion()
560 GFP_KERNEL, &cmd->sg_frame_phys_addr); in megasas_create_sg_sense_fusion()
563 cmd->sense = (u8 *)fusion->sense + offset; in megasas_create_sg_sense_fusion()
564 cmd->sense_phys_addr = fusion->sense_phys_addr + offset; in megasas_create_sg_sense_fusion()
566 if (!cmd->sg_frame) { in megasas_create_sg_sense_fusion()
575 cmd = fusion->cmd_list[i]; in megasas_create_sg_sense_fusion()
577 cmd->sense = (u8 *)fusion->sense + offset; in megasas_create_sg_sense_fusion()
578 cmd->sense_phys_addr = fusion->sense_phys_addr + offset; in megasas_create_sg_sense_fusion()
974 struct megasas_cmd_fusion *cmd; in megasas_alloc_cmds_fusion() local
1005 cmd = fusion->cmd_list[i]; in megasas_alloc_cmds_fusion()
1007 memset(cmd, 0, sizeof(struct megasas_cmd_fusion)); in megasas_alloc_cmds_fusion()
1008 cmd->index = i + 1; in megasas_alloc_cmds_fusion()
1009 cmd->scmd = NULL; in megasas_alloc_cmds_fusion()
1010 cmd->sync_cmd_idx = in megasas_alloc_cmds_fusion()
1014 cmd->instance = instance; in megasas_alloc_cmds_fusion()
1015 cmd->io_request = in megasas_alloc_cmds_fusion()
1018 memset(cmd->io_request, 0, in megasas_alloc_cmds_fusion()
1020 cmd->io_request_phys_addr = io_req_base_phys + offset; in megasas_alloc_cmds_fusion()
1021 cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; in megasas_alloc_cmds_fusion()
1043 wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd, in wait_and_poll() argument
1047 struct megasas_header *frame_hdr = &cmd->frame->hdr; in wait_and_poll()
1086 struct megasas_cmd *cmd; in megasas_ioc_init_fusion() local
1104 cmd = fusion->ioc_init_cmd; in megasas_ioc_init_fusion()
1170 init_frame = (struct megasas_init_frame *)cmd->frame; in megasas_ioc_init_fusion()
1173 frame_hdr = &cmd->frame->hdr; in megasas_ioc_init_fusion()
1177 init_frame->cmd = MFI_CMD_INIT; in megasas_ioc_init_fusion()
1245 req_desc.u.low = cpu_to_le32(lower_32_bits(cmd->frame_phys_addr)); in megasas_ioc_init_fusion()
1246 req_desc.u.high = cpu_to_le32(upper_32_bits(cmd->frame_phys_addr)); in megasas_ioc_init_fusion()
1266 wait_and_poll(instance, cmd, MFI_IO_TIMEOUT_SECS); in megasas_ioc_init_fusion()
1268 frame_hdr = &cmd->frame->hdr; in megasas_ioc_init_fusion()
1308 struct megasas_cmd *cmd; in megasas_sync_pd_seq_num() local
1318 cmd = megasas_get_cmd(instance); in megasas_sync_pd_seq_num()
1319 if (!cmd) { in megasas_sync_pd_seq_num()
1326 dcmd = &cmd->frame->dcmd; in megasas_sync_pd_seq_num()
1334 instance->jbod_seq_cmd = cmd; in megasas_sync_pd_seq_num()
1339 dcmd->cmd = MFI_CMD_DCMD; in megasas_sync_pd_seq_num()
1350 instance->instancet->issue_dcmd(instance, cmd); in megasas_sync_pd_seq_num()
1356 ret = megasas_issue_blocked_cmd(instance, cmd, in megasas_sync_pd_seq_num()
1359 ret = megasas_issue_polled(instance, cmd); in megasas_sync_pd_seq_num()
1376 megasas_return_cmd(instance, cmd); in megasas_sync_pd_seq_num()
1399 struct megasas_cmd *cmd; in megasas_get_ld_map_info() local
1406 cmd = megasas_get_cmd(instance); in megasas_get_ld_map_info()
1408 if (!cmd) { in megasas_get_ld_map_info()
1416 megasas_return_cmd(instance, cmd); in megasas_get_ld_map_info()
1420 dcmd = &cmd->frame->dcmd; in megasas_get_ld_map_info()
1429 megasas_return_cmd(instance, cmd); in megasas_get_ld_map_info()
1435 dcmd->cmd = MFI_CMD_DCMD; in megasas_get_ld_map_info()
1447 ret = megasas_issue_blocked_cmd(instance, cmd, in megasas_get_ld_map_info()
1450 ret = megasas_issue_polled(instance, cmd); in megasas_get_ld_map_info()
1457 megasas_return_cmd(instance, cmd); in megasas_get_ld_map_info()
1489 struct megasas_cmd *cmd; in megasas_sync_map_info() local
1500 cmd = megasas_get_cmd(instance); in megasas_sync_map_info()
1502 if (!cmd) { in megasas_sync_map_info()
1510 megasas_return_cmd(instance, cmd); in megasas_sync_map_info()
1518 dcmd = &cmd->frame->dcmd; in megasas_sync_map_info()
1538 dcmd->cmd = MFI_CMD_DCMD; in megasas_sync_map_info()
1551 instance->map_update_cmd = cmd; in megasas_sync_map_info()
1553 instance->instancet->issue_dcmd(instance, cmd); in megasas_sync_map_info()
1743 struct megasas_cmd *cmd; in megasas_alloc_ioc_init_frame() local
1747 cmd = kzalloc(sizeof(struct megasas_cmd), GFP_KERNEL); in megasas_alloc_ioc_init_frame()
1749 if (!cmd) { in megasas_alloc_ioc_init_frame()
1755 cmd->frame = dma_alloc_coherent(&instance->pdev->dev, in megasas_alloc_ioc_init_frame()
1757 &cmd->frame_phys_addr, GFP_KERNEL); in megasas_alloc_ioc_init_frame()
1759 if (!cmd->frame) { in megasas_alloc_ioc_init_frame()
1762 kfree(cmd); in megasas_alloc_ioc_init_frame()
1766 fusion->ioc_init_cmd = cmd; in megasas_alloc_ioc_init_frame()
2149 struct megasas_cmd_fusion *cmd, int sge_count) in megasas_make_prp_nvme() argument
2182 ptr_sgl = (u64 *)cmd->sg_frame; in megasas_make_prp_nvme()
2183 ptr_sgl_phys = cmd->sg_frame_phys_addr; in megasas_make_prp_nvme()
2273 struct megasas_cmd_fusion *cmd, int sge_count) in megasas_make_sgl_fusion() argument
2302 if ((le16_to_cpu(cmd->io_request->IoFlags) & in megasas_make_sgl_fusion()
2305 cmd->io_request->ChainOffset = in megasas_make_sgl_fusion()
2309 cmd->io_request->ChainOffset = 0; in megasas_make_sgl_fusion()
2311 cmd->io_request->ChainOffset = in megasas_make_sgl_fusion()
2324 sg_chain->Address = cpu_to_le64(cmd->sg_frame_phys_addr); in megasas_make_sgl_fusion()
2327 (struct MPI25_IEEE_SGE_CHAIN64 *)cmd->sg_frame; in megasas_make_sgl_fusion()
2348 struct megasas_cmd_fusion *cmd) in megasas_make_sgl() argument
2359 sgl_chain64 = (struct MPI25_IEEE_SGE_CHAIN64 *)&cmd->io_request->SGL; in megasas_make_sgl()
2360 if ((le16_to_cpu(cmd->io_request->IoFlags) & in megasas_make_sgl()
2362 (cmd->pd_interface == NVME_PD)) in megasas_make_sgl()
2364 cmd, sge_count); in megasas_make_sgl()
2368 cmd, sge_count); in megasas_make_sgl()
2563 struct megasas_cmd_fusion *cmd, in megasas_stream_detect() argument
2599 SET_STREAM_DETECTED(cmd->io_request->RaidContext.raid_context_g35); in megasas_stream_detect()
2728 struct megasas_cmd_fusion *cmd) in megasas_build_ldio_fusion() argument
2749 io_request = cmd->io_request; in megasas_build_ldio_fusion()
2838 megasas_get_msix_index(instance, scp, cmd, io_info.data_arms); in megasas_build_ldio_fusion()
2871 megasas_stream_detect(instance, cmd, &io_info); in megasas_build_ldio_fusion()
2895 cmd->request_desc->SCSIIO.RequestFlags = in megasas_build_ldio_fusion()
2920 cmd->pd_r1_lb = io_info.pd_after_lb; in megasas_build_ldio_fusion()
2930 cmd->r1_alt_dev_handle = io_info.r1_alt_dev_handle; in megasas_build_ldio_fusion()
2932 cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; in megasas_build_ldio_fusion()
2941 cmd->request_desc->SCSIIO.DevHandle = io_info.devHandle; in megasas_build_ldio_fusion()
2943 cmd->pd_interface = io_info.pd_interface; in megasas_build_ldio_fusion()
2949 cmd->request_desc->SCSIIO.RequestFlags = in megasas_build_ldio_fusion()
2955 cmd->request_desc->SCSIIO.RequestFlags = in megasas_build_ldio_fusion()
2983 struct scsi_cmnd *scmd, struct megasas_cmd_fusion *cmd) in megasas_build_ld_nonrw_fusion() argument
2997 io_request = cmd->io_request; in megasas_build_ld_nonrw_fusion()
3028 cmd->request_desc->SCSIIO.RequestFlags = in megasas_build_ld_nonrw_fusion()
3048 cmd->request_desc->SCSIIO.RequestFlags = in megasas_build_ld_nonrw_fusion()
3051 cmd->request_desc->SCSIIO.DevHandle = devHandle; in megasas_build_ld_nonrw_fusion()
3073 struct scsi_cmnd *scmd, struct megasas_cmd_fusion *cmd, in megasas_build_syspd_fusion() argument
3092 cmd->pd_interface = mr_device_priv_data->interface_type; in megasas_build_syspd_fusion()
3094 io_request = cmd->io_request; in megasas_build_syspd_fusion()
3157 cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; in megasas_build_syspd_fusion()
3159 megasas_get_msix_index(instance, scmd, cmd, 1); in megasas_build_syspd_fusion()
3164 cmd->request_desc->SCSIIO.RequestFlags = in megasas_build_syspd_fusion()
3184 cmd->request_desc->SCSIIO.RequestFlags = in megasas_build_syspd_fusion()
3202 struct megasas_cmd_fusion *cmd) in megasas_build_io_fusion() argument
3207 struct MPI2_RAID_SCSI_IO_REQUEST *io_request = cmd->io_request; in megasas_build_io_fusion()
3232 megasas_build_ldio_fusion(instance, scp, cmd); in megasas_build_io_fusion()
3235 megasas_build_ld_nonrw_fusion(instance, scp, cmd); in megasas_build_io_fusion()
3238 megasas_build_syspd_fusion(instance, scp, cmd, true); in megasas_build_io_fusion()
3247 megasas_build_syspd_fusion(instance, scp, cmd, false); in megasas_build_io_fusion()
3249 megasas_build_syspd_fusion(instance, scp, cmd, true); in megasas_build_io_fusion()
3259 sge_count = megasas_make_sgl(instance, scp, cmd); in megasas_build_io_fusion()
3292 cpu_to_le32(lower_32_bits(cmd->sense_phys_addr)); in megasas_build_io_fusion()
3295 cmd->scmd = scp; in megasas_build_io_fusion()
3296 megasas_priv(scp)->cmd_priv = cmd; in megasas_build_io_fusion()
3319 struct megasas_cmd_fusion *cmd, in megasas_prepare_secondRaid1_IO() argument
3325 req_desc = cmd->request_desc; in megasas_prepare_secondRaid1_IO()
3327 memcpy(r1_cmd->io_request, cmd->io_request, in megasas_prepare_secondRaid1_IO()
3329 memcpy(r1_cmd->io_request->SGLs, cmd->io_request->SGLs, in megasas_prepare_secondRaid1_IO()
3334 r1_cmd->scmd = cmd->scmd; in megasas_prepare_secondRaid1_IO()
3341 r1_cmd->request_desc->SCSIIO.DevHandle = cmd->r1_alt_dev_handle; in megasas_prepare_secondRaid1_IO()
3342 r1_cmd->io_request->DevHandle = cmd->r1_alt_dev_handle; in megasas_prepare_secondRaid1_IO()
3343 r1_cmd->r1_alt_dev_handle = cmd->io_request->DevHandle; in megasas_prepare_secondRaid1_IO()
3344 cmd->io_request->RaidContext.raid_context_g35.flow_specific.peer_smid = in megasas_prepare_secondRaid1_IO()
3347 cpu_to_le16(cmd->index); in megasas_prepare_secondRaid1_IO()
3350 cmd->request_desc->SCSIIO.MSIxIndex; in megasas_prepare_secondRaid1_IO()
3353 cmd->io_request->RaidContext.raid_context_g35.span_arm + 1; in megasas_prepare_secondRaid1_IO()
3366 struct megasas_cmd_fusion *cmd, *r1_cmd = NULL; in megasas_build_and_issue_cmd_fusion() local
3384 cmd = megasas_get_cmd_fusion(instance, scsi_cmd_to_rq(scmd)->tag); in megasas_build_and_issue_cmd_fusion()
3386 if (!cmd) { in megasas_build_and_issue_cmd_fusion()
3391 index = cmd->index; in megasas_build_and_issue_cmd_fusion()
3396 cmd->request_desc = req_desc; in megasas_build_and_issue_cmd_fusion()
3398 if (megasas_build_io_fusion(instance, scmd, cmd)) { in megasas_build_and_issue_cmd_fusion()
3399 megasas_return_cmd_fusion(instance, cmd); in megasas_build_and_issue_cmd_fusion()
3401 cmd->request_desc = NULL; in megasas_build_and_issue_cmd_fusion()
3406 req_desc = cmd->request_desc; in megasas_build_and_issue_cmd_fusion()
3409 if (cmd->io_request->ChainOffset != 0 && in megasas_build_and_issue_cmd_fusion()
3410 cmd->io_request->ChainOffset != 0xF) in megasas_build_and_issue_cmd_fusion()
3412 "correct : %x\n", cmd->io_request->ChainOffset); in megasas_build_and_issue_cmd_fusion()
3423 if (cmd->r1_alt_dev_handle != MR_DEVHANDLE_INVALID) { in megasas_build_and_issue_cmd_fusion()
3426 megasas_prepare_secondRaid1_IO(instance, cmd, r1_cmd); in megasas_build_and_issue_cmd_fusion()
3453 struct megasas_cmd_fusion *cmd) in megasas_complete_r1_command() argument
3463 rctx_g35 = &cmd->io_request->RaidContext.raid_context_g35; in megasas_complete_r1_command()
3468 scmd_local = cmd->scmd; in megasas_complete_r1_command()
3471 data_length = cmd->io_request->DataLength; in megasas_complete_r1_command()
3472 sense = cmd->sense; in megasas_complete_r1_command()
3474 cmd->cmd_completed = true; in megasas_complete_r1_command()
3493 megasas_return_cmd_fusion(instance, cmd); in megasas_complete_r1_command()
3893 struct megasas_cmd_fusion *cmd; in build_mpt_mfi_pass_thru() local
3899 cmd = megasas_get_cmd_fusion(instance, in build_mpt_mfi_pass_thru()
3903 mfi_cmd->context.smid = cmd->index; in build_mpt_mfi_pass_thru()
3914 io_req = cmd->io_request; in build_mpt_mfi_pass_thru()
3946 build_mpt_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd) in build_mpt_cmd() argument
3951 build_mpt_mfi_pass_thru(instance, cmd); in build_mpt_cmd()
3952 index = cmd->context.smid; in build_mpt_cmd()
3973 struct megasas_cmd *cmd) in megasas_issue_dcmd_fusion() argument
3977 req_desc = build_mpt_cmd(instance, cmd); in megasas_issue_dcmd_fusion()
4326 switch (cmd_mfi->frame->hdr.cmd) { in megasas_refire_mgmt_cmd()
4363 cmd_mfi->frame->hdr.cmd != MFI_CMD_ABORT) { in megasas_refire_mgmt_cmd()
4366 __func__, __LINE__, cmd_mfi->frame->hdr.cmd, in megasas_refire_mgmt_cmd()
4414 __func__, __LINE__, cmd_mfi->frame->hdr.cmd, in megasas_return_polled_cmds()