Lines Matching refs:iocp
103 static int mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg);
104 static int mptctl_getiocinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd);
105 static int mptctl_gettargetinfo(MPT_ADAPTER *iocp, unsigned long arg);
106 static int mptctl_readtest(MPT_ADAPTER *iocp, unsigned long arg);
107 static int mptctl_mpt_command(MPT_ADAPTER *iocp, unsigned long arg);
108 static int mptctl_eventquery(MPT_ADAPTER *iocp, unsigned long arg);
109 static int mptctl_eventenable(MPT_ADAPTER *iocp, unsigned long arg);
110 static int mptctl_eventreport(MPT_ADAPTER *iocp, unsigned long arg);
111 static int mptctl_replace_fw(MPT_ADAPTER *iocp, unsigned long arg);
113 static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg);
114 static int mptctl_hp_hostinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd);
115 static int mptctl_hp_targetinfo(MPT_ADAPTER *iocp, unsigned long arg);
126 static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfP…
127 static int mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen);
626 MPT_ADAPTER *iocp = NULL; in __mptctl_ioctl() local
640 if ((mpt_verify_adapter(iocnumX, &iocp) < 0) || (iocp == NULL)) in __mptctl_ioctl()
643 if (!iocp->active) { in __mptctl_ioctl()
655 return mptctl_getiocinfo(iocp, arg, _IOC_SIZE(cmd)); in __mptctl_ioctl()
657 return mptctl_gettargetinfo(iocp, arg); in __mptctl_ioctl()
659 return mptctl_readtest(iocp, arg); in __mptctl_ioctl()
661 return mptctl_eventquery(iocp, arg); in __mptctl_ioctl()
663 return mptctl_eventenable(iocp, arg); in __mptctl_ioctl()
665 return mptctl_eventreport(iocp, arg); in __mptctl_ioctl()
667 return mptctl_replace_fw(iocp, arg); in __mptctl_ioctl()
673 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) in __mptctl_ioctl()
677 ret = mptctl_fw_download(iocp, arg); in __mptctl_ioctl()
679 ret = mptctl_mpt_command(iocp, arg); in __mptctl_ioctl()
681 ret = mptctl_do_reset(iocp, arg); in __mptctl_ioctl()
683 ret = mptctl_hp_hostinfo(iocp, arg, _IOC_SIZE(cmd)); in __mptctl_ioctl()
685 ret = mptctl_hp_targetinfo(iocp, arg); in __mptctl_ioctl()
689 mutex_unlock(&iocp->ioctl_cmds.mutex); in __mptctl_ioctl()
704 static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg) in mptctl_do_reset() argument
716 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n", in mptctl_do_reset()
717 iocp->name)); in mptctl_do_reset()
719 if (mpt_HardResetHandler(iocp, CAN_SLEEP) != 0) { in mptctl_do_reset()
721 iocp->name, __FILE__, __LINE__); in mptctl_do_reset()
746 mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg) in mptctl_fw_download() argument
758 return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen); in mptctl_fw_download()
776 mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen) in mptctl_do_fw_download() argument
801 if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) in mptctl_do_fw_download()
804 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT in mptctl_do_fw_download()
805 "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id)); in mptctl_do_fw_download()
806 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.bufp = %p\n", in mptctl_do_fw_download()
807 iocp->name, ufwbuf)); in mptctl_do_fw_download()
808 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n", in mptctl_do_fw_download()
809 iocp->name, (int)fwlen)); in mptctl_do_fw_download()
823 if (iocp->facts.MsgVersion >= MPI_VERSION_01_05) in mptctl_do_fw_download()
858 &numfrags, &buflist, &sgl_dma, iocp)) == NULL) in mptctl_do_fw_download()
872 maxfrags = (iocp->req_sz - sizeof(MPIHeader_t) - in mptctl_do_fw_download()
874 / iocp->SGE_size; in mptctl_do_fw_download()
880 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: sgl buffer = %p, sgfrags = %d\n", in mptctl_do_fw_download()
881 iocp->name, sgl, numfrags)); in mptctl_do_fw_download()
902 iocp->add_sge(sgOut, sgIn->FlagsLength, sgIn->Address); in mptctl_do_fw_download()
907 iocp->name, __FILE__, __LINE__, n, ufwbuf); in mptctl_do_fw_download()
914 sgOut += iocp->SGE_size; in mptctl_do_fw_download()
917 DBG_DUMP_FW_DOWNLOAD(iocp, (u32 *)mf, numfrags); in mptctl_do_fw_download()
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()
925 mpt_put_msg_frame(mptctl_id, iocp, mf); 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()
932 printk(MYIOC_s_WARN_FMT "%s: failed\n", iocp->name, __func__); in mptctl_do_fw_download()
933 if (iocp->ioctl_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) { in mptctl_do_fw_download()
934 mpt_free_msg_frame(iocp, mf); in mptctl_do_fw_download()
940 iocp->name, mpt_GetIocState(iocp, 0)); in mptctl_do_fw_download()
941 mptctl_timeout_expired(iocp, mf); in mptctl_do_fw_download()
947 if (!(iocp->ioctl_cmds.status & MPT_MGMT_STATUS_RF_VALID)) { in mptctl_do_fw_download()
948 printk(MYIOC_s_WARN_FMT "%s: failed\n", iocp->name, __func__); in mptctl_do_fw_download()
949 mpt_free_msg_frame(iocp, mf); in mptctl_do_fw_download()
955 kfree_sgl(sgl, sgl_dma, buflist, iocp); in mptctl_do_fw_download()
957 ReplyMsg = (pFWDownloadReply_t)iocp->ioctl_cmds.reply; in mptctl_do_fw_download()
960 printk(MYIOC_s_INFO_FMT "F/W update successful!\n", iocp->name); in mptctl_do_fw_download()
964 iocp->name); in mptctl_do_fw_download()
966 iocp->name); in mptctl_do_fw_download()
969 printk(MYIOC_s_WARN_FMT "IOC_BUSY!\n", iocp->name); in mptctl_do_fw_download()
970 printk(MYIOC_s_WARN_FMT "(try again later?)\n", iocp->name); in mptctl_do_fw_download()
974 iocp->name, iocstat); in mptctl_do_fw_download()
975 printk(MYIOC_s_WARN_FMT "(bad VooDoo)\n", iocp->name); 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()
984 kfree_sgl(sgl, sgl_dma, buflist, iocp); in mptctl_do_fw_download()
2719 MPT_ADAPTER *iocp = NULL; in compat_mptfwxfer_ioctl() local
2730 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || in compat_mptfwxfer_ioctl()
2731 (iocp == NULL)) { in compat_mptfwxfer_ioctl()
2737 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) in compat_mptfwxfer_ioctl()
2740 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "compat_mptfwxfer_ioctl() called\n", in compat_mptfwxfer_ioctl()
2741 iocp->name)); in compat_mptfwxfer_ioctl()
2746 ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen); in compat_mptfwxfer_ioctl()
2748 mutex_unlock(&iocp->ioctl_cmds.mutex); in compat_mptfwxfer_ioctl()
2760 MPT_ADAPTER *iocp = NULL; in compat_mpt_command() local
2770 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || in compat_mpt_command()
2771 (iocp == NULL)) { in compat_mpt_command()
2777 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) in compat_mpt_command()
2780 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "compat_mpt_command() called\n", in compat_mpt_command()
2781 iocp->name)); in compat_mpt_command()
2800 ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); in compat_mpt_command()
2802 mutex_unlock(&iocp->ioctl_cmds.mutex); in compat_mpt_command()