Lines Matching refs:ctl_cmds
261 if (ioc->ctl_cmds.status == MPT3_CMD_NOT_USED) in mpt3sas_ctl_done()
263 if (ioc->ctl_cmds.smid != smid) in mpt3sas_ctl_done()
265 ioc->ctl_cmds.status |= MPT3_CMD_COMPLETE; in mpt3sas_ctl_done()
268 memcpy(ioc->ctl_cmds.reply, mpi_reply, mpi_reply->MsgLength*4); in mpt3sas_ctl_done()
269 ioc->ctl_cmds.status |= MPT3_CMD_REPLY_VALID; in mpt3sas_ctl_done()
281 memcpy(ioc->ctl_cmds.sense, sense_data, sz); in mpt3sas_ctl_done()
294 memcpy(ioc->ctl_cmds.sense, sense_data, sz); in mpt3sas_ctl_done()
299 ioc->ctl_cmds.status &= ~MPT3_CMD_PENDING; in mpt3sas_ctl_done()
300 complete(&ioc->ctl_cmds.done); in mpt3sas_ctl_done()
482 if (ioc->ctl_cmds.status & MPT3_CMD_PENDING) { in mpt3sas_ctl_after_reset_handler()
483 ioc->ctl_cmds.status |= MPT3_CMD_RESET; in mpt3sas_ctl_after_reset_handler()
484 mpt3sas_base_free_smid(ioc, ioc->ctl_cmds.smid); in mpt3sas_ctl_after_reset_handler()
485 complete(&ioc->ctl_cmds.done); in mpt3sas_ctl_after_reset_handler()
616 tm_reply = ioc->ctl_cmds.reply; in _ctl_set_task_mid()
624 if (copy_to_user(karg->reply_frame_buf_ptr, ioc->ctl_cmds.reply, in _ctl_set_task_mid()
668 if (ioc->ctl_cmds.status != MPT3_CMD_NOT_USED) { in _ctl_do_mpt_command()
714 ioc->ctl_cmds.status = MPT3_CMD_PENDING; in _ctl_do_mpt_command()
715 memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); in _ctl_do_mpt_command()
719 ioc->ctl_cmds.smid = smid; in _ctl_do_mpt_command()
776 init_completion(&ioc->ctl_cmds.done); in _ctl_do_mpt_command()
797 memset(ioc->ctl_cmds.sense, 0, NVME_ERROR_RESPONSE_SIZE); in _ctl_do_mpt_command()
819 memset(ioc->ctl_cmds.sense, 0, SCSI_SENSE_BUFFERSIZE); in _ctl_do_mpt_command()
991 wait_for_completion_timeout(&ioc->ctl_cmds.done, timeout*HZ); in _ctl_do_mpt_command()
1004 if (!(ioc->ctl_cmds.status & MPT3_CMD_COMPLETE)) { in _ctl_do_mpt_command()
1007 ioc->ctl_cmds.status, mpi_request, in _ctl_do_mpt_command()
1012 mpi_reply = ioc->ctl_cmds.reply; in _ctl_do_mpt_command()
1039 if (copy_to_user(karg.reply_frame_buf_ptr, ioc->ctl_cmds.reply, in _ctl_do_mpt_command()
1061 if (copy_to_user(karg.sense_data_ptr, ioc->ctl_cmds.sense, in _ctl_do_mpt_command()
1113 ioc->ctl_cmds.status = MPT3_CMD_NOT_USED; in _ctl_do_mpt_command()
1521 if (ioc->ctl_cmds.status != MPT3_CMD_NOT_USED) { in _ctl_diag_register_2()
1555 ioc->ctl_cmds.status = MPT3_CMD_PENDING; in _ctl_diag_register_2()
1556 memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); in _ctl_diag_register_2()
1558 ioc->ctl_cmds.smid = smid; in _ctl_diag_register_2()
1612 init_completion(&ioc->ctl_cmds.done); in _ctl_diag_register_2()
1614 wait_for_completion_timeout(&ioc->ctl_cmds.done, in _ctl_diag_register_2()
1617 if (!(ioc->ctl_cmds.status & MPT3_CMD_COMPLETE)) { in _ctl_diag_register_2()
1620 ioc->ctl_cmds.status, mpi_request, in _ctl_diag_register_2()
1626 if ((ioc->ctl_cmds.status & MPT3_CMD_REPLY_VALID) == 0) { in _ctl_diag_register_2()
1632 mpi_reply = ioc->ctl_cmds.reply; in _ctl_diag_register_2()
1656 ioc->ctl_cmds.status = MPT3_CMD_NOT_USED; in _ctl_diag_register_2()
1916 if (ioc->ctl_cmds.status != MPT3_CMD_NOT_USED) { in mpt3sas_send_diag_release()
1929 ioc->ctl_cmds.status = MPT3_CMD_PENDING; in mpt3sas_send_diag_release()
1930 memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); in mpt3sas_send_diag_release()
1932 ioc->ctl_cmds.smid = smid; in mpt3sas_send_diag_release()
1939 init_completion(&ioc->ctl_cmds.done); in mpt3sas_send_diag_release()
1941 wait_for_completion_timeout(&ioc->ctl_cmds.done, in mpt3sas_send_diag_release()
1944 if (!(ioc->ctl_cmds.status & MPT3_CMD_COMPLETE)) { in mpt3sas_send_diag_release()
1946 ioc->ctl_cmds.status, mpi_request, in mpt3sas_send_diag_release()
1953 if ((ioc->ctl_cmds.status & MPT3_CMD_REPLY_VALID) == 0) { in mpt3sas_send_diag_release()
1959 mpi_reply = ioc->ctl_cmds.reply; in mpt3sas_send_diag_release()
1974 ioc->ctl_cmds.status = MPT3_CMD_NOT_USED; in mpt3sas_send_diag_release()
2156 if (ioc->ctl_cmds.status != MPT3_CMD_NOT_USED) { in _ctl_diag_read_buffer()
2170 ioc->ctl_cmds.status = MPT3_CMD_PENDING; in _ctl_diag_read_buffer()
2171 memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); in _ctl_diag_read_buffer()
2173 ioc->ctl_cmds.smid = smid; in _ctl_diag_read_buffer()
2187 init_completion(&ioc->ctl_cmds.done); in _ctl_diag_read_buffer()
2189 wait_for_completion_timeout(&ioc->ctl_cmds.done, in _ctl_diag_read_buffer()
2192 if (!(ioc->ctl_cmds.status & MPT3_CMD_COMPLETE)) { in _ctl_diag_read_buffer()
2195 ioc->ctl_cmds.status, mpi_request, in _ctl_diag_read_buffer()
2201 if ((ioc->ctl_cmds.status & MPT3_CMD_REPLY_VALID) == 0) { in _ctl_diag_read_buffer()
2207 mpi_reply = ioc->ctl_cmds.reply; in _ctl_diag_read_buffer()
2227 ioc->ctl_cmds.status = MPT3_CMD_NOT_USED; in _ctl_diag_read_buffer()
2320 if (!mutex_trylock(&ioc->ctl_cmds.mutex)) { in _ctl_ioctl_main()
2324 } else if (mutex_lock_interruptible(&ioc->ctl_cmds.mutex)) { in _ctl_ioctl_main()
2412 mutex_unlock(&ioc->ctl_cmds.mutex); in _ctl_ioctl_main()