diff options
Diffstat (limited to 'drivers/message/fusion/mptctl.c')
-rw-r--r-- | drivers/message/fusion/mptctl.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index 2df3b8756545..fe10cc0fe18e 100644 --- a/drivers/message/fusion/mptctl.c +++ b/drivers/message/fusion/mptctl.c | |||
@@ -674,22 +674,23 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) | |||
674 | u16 iocstat; | 674 | u16 iocstat; |
675 | pFWDownloadReply_t ReplyMsg = NULL; | 675 | pFWDownloadReply_t ReplyMsg = NULL; |
676 | 676 | ||
677 | dctlprintk((KERN_INFO "mptctl_do_fwdl called. mptctl_id = %xh.\n", mptctl_id)); | 677 | dctlprintk(("mptctl_do_fwdl called. mptctl_id = %xh.\n", mptctl_id)); |
678 | 678 | ||
679 | dctlprintk((KERN_INFO "DbG: kfwdl.bufp = %p\n", ufwbuf)); | 679 | dctlprintk(("DbG: kfwdl.bufp = %p\n", ufwbuf)); |
680 | dctlprintk((KERN_INFO "DbG: kfwdl.fwlen = %d\n", (int)fwlen)); | 680 | dctlprintk(("DbG: kfwdl.fwlen = %d\n", (int)fwlen)); |
681 | dctlprintk((KERN_INFO "DbG: kfwdl.ioc = %04xh\n", ioc)); | 681 | dctlprintk(("DbG: kfwdl.ioc = %04xh\n", ioc)); |
682 | 682 | ||
683 | if ((ioc = mpt_verify_adapter(ioc, &iocp)) < 0) { | 683 | if (mpt_verify_adapter(ioc, &iocp) < 0) { |
684 | dctlprintk(("%s@%d::_ioctl_fwdl - ioc%d not found!\n", | 684 | dctlprintk(("ioctl_fwdl - ioc%d not found!\n", |
685 | __FILE__, __LINE__, ioc)); | 685 | ioc)); |
686 | return -ENODEV; /* (-6) No such device or address */ | 686 | return -ENODEV; /* (-6) No such device or address */ |
687 | } | 687 | } else { |
688 | 688 | ||
689 | /* Valid device. Get a message frame and construct the FW download message. | 689 | /* Valid device. Get a message frame and construct the FW download message. |
690 | */ | 690 | */ |
691 | if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) | 691 | if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL) |
692 | return -EAGAIN; | 692 | return -EAGAIN; |
693 | } | ||
693 | dlmsg = (FWDownload_t*) mf; | 694 | dlmsg = (FWDownload_t*) mf; |
694 | ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL; | 695 | ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL; |
695 | sgOut = (char *) (ptsge + 1); | 696 | sgOut = (char *) (ptsge + 1); |
@@ -702,7 +703,11 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) | |||
702 | dlmsg->ChainOffset = 0; | 703 | dlmsg->ChainOffset = 0; |
703 | dlmsg->Function = MPI_FUNCTION_FW_DOWNLOAD; | 704 | dlmsg->Function = MPI_FUNCTION_FW_DOWNLOAD; |
704 | dlmsg->Reserved1[0] = dlmsg->Reserved1[1] = dlmsg->Reserved1[2] = 0; | 705 | dlmsg->Reserved1[0] = dlmsg->Reserved1[1] = dlmsg->Reserved1[2] = 0; |
705 | dlmsg->MsgFlags = 0; | 706 | if (iocp->facts.MsgVersion >= MPI_VERSION_01_05) |
707 | dlmsg->MsgFlags = MPI_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT; | ||
708 | else | ||
709 | dlmsg->MsgFlags = 0; | ||
710 | |||
706 | 711 | ||
707 | /* Set up the Transaction SGE. | 712 | /* Set up the Transaction SGE. |
708 | */ | 713 | */ |
@@ -754,7 +759,7 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) | |||
754 | goto fwdl_out; | 759 | goto fwdl_out; |
755 | } | 760 | } |
756 | 761 | ||
757 | dctlprintk((KERN_INFO "DbG: sgl buffer = %p, sgfrags = %d\n", sgl, numfrags)); | 762 | dctlprintk(("DbG: sgl buffer = %p, sgfrags = %d\n", sgl, numfrags)); |
758 | 763 | ||
759 | /* | 764 | /* |
760 | * Parse SG list, copying sgl itself, | 765 | * Parse SG list, copying sgl itself, |
@@ -803,7 +808,7 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) | |||
803 | /* | 808 | /* |
804 | * Finally, perform firmware download. | 809 | * Finally, perform firmware download. |
805 | */ | 810 | */ |
806 | iocp->ioctl->wait_done = 0; | 811 | ReplyMsg = NULL; |
807 | mpt_put_msg_frame(mptctl_id, iocp, mf); | 812 | mpt_put_msg_frame(mptctl_id, iocp, mf); |
808 | 813 | ||
809 | /* Now wait for the command to complete */ | 814 | /* Now wait for the command to complete */ |