Lines Matching refs:ioctl_cmds
184 if (!mutex_trylock(&ioc->ioctl_cmds.mutex)) in mptctl_syscall_down()
187 if (mutex_lock_interruptible(&ioc->ioctl_cmds.mutex)) in mptctl_syscall_down()
218 if (ioc->ioctl_cmds.msg_context != req->u.hdr.MsgContext) in mptctl_reply()
221 ioc->ioctl_cmds.status |= MPT_MGMT_STATUS_COMMAND_GOOD; in mptctl_reply()
226 ioc->ioctl_cmds.status |= MPT_MGMT_STATUS_RF_VALID; in mptctl_reply()
228 memcpy(ioc->ioctl_cmds.reply, reply, sz); in mptctl_reply()
256 memcpy(ioc->ioctl_cmds.sense, sense_data, sz); in mptctl_reply()
257 ioc->ioctl_cmds.status |= MPT_MGMT_STATUS_SENSE_VALID; in mptctl_reply()
264 if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_PENDING) { in mptctl_reply()
267 ioc->ioctl_cmds.status &= ~MPT_MGMT_STATUS_PENDING; in mptctl_reply()
268 complete(&ioc->ioctl_cmds.done); in mptctl_reply()
272 ioc->ioctl_cmds.status &= ~MPT_MGMT_STATUS_PENDING; in mptctl_reply()
273 complete(&ioc->ioctl_cmds.done); in mptctl_reply()
477 CLEAR_MGMT_PENDING_STATUS(ioc->ioctl_cmds.status) in mptctl_timeout_expired()
484 CLEAR_MGMT_PENDING_STATUS(ioc->ioctl_cmds.status) in mptctl_timeout_expired()
536 if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_PENDING) { in mptctl_ioc_reset()
537 ioc->ioctl_cmds.status |= MPT_MGMT_STATUS_DID_IOCRESET; in mptctl_ioc_reset()
538 complete(&ioc->ioctl_cmds.done); in mptctl_ioc_reset()
689 mutex_unlock(&iocp->ioctl_cmds.mutex); in __mptctl_ioctl()
923 SET_MGMT_MSG_CONTEXT(iocp->ioctl_cmds.msg_context, dlmsg->MsgContext); in mptctl_do_fw_download()
924 INITIALIZE_MGMT_STATUS(iocp->ioctl_cmds.status) in mptctl_do_fw_download()
929 timeleft = wait_for_completion_timeout(&iocp->ioctl_cmds.done, HZ*60); in mptctl_do_fw_download()
930 if (!(iocp->ioctl_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) { in mptctl_do_fw_download()
933 if (iocp->ioctl_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) { in mptctl_do_fw_download()
947 if (!(iocp->ioctl_cmds.status & MPT_MGMT_STATUS_RF_VALID)) { in mptctl_do_fw_download()
957 ReplyMsg = (pFWDownloadReply_t)iocp->ioctl_cmds.reply; in mptctl_do_fw_download()
982 CLEAR_MGMT_STATUS(iocp->ioctl_cmds.status); in mptctl_do_fw_download()
983 SET_MGMT_MSG_CONTEXT(iocp->ioctl_cmds.msg_context, 0); in mptctl_do_fw_download()
2162 SET_MGMT_MSG_CONTEXT(ioc->ioctl_cmds.msg_context, hdr->MsgContext); in mptctl_do_mpt_command()
2163 INITIALIZE_MGMT_STATUS(ioc->ioctl_cmds.status) in mptctl_do_mpt_command()
2197 timeleft = wait_for_completion_timeout(&ioc->ioctl_cmds.done, in mptctl_do_mpt_command()
2199 if (!(ioc->ioctl_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) { in mptctl_do_mpt_command()
2203 if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) { in mptctl_do_mpt_command()
2231 if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_RF_VALID) { in mptctl_do_mpt_command()
2234 4*ioc->ioctl_cmds.reply[2]); in mptctl_do_mpt_command()
2236 sz = min(ioc->reply_sz, 4*ioc->ioctl_cmds.reply[2]); in mptctl_do_mpt_command()
2240 ioc->ioctl_cmds.reply, sz)){ in mptctl_do_mpt_command()
2253 if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_SENSE_VALID) { in mptctl_do_mpt_command()
2257 ioc->ioctl_cmds.sense, sz)) { in mptctl_do_mpt_command()
2271 if ((ioc->ioctl_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD) && in mptctl_do_mpt_command()
2286 CLEAR_MGMT_STATUS(ioc->ioctl_cmds.status) in mptctl_do_mpt_command()
2287 SET_MGMT_MSG_CONTEXT(ioc->ioctl_cmds.msg_context, 0); in mptctl_do_mpt_command()
2488 SET_MGMT_MSG_CONTEXT(ioc->ioctl_cmds.msg_context, in mptctl_hp_hostinfo()
2490 INITIALIZE_MGMT_STATUS(ioc->ioctl_cmds.status) in mptctl_hp_hostinfo()
2494 timeleft = wait_for_completion_timeout(&ioc->ioctl_cmds.done, in mptctl_hp_hostinfo()
2496 if (!(ioc->ioctl_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) { in mptctl_hp_hostinfo()
2498 if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) { in mptctl_hp_hostinfo()
2521 if (ioc->ioctl_cmds.status & MPT_MGMT_STATUS_RF_VALID) in mptctl_hp_hostinfo()
2525 CLEAR_MGMT_STATUS(ioc->ioctl_cmds.status) in mptctl_hp_hostinfo()
2526 SET_MGMT_MSG_CONTEXT(ioc->ioctl_cmds.msg_context, 0); in mptctl_hp_hostinfo()
2748 mutex_unlock(&iocp->ioctl_cmds.mutex); in compat_mptfwxfer_ioctl()
2802 mutex_unlock(&iocp->ioctl_cmds.mutex); in compat_mpt_command()
2856 mutex_init(&ioc->ioctl_cmds.mutex); in mptctl_probe()
2857 init_completion(&ioc->ioctl_cmds.done); in mptctl_probe()