Lines Matching refs:ctl_cmds
267 if (ioc->ctl_cmds.status == MPT3_CMD_NOT_USED) in mpt3sas_ctl_done()
269 if (ioc->ctl_cmds.smid != smid) in mpt3sas_ctl_done()
271 ioc->ctl_cmds.status |= MPT3_CMD_COMPLETE; in mpt3sas_ctl_done()
274 memcpy(ioc->ctl_cmds.reply, mpi_reply, mpi_reply->MsgLength*4); in mpt3sas_ctl_done()
275 ioc->ctl_cmds.status |= MPT3_CMD_REPLY_VALID; in mpt3sas_ctl_done()
287 memcpy(ioc->ctl_cmds.sense, sense_data, sz); in mpt3sas_ctl_done()
300 memcpy(ioc->ctl_cmds.sense, sense_data, sz); in mpt3sas_ctl_done()
305 ioc->ctl_cmds.status &= ~MPT3_CMD_PENDING; in mpt3sas_ctl_done()
306 complete(&ioc->ctl_cmds.done); in mpt3sas_ctl_done()
498 if (ioc->ctl_cmds.status & MPT3_CMD_PENDING) { in mpt3sas_ctl_clear_outstanding_ioctls()
499 ioc->ctl_cmds.status |= MPT3_CMD_RESET; in mpt3sas_ctl_clear_outstanding_ioctls()
500 mpt3sas_base_free_smid(ioc, ioc->ctl_cmds.smid); in mpt3sas_ctl_clear_outstanding_ioctls()
501 complete(&ioc->ctl_cmds.done); in mpt3sas_ctl_clear_outstanding_ioctls()
632 tm_reply = ioc->ctl_cmds.reply; in _ctl_set_task_mid()
640 if (copy_to_user(karg->reply_frame_buf_ptr, ioc->ctl_cmds.reply, in _ctl_set_task_mid()
684 if (ioc->ctl_cmds.status != MPT3_CMD_NOT_USED) { in _ctl_do_mpt_command()
730 ioc->ctl_cmds.status = MPT3_CMD_PENDING; in _ctl_do_mpt_command()
731 memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); in _ctl_do_mpt_command()
735 ioc->ctl_cmds.smid = smid; in _ctl_do_mpt_command()
792 init_completion(&ioc->ctl_cmds.done); in _ctl_do_mpt_command()
825 memset(ioc->ctl_cmds.sense, 0, NVME_ERROR_RESPONSE_SIZE); in _ctl_do_mpt_command()
847 memset(ioc->ctl_cmds.sense, 0, SCSI_SENSE_BUFFERSIZE); in _ctl_do_mpt_command()
1021 wait_for_completion_timeout(&ioc->ctl_cmds.done, timeout*HZ); in _ctl_do_mpt_command()
1034 if (!(ioc->ctl_cmds.status & MPT3_CMD_COMPLETE)) { in _ctl_do_mpt_command()
1036 ioc->ctl_cmds.status, mpi_request, in _ctl_do_mpt_command()
1041 mpi_reply = ioc->ctl_cmds.reply; in _ctl_do_mpt_command()
1068 if (copy_to_user(karg.reply_frame_buf_ptr, ioc->ctl_cmds.reply, in _ctl_do_mpt_command()
1090 if (copy_to_user(karg.sense_data_ptr, ioc->ctl_cmds.sense, in _ctl_do_mpt_command()
1144 ioc->ctl_cmds.status = MPT3_CMD_NOT_USED; in _ctl_do_mpt_command()
1574 if (ioc->ctl_cmds.status != MPT3_CMD_NOT_USED) { in _ctl_diag_register_2()
1685 ioc->ctl_cmds.status = MPT3_CMD_PENDING; in _ctl_diag_register_2()
1686 memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); in _ctl_diag_register_2()
1688 ioc->ctl_cmds.smid = smid; in _ctl_diag_register_2()
1747 init_completion(&ioc->ctl_cmds.done); in _ctl_diag_register_2()
1749 wait_for_completion_timeout(&ioc->ctl_cmds.done, in _ctl_diag_register_2()
1752 if (!(ioc->ctl_cmds.status & MPT3_CMD_COMPLETE)) { in _ctl_diag_register_2()
1754 ioc->ctl_cmds.status, mpi_request, in _ctl_diag_register_2()
1760 if ((ioc->ctl_cmds.status & MPT3_CMD_REPLY_VALID) == 0) { in _ctl_diag_register_2()
1766 mpi_reply = ioc->ctl_cmds.reply; in _ctl_diag_register_2()
1793 ioc->ctl_cmds.status = MPT3_CMD_NOT_USED; in _ctl_diag_register_2()
2149 if (ioc->ctl_cmds.status != MPT3_CMD_NOT_USED) { in mpt3sas_send_diag_release()
2162 ioc->ctl_cmds.status = MPT3_CMD_PENDING; in mpt3sas_send_diag_release()
2163 memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); in mpt3sas_send_diag_release()
2165 ioc->ctl_cmds.smid = smid; in mpt3sas_send_diag_release()
2172 init_completion(&ioc->ctl_cmds.done); in mpt3sas_send_diag_release()
2174 wait_for_completion_timeout(&ioc->ctl_cmds.done, in mpt3sas_send_diag_release()
2177 if (!(ioc->ctl_cmds.status & MPT3_CMD_COMPLETE)) { in mpt3sas_send_diag_release()
2179 ioc->ctl_cmds.status, mpi_request, in mpt3sas_send_diag_release()
2187 if ((ioc->ctl_cmds.status & MPT3_CMD_REPLY_VALID) == 0) { in mpt3sas_send_diag_release()
2193 mpi_reply = ioc->ctl_cmds.reply; in mpt3sas_send_diag_release()
2208 ioc->ctl_cmds.status = MPT3_CMD_NOT_USED; in mpt3sas_send_diag_release()
2402 if (ioc->ctl_cmds.status != MPT3_CMD_NOT_USED) { in _ctl_diag_read_buffer()
2416 ioc->ctl_cmds.status = MPT3_CMD_PENDING; in _ctl_diag_read_buffer()
2417 memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); in _ctl_diag_read_buffer()
2419 ioc->ctl_cmds.smid = smid; in _ctl_diag_read_buffer()
2433 init_completion(&ioc->ctl_cmds.done); in _ctl_diag_read_buffer()
2435 wait_for_completion_timeout(&ioc->ctl_cmds.done, in _ctl_diag_read_buffer()
2438 if (!(ioc->ctl_cmds.status & MPT3_CMD_COMPLETE)) { in _ctl_diag_read_buffer()
2440 ioc->ctl_cmds.status, mpi_request, in _ctl_diag_read_buffer()
2446 if ((ioc->ctl_cmds.status & MPT3_CMD_REPLY_VALID) == 0) { in _ctl_diag_read_buffer()
2452 mpi_reply = ioc->ctl_cmds.reply; in _ctl_diag_read_buffer()
2474 ioc->ctl_cmds.status = MPT3_CMD_NOT_USED; in _ctl_diag_read_buffer()
2620 if (!mutex_trylock(&ioc->ctl_cmds.mutex)) { in _ctl_ioctl_main()
2624 } else if (mutex_lock_interruptible(&ioc->ctl_cmds.mutex)) { in _ctl_ioctl_main()
2716 mutex_unlock(&ioc->ctl_cmds.mutex); in _ctl_ioctl_main()