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);
627 MPT_ADAPTER *iocp = NULL; in __mptctl_ioctl() local
641 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || in __mptctl_ioctl()
642 (iocp == NULL)) in __mptctl_ioctl()
645 if (!iocp->active) { in __mptctl_ioctl()
657 return mptctl_getiocinfo(iocp, arg, _IOC_SIZE(cmd)); in __mptctl_ioctl()
659 return mptctl_gettargetinfo(iocp, arg); in __mptctl_ioctl()
661 return mptctl_readtest(iocp, arg); in __mptctl_ioctl()
663 return mptctl_eventquery(iocp, arg); in __mptctl_ioctl()
665 return mptctl_eventenable(iocp, arg); in __mptctl_ioctl()
667 return mptctl_eventreport(iocp, arg); in __mptctl_ioctl()
669 return mptctl_replace_fw(iocp, arg); in __mptctl_ioctl()
675 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) in __mptctl_ioctl()
679 ret = mptctl_fw_download(iocp, arg); in __mptctl_ioctl()
681 ret = mptctl_mpt_command(iocp, arg); in __mptctl_ioctl()
683 ret = mptctl_do_reset(iocp, arg); in __mptctl_ioctl()
685 ret = mptctl_hp_hostinfo(iocp, arg, _IOC_SIZE(cmd)); in __mptctl_ioctl()
687 ret = mptctl_hp_targetinfo(iocp, arg); in __mptctl_ioctl()
691 mutex_unlock(&iocp->ioctl_cmds.mutex); in __mptctl_ioctl()
706 static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg) in mptctl_do_reset() argument
718 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n", in mptctl_do_reset()
719 iocp->name)); in mptctl_do_reset()
721 if (mpt_HardResetHandler(iocp, CAN_SLEEP) != 0) { in mptctl_do_reset()
723 iocp->name, __FILE__, __LINE__); in mptctl_do_reset()
748 mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg) in mptctl_fw_download() argument
760 return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen); in mptctl_fw_download()
778 mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen) in mptctl_do_fw_download() argument
803 if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) in mptctl_do_fw_download()
806 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT in mptctl_do_fw_download()
807 "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id)); in mptctl_do_fw_download()
808 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.bufp = %p\n", in mptctl_do_fw_download()
809 iocp->name, ufwbuf)); in mptctl_do_fw_download()
810 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n", in mptctl_do_fw_download()
811 iocp->name, (int)fwlen)); in mptctl_do_fw_download()
825 if (iocp->facts.MsgVersion >= MPI_VERSION_01_05) in mptctl_do_fw_download()
860 &numfrags, &buflist, &sgl_dma, iocp)) == NULL) in mptctl_do_fw_download()
874 maxfrags = (iocp->req_sz - sizeof(MPIHeader_t) - in mptctl_do_fw_download()
876 / iocp->SGE_size; in mptctl_do_fw_download()
882 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: sgl buffer = %p, sgfrags = %d\n", in mptctl_do_fw_download()
883 iocp->name, sgl, numfrags)); in mptctl_do_fw_download()
904 iocp->add_sge(sgOut, sgIn->FlagsLength, sgIn->Address); in mptctl_do_fw_download()
909 iocp->name, __FILE__, __LINE__, n, ufwbuf); in mptctl_do_fw_download()
916 sgOut += iocp->SGE_size; in mptctl_do_fw_download()
919 DBG_DUMP_FW_DOWNLOAD(iocp, (u32 *)mf, numfrags); in mptctl_do_fw_download()
925 SET_MGMT_MSG_CONTEXT(iocp->ioctl_cmds.msg_context, dlmsg->MsgContext); in mptctl_do_fw_download()
926 INITIALIZE_MGMT_STATUS(iocp->ioctl_cmds.status) in mptctl_do_fw_download()
927 mpt_put_msg_frame(mptctl_id, iocp, mf); in mptctl_do_fw_download()
931 timeleft = wait_for_completion_timeout(&iocp->ioctl_cmds.done, HZ*60); in mptctl_do_fw_download()
932 if (!(iocp->ioctl_cmds.status & MPT_MGMT_STATUS_COMMAND_GOOD)) { in mptctl_do_fw_download()
934 printk(MYIOC_s_WARN_FMT "%s: failed\n", iocp->name, __func__); in mptctl_do_fw_download()
935 if (iocp->ioctl_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET) { in mptctl_do_fw_download()
936 mpt_free_msg_frame(iocp, mf); in mptctl_do_fw_download()
942 iocp->name, mpt_GetIocState(iocp, 0)); in mptctl_do_fw_download()
943 mptctl_timeout_expired(iocp, mf); in mptctl_do_fw_download()
949 if (!(iocp->ioctl_cmds.status & MPT_MGMT_STATUS_RF_VALID)) { in mptctl_do_fw_download()
950 printk(MYIOC_s_WARN_FMT "%s: failed\n", iocp->name, __func__); in mptctl_do_fw_download()
951 mpt_free_msg_frame(iocp, mf); in mptctl_do_fw_download()
957 kfree_sgl(sgl, sgl_dma, buflist, iocp); in mptctl_do_fw_download()
959 ReplyMsg = (pFWDownloadReply_t)iocp->ioctl_cmds.reply; in mptctl_do_fw_download()
962 printk(MYIOC_s_INFO_FMT "F/W update successful!\n", iocp->name); in mptctl_do_fw_download()
966 iocp->name); in mptctl_do_fw_download()
968 iocp->name); in mptctl_do_fw_download()
971 printk(MYIOC_s_WARN_FMT "IOC_BUSY!\n", iocp->name); in mptctl_do_fw_download()
972 printk(MYIOC_s_WARN_FMT "(try again later?)\n", iocp->name); in mptctl_do_fw_download()
976 iocp->name, iocstat); in mptctl_do_fw_download()
977 printk(MYIOC_s_WARN_FMT "(bad VooDoo)\n", iocp->name); in mptctl_do_fw_download()
984 CLEAR_MGMT_STATUS(iocp->ioctl_cmds.status); in mptctl_do_fw_download()
985 SET_MGMT_MSG_CONTEXT(iocp->ioctl_cmds.msg_context, 0); in mptctl_do_fw_download()
986 kfree_sgl(sgl, sgl_dma, buflist, iocp); in mptctl_do_fw_download()
2721 MPT_ADAPTER *iocp = NULL; in compat_mptfwxfer_ioctl() local
2732 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || in compat_mptfwxfer_ioctl()
2733 (iocp == NULL)) { in compat_mptfwxfer_ioctl()
2739 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) in compat_mptfwxfer_ioctl()
2742 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "compat_mptfwxfer_ioctl() called\n", in compat_mptfwxfer_ioctl()
2743 iocp->name)); in compat_mptfwxfer_ioctl()
2748 ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen); in compat_mptfwxfer_ioctl()
2750 mutex_unlock(&iocp->ioctl_cmds.mutex); in compat_mptfwxfer_ioctl()
2762 MPT_ADAPTER *iocp = NULL; in compat_mpt_command() local
2772 if (((iocnum = mpt_verify_adapter(iocnumX, &iocp)) < 0) || in compat_mpt_command()
2773 (iocp == NULL)) { in compat_mpt_command()
2779 if ((ret = mptctl_syscall_down(iocp, nonblock)) != 0) in compat_mpt_command()
2782 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "compat_mpt_command() called\n", in compat_mpt_command()
2783 iocp->name)); in compat_mpt_command()
2802 ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF); in compat_mpt_command()
2804 mutex_unlock(&iocp->ioctl_cmds.mutex); in compat_mpt_command()